[dpdk-dev] [PATCH] net/mlx5: fix multi segment packet send

Shahaf Shuler shahafs at mellanox.com
Mon Dec 26 16:28:36 CET 2016


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 at dpdk.org
Signed-off-by: Shahaf Shuler <shahafs at mellanox.com>
---
 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



More information about the dev mailing list