diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-11-28 07:24:52 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-30 22:30:44 +0100 |
commit | d7cc8252252f9e5b72975a3d498ba2ee08245740 (patch) | |
tree | 968d6a3c8be538cc37c1d59d1b685a8eb1227b59 /drivers | |
parent | nfp: correct descriptor offsets in presence of metadata (diff) | |
download | linux-d7cc8252252f9e5b72975a3d498ba2ee08245740.tar.xz linux-d7cc8252252f9e5b72975a3d498ba2ee08245740.zip |
nfp: avoid oversized TSO headers with metadata prepend
In preparation for TSO over representors make sure the port id
prepend will always fit in the frame. The current max header
length is 255, which is ample, so assume worst case scenario
of 8 byte prepend and save ourselves the conditionals.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index 9cc2c204baa3..3cb7dceca2d9 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -3284,7 +3284,10 @@ nfp_net_features_check(struct sk_buff *skb, struct net_device *dev, hdrlen = skb_inner_transport_header(skb) - skb->data + inner_tcp_hdrlen(skb); - if (unlikely(hdrlen > NFP_NET_LSO_MAX_HDR_SZ)) + /* Assume worst case scenario of having longest possible + * metadata prepend - 8B + */ + if (unlikely(hdrlen > NFP_NET_LSO_MAX_HDR_SZ - 8)) features &= ~NETIF_F_GSO_MASK; } |