From: Yongseok Koh Date: Wed, 18 Jan 2017 00:51:55 +0000 (-0800) Subject: net/mlx5: fix queue wrap-around of multi-packet send X-Git-Tag: spdx-start~4621 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=16c647683019233a07d67af2f94867f52e7cf0b5;p=dpdk.git net/mlx5: fix queue wrap-around of multi-packet send When the WQ is wrapped around, it wrongly checks the condition when resetting the pointer. It should be compared against the end of the queue, not the beginning of the queue. And this isn't even needed when the length of the copying data crosses the boundary. Fixes: fdcb0f53053b ("net/mlx5: use work queue buffer as a raw buffer") Cc: stable@dpdk.org Signed-off-by: Yongseok Koh Acked-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 6c23899a4c..fbfc5fb304 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -1038,11 +1038,13 @@ mlx5_tx_burst_mpw_inline(void *dpdk_txq, struct rte_mbuf **pkts, rte_memcpy((void *)(uintptr_t)mpw.data.raw, (void *)addr, length); - mpw.data.raw += length; + + if (length == max) + mpw.data.raw = + (volatile void *)txq->wqes; + else + mpw.data.raw += length; } - if ((uintptr_t)mpw.data.raw == - (uintptr_t)tx_mlx5_wqe(txq, 1 << txq->wqe_n)) - mpw.data.raw = (volatile void *)txq->wqes; ++mpw.pkts_n; ++j; if (mpw.pkts_n == MLX5_MPW_DSEG_MAX) {