[dpdk-stable] patch 'test/distributor: fix return buffer queue overload' has been queued to stable release 19.11.7
Christian Ehrhardt
christian.ehrhardt at canonical.com
Thu Feb 4 12:28:58 CET 2021
Hi,
FYI, your patch has been queued to stable release 19.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/06/21. 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/cpaelzer/dpdk-stable-queue
This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/09bc0f04c8210874e39e4e8c0eb095430dfca15b
Thanks.
Christian Ehrhardt <christian.ehrhardt at canonical.com>
---
>From 09bc0f04c8210874e39e4e8c0eb095430dfca15b Mon Sep 17 00:00:00 2001
From: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
Date: Tue, 19 Jan 2021 04:59:10 +0100
Subject: [PATCH] test/distributor: fix return buffer queue overload
[ upstream commit 95bb2477022e6153419adc41f829e69b83b18925 ]
The distributor library implementation uses a cyclic queue to store
packets returned from workers. These packets can be later collected
with rte_distributor_returned_pkts() call.
However the queue has limited capacity. It is able to contain only
127 packets (RTE_DISTRIB_RETURNS_MASK).
Big burst tests sent 1024 packets in 32 packets bursts without waiting
until they are processed by the distributor. In case when tests were
run with big number of worker threads, it happened that more than
127 packets were returned from workers and put into cyclic queue.
This caused packets to be dropped by the queue, making them impossible
to be collected later with rte_distributor_returned_pkts() calls.
However the test waited for all packets to be returned infinitely.
This patch fixes the big burst test by not allowing more than
queue capacity packets to be processed at the same time, making
impossible to drop any packets.
It also cleans up duplicated code in the same test.
Bugzilla ID: 612
Fixes: c0de0eb82e40 ("distributor: switch over to new API")
Signed-off-by: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
Tested-by: David Marchand <david.marchand at redhat.com>
Reviewed-by: David Hunt <david.hunt at intel.com>
---
app/test/test_distributor.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c
index 3b2a4cbcf9..acfe728f0c 100644
--- a/app/test/test_distributor.c
+++ b/app/test/test_distributor.c
@@ -207,6 +207,8 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
clear_packet_count();
struct rte_mbuf *many_bufs[BIG_BATCH], *return_bufs[BIG_BATCH];
unsigned num_returned = 0;
+ unsigned int num_being_processed = 0;
+ unsigned int return_buffer_capacity = 127;/* RTE_DISTRIB_RETURNS_MASK */
/* flush out any remaining packets */
rte_distributor_flush(db);
@@ -223,16 +225,16 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
for (i = 0; i < BIG_BATCH/BURST; i++) {
rte_distributor_process(db,
&many_bufs[i*BURST], BURST);
- count = rte_distributor_returned_pkts(db,
- &return_bufs[num_returned],
- BIG_BATCH - num_returned);
- num_returned += count;
+ num_being_processed += BURST;
+ do {
+ count = rte_distributor_returned_pkts(db,
+ &return_bufs[num_returned],
+ BIG_BATCH - num_returned);
+ num_being_processed -= count;
+ num_returned += count;
+ rte_distributor_flush(db);
+ } while (num_being_processed + BURST > return_buffer_capacity);
}
- rte_distributor_flush(db);
- count = rte_distributor_returned_pkts(db,
- &return_bufs[num_returned],
- BIG_BATCH - num_returned);
- num_returned += count;
retries = 0;
do {
rte_distributor_flush(db);
--
2.30.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2021-02-04 12:04:31.488002814 +0100
+++ 0083-test-distributor-fix-return-buffer-queue-overload.patch 2021-02-04 12:04:28.078789775 +0100
@@ -1 +1 @@
-From 95bb2477022e6153419adc41f829e69b83b18925 Mon Sep 17 00:00:00 2001
+From 09bc0f04c8210874e39e4e8c0eb095430dfca15b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 95bb2477022e6153419adc41f829e69b83b18925 ]
+
@@ -27 +28,0 @@
-Cc: stable at dpdk.org
@@ -37 +38 @@
-index f4c6229f16..961f326cd5 100644
+index 3b2a4cbcf9..acfe728f0c 100644
@@ -40 +41 @@
-@@ -217,6 +217,8 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
+@@ -207,6 +207,8 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
@@ -49 +50 @@
-@@ -233,16 +235,16 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
+@@ -223,16 +225,16 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p)
More information about the stable
mailing list