aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGal Pressman <galp@mellanox.com>2017-11-21 10:49:36 -0500
committerSaeed Mahameed <saeedm@mellanox.com>2017-12-19 16:24:00 -0500
commit2989ad1ec03021ee6d2193c35414f1d970a243de (patch)
tree16008845aa101822e7b294d52211bcfc47f9f973
parentff0891915cd7b24ab27eee9b360c0452853bf9f6 (diff)
net/mlx5e: Fix features check of IPv6 traffic
The assumption that the next header field contains the transport protocol is wrong for IPv6 packets with extension headers. Instead, we should look the inner-most next header field in the buffer. This will fix TSO offload for tunnels over IPv6 with extension headers. Performance testing: 19.25x improvement, cool! Measuring bandwidth of 16 threads TCP traffic over IPv6 GRE tap. CPU: Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz NIC: Mellanox Technologies MT28800 Family [ConnectX-5 Ex] TSO: Enabled Before: 4,926.24 Mbps Now : 94,827.91 Mbps Fixes: b3f63c3d5e2c ("net/mlx5e: Add netdev support for VXLAN tunneling") Signed-off-by: Gal Pressman <galp@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index cbec66bc82f1..c535a44ab8ac 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -3678,6 +3678,7 @@ static netdev_features_t mlx5e_tunnel_features_check(struct mlx5e_priv *priv,
3678 struct sk_buff *skb, 3678 struct sk_buff *skb,
3679 netdev_features_t features) 3679 netdev_features_t features)
3680{ 3680{
3681 unsigned int offset = 0;
3681 struct udphdr *udph; 3682 struct udphdr *udph;
3682 u8 proto; 3683 u8 proto;
3683 u16 port; 3684 u16 port;
@@ -3687,7 +3688,7 @@ static netdev_features_t mlx5e_tunnel_features_check(struct mlx5e_priv *priv,
3687 proto = ip_hdr(skb)->protocol; 3688 proto = ip_hdr(skb)->protocol;
3688 break; 3689 break;
3689 case htons(ETH_P_IPV6): 3690 case htons(ETH_P_IPV6):
3690 proto = ipv6_hdr(skb)->nexthdr; 3691 proto = ipv6_find_hdr(skb, &offset, -1, NULL, NULL);
3691 break; 3692 break;
3692 default: 3693 default:
3693 goto out; 3694 goto out;