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 DC8702B86 for ; Mon, 26 Dec 2016 16:28:45 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from shahafs@mellanox.com) with ESMTPS (AES256-SHA encrypted); 26 Dec 2016 17:28:42 +0200 Received: from arch010.mtl.labs.mlnx (arch010.mtl.labs.mlnx [10.7.12.210]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id uBQFSgNx004994; Mon, 26 Dec 2016 17:28:42 +0200 Received: from arch010.mtl.labs.mlnx (localhost [127.0.0.1]) by arch010.mtl.labs.mlnx (8.14.7/8.14.7) with ESMTP id uBQFSg7b006240; Mon, 26 Dec 2016 17:28:42 +0200 Received: (from root@localhost) by arch010.mtl.labs.mlnx (8.14.7/8.14.7/Submit) id uBQFSaKV006238; Mon, 26 Dec 2016 17:28:36 +0200 From: Shahaf Shuler To: adrien.mazarguil@6wind.com Cc: dev@dpdk.org, stable@dpdk.org Date: Mon, 26 Dec 2016 17:28:36 +0200 Message-Id: <1482766116-6202-1-git-send-email-shahafs@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix multi segment packet send X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 15:28:46 -0000 Dseg pointer is not initialised when the first segment is inlined causing a segmentation fault in such situation. Fixes: 2a66cf378954 ("net/mlx5: support inline send") CC: stable@dpdk.org Signed-off-by: Shahaf Shuler --- drivers/net/mlx5/mlx5_rxtx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 97810e8..d6688c6 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -483,7 +483,7 @@ assert(addr <= addr_end); } /* - * 2 DWORDs consumed by the WQE header + 1 DSEG + + * 2 DWORDs consumed by the WQE header + ETH segment + * the size of the inline part of the packet. */ ds = 2 + MLX5_WQE_DS(pkt_inline_sz - 2); @@ -498,6 +498,10 @@ } else if (!segs_n) { goto next_pkt; } else { + /* dseg will be advance as part of next_seg*/ + dseg = (volatile rte_v128u32_t *) + ((uintptr_t)wqe + + ((ds - 1) * MLX5_WQE_DWORD_SIZE)); goto next_seg; } } else { -- 1.8.3.1