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 129C2A04DD for ; Wed, 28 Oct 2020 11:56:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D73C7CAF7; Wed, 28 Oct 2020 11:56:26 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 9E085CAE2 for ; Wed, 28 Oct 2020 11:56:25 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id n18so5180276wrs.5 for ; Wed, 28 Oct 2020 03:56:25 -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=5jvIHgjkKX6UE3s9V3utwE4Pejzi5wQ4LgW91bqSCHs=; b=smnYLAqt4f+ccyY2Iv6NlsAOEheqb0kuBwOT1bgyL+Vcl726puHoIXSfOGckq0Dx3K pmGvca++tTAqwIj1OcVWdpd/TTw+zkYB9yKXRAuFQw+G7WUmJesbBGJzTgb8wJpdcNIP yyZSOu+0vE+HSkppmnhs14PWLSLvTp0UroQuqtDPRb2pbTjrCdKTQtWJ0d6fKesqncTs 6aprH2hMemBrEjYoTwUcf8iCGAnnlip3DIfhgCRL7HYs7e0wHWSXDTOGg7R/BowbGPAU A/oes25KJQxygLqKkl/IjjfgIBK/nTIYoj+TSGCG/Tor+JFbH7iETW9/UmFWAF46eiUR WvoA== 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=5jvIHgjkKX6UE3s9V3utwE4Pejzi5wQ4LgW91bqSCHs=; b=SYtkR9IdKtWhdHVGxkctXL9V4RIae5E7eshdK80ZRDOtSsdFtMDVOP2LSFus7XG4Dp 8pZIjco2qh936PlFP+/fJk9jXE18sQZ1eRmU8+SYhZGBgESOVVZakSAWKDSsxf176+QJ fhIALzitz2RNi4IoajkLLfBvU4Uh2G6HT+zbOQVE18tN9ecAYBqwt1E2X8I6ijiP/ZmN bVCYUxzieZtKAEJGyRahzoseX36p1/NJT4sP0RN0XkL+orwPrEDJfB6/syRDJHs28lDd 9f6kUNigng/Gv5l5L6RbLAdjclf24xuu2/v4fv3pxIaDsqw4mUA9k/iMGlBSw7zKT5Lf SbPA== X-Gm-Message-State: AOAM532tGJtuI2b32DsCgfap77ru1svFgbjjenUaEXDf3jXmDdWlIE/D ExKO8tq5fcPjy4fUqcAHyG4= X-Google-Smtp-Source: ABdhPJwim2zKHrhCLpq1whnFf9Xp820rz7JjBdcJ/2hle0lqPRKNjnNzm/4Il72O07rg0e5yYH6vzw== X-Received: by 2002:adf:ed52:: with SMTP id u18mr8575955wro.357.1603882584367; Wed, 28 Oct 2020 03:56:24 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id i33sm6812138wri.79.2020.10.28.03.56.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:56:23 -0700 (PDT) From: luca.boccassi@gmail.com To: Lukasz Wojciechowski Cc: David Hunt , dpdk stable Date: Wed, 28 Oct 2020 10:45:53 +0000 Message-Id: <20201028104606.3504127-194-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 'distributor: fix flushing in flight packets' 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 a5b5ebfb5a41ff69bf7bba06ac6b8cc9e2d45d10 Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski Date: Sat, 17 Oct 2020 05:06:58 +0200 Subject: [PATCH] distributor: fix flushing in flight packets [ upstream commit 91d6b8235e726a40b87e9268b9686231eb1f7741 ] rte_distributor_flush() is using total_outstanding() function to calculate if it should still wait for processing packets. However in burst mode only backlog packets were counted. This patch fixes that issue by counting also in flight packets. There are also sum fixes to properly keep count of in flight packets for each worker in bufs[].count. Fixes: 775003ad2f96 ("distributor: add new burst-capable library") Signed-off-by: Lukasz Wojciechowski Acked-by: David Hunt --- lib/librte_distributor/rte_distributor.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c index 9fea3f69ab..fb4e9d93f9 100644 --- a/lib/librte_distributor/rte_distributor.c +++ b/lib/librte_distributor/rte_distributor.c @@ -465,6 +465,7 @@ rte_distributor_process(struct rte_distributor *d, /* Sync with worker on GET_BUF flag. */ if (__atomic_load_n(&(d->bufs[wid].bufptr64[0]), __ATOMIC_ACQUIRE) & RTE_DISTRIB_GET_BUF) { + d->bufs[wid].count = 0; release(d, wid); handle_returns(d, wid); } @@ -479,11 +480,6 @@ rte_distributor_process(struct rte_distributor *d, uint16_t matches[RTE_DIST_BURST_SIZE]; unsigned int pkts; - /* Sync with worker on GET_BUF flag. */ - if (__atomic_load_n(&(d->bufs[wkr].bufptr64[0]), - __ATOMIC_ACQUIRE) & RTE_DISTRIB_GET_BUF) - d->bufs[wkr].count = 0; - if ((num_mbufs - next_idx) < RTE_DIST_BURST_SIZE) pkts = num_mbufs - next_idx; else @@ -603,8 +599,10 @@ rte_distributor_process(struct rte_distributor *d, for (wid = 0 ; wid < d->num_workers; wid++) /* Sync with worker on GET_BUF flag. */ if ((__atomic_load_n(&(d->bufs[wid].bufptr64[0]), - __ATOMIC_ACQUIRE) & RTE_DISTRIB_GET_BUF)) + __ATOMIC_ACQUIRE) & RTE_DISTRIB_GET_BUF)) { + d->bufs[wid].count = 0; release(d, wid); + } return num_mbufs; } @@ -647,7 +645,7 @@ total_outstanding(const struct rte_distributor *d) unsigned int wkr, total_outstanding = 0; for (wkr = 0; wkr < d->num_workers; wkr++) - total_outstanding += d->backlog[wkr].count; + total_outstanding += d->backlog[wkr].count + d->bufs[wkr].count; return total_outstanding; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:17.712062136 +0000 +++ 0194-distributor-fix-flushing-in-flight-packets.patch 2020-10-28 10:35:11.804834440 +0000 @@ -1,8 +1,10 @@ -From 91d6b8235e726a40b87e9268b9686231eb1f7741 Mon Sep 17 00:00:00 2001 +From a5b5ebfb5a41ff69bf7bba06ac6b8cc9e2d45d10 Mon Sep 17 00:00:00 2001 From: Lukasz Wojciechowski Date: Sat, 17 Oct 2020 05:06:58 +0200 Subject: [PATCH] distributor: fix flushing in flight packets +[ upstream commit 91d6b8235e726a40b87e9268b9686231eb1f7741 ] + rte_distributor_flush() is using total_outstanding() function to calculate if it should still wait for processing packets. However in burst mode @@ -13,7 +15,6 @@ count of in flight packets for each worker in bufs[].count. Fixes: 775003ad2f96 ("distributor: add new burst-capable library") -Cc: stable@dpdk.org Signed-off-by: Lukasz Wojciechowski Acked-by: David Hunt