From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A65CEA04DD for ; Wed, 28 Oct 2020 11:56:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 18B33C9D6; Wed, 28 Oct 2020 11:56:41 +0100 (CET) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by dpdk.org (Postfix) with ESMTP id 072C2CADE for ; Wed, 28 Oct 2020 11:56:38 +0100 (CET) Received: by mail-wr1-f47.google.com with SMTP id g12so5144745wrp.10 for ; Wed, 28 Oct 2020 03:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=onuoCMNR0+xVtOqOlIXkXLWNXBxYMq6tF/Y/mYDV4EY=; b=Hh3L7gNGBf/7sEJBgLlaDTApIk7x1HxtiQY34c3RQrADPWrTQvXZswRNJ9ll9RitFO /Kgbr1vqhr5nS1eq4j/b9+5X/t0kTIY29RhcGV7Ko3h/3GK/AI2kmbLNQhnbpm4NMqK+ bxeYcuiQSgAdCOKkoZKiUuYPi8cS+rf7elNNx5hBW9quT0Pb8n4HFV5tZsPs9oqm4DEc glA8naZCCpj2sM75CcDyrRsReYV6gFpDEbrXM6ZHK5mfngq5TcCmY3N1cq49weAPzdGw JRhP0edxgBz+XU8la1wrrRS9UzYODV80eloGwu29N6EDd55ntb25Mi3DoQTFe51fSt1B 3ILA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=onuoCMNR0+xVtOqOlIXkXLWNXBxYMq6tF/Y/mYDV4EY=; b=De47Rxs4qYaqpdOxrUlIBMrFqp23qK4ud3318fLpOw5b6mlIuJ1at6MG+O5yjmOlQ/ JEfPJ3YGwZLfVkR9f6BG8bVUAwN3RuRbx+nMnvzVDlHMXG5HU2KU3LhIOKIH53JqCpUJ bnlhhdSDjbtLjEcQmURGpK5BvX4/iT+x93SFcOutXEp5zKDGhWBMrN5bSAve+TYfFu3c MialZ9FtZsbl0mjx000jitPQW9zcX/YR9QphZPg4zpR+Ifx6lMHrsorcV/5HrIhIrGvn qP4TdwNPOrHPys0iBsCgSeZbPvrmbhXteHBP0C4tjfDK6WS3DviSOYr0wpFHKFg5vBeE 0kMA== X-Gm-Message-State: AOAM533xIdQPOoTlSpek13c2RB8VtxAPm/3J8CrLp852dkKCmZVHk40w pjPWWJdE4ZPY9auehPnPkgkQ3LgtpAu8yquh X-Google-Smtp-Source: ABdhPJwSSgEFOjvdtWduo9ERIpgtcveJWGF+K4f/+WCjSGovLJz4Yzsf+3igwDLa1zoUbnKj5BDWvg== X-Received: by 2002:a5d:6591:: with SMTP id q17mr8083598wru.173.1603882596745; Wed, 28 Oct 2020 03:56:36 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id t19sm5692994wmj.42.2020.10.28.03.56.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:56:36 -0700 (PDT) From: luca.boccassi@gmail.com To: Lukasz Wojciechowski Cc: David Hunt , dpdk stable Date: Wed, 28 Oct 2020 10:45:55 +0000 Message-Id: <20201028104606.3504127-196-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com> References: <20201028104606.3504127-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'test/distributor: ensure all packets are delivered' has been queued to stable release 19.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 10/30/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. Thanks. Luca Boccassi --- >From b3d6175b8ea44b5349a643e9140cc787d884a4c1 Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski Date: Sat, 17 Oct 2020 05:07:00 +0200 Subject: [PATCH] test/distributor: ensure all packets are delivered [ upstream commit e1f1400cf6b85bbb6f4b7b088d54758e210343e7 ] In all distributor tests there is a chance that tests will send packets to distributor with rte_distributor_process() before workers are started and requested for packets. This patch ensures that all packets are delivered to workers by calling rte_distributor_process() in loop until number of successfully processed packets reaches required by test. Change is applied to every first call in test case. Signed-off-by: Lukasz Wojciechowski Acked-by: David Hunt --- app/test/test_distributor.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c index e9e8e2c7af..199f88887d 100644 --- a/app/test/test_distributor.c +++ b/app/test/test_distributor.c @@ -103,6 +103,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) struct rte_mbuf *returns[BURST*2]; unsigned int i, count; unsigned int retries; + unsigned int processed; printf("=== Basic distributor sanity tests ===\n"); clear_packet_count(); @@ -116,7 +117,11 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) for (i = 0; i < BURST; i++) bufs[i]->hash.usr = 0; - rte_distributor_process(db, bufs, BURST); + processed = 0; + while (processed < BURST) + processed += rte_distributor_process(db, &bufs[processed], + BURST - processed); + count = 0; do { @@ -304,6 +309,7 @@ sanity_test_with_mbuf_alloc(struct worker_params *wp, struct rte_mempool *p) struct rte_distributor *d = wp->dist; unsigned i; struct rte_mbuf *bufs[BURST]; + unsigned int processed; printf("=== Sanity test with mbuf alloc/free (%s) ===\n", wp->name); @@ -316,7 +322,10 @@ sanity_test_with_mbuf_alloc(struct worker_params *wp, struct rte_mempool *p) bufs[j]->hash.usr = (i+j) << 1; } - rte_distributor_process(d, bufs, BURST); + processed = 0; + while (processed < BURST) + processed += rte_distributor_process(d, + &bufs[processed], BURST - processed); } rte_distributor_flush(d); @@ -410,6 +419,7 @@ sanity_test_with_worker_shutdown(struct worker_params *wp, struct rte_mbuf *bufs2[BURST]; unsigned int i; unsigned int failed = 0; + unsigned int processed = 0; printf("=== Sanity test of worker shutdown ===\n"); @@ -427,7 +437,10 @@ sanity_test_with_worker_shutdown(struct worker_params *wp, for (i = 0; i < BURST; i++) bufs[i]->hash.usr = 1; - rte_distributor_process(d, bufs, BURST); + processed = 0; + while (processed < BURST) + processed += rte_distributor_process(d, &bufs[processed], + BURST - processed); rte_distributor_flush(d); /* at this point, we will have processed some packets and have a full @@ -489,6 +502,7 @@ test_flush_with_worker_shutdown(struct worker_params *wp, struct rte_mbuf *bufs[BURST]; unsigned int i; unsigned int failed = 0; + unsigned int processed; printf("=== Test flush fn with worker shutdown (%s) ===\n", wp->name); @@ -503,7 +517,10 @@ test_flush_with_worker_shutdown(struct worker_params *wp, for (i = 0; i < BURST; i++) bufs[i]->hash.usr = 0; - rte_distributor_process(d, bufs, BURST); + processed = 0; + while (processed < BURST) + processed += rte_distributor_process(d, &bufs[processed], + BURST - processed); /* at this point, we will have processed some packets and have a full * backlog for the other ones at worker 0. */ -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:17.769708130 +0000 +++ 0196-test-distributor-ensure-all-packets-are-delivered.patch 2020-10-28 10:35:11.804834440 +0000 @@ -1,8 +1,10 @@ -From e1f1400cf6b85bbb6f4b7b088d54758e210343e7 Mon Sep 17 00:00:00 2001 +From b3d6175b8ea44b5349a643e9140cc787d884a4c1 Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski Date: Sat, 17 Oct 2020 05:07:00 +0200 Subject: [PATCH] test/distributor: ensure all packets are delivered +[ upstream commit e1f1400cf6b85bbb6f4b7b088d54758e210343e7 ] + In all distributor tests there is a chance that tests will send packets to distributor with rte_distributor_process() before workers are started and requested for packets. @@ -12,16 +14,14 @@ of successfully processed packets reaches required by test. Change is applied to every first call in test case. -Cc: stable@dpdk.org - Signed-off-by: Lukasz Wojciechowski Acked-by: David Hunt --- - app/test/test_distributor.c | 32 +++++++++++++++++++++++++++----- - 1 file changed, 27 insertions(+), 5 deletions(-) + app/test/test_distributor.c | 25 +++++++++++++++++++++---- + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c -index cfae5a1ac9..a4af0a39c6 100644 +index e9e8e2c7af..199f88887d 100644 --- a/app/test/test_distributor.c +++ b/app/test/test_distributor.c @@ -103,6 +103,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) @@ -105,27 +105,6 @@ /* at this point, we will have processed some packets and have a full * backlog for the other ones at worker 0. */ -@@ -585,6 +602,7 @@ sanity_mark_test(struct worker_params *wp, struct rte_mempool *p) - unsigned int i, count, id; - unsigned int sorted[buf_count], seq; - unsigned int failed = 0; -+ unsigned int processed; - - printf("=== Marked packets test ===\n"); - clear_packet_count(); -@@ -615,7 +633,11 @@ sanity_mark_test(struct worker_params *wp, struct rte_mempool *p) - - count = 0; - for (i = 0; i < buf_count/burst; i++) { -- rte_distributor_process(db, &bufs[i * burst], burst); -+ processed = 0; -+ while (processed < burst) -+ processed += rte_distributor_process(db, -+ &bufs[i * burst + processed], -+ burst - processed); - count += rte_distributor_returned_pkts(db, &returns[count], - buf_count - count); - } -- 2.20.1