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 CB445A04DD; Thu, 26 Nov 2020 17:43:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6FCC6CA2A; Thu, 26 Nov 2020 17:43:58 +0100 (CET) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by dpdk.org (Postfix) with ESMTP id 81944CA18; Thu, 26 Nov 2020 17:43:55 +0100 (CET) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 26 Nov 2020 08:44:00 -0800 Received: from nvidia.com (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 26 Nov 2020 16:43:42 +0000 From: Gregory Etelson To: CC: , , , , , , Wenzhuo Lu , Beilei Xing , Bernard Iremonger Date: Thu, 26 Nov 2020 18:43:02 +0200 Message-ID: <20201126164302.19120-1-getelson@nvidia.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20200811061443.8214-1-getelson@nvidia.com> References: <20200811061443.8214-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1606409040; bh=LJzF5IZqihwnyWuMiaG1mUPs0OC3DP2v8u32/cUt5UE=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy; b=MQ+1EBVobZFjAj6gEcN2hXMaGLJ6NiSJzG3N+ICfZyE3G0X+ovA1k7SAZlfST3lgt mKTgNr8bEtoYA+wL66U+pgEFoxEkYeMJVtEPehaa4F9HTlC7WwV3fRWYSp3UCB1sN/ Q1n2jjIMTYkaAlJg4Xu2lhcbm/o/JYz8wtu/2YvaOaafq9r7wSpvhr7qOwNDjBsmeo VNYyIrItOnpLv1yyLvBz0K/zzFePxfB+qtgCDzHr/g15aaCvbwPpeYTjDBtfhMRHOd 0/3T6uNGrda1twhL8onVOyVH/0/xQEI2Fj9Bbi7LZkXoOwr4fvqYy+0+O3udss29DR wxjyjJY1xleBg== Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix testpmd flows left before port stop. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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 33fc0fddf5..0bb192b2f5 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2806,6 +2806,9 @@ stop_port(portid_t pid) } } =20 + if (port->flow_list) + port_flow_flush(pi); + if (rte_eth_dev_stop(pi) !=3D 0) RTE_LOG(ERR, EAL, "rte_eth_dev_stop failed for port %u\n", pi); --=20 2.29.2