From: Shahaf Shuler Date: Mon, 26 Dec 2016 15:28:36 +0000 (+0200) Subject: net/mlx5: fix multi segment packet send X-Git-Tag: spdx-start~4867 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=786b5c2dac785fe2fdbd303c236edc9491c00e5e;p=dpdk.git 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 --- 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 {