From: Gregory Etelson Date: Thu, 26 Nov 2020 16:43:02 +0000 (+0200) Subject: app/testpmd: release flows left before port stop X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0f93edbf7c874480e21e365f527fecdb305984b9;p=dpdk.git app/testpmd: release flows left before port stop 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. Cc: stable@dpdk.org Signed-off-by: Gregory Etelson Acked-by: Ori Kam Acked-by: Ajit Khaparde --- diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 33a060dffd..2b60f6c5d3 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2734,6 +2734,9 @@ stop_port(portid_t pid) } } + if (port->flow_list) + port_flow_flush(pi); + if (rte_eth_dev_stop(pi) != 0) RTE_LOG(ERR, EAL, "rte_eth_dev_stop failed for port %u\n", pi);