[dpdk-stable] patch 'net/mlx5: fix Rx descriptor status' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Nov 25 10:02:47 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/26/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/db0b497bd529dd264d7a4a2a7f5b6ab14ed5610a

Thanks.

Luca Boccassi

---
>From db0b497bd529dd264d7a4a2a7f5b6ab14ed5610a Mon Sep 17 00:00:00 2001
From: Didier Pallard <didier.pallard at 6wind.com>
Date: Tue, 17 Nov 2020 12:26:47 +0100
Subject: [PATCH] net/mlx5: fix Rx descriptor status

[ upstream commit 7c085d3a4a06b60cd04a408d7edf4e9382172a42 ]

Three bugs in rx_queue_count function:
- One entry may contain several segments, so 'used' must be multiplied
  by number of segments per entry to properly reflect the queue usage.
- The number of cqes is equals to (1U << rxq->elts_n) - 1 in SPRQ mode.
  The range returned by rx_queue_count should be the number of entries
  used in queue, so it ranges from 0 to max number of entries
  in queue, not this number minus one.
- For MPRQ mode, we need to take into account of the number of strd.

Fixes: 8788fec1f269 ("net/mlx5: implement descriptor status API")

Signed-off-by: Didier Pallard <didier.pallard at 6wind.com>
Signed-off-by: Maxime Leroy <maxime.leroy at 6wind.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 6e5605d37e..ac5c1868a0 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -469,6 +469,9 @@ rx_queue_count(struct mlx5_rxq_data *rxq)
 	struct rxq_zip *zip = &rxq->zip;
 	volatile struct mlx5_cqe *cqe;
 	const unsigned int cqe_n = (1 << rxq->cqe_n);
+	const unsigned int sges_n = (1 << rxq->sges_n);
+	const unsigned int elts_n = (1 << rxq->elts_n);
+	const unsigned int strd_n = (1 << rxq->strd_num_n);
 	const unsigned int cqe_cnt = cqe_n - 1;
 	unsigned int cq_ci, used;
 
@@ -494,7 +497,7 @@ rx_queue_count(struct mlx5_rxq_data *rxq)
 		used += n;
 		cqe = &(*rxq->cqes)[cq_ci & cqe_cnt];
 	}
-	used = RTE_MIN(used, cqe_n);
+	used = RTE_MIN(used * sges_n, elts_n * strd_n);
 	return used;
 }
 
-- 
2.27.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-24 16:50:36.763174488 +0000
+++ 0005-net-mlx5-fix-Rx-descriptor-status.patch	2020-11-24 16:50:36.553495977 +0000
@@ -1 +1 @@
-From 7c085d3a4a06b60cd04a408d7edf4e9382172a42 Mon Sep 17 00:00:00 2001
+From db0b497bd529dd264d7a4a2a7f5b6ab14ed5610a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7c085d3a4a06b60cd04a408d7edf4e9382172a42 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -26 +27 @@
-index 2733dcd3ff..2ecf901fb1 100644
+index 6e5605d37e..ac5c1868a0 100644
@@ -29 +30 @@
-@@ -463,6 +463,9 @@ rx_queue_count(struct mlx5_rxq_data *rxq)
+@@ -469,6 +469,9 @@ rx_queue_count(struct mlx5_rxq_data *rxq)
@@ -39 +40 @@
-@@ -488,7 +491,7 @@ rx_queue_count(struct mlx5_rxq_data *rxq)
+@@ -494,7 +497,7 @@ rx_queue_count(struct mlx5_rxq_data *rxq)


More information about the stable mailing list