From 786b5c2dac785fe2fdbd303c236edc9491c00e5e Mon Sep 17 00:00:00 2001 From: Shahaf Shuler Date: Mon, 26 Dec 2016 17:28:36 +0200 Subject: [PATCH] net/mlx5: fix multi segment packet send Dseg pointer is not initialized when the first segment is inlined causing a segmentation fault in such situation. Fixes: 2a66cf378954 ("net/mlx5: support inline send") Signed-off-by: Shahaf Shuler Acked-by: Adrien Mazarguil --- 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 0aa2da9c91..0e75561f90 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -484,7 +484,7 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) 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); @@ -499,6 +499,10 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) } 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 {