From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C5EE4A0524 for ; Fri, 5 Feb 2021 12:35:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BFDA61889FD; Fri, 5 Feb 2021 12:35:44 +0100 (CET) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mails.dpdk.org (Postfix) with ESMTP id 4B41B40682 for ; Fri, 5 Feb 2021 12:35:43 +0100 (CET) Received: by mail-wm1-f45.google.com with SMTP id u14so5640011wmq.4 for ; Fri, 05 Feb 2021 03:35:43 -0800 (PST) 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=6L5HKj8HUloijTPHWZ3eX85wnKkEgNoSklMhXVaI6B8=; b=EaIBswZ61suxkiQRBMPihVUkGg94fyRc6SZwIZo/z8R3X7WHpUKgmVk4TjmvMnm7YQ iTrDsajmxqBWrxnh8ANHqzOC28n+hTgsd10mhD+3imV60tAPm2PdlunsyiPUMZ5zrCWj PEIyaH3oApjHq0N0TKbTL4jbKI4ikECU6gkTxGOdvd6+0Da5ESTgaaMmpJrdMnH5s/o7 QzA3ahkFf0wgVXPAwEgayl1vR8zTc7sTWdSvdLaVTdLFo9ZPIgcA5pcrcR15CmTNrHQd iZHUwL9F6FaNDDV0SpW7wCRtQ2RqyhKxAeFUWE6Q4KxAIFIV+5QIsJluFyTMYlZpvFC1 6wMQ== 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=6L5HKj8HUloijTPHWZ3eX85wnKkEgNoSklMhXVaI6B8=; b=M2tu8yKDqHgLfMsYkA11eGrGL94kpI7kOy6WKtHQYjMAmwpVxMn9BJXFEo/IfIwsDR CQUhs7la3U5KtHZhQaouNB/WSdTwm5VyfvS/l43nvVAEfSz5/RpUw0azGlLYEYgl6zKZ V5SDoctMM/XdhtLXG+EwHbrnKkhAglVC+iLAU/OKH2QeRAC/xlFMtj0U5BpA/mRSPG/Z sDZvaOC5Dhy4Zk8T9/olRunMcQkKv6QXtBwRJO6+vXm4dfSG/XpUkhlvIPDTc2SoGHlO nM6W95TTNq3vMaze/XK2pZmYuTeEe1wjcyWSccfCSZECAotHuvQqVQipwoFIZ7ywOLp2 s+0g== X-Gm-Message-State: AOAM532XwjGdpiXTmSACuTh05nL5WK+fvbm7snq8QrAP2IgosvxYZm2V 8LoFHe06w7hhdnaB1Bzxujg= X-Google-Smtp-Source: ABdhPJz6qkm6eWKgqn6layCAiUapV8JW85Twgb/Mbhw2aRI+V/ExdB0lG2iXvl3/k9iv6d8fXJa5Jg== X-Received: by 2002:a1c:bc89:: with SMTP id m131mr3257291wmf.32.1612524943079; Fri, 05 Feb 2021 03:35:43 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id t17sm8607136wmi.46.2021.02.05.03.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:35:42 -0800 (PST) From: luca.boccassi@gmail.com To: Lukasz Wojciechowski Cc: David Marchand , David Hunt , dpdk stable Date: Fri, 5 Feb 2021 11:18:03 +0000 Message-Id: <20210205111920.1272063-197-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'test/distributor: fix return buffer queue overload' has been queued to stable release 20.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 20.11.1 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/07/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/319aae05f903d5c4b126ef2665653763eb4d29f2 Thanks. Luca Boccassi --- >From 319aae05f903d5c4b126ef2665653763eb4d29f2 Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski 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 Tested-by: David Marchand Reviewed-by: David Hunt --- 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 f4c6229f16..961f326cd5 100644 --- a/app/test/test_distributor.c +++ b/app/test/test_distributor.c @@ -217,6 +217,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); @@ -233,16 +235,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.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:37.969905774 +0000 +++ 0197-test-distributor-fix-return-buffer-queue-overload.patch 2021-02-05 11:18:29.150697661 +0000 @@ -1 +1 @@ -From 95bb2477022e6153419adc41f829e69b83b18925 Mon Sep 17 00:00:00 2001 +From 319aae05f903d5c4b126ef2665653763eb4d29f2 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 95bb2477022e6153419adc41f829e69b83b18925 ] + @@ -27 +28,0 @@ -Cc: stable@dpdk.org