diff options
author | Thomas Falcon <tlfalcon@linux.vnet.ibm.com> | 2018-03-12 11:51:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-13 10:09:28 -0400 |
commit | f10b09ef687f3134c26027d2a38a9d4cd3bb9cb7 (patch) | |
tree | 3b6f70150be0606cf1f3679a76fd01514c036c2f /drivers | |
parent | 1f247a6f9e5d1b5a1e57d66829ee52dbafac256f (diff) | |
download | linux-f10b09ef687f3134c26027d2a38a9d4cd3bb9cb7.tar.bz2 |
ibmvnic: Handle TSO backing device errata
TSO packets with one segment or with an MSS less than 224 can
cause errors on some backing devices, so disable GSO in those cases.
Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/ibm/ibmvnic.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 7ed87fbb156b..e02d3b9aaf15 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -2049,6 +2049,23 @@ static int ibmvnic_change_mtu(struct net_device *netdev, int new_mtu) return wait_for_reset(adapter); } +static netdev_features_t ibmvnic_features_check(struct sk_buff *skb, + struct net_device *dev, + netdev_features_t features) +{ + /* Some backing hardware adapters can not + * handle packets with a MSS less than 224 + * or with only one segment. + */ + if (skb_is_gso(skb)) { + if (skb_shinfo(skb)->gso_size < 224 || + skb_shinfo(skb)->gso_segs == 1) + features &= ~NETIF_F_GSO_MASK; + } + + return features; +} + static const struct net_device_ops ibmvnic_netdev_ops = { .ndo_open = ibmvnic_open, .ndo_stop = ibmvnic_close, @@ -2061,6 +2078,7 @@ static const struct net_device_ops ibmvnic_netdev_ops = { .ndo_poll_controller = ibmvnic_netpoll_controller, #endif .ndo_change_mtu = ibmvnic_change_mtu, + .ndo_features_check = ibmvnic_features_check, }; /* ethtool functions */ |