Commit bd198058 authored by Alexander Duyck's avatar Alexander Duyck Committed by Jeff Kirsher

ixgbe: Move interrupt related values out of ring and into q_vector

This change moves work_limit, total_packets, and total_bytes into the ring
container struct of the q_vector.  The advantage of this is that it should
reduce the size of memory used in the event of multiple rings being
assigned to a single q_vector.  In addition it should help to reduce the
total workload for calculating itr since now total_packets and total_bytes
will be the total work done of the interrupt instead of for the ring.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 08c8833b
...@@ -214,12 +214,10 @@ struct ixgbe_ring { ...@@ -214,12 +214,10 @@ struct ixgbe_ring {
struct ixgbe_rx_buffer *rx_buffer_info; struct ixgbe_rx_buffer *rx_buffer_info;
}; };
unsigned long state; unsigned long state;
u8 atr_sample_rate; u8 __iomem *tail;
u8 atr_count;
u16 count; /* amount of descriptors */ u16 count; /* amount of descriptors */
u16 rx_buf_len; u16 rx_buf_len;
u16 next_to_use;
u16 next_to_clean;
u8 queue_index; /* needed for multiqueue queue management */ u8 queue_index; /* needed for multiqueue queue management */
u8 reg_idx; /* holds the special value that gets u8 reg_idx; /* holds the special value that gets
...@@ -227,15 +225,13 @@ struct ixgbe_ring { ...@@ -227,15 +225,13 @@ struct ixgbe_ring {
* associated with this ring, which is * associated with this ring, which is
* different for DCB and RSS modes * different for DCB and RSS modes
*/ */
u8 dcb_tc; u8 atr_sample_rate;
u8 atr_count;
u16 work_limit; /* max work per interrupt */
u8 __iomem *tail;
unsigned int total_bytes; u16 next_to_use;
unsigned int total_packets; u16 next_to_clean;
u8 dcb_tc;
struct ixgbe_queue_stats stats; struct ixgbe_queue_stats stats;
struct u64_stats_sync syncp; struct u64_stats_sync syncp;
union { union {
...@@ -283,6 +279,9 @@ struct ixgbe_ring_container { ...@@ -283,6 +279,9 @@ struct ixgbe_ring_container {
#else #else
DECLARE_BITMAP(idx, MAX_TX_QUEUES); DECLARE_BITMAP(idx, MAX_TX_QUEUES);
#endif #endif
unsigned int total_bytes; /* total bytes processed this int */
unsigned int total_packets; /* total packets processed this int */
u16 work_limit; /* total work allowed per interrupt */
u8 count; /* total number of rings in vector */ u8 count; /* total number of rings in vector */
u8 itr; /* current ITR setting for ring */ u8 itr; /* current ITR setting for ring */
}; };
...@@ -417,6 +416,9 @@ struct ixgbe_adapter { ...@@ -417,6 +416,9 @@ struct ixgbe_adapter {
u16 eitr_low; u16 eitr_low;
u16 eitr_high; u16 eitr_high;
/* Work limits */
u16 tx_work_limit;
/* TX */ /* TX */
struct ixgbe_ring *tx_ring[MAX_TX_QUEUES] ____cacheline_aligned_in_smp; struct ixgbe_ring *tx_ring[MAX_TX_QUEUES] ____cacheline_aligned_in_smp;
int num_tx_queues; int num_tx_queues;
......
...@@ -2103,7 +2103,7 @@ static int ixgbe_get_coalesce(struct net_device *netdev, ...@@ -2103,7 +2103,7 @@ static int ixgbe_get_coalesce(struct net_device *netdev,
{ {
struct ixgbe_adapter *adapter = netdev_priv(netdev); struct ixgbe_adapter *adapter = netdev_priv(netdev);
ec->tx_max_coalesced_frames_irq = adapter->tx_ring[0]->work_limit; ec->tx_max_coalesced_frames_irq = adapter->tx_work_limit;
/* only valid if in constant ITR mode */ /* only valid if in constant ITR mode */
switch (adapter->rx_itr_setting) { switch (adapter->rx_itr_setting) {
...@@ -2192,7 +2192,7 @@ static int ixgbe_set_coalesce(struct net_device *netdev, ...@@ -2192,7 +2192,7 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
return -EINVAL; return -EINVAL;
if (ec->tx_max_coalesced_frames_irq) if (ec->tx_max_coalesced_frames_irq)
adapter->tx_ring[0]->work_limit = ec->tx_max_coalesced_frames_irq; adapter->tx_work_limit = ec->tx_max_coalesced_frames_irq;
if (ec->rx_coalesce_usecs > 1) { if (ec->rx_coalesce_usecs > 1) {
/* check the limits */ /* check the limits */
...@@ -2267,12 +2267,14 @@ static int ixgbe_set_coalesce(struct net_device *netdev, ...@@ -2267,12 +2267,14 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
else else
/* rx only or mixed */ /* rx only or mixed */
q_vector->eitr = adapter->rx_eitr_param; q_vector->eitr = adapter->rx_eitr_param;
q_vector->tx.work_limit = adapter->tx_work_limit;
ixgbe_write_eitr(q_vector); ixgbe_write_eitr(q_vector);
} }
/* Legacy Interrupt Mode */ /* Legacy Interrupt Mode */
} else { } else {
q_vector = adapter->q_vector[0]; q_vector = adapter->q_vector[0];
q_vector->eitr = adapter->rx_eitr_param; q_vector->eitr = adapter->rx_eitr_param;
q_vector->tx.work_limit = adapter->tx_work_limit;
ixgbe_write_eitr(q_vector); ixgbe_write_eitr(q_vector);
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment