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

Kevin Traynor ktraynor at redhat.com
Mon Nov 23 18:12:16 CET 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.11

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/27/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/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/b8a7d45b93255969067b0150fa9d086fa86586a1

Thanks.

Kevin.

---
>From b8a7d45b93255969067b0150fa9d086fa86586a1 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 dd7b183395..c9305334d0 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -432,4 +432,7 @@ rx_queue_count(struct mlx5_rxq_data *rxq)
 	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;
@@ -457,5 +460,5 @@ rx_queue_count(struct mlx5_rxq_data *rxq)
 		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.26.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-23 17:10:14.558324428 +0000
+++ 0024-net-mlx5-fix-Rx-descriptor-status.patch	2020-11-23 17:10:14.009061603 +0000
@@ -1 +1 @@
-From 7c085d3a4a06b60cd04a408d7edf4e9382172a42 Mon Sep 17 00:00:00 2001
+From b8a7d45b93255969067b0150fa9d086fa86586a1 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 dd7b183395..c9305334d0 100644
@@ -29 +30 @@
-@@ -464,4 +464,7 @@ rx_queue_count(struct mlx5_rxq_data *rxq)
+@@ -432,4 +432,7 @@ rx_queue_count(struct mlx5_rxq_data *rxq)
@@ -37 +38 @@
-@@ -489,5 +492,5 @@ rx_queue_count(struct mlx5_rxq_data *rxq)
+@@ -457,5 +460,5 @@ rx_queue_count(struct mlx5_rxq_data *rxq)



More information about the stable mailing list