All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix queue wrap-around of multi-packet send
@ 2017-01-18  0:51 Yongseok Koh
  2017-01-20 16:56 ` Adrien Mazarguil
  0 siblings, 1 reply; 3+ messages in thread
From: Yongseok Koh @ 2017-01-18  0:51 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, adrien.mazarguil, Yongseok Koh, stable

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: e5291c280c08 ("net/mlx5: use work queue buffer as a raw buffer")

CC: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 2ae949295..f54db5b85 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -1037,11 +1037,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) {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net/mlx5: fix queue wrap-around of multi-packet send
  2017-01-18  0:51 [PATCH] net/mlx5: fix queue wrap-around of multi-packet send Yongseok Koh
@ 2017-01-20 16:56 ` Adrien Mazarguil
  2017-01-20 18:43   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Adrien Mazarguil @ 2017-01-20 16:56 UTC (permalink / raw)
  To: Yongseok Koh; +Cc: ferruh.yigit, dev, stable

On Tue, Jan 17, 2017 at 04:51:55PM -0800, Yongseok Koh wrote:
> 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: e5291c280c08 ("net/mlx5: use work queue buffer as a raw buffer")
> 
> CC: stable@dpdk.org
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_rxtx.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Thanks for addressing this issue.

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

-- 
Adrien Mazarguil
6WIND

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net/mlx5: fix queue wrap-around of multi-packet send
  2017-01-20 16:56 ` Adrien Mazarguil
@ 2017-01-20 18:43   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-01-20 18:43 UTC (permalink / raw)
  To: Adrien Mazarguil, Yongseok Koh; +Cc: dev, stable

On 1/20/2017 4:56 PM, Adrien Mazarguil wrote:
> On Tue, Jan 17, 2017 at 04:51:55PM -0800, Yongseok Koh wrote:
>> 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: e5291c280c08 ("net/mlx5: use work queue buffer as a raw buffer")
>>
>> CC: stable@dpdk.org
>> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
>> ---
>>  drivers/net/mlx5/mlx5_rxtx.c | 10 ++++++----
>>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> Thanks for addressing this issue.
> 
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Fixes: fdcb0f53053b ("net/mlx5: use work queue buffer as a raw buffer")
Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-20 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-18  0:51 [PATCH] net/mlx5: fix queue wrap-around of multi-packet send Yongseok Koh
2017-01-20 16:56 ` Adrien Mazarguil
2017-01-20 18:43   ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.