diff options
author | Emil Tantilov <emil.s.tantilov@intel.com> | 2011-05-13 02:22:50 +0000 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-06-23 22:46:21 -0700 |
commit | 2ba279e2f72a9112a2536eabc8fae5413bbbdfb6 (patch) | |
tree | 63d26f47531fe5671b619d1c5d283c4f72e58559 /drivers/net/ixgbe | |
parent | c988ee829074073d3cd80090ef56a6e370b5c9b4 (diff) | |
download | kernel_goldelico_gta04-2ba279e2f72a9112a2536eabc8fae5413bbbdfb6.zip kernel_goldelico_gta04-2ba279e2f72a9112a2536eabc8fae5413bbbdfb6.tar.gz kernel_goldelico_gta04-2ba279e2f72a9112a2536eabc8fae5413bbbdfb6.tar.bz2 |
ixgbe: disable RSC when Rx checksum is off
Disabling Rx checksumming leads to performance degradation due to
RSC causing packets to have incorrect checksums.
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index bb8441e..596d794 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c @@ -458,17 +458,6 @@ static u32 ixgbe_get_rx_csum(struct net_device *netdev) return adapter->flags & IXGBE_FLAG_RX_CSUM_ENABLED; } -static int ixgbe_set_rx_csum(struct net_device *netdev, u32 data) -{ - struct ixgbe_adapter *adapter = netdev_priv(netdev); - if (data) - adapter->flags |= IXGBE_FLAG_RX_CSUM_ENABLED; - else - adapter->flags &= ~IXGBE_FLAG_RX_CSUM_ENABLED; - - return 0; -} - static void ixgbe_set_rsc(struct ixgbe_adapter *adapter) { int i; @@ -484,6 +473,39 @@ static void ixgbe_set_rsc(struct ixgbe_adapter *adapter) } } +static int ixgbe_set_rx_csum(struct net_device *netdev, u32 data) +{ + struct ixgbe_adapter *adapter = netdev_priv(netdev); + bool need_reset = false; + + if (data) { + adapter->flags |= IXGBE_FLAG_RX_CSUM_ENABLED; + } else { + adapter->flags &= ~IXGBE_FLAG_RX_CSUM_ENABLED; + + if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) { + adapter->flags2 &= ~IXGBE_FLAG2_RSC_ENABLED; + netdev->features &= ~NETIF_F_LRO; + } + + switch (adapter->hw.mac.type) { + case ixgbe_mac_X540: + ixgbe_set_rsc(adapter); + break; + case ixgbe_mac_82599EB: + need_reset = true; + break; + default: + break; + } + } + + if (need_reset) + ixgbe_do_reset(netdev); + + return 0; +} + static u32 ixgbe_get_tx_csum(struct net_device *netdev) { return (netdev->features & NETIF_F_IP_CSUM) != 0; |