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 82A8743CFA for ; Tue, 19 Mar 2024 10:33:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CA4440A79; Tue, 19 Mar 2024 10:33:22 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2074.outbound.protection.outlook.com [40.107.244.74]) by mails.dpdk.org (Postfix) with ESMTP id BB9DF40298; Tue, 19 Mar 2024 10:33:20 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=akhpQdUo/h3+Qw06OCU5gFc25pWDetC9S9RFR0jdr9sYVzMn/L/jY8D3BkesMcWsIkh0ppwFq5V1Fz4od/+eNimJgMSWAc41xWOSsH0odLZg8Uahh/nO2lh295nioe2x7sPiBQfX2/cMzR8qMhs/jOXfwBXtKclXrrc3iwGfBMG4x/Xd7pMt+bn6KYKzGdUPs2VEaQZqiO+vmyoAV3xuekmNTXCwRtcQa9uGrPI2bxHXJuRDRsIxTKjmBG1sfrQd3OsiI1xdJTR29i5tCnVsvYeOaQg06SwjRve8653fNIOjlY+Tr65dKmsdnL4+BU2nruvD1V/2VZzecTqhOki2UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ay2JU/8mkTVAECJwF38nxARUgOlxz3k0KvEtu8P5uj8=; b=Wj6iiH8WXjZR3XahNfzBq7U46t5HfL59x85I714KCjFeiAK16/Nggy6nFO8I4Heo8NjP30QEtfbHCEAznHpaYjgdPHEL9GhHr8wCb0VlNkrEFroI7EL3xMB9lxKwkTehtcTeFlfZZz3wsODOnf75uD1srLTWC7y5jQMc7ofADncfvKYbD/SzUe0U2D+BoJu/jZh2mjbC81qxsV0M1WkYwEZIN5eJkyUwCkZHDVZQWgOEt8whRBXu/NOE54bLEoNBLH7mf6fF1yYvHrRQiDwgZeviB0dkbvO2H1bGYlvf6O3C1x3F57uR53oi7OmVMlgPJe1yYAZFe4CtlTtHDo11mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ay2JU/8mkTVAECJwF38nxARUgOlxz3k0KvEtu8P5uj8=; b=OXF+M9NvPEDeN+vc+vS1L/iD/kpDJf6uGfsnquDwuUEKN8OJUJZFKF/GOkH/dCWRwpN3yrqMrs0kbwW7Ac3A5i3teEXUjaujY5orAqBX/4qPAiMp6UC/qOJEHapLCp+/wgPfdj36dI4TcimpejxYHqgfx7K7+Iov3zbqAh41IxcPoN08L5V8tK+PrAr8N7YMDf6a0hVZJhTAiECVDTi9zEjg4iDsY1EHiZ1pX3eCecQGoRDt6Kn2efXtdvXEyIdTx2UGlHK8OaVi8oIpbm0ghHmU5LLq2yguYelv2Y+rPzUyQ8s6yG6QgnpR712wV3BqG2RnNZ0Aqr6tCicsvkpbtQ== Received: from DS7PR03CA0235.namprd03.prod.outlook.com (2603:10b6:5:3ba::30) by DS7PR12MB6141.namprd12.prod.outlook.com (2603:10b6:8:9b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.27; Tue, 19 Mar 2024 09:33:18 +0000 Received: from DS1PEPF0001709A.namprd05.prod.outlook.com (2603:10b6:5:3ba:cafe::89) by DS7PR03CA0235.outlook.office365.com (2603:10b6:5:3ba::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26 via Frontend Transport; Tue, 19 Mar 2024 09:33:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS1PEPF0001709A.mail.protection.outlook.com (10.167.18.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.10 via Frontend Transport; Tue, 19 Mar 2024 09:33:16 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 19 Mar 2024 02:33:05 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Tue, 19 Mar 2024 02:33:03 -0700 From: Bing Zhao To: , CC: , , , , Dariusz Sosnowski Subject: [PATCH] app/testpmd: fix releasing action handle flush memory Date: Tue, 19 Mar 2024 11:32:49 +0200 Message-ID: <20240319093249.307606-1-bingz@nvidia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709A:EE_|DS7PR12MB6141:EE_ X-MS-Office365-Filtering-Correlation-Id: 50e1cd5a-c044-4679-01fb-08dc47f79b0d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O3TBp5ecKHrVBXouj8axQNYN35/Cy1eq9FqPcEoDX34XM31PqMnfWitOnIGReZJF65O+TjjlZkigoz4TdEyVfdz7EwE6XFV6MSLNnvadFOTeUlsa23+V14tT8CzipLC3bODuKMrzVZQVxVOPLcI8NfmETR97kqJrSo5zG3acfwM+cKBuNwOYpxOww/eO2VUeMuo5PDSl+WppXA1MQ79evSN89Aa5ihZ/k6ea6pTDgrm957NgkK68Rj/pt6O/DJr8a2ZtVzkEMzWzMszbSv7704uhkT3gEsYX7EXxR7tooCMKKmBiSg1ppngifAtbnfmbDKXK2hZgmBlywNl6gJ/8f2wAqNBg781tUrebGewKVZYFd5FfvsCfVye48JMxgPIm4vF2nfTJDrGM52L5vC1SHaBYQ2kjG9JdEDatl08pnsEnOUpipGZlQYc/cZQxMKZVbPnzq+4VjuGW0d8v+aF9nAEEVivdwVBD57RE/C+fYcNoKcIU8QgHMx+y0yN1A77Wnb0lSxa8iF5lfaa4fa/JmEP+PROH3kerZRzk5Dg4fVkjx7SF7dC1MhEIFrW+EKTLZTUkyEyEoXWiuYe4pLONliJszBqQTU0moyKq9Pm6jm7txD2EmICUrJt6Z7X3YlphLQuJO73QB7ICEU5e/QgE9MoOs6Tn043Ld4yXvdu5rQaYpCkCYZUS3rwvpjDnwTvGlIDuW1ygkxSv0yNb8zZE1V2J/PBL5s1o+j7GWrvNx7xrSwFpDO3UVwVUJSzeVfnW X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(1800799015)(36860700004)(376005)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2024 09:33:16.2020 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 50e1cd5a-c044-4679-01fb-08dc47f79b0d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709A.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6141 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 The memory of the indirect action handles should be freed after being destroyed in the flush. The behavior needs to be consistent with the single handle destroy. Or else, there will be some unexpected error when the action handle is destroyed for the 2nd time, for example, the port needs to be closed again. Fixes: f7352c176bbf ("app/testpmd: fix use of indirect action after port close") Cc: dmitry.kozliuk@gmail.com Cc: stable@dpdk.org Signed-off-by: Bing Zhao Reviewed-by: Dariusz Sosnowski --- app/test-pmd/config.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index ba1007ace6..f62ba90c87 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1918,8 +1918,7 @@ port_action_handle_flush(portid_t port_id) /* Poisoning to make sure PMDs update it in case of error. */ memset(&error, 0x44, sizeof(error)); if (pia->handle != NULL) { - ret = pia->type == - RTE_FLOW_ACTION_TYPE_INDIRECT_LIST ? + ret = pia->type == RTE_FLOW_ACTION_TYPE_INDIRECT_LIST ? rte_flow_action_list_handle_destroy (port_id, pia->list_handle, &error) : rte_flow_action_handle_destroy @@ -1929,11 +1928,9 @@ port_action_handle_flush(portid_t port_id) pia->id); ret = port_flow_complain(&error); } - tmp = &pia->next; - } else { - *tmp = pia->next; - free(pia); } + *tmp = pia->next; + free(pia); } return ret; } -- 2.34.1