diff options
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 2a978008fd6e..dff8dfac7ed9 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -1948,6 +1948,7 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
1948 | struct ethtool_coalesce *ec) | 1948 | struct ethtool_coalesce *ec) |
1949 | { | 1949 | { |
1950 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 1950 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
1951 | struct ixgbe_q_vector *q_vector; | ||
1951 | int i; | 1952 | int i; |
1952 | 1953 | ||
1953 | if (ec->tx_max_coalesced_frames_irq) | 1954 | if (ec->tx_max_coalesced_frames_irq) |
@@ -1975,18 +1976,31 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
1975 | * any other value means disable eitr, which is best | 1976 | * any other value means disable eitr, which is best |
1976 | * served by setting the interrupt rate very high | 1977 | * served by setting the interrupt rate very high |
1977 | */ | 1978 | */ |
1978 | adapter->eitr_param = IXGBE_MAX_INT_RATE; | 1979 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) |
1980 | adapter->eitr_param = IXGBE_MAX_RSC_INT_RATE; | ||
1981 | else | ||
1982 | adapter->eitr_param = IXGBE_MAX_INT_RATE; | ||
1979 | adapter->itr_setting = 0; | 1983 | adapter->itr_setting = 0; |
1980 | } | 1984 | } |
1981 | 1985 | ||
1982 | for (i = 0; i < adapter->num_msix_vectors - NON_Q_VECTORS; i++) { | 1986 | /* MSI/MSIx Interrupt Mode */ |
1983 | struct ixgbe_q_vector *q_vector = adapter->q_vector[i]; | 1987 | if (adapter->flags & |
1984 | if (q_vector->txr_count && !q_vector->rxr_count) | 1988 | (IXGBE_FLAG_MSIX_ENABLED | IXGBE_FLAG_MSI_ENABLED)) { |
1985 | /* tx vector gets half the rate */ | 1989 | int num_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; |
1986 | q_vector->eitr = (adapter->eitr_param >> 1); | 1990 | for (i = 0; i < num_vectors; i++) { |
1987 | else | 1991 | q_vector = adapter->q_vector[i]; |
1988 | /* rx only or mixed */ | 1992 | if (q_vector->txr_count && !q_vector->rxr_count) |
1989 | q_vector->eitr = adapter->eitr_param; | 1993 | /* tx vector gets half the rate */ |
1994 | q_vector->eitr = (adapter->eitr_param >> 1); | ||
1995 | else | ||
1996 | /* rx only or mixed */ | ||
1997 | q_vector->eitr = adapter->eitr_param; | ||
1998 | ixgbe_write_eitr(q_vector); | ||
1999 | } | ||
2000 | /* Legacy Interrupt Mode */ | ||
2001 | } else { | ||
2002 | q_vector = adapter->q_vector[0]; | ||
2003 | q_vector->eitr = adapter->eitr_param; | ||
1990 | ixgbe_write_eitr(q_vector); | 2004 | ixgbe_write_eitr(q_vector); |
1991 | } | 2005 | } |
1992 | 2006 | ||
@@ -1999,13 +2013,13 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data) | |||
1999 | 2013 | ||
2000 | ethtool_op_set_flags(netdev, data); | 2014 | ethtool_op_set_flags(netdev, data); |
2001 | 2015 | ||
2002 | if (!(adapter->flags & IXGBE_FLAG2_RSC_CAPABLE)) | 2016 | if (!(adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)) |
2003 | return 0; | 2017 | return 0; |
2004 | 2018 | ||
2005 | /* if state changes we need to update adapter->flags and reset */ | 2019 | /* if state changes we need to update adapter->flags and reset */ |
2006 | if ((!!(data & ETH_FLAG_LRO)) != | 2020 | if ((!!(data & ETH_FLAG_LRO)) != |
2007 | (!!(adapter->flags & IXGBE_FLAG2_RSC_ENABLED))) { | 2021 | (!!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED))) { |
2008 | adapter->flags ^= IXGBE_FLAG2_RSC_ENABLED; | 2022 | adapter->flags2 ^= IXGBE_FLAG2_RSC_ENABLED; |
2009 | if (netif_running(netdev)) | 2023 | if (netif_running(netdev)) |
2010 | ixgbe_reinit_locked(adapter); | 2024 | ixgbe_reinit_locked(adapter); |
2011 | else | 2025 | else |