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 4FA0045E41 for ; Sat, 7 Dec 2024 09:09:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 457A540281; Sat, 7 Dec 2024 09:09:10 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2059.outbound.protection.outlook.com [40.107.237.59]) by mails.dpdk.org (Postfix) with ESMTP id DFC6040E50 for ; Sat, 7 Dec 2024 09:09:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mG05YhJlZbfEhJIOsmNPLXlW9qjKQ3KomjEwJ0u8c+O77NHnWtGWkBqnRXgs812UMEZPJjbFExXhvNVbesADrOodgqR+0IVuOu0327FrDXuA5gUZXypqfn2itBSm8DFEs79ultGx9xLGJY6RPoahiomj2Ncj9lctPhR+NfMHZBYWJFAl59hQlV6CQ9v9KWFkC+NFS+hoVJq9qIWkZRzXRDa6MClNypNDb7IX3UJCyFHGtc/KLJLBIVMzRsOMD23KU60vq8KkVmaGy9PhNVCPUnMR8Ar1TA84sAo36QCC/RhixeRaOhlHpxQ8vfhp9sxhlZxaoXBvcPWlEHcaGNjmpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=QaTo+M8iVfbcHlyIHe8nZm89283sNxAIFv7LYjieNIw=; b=jldwZNoXDlSJHmO7xKzEFvwaLeRB3K9TDxRHWVNJvl+N+EeT5IysOMHJBTEs99IOs4HUpt9xM8XOEkFEiBrlM9vmFz3T10m0DzfSXTIe0Sm5Clx+odAg/UIzfHWv9IIBLNG6Ve2OlBsxgREaOlodF9vuIpRNBn4SdaoFSB6KbMcrQeIBFFrz6ywG/a7pEdf1H2Z19s9FshUBfFqlnuJ5o6X8q9buGDd7d+kyEFB67T5WHUzrbq6A5gqPMjb4/X4b+3fOHYT+ZJFSD+l9E8B1jy7A6NYq56essFgHhygUTBS1vWiVyzpXg1QJADPLxB4yPjSk3Zl3fzdr9bubHyd+6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=napatech.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=QaTo+M8iVfbcHlyIHe8nZm89283sNxAIFv7LYjieNIw=; b=H/jwKN+rsNmigY0Eq5dgF0c52J99KGizTqCXPyhJOjVgHX0TXbgTRpX0Ih8vNQnohCcARsi8lsyitnfzlefh87vPiFgedotaV2VTc6OPiVPeRYO82QpUoTCgD+ZzQrEJmh1+SUI4UYW1Sy6n8Ifn5PXRGGDmKyWRhUAJSFui/KjQordGl9ar/wlok7mYBSzq+5Dv/muqzPO1tYJSjIPdZynWlfcrZKkQasdd1g385nGjbkJqf6i3afEzfgOhLdkB3S4qdmdV9pYkqoVN78qOlm7mamAen9yYXIaGhupMYdgTTpK4tIA+DUwjbWinaIaxM3gxM85Bokace1hb0hn0VA== Received: from BLAPR03CA0067.namprd03.prod.outlook.com (2603:10b6:208:329::12) by CYXPR12MB9338.namprd12.prod.outlook.com (2603:10b6:930:e5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Sat, 7 Dec 2024 08:09:03 +0000 Received: from BL02EPF00021F6E.namprd02.prod.outlook.com (2603:10b6:208:329:cafe::d3) by BLAPR03CA0067.outlook.office365.com (2603:10b6:208:329::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.12 via Frontend Transport; Sat, 7 Dec 2024 08:09:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BL02EPF00021F6E.mail.protection.outlook.com (10.167.249.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Sat, 7 Dec 2024 08:09:02 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:08:53 -0800 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.1544.4; Sat, 7 Dec 2024 00:08:51 -0800 From: Xueming Li To: Danylo Vodopianov CC: Xueming Li , Dariusz Sosnowski , dpdk stable Subject: patch 'app/testpmd: fix aged flow destroy' has been queued to stable release 23.11.3 Date: Sat, 7 Dec 2024 16:00:41 +0800 Message-ID: <20241207080055.488538-84-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207080055.488538-1-xuemingl@nvidia.com> References: <20241111062847.216344-122-xuemingl@nvidia.com> <20241207080055.488538-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F6E:EE_|CYXPR12MB9338:EE_ X-MS-Office365-Filtering-Correlation-Id: ce6a8786-379b-4804-d4a2-08dd169669bf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?QvuppQiRjx2UdD9CewAHvONylh2wnaCrDVdscdJ6sJlPNKFTMA2MepmScQE6?= =?us-ascii?Q?UHXnOrZxFO/Eguuv8daJ/c/UC33MTpaq1S12bnHiwYxoKeLJRsvY/lSbZ9f1?= =?us-ascii?Q?bz+ba8Uui6amAS9M6QL8MDTXcb745byUmjQTsec1ZhlUYy0wouJNR1pDdBG0?= =?us-ascii?Q?hey8Zm9NH+YRnB/iprE0KIhdnU+mJH33d/6Tz1ZGM0QSL7AWmqjTikFGN4Wu?= =?us-ascii?Q?XwQoAbxaxEgE5eVju+AsI698/b6LPGjtprHGzbHpOGg0J7UgKZhw5qZ1F+GG?= =?us-ascii?Q?oPsFDBz/CwvCd/296xjYoyWR+oAltSMEcnqLMMywsMLOvWwgVtlb6wzSpEM1?= =?us-ascii?Q?YWK0pVLZykQrCE9nENBmLp9cfRYV99hUtDJeUsXLeVpE7h13bFcii0FiAmeq?= =?us-ascii?Q?03q0v6ZiOl2czOdTbBh5iVSwyBjxc3knzvAhZleAPoMJclS7THrC/jyEDpJ+?= =?us-ascii?Q?YXEbkGhcOZcojxIXx9rcGOrsrOT9kjXY83OKrICkQvGzX/PJj/yUpdoBTlKG?= =?us-ascii?Q?RRYF88NCd5y5ptMqZB5c3MGkdKytBzP5LblIr61b4V2t/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avruMcMD?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2024 08:09:02.9532 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce6a8786-379b-4804-d4a2-08dd169669bf 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00021F6E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9338 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 Hi, FYI, your patch has been queued to stable release 23.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/10/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=44ba5aae390e412a09968b2aca2f80cd2c4ec06b Thanks. Xueming Li --- >From 44ba5aae390e412a09968b2aca2f80cd2c4ec06b Mon Sep 17 00:00:00 2001 From: Danylo Vodopianov Date: Mon, 18 Nov 2024 19:03:23 +0100 Subject: [PATCH] app/testpmd: fix aged flow destroy Cc: Xueming Li [ upstream commit 098f949f8a70f7618f5390f9c1e9edfb9e5469c4 ] port_flow_destroy() function never assumed that rule array can be freed when it's executing, and port_flow_aged() just violated that assumption. In case of flow async create failure, it tries to do a cleanup, but it wrongly removes a 1st flow (with id 0). pf->id is not set at this moment and it always is 0, thus 1st flow is removed. A local copy of flow->id must be used to call of port_flow_destroy() to avoid access and processing of flow->id after the flow is removed. Fixes: de956d5ecf08 ("app/testpmd: support age shared action context") Signed-off-by: Danylo Vodopianov Acked-by: Dariusz Sosnowski --- app/test-pmd/config.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 40e4e83fb8..ff2e9da324 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3913,8 +3913,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy) } type = (enum age_action_context_type *)contexts[idx]; switch (*type) { - case ACTION_AGE_CONTEXT_TYPE_FLOW: + case ACTION_AGE_CONTEXT_TYPE_FLOW: { + uint64_t flow_id; ctx.pf = container_of(type, struct port_flow, age_type); + flow_id = ctx.pf->id; printf("%-20s\t%" PRIu64 "\t%" PRIu32 "\t%" PRIu32 "\t%c%c%c\t\n", "Flow", @@ -3925,9 +3927,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy) ctx.pf->rule.attr->egress ? 'e' : '-', ctx.pf->rule.attr->transfer ? 't' : '-'); if (destroy && !port_flow_destroy(port_id, 1, - &ctx.pf->id, false)) + &flow_id, false)) total++; break; + } case ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION: ctx.pia = container_of(type, struct port_indirect_action, age_type); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-12-06 23:26:46.863741505 +0800 +++ 0083-app-testpmd-fix-aged-flow-destroy.patch 2024-12-06 23:26:44.093044826 +0800 @@ -1 +1 @@ -From 098f949f8a70f7618f5390f9c1e9edfb9e5469c4 Mon Sep 17 00:00:00 2001 +From 44ba5aae390e412a09968b2aca2f80cd2c4ec06b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 098f949f8a70f7618f5390f9c1e9edfb9e5469c4 ] @@ -16 +18,0 @@ -Cc: stable@dpdk.org @@ -25 +27 @@ -index c831166431..28d45568ac 100644 +index 40e4e83fb8..ff2e9da324 100644 @@ -28 +30 @@ -@@ -4160,8 +4160,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy) +@@ -3913,8 +3913,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy) @@ -40 +42 @@ -@@ -4172,9 +4174,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy) +@@ -3925,9 +3927,10 @@ port_flow_aged(portid_t port_id, uint8_t destroy)