From: Yongseok Koh Date: Thu, 2 Feb 2017 18:43:32 +0000 (-0800) Subject: net/mlx5: fix updating total length of multi-packet send X-Git-Tag: spdx-start~4530 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=76bf1574e3a8ebbce845fe8c6691665dfc657ddf;p=dpdk.git 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 --- 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. */