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,8 +1983,12 @@ static int ixgbe_set_coalesce(struct net_device *netdev, ...@@ -1982,8 +1983,12 @@ 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 &
(IXGBE_FLAG_MSIX_ENABLED | IXGBE_FLAG_MSI_ENABLED)) {
int num_vectors = adapter->num_msix_vectors - NON_Q_VECTORS;
for (i = 0; i < num_vectors; i++) {
q_vector = adapter->q_vector[i];
if (q_vector->txr_count && !q_vector->rxr_count) if (q_vector->txr_count && !q_vector->rxr_count)
/* tx vector gets half the rate */ /* tx vector gets half the rate */
q_vector->eitr = (adapter->eitr_param >> 1); q_vector->eitr = (adapter->eitr_param >> 1);
...@@ -1992,6 +1997,12 @@ static int ixgbe_set_coalesce(struct net_device *netdev, ...@@ -1992,6 +1997,12 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
q_vector->eitr = adapter->eitr_param; q_vector->eitr = adapter->eitr_param;
ixgbe_write_eitr(q_vector); 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);
}
return 0; return 0;
} }
......
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