From 76bf1574e3a8ebbce845fe8c6691665dfc657ddf Mon Sep 17 00:00:00 2001 From: Yongseok Koh Date: Thu, 2 Feb 2017 10:43:32 -0800 Subject: [PATCH] net/mlx5: fix updating total length of multi-packet send The total length field in descriptor of inlined multi-packet send must be updated before closing a session. There's possibility of updating it afterward. This bug might cause one packet out of MLX5_MPW_DSEG_MAX gets silently dropped by HW and impact performance, especially lossless test. Fixes: 230189d9ff22 ("net/mlx5: support multi-packet send") Cc: stable@dpdk.org Signed-off-by: Yongseok Koh Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 40f2c474d4..88b0354479 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -1106,6 +1106,7 @@ mlx5_tx_burst_mpw_inline(void *dpdk_txq, struct rte_mbuf **pkts, mpw.data.raw += length; } ++mpw.pkts_n; + mpw.total_len += length; ++j; if (mpw.pkts_n == MLX5_MPW_DSEG_MAX) { mlx5_mpw_inline_close(txq, &mpw); @@ -1115,7 +1116,6 @@ mlx5_tx_burst_mpw_inline(void *dpdk_txq, struct rte_mbuf **pkts, inline_room -= length; } } - mpw.total_len += length; elts_head = elts_head_next; #ifdef MLX5_PMD_SOFT_COUNTERS /* Increment sent bytes counter. */ -- 2.20.1