Commit 237057ad authored by Don Skidmore's avatar Don Skidmore Committed by David S. Miller

ixgbe: fix issues setting rx-usecs with legacy interrupts

Currently setting rx-usecs when the interface is in legacy interrupt
mode it is not immediate.  We were only setting EITR for each MSIx
vector and since this count would be zero for legacy mode it wasn't
set until after a reset.  This patch corrects that by checking what
mode we are in and then setting EITR accordingly.
Signed-off-by: default avatarDon Skidmore <donald.skidmore@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 993e6f2f
...@@ -1948,6 +1948,7 @@ static int ixgbe_set_coalesce(struct net_device *netdev, ...@@ -1948,6 +1948,7 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
struct ethtool_coalesce *ec) struct ethtool_coalesce *ec)
{ {
struct ixgbe_adapter *adapter = netdev_priv(netdev); struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_q_vector *q_vector;
int i; int i;
if (ec->tx_max_coalesced_frames_irq) if (ec->tx_max_coalesced_frames_irq)
...@@ -1982,14 +1983,24 @@ static int ixgbe_set_coalesce(struct net_device *netdev, ...@@ -1982,14 +1983,24 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
adapter->itr_setting = 0; adapter->itr_setting = 0;
} }
for (i = 0; i < adapter->num_msix_vectors - NON_Q_VECTORS; i++) { /* MSI/MSIx Interrupt Mode */
struct ixgbe_q_vector *q_vector = adapter->q_vector[i]; if (adapter->flags &
if (q_vector->txr_count && !q_vector->rxr_count) (IXGBE_FLAG_MSIX_ENABLED | IXGBE_FLAG_MSI_ENABLED)) {
/* tx vector gets half the rate */ int num_vectors = adapter->num_msix_vectors - NON_Q_VECTORS;
q_vector->eitr = (adapter->eitr_param >> 1); for (i = 0; i < num_vectors; i++) {
else q_vector = adapter->q_vector[i];
/* rx only or mixed */ if (q_vector->txr_count && !q_vector->rxr_count)
q_vector->eitr = adapter->eitr_param; /* tx vector gets half the rate */
q_vector->eitr = (adapter->eitr_param >> 1);
else
/* rx only or mixed */
q_vector->eitr = adapter->eitr_param;
ixgbe_write_eitr(q_vector);
}
/* Legacy Interrupt Mode */
} else {
q_vector = adapter->q_vector[0];
q_vector->eitr = adapter->eitr_param;
ixgbe_write_eitr(q_vector); ixgbe_write_eitr(q_vector);
} }
......
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