From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id B3425CF90 for ; Thu, 23 Mar 2017 13:42:19 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shahafs@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Mar 2017 14:42:18 +0200 Received: from unicorn02.mtl.labs.mlnx (unicorn02.mtl.labs.mlnx [10.7.12.63]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v2NCgI3P023495; Thu, 23 Mar 2017 14:42:18 +0200 Received: from unicorn02.mtl.labs.mlnx (localhost [127.0.0.1]) by unicorn02.mtl.labs.mlnx (8.14.7/8.14.7) with ESMTP id v2NCgIIP145116; Thu, 23 Mar 2017 14:42:18 +0200 Received: (from root@localhost) by unicorn02.mtl.labs.mlnx (8.14.7/8.14.7/Submit) id v2NCgBL4145113; Thu, 23 Mar 2017 14:42:11 +0200 From: Shahaf Shuler To: nelio.laranjeiro@6wind.com, adrien.mazarguil@6wind.com Cc: dev@dpdk.org, stable@dpdk.org Date: Thu, 23 Mar 2017 14:42:11 +0200 Message-Id: <1490272931-145077-1-git-send-email-shahafs@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-stable] [PATCH] net/mlx5: fix TSO header size in case of VLAN insertion X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2017 12:42:20 -0000 When VLAN insertion is requested the vlan size must be added to the calculation of the TSO header size, as it is not embedded within the mbuf l2 length. Fixes: 98083fd482a2 ("net/mlx5: add hardware TSO support") Cc: stable@dpdk.org Signed-off-by: Shahaf Shuler --- drivers/net/mlx5/mlx5_rxtx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 823aac8..9e8c6d0 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -548,10 +548,11 @@ buf->ol_flags & (PKT_TX_TUNNEL_GRE | PKT_TX_TUNNEL_VXLAN); + uint8_t vlan_sz = (buf->ol_flags & + PKT_TX_VLAN_PKT) ? 4 : 0; - tso_header_sz = buf->l2_len + buf->l3_len + - buf->l4_len; - + tso_header_sz = buf->l2_len + vlan_sz + + buf->l3_len + buf->l4_len; if (is_tunneled && txq->tunnel_en) { tso_header_sz += buf->outer_l2_len + buf->outer_l3_len; -- 1.8.3.1