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 1ACE4A0524 for ; Thu, 4 Feb 2021 12:38:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E00302407A3; Thu, 4 Feb 2021 12:38:23 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id 8B06224077D for ; Thu, 4 Feb 2021 12:38:21 +0100 (CET) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l7cxo-0005jf-TS; Thu, 04 Feb 2021 11:38:20 +0000 From: Christian Ehrhardt To: Gregory Etelson Cc: Ori Kam , Ajit Khaparde , dpdk stable Date: Thu, 4 Feb 2021 12:29:40 +0100 Message-Id: <20210204112954.2488123-125-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> References: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'app/testpmd: release flows left before port stop' has been queued to stable release 19.11.7 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 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/ba53d40b4eb900d12beeb707c3cb163e421e6e85 Thanks. Christian Ehrhardt --- >From ba53d40b4eb900d12beeb707c3cb163e421e6e85 Mon Sep 17 00:00:00 2001 From: Gregory Etelson Date: Thu, 26 Nov 2020 18:43:02 +0200 Subject: [PATCH] app/testpmd: release flows left before port stop [ upstream commit 0f93edbf7c874480e21e365f527fecdb305984b9 ] According to RTE flow user guide, PMD will not keep flow rules after port stop. Application resources that refer to flow rules become obsolete after port stop and must not be used. Testpmd maintains linked list of active flows for each port. Entries in that list are allocated dynamically and must be explicitly released to prevent memory leak. The patch releases testpmd port flow_list that holds remaining flows before port is stopped. Signed-off-by: Gregory Etelson Acked-by: Ori Kam Acked-by: Ajit Khaparde --- app/test-pmd/testpmd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index f93e459ccf..0797e634fe 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2552,6 +2552,9 @@ stop_port(portid_t pid) RTE_PORT_HANDLING) == 0) continue; + if (port->flow_list) + port_flow_flush(pi); + rte_eth_dev_stop(pi); if (rte_atomic16_cmpset(&(port->port_status), -- 2.30.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-04 12:04:33.127196864 +0100 +++ 0125-app-testpmd-release-flows-left-before-port-stop.patch 2021-02-04 12:04:28.190789883 +0100 @@ -1 +1 @@ -From 0f93edbf7c874480e21e365f527fecdb305984b9 Mon Sep 17 00:00:00 2001 +From ba53d40b4eb900d12beeb707c3cb163e421e6e85 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0f93edbf7c874480e21e365f527fecdb305984b9 ] + @@ -15,2 +16,0 @@ -Cc: stable@dpdk.org - @@ -25 +25 @@ -index 33a060dffd..2b60f6c5d3 100644 +index f93e459ccf..0797e634fe 100644 @@ -28,3 +28,3 @@ -@@ -2734,6 +2734,9 @@ stop_port(portid_t pid) - } - } +@@ -2552,6 +2552,9 @@ stop_port(portid_t pid) + RTE_PORT_HANDLING) == 0) + continue; @@ -35,3 +35,3 @@ - if (rte_eth_dev_stop(pi) != 0) - RTE_LOG(ERR, EAL, "rte_eth_dev_stop failed for port %u\n", - pi); + rte_eth_dev_stop(pi); + + if (rte_atomic16_cmpset(&(port->port_status),