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 29B4F45D37 for ; Mon, 18 Nov 2024 12:26:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 253F240E4D; Mon, 18 Nov 2024 12:26:43 +0100 (CET) Received: from egress-ip11b.ess.de.barracuda.com (egress-ip11b.ess.de.barracuda.com [18.185.115.215]) by mails.dpdk.org (Postfix) with ESMTP id 9630F40150; Mon, 18 Nov 2024 12:26:33 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2106.outbound.protection.outlook.com [104.47.18.106]) by mx-outbound42-231.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 18 Nov 2024 11:26:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Vz9YH11O/o3NHOiNIHpLHX1rICPmHup0ZeiDCOwZjdgFPcL2bG3IwKlV1nStutyWJ3hnCvHwJRqFQMOnu5gWyuMwX570rk8A1C9b8cLp0VkFCB/wo1oH2w3vaURM3jT/9oBQ25wkuE+y1Hv3XbeA0TwJKP+6aFmPGMVX5anR0qqgzYekzAJiwtuC/00xFxrqT1AoYoHZRIcTZcpgVlUZqY22yhiiAy8fBQh0vxPzQMFoiShtOdHsxTfU2bniJjNtiQ3v0+1MpubhN3iXgASa5Yi35qCo53Vmyjkm1b8yJTPRktttwzGUmBSg/OsW4DJ10q8Nt/T1x+F+EZ9ke+XJ3g== 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=/CT2pb9qrlLz3Ou6Nn+AbBFsENw48Svcn5klwrZNrYQ=; b=mzO4kRvEgFJk2YF+hfmME8ZBj8ACxzWHP47Pm7Z6/PkCwNu7kccx4XHISoZkOboMbkWNISxwYr5kAg8CThz2oPk7ZNrF/VmfENnfKtqYIgSsmEPi/4EfUfN3yFmPpmwdC6qXXwJrIHuIiQXQQ2Y7QjreZyuvhLW6G2UzFcljsbXnOZNei7lr71XXLduLH7DYItBT1TVMXA7MPqviY5WBuXCb6g/7b6Y55v4mOpUbC/q0r0XR+k92LUlbTVkID3FWdMF/bU3lqdbT1hgHkFhUsxqWxOWIDSOviuozquGG8v0vr2IuGoOgTVagIUA2qPnmmkBjJbxhR9rnOxWeF8Rs/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 178.72.21.4) smtp.rcpttodomain=monjalon.net smtp.mailfrom=napatech.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=napatech.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/CT2pb9qrlLz3Ou6Nn+AbBFsENw48Svcn5klwrZNrYQ=; b=juxeBtBnb662xeJjKvUjZxDr4FCR5G9tb5ml738tGt1qJRFW6PmSrWEaIkbu/8/LCSsqJd5AVoBbtIcnEkeIh3ItIxsRX+sd0WPWyT9CEcuNhCq+rLW4Ebs923FaKwHCcJYahZ9H827ap9hfoOW80o801hVten5LZvsqY1+TBXA= Received: from DU7PR01CA0038.eurprd01.prod.exchangelabs.com (2603:10a6:10:50e::20) by AM8P190MB0977.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:1dd::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.24; Mon, 18 Nov 2024 11:26:31 +0000 Received: from DB1PEPF000509F7.eurprd02.prod.outlook.com (2603:10a6:10:50e:cafe::3d) by DU7PR01CA0038.outlook.office365.com (2603:10a6:10:50e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23 via Frontend Transport; Mon, 18 Nov 2024 11:26:30 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 178.72.21.4) smtp.mailfrom=napatech.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=napatech.com; Received-SPF: Fail (protection.outlook.com: domain of napatech.com does not designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com; client-ip=178.72.21.4; helo=k8s-node-23.default.svc.cluster.local; Received: from k8s-node-23.default.svc.cluster.local (178.72.21.4) by DB1PEPF000509F7.mail.protection.outlook.com (10.167.242.153) with Microsoft SMTP Server id 15.20.8158.14 via Frontend Transport; Mon, 18 Nov 2024 11:26:30 +0000 From: Danylo Vodopianov To: thomas@monjalon.net, aman.deep.singh@intel.com, yuying.zhang@intel.com, orika@nvidia.com, mko-plv@napatech.com, ckm@napatech.com, dsosnowski@nvidia.com, sil-plv@napatech.com Cc: getelson@nvidia.com, akozyrev@nvidia.com, dev@dpdk.org, stable@dpdk.org, ferruh.yigit@amd.com Subject: [PATCH v2 1/2] app/testpmd: fix flow update Date: Mon, 18 Nov 2024 12:26:24 +0100 Message-ID: <20241118112625.1880659-2-dvo-plv@napatech.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241118112625.1880659-1-dvo-plv@napatech.com> References: <20241031150010.2991953-1-dvo-plv@napatech.com> <20241118112625.1880659-1-dvo-plv@napatech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509F7:EE_|AM8P190MB0977:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f1ab65b-6d10-4c1f-f310-08dd07c3d9b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?B?U1V0eTlVV0greFZ0QlNSVHFRY2x5cDE2QWx3ZHdGK0FrVENVUEd0Qk92ZUpp?= =?utf-8?B?QVhIcDZ6VHlaZmZ1Uk04a3EvKzJkYWRjdnpGdEJrbk9KYzhpYUlFNmVqRVpL?= =?utf-8?B?UitZVVJUWk5QODRtUEtBSFFTMm13aUdrOHJxVFdYMHFnZmhYZWt4N0JQWFJV?= =?utf-8?B?RkJRRUdCZUsrRml2ZzE3S3dMcXVRRy91ZUhSREJvR3pBMjVsd3RRK2tZYTBt?= =?utf-8?B?dGFQZEFDeXNLT3hFMnNtOWV3UE9MSXFsci9vQ3FOSGo0VloxLzYrT1NseHly?= =?utf-8?B?QzhNdVl5Vnk4bi9UN2JEZDVPclIxZHlqbDJjaEZHZE5YOWordVdBK2VzY21G?= =?utf-8?B?MG5MRU1OSllyaUtTRzh6a1RRcGxlVjZPU0hPakVNM0VlL1FCeVVoTm1CZWRl?= =?utf-8?B?aUVRR09IVzVJcXJqb1N0eE1Qbm5ndGc2QVhDbWVTRVBsNGZvcUpVZHdEdDlB?= =?utf-8?B?MVNVaTJSRDVqNkJCdWg5TE5hTC9uVjZPb2NkUG8zcXA3NlZKMDFLRi9vZWRV?= =?utf-8?B?Q0kzbXpuc1Z0WU0yZHI0K2JGNytGa0NobmdrRHh2QjhTT1JTUnZsUW9hRCtz?= =?utf-8?B?TnVZR3dtbUpDMmpueGpuWXhTTVhiSXRWSWkxbFIyWUZJelpURDFBMDdrRS84?= =?utf-8?B?aHZidkM3bzYvNk9aTVhFMjJhS2w0MHhYVFJ3b21GSXJiWW9zM0Y5NmMzd0xX?= =?utf-8?B?bE45K1pBVGFteWs2YlRYaWtlb3pJWGM4a09DZXAxVzI0amVtMDNOendYR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1ZkTkJuenI4MEZt?= =?utf-8?B?QXRSSVZBaGQ4dWZpb04rTElmczRlcThkUmh3Y2U0MUxQd3I0M05QcUZmV2dt?= =?utf-8?B?bzRKTlc4VHFBR2pMUThLcEpxaERDWHJ5N2htS1haQ240UFllb2M5Y2ZmckVH?= =?utf-8?B?SkdZeFN2dUk2MVNlUFgvbUxnalkzZ1o4aEVmMW8wMm5vanIrNS9MeHUraXpT?= =?utf-8?B?ODlHbGUzL2ZWenp3U3NDUFpJWitEemtGTjQwYmc4cnB5U3c9PQ==?= X-Forefront-Antispam-Report: CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:k8s-node-23.default.svc.cluster.local; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: LtdUqEXN9EfAeUt+Nyi/TSbs7f5EM5SJJf/7udhpaLWYD9BivRrzEoejdwuAqsxkHusJXxQepZ6vhGHU5/UAiSKC9D1ncixuwNNmhR4GCjXLvRZH3vM9X6WS5qQ298nMS+/0B0zd5mA6IgkuSFaT66g5rOo1DMDUjxaRF2zoOUpLcgtCUNBUaM32lKBPU35CjbG+jeuWsj2/NIkFJTfRxNEaUeCMannpxAdQrnq1Ypn1N06wepOJmS8eTGCbg6En51BsbWjaLQ3pqdLzXZ4DOfQ2pl4ssOiU3B8DSJkGMGFacY0fJHPMOIELe19sXHg0VD69TvSJM1qZ2Ytt6hdu7N18Ri/tvYgVey1CE8Ag6lZJu56NrVCREPNd4ht1p1+OB7ILOeTwcNihHpAaY4ShlyfhbKEXgHnZDZzm4ogBgz1DOpSWkV9ajU4i0zHNMFxSDW+kRqah1BcPb9T/g1iPr0FbAo6mpQNxlMMRc/WI8eCaVhT14OVGoSMXT8OeHj39fbdI5VHBAXqKFlUkDFkzZEk/EVKe0N3uhuFUDszk3xHeCS7AqODYzEfCmH/UVLX4gD4eVjrzh9OjZYC3h8tMq3D2lMOMrEGG//JVjM2KUWzwPHuj1xXVZi2ci/XgyTPm1uqta80s4AILI3MULrvHO+AcdzgJ/GMynPHHwkPQitU= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 11:26:30.4806 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6f1ab65b-6d10-4c1f-f310-08dd07c3d9b9 X-MS-Exchange-CrossTenant-Id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4]; Helo=[k8s-node-23.default.svc.cluster.local] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509F7.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P190MB0977 X-BESS-ID: 1731929192-310983-13351-3852-1 X-BESS-VER: 2019.1_20241105.1725 X-BESS-Apparent-Source-IP: 104.47.18.106 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVkYGZmZAVgZQMNnYxCDRzCjRwD zN0CDVwsg0NTHZLDU5ydzY0sTUzNhQqTYWAG1wj2tBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.260505 [from cloudscan12-37.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 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 If actions provided to “flow update…“ command contained an age action, then testpmd did not update the age action context accordingly. Thus "flow aged destroy" command can not execute successfully. Fix was done with next steps 1. Generate new port flow entry to add/replace action(s). 2. Set age context if age action is present. 3. Replace flow in the flow list. Fixes: 2d9c7e56e52c ("app/testpmd: support updating flow rule actions") Cc: stable@dpdk.org Signed-off-by: Danylo Vodopianov --- app/test-pmd/config.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 88770b4dfc..c831166431 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3882,7 +3882,8 @@ port_flow_update(portid_t port_id, uint32_t rule_id, const struct rte_flow_action *actions, bool is_user_id) { struct rte_port *port; - struct port_flow **flow_list; + struct port_flow **flow_list, *uf; + struct rte_flow_action_age *age = age_action_get(actions); if (port_id_is_invalid(port_id, ENABLED_WARN) || port_id == (portid_t)RTE_PORT_ALL) @@ -3897,6 +3898,16 @@ port_flow_update(portid_t port_id, uint32_t rule_id, flow_list = &flow->next; continue; } + + /* Update flow action(s) with new action(s) */ + uf = port_flow_new(flow->rule.attr_ro, flow->rule.pattern_ro, actions, &error); + if (!uf) + return port_flow_complain(&error); + if (age) { + flow->age_type = ACTION_AGE_CONTEXT_TYPE_FLOW; + age->context = &flow->age_type; + } + /* * Poisoning to make sure PMDs update it in case * of error. @@ -3913,6 +3924,14 @@ port_flow_update(portid_t port_id, uint32_t rule_id, printf("Flow rule #%"PRIu64 " updated with new actions\n", flow->id); + + uf->next = flow->next; + uf->id = flow->id; + uf->user_id = flow->user_id; + uf->flow = flow->flow; + *flow_list = uf; + + free(flow); return 0; } printf("Failed to find flow %"PRIu32"\n", rule_id); -- 2.43.5