diff options
author | Ronak Doshi <doshir@vmware.com> | 2019-06-04 09:58:38 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-05 06:05:56 +0300 |
commit | 3dd7400b419409b1551f7f01764b1f3160feda90 (patch) | |
tree | ec151390109f176fa7d23af3746e20ffb0ee6d4f /drivers/net/vmxnet3/vmxnet3_ethtool.c | |
parent | 9ec49a7e58fb028f23ce6bb6a6a91384811c1dcc (diff) | |
download | linux-3dd7400b419409b1551f7f01764b1f3160feda90.tar.xz |
vmxnet3: turn off lro when rxcsum is disabled
Currently, when rx csum is disabled, vmxnet3 driver does not turn
off lro, which can cause performance issues if user does not turn off
lro explicitly. This patch adds fix_features support which is used to
turn off LRO whenever RXCSUM is disabled.
Signed-off-by: Ronak Doshi <doshir@vmware.com>
Acked-by: Rishi Mehta <rmehta@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vmxnet3/vmxnet3_ethtool.c')
-rw-r--r-- | drivers/net/vmxnet3/vmxnet3_ethtool.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c index 559db051a500..0a38c76688ab 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c @@ -257,6 +257,16 @@ vmxnet3_get_strings(struct net_device *netdev, u32 stringset, u8 *buf) } } +netdev_features_t vmxnet3_fix_features(struct net_device *netdev, + netdev_features_t features) +{ + /* If Rx checksum is disabled, then LRO should also be disabled */ + if (!(features & NETIF_F_RXCSUM)) + features &= ~NETIF_F_LRO; + + return features; +} + int vmxnet3_set_features(struct net_device *netdev, netdev_features_t features) { struct vmxnet3_adapter *adapter = netdev_priv(netdev); |