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 58EE845D39; Mon, 18 Nov 2024 18:33:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A67D40EDF; Mon, 18 Nov 2024 18:33:49 +0100 (CET) Received: from egress-ip42b.ess.de.barracuda.com (egress-ip42b.ess.de.barracuda.com [18.185.115.246]) by mails.dpdk.org (Postfix) with ESMTP id CCF4B40665; Mon, 18 Nov 2024 11:25:38 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2108.outbound.protection.outlook.com [104.47.18.108]) by mx-outbound19-21.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 18 Nov 2024 10:25:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MY1FOsytF1tbe8N6suf07FKJCbxIyKiFnYIVxCM3N0Q00P/6rXCRxa/dKIMEtrleh6bSlnnn43cF7idrhBxNoP5LhWPXasELyrbDPTxZ9V9xwkq4yvNRdDbL/0tlBBuZAAotIK/IhZhWkX5KDxZNgGPUu3MWgRFtfMXTYKxV/rr0wh6cACvGNdhZClMB90cQfT/Dc/2LjmhBDrAwAT0+1/DlAgRZNxWkiPepEy/0ZFa5RLf+A0ANNyxmcenn0XXRMbOzvm3Q5wiHH/Z/EgRDHAx83zRcV01QUPLyxGlzYxvK4jXfU5KbILHE8v/sTQt+Hop66ZYN0eiNsGhhgpsyIQ== 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=C49l06N3HBBiIGiOpXLCoeRO2q7c99Uboshy5yZSy3IcLzTSYnIEWUtyOGSQOZDYsRJ6/gnBMM37bsmGj5bTRL+H+xoyguIE1NSfHzXrCXvsmdmQL/8BOKIQAfGshg3ySS/C6bs+v3kJcIaduIyft1559Lrt20RnaBrWbyMIXzwMjyl8s++JKtZ8tMnQmg8ag4633ZLDuC0Lhc2Gdc3kco+7deRNc48g4QV7RLNu/1gFJrK++x84tSkPGAUijbFVLBDIpHxwPBwflBhcWf1B3f1uyl9W94zPdVUUKFHA15khg2pArYnAzBZe/SC+UtsJCzCr95ZTnSAW321YIB2VdQ== 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=S0n8yMj1l8dvJrJmU04hk4QsrdTNWOeRvuHBP1mSp7IGoh0gNDW8FJmzsEZTbtQbi/+8MHE5logfV16FVI2hqyS5ifzT+c6X9T04mWpQtuc0uRWy8mNpEPsLLnURJpWsd5PTkvUZdkSubw86jpdElHpjZe/jv7BeLVUTSWau4oQ= Received: from AS9PR06CA0084.eurprd06.prod.outlook.com (2603:10a6:20b:464::6) by PA4P190MB1167.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:bd::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.21; Mon, 18 Nov 2024 10:25:34 +0000 Received: from AM2PEPF0001C717.eurprd05.prod.outlook.com (2603:10a6:20b:464:cafe::52) by AS9PR06CA0084.outlook.office365.com (2603:10a6:20b:464::6) 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 10:25:34 +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 AM2PEPF0001C717.mail.protection.outlook.com (10.167.16.187) with Microsoft SMTP Server id 15.20.8158.14 via Frontend Transport; Mon, 18 Nov 2024 10:25:34 +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 11:25:27 +0100 Message-ID: <20241118102528.1858308-2-dvo-plv@napatech.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241118102528.1858308-1-dvo-plv@napatech.com> References: <20241031150010.2991953-1-dvo-plv@napatech.com> <20241118102528.1858308-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: AM2PEPF0001C717:EE_|PA4P190MB1167:EE_ X-MS-Office365-Filtering-Correlation-Id: d9085ff7-befc-4440-579e-08dd07bb5689 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?bStCOG9sWldEczFyK3VKZVNSQnl2K3dlV1dOZnBncnViUFJWL1k3MCtWQTFS?= =?utf-8?B?SElZdlpFRHFVblI1cG9iUWozS0lVLzhBNUpPY2tuZ1dudkNLQXB6emdHMlRN?= =?utf-8?B?eEYyMW9pN2dtdG1WSy94cVNscjkvOVUzKzVqWVIwanNlN3NOR1Bxb3RIL1R1?= =?utf-8?B?b0RjVkZacWcvSXBSRVh6VU5OR05vNnBhS3IxN3FyVEREOXd3ajk3TWxyRUsv?= =?utf-8?B?dWQ2V2NYV203dVNvaHlDaVd3dHY4KzU4Z2J4RHJEZzdhSEdtb3BJbFpncFNy?= =?utf-8?B?U1JLUFVhNy9sR1hUSTMvY1lLa05mWkNwVGZtQ3ZZejh2NlNxVmFmUnhpY0tv?= =?utf-8?B?Z09xOENoQ0Yzb0hRMmkwMDFDMzZTSTBLNnlOR082N1hWRERLT05rcUluOWRl?= =?utf-8?B?TFIwNjJpc1RyYkZuSCtxNW80eFZaakxEQmlWTVpaRkVTMDBvblI1blhHeFpM?= =?utf-8?B?RWxNOW5ycW1rbVlkbjg3WVpSQThIbEZuN2RyTk1CYStEaHhWeExpU1BjaFNU?= =?utf-8?B?aW5LRUNrZVdteXcvMkVQNjVxZ2tjeUdobWZDY3lpMk5VWUlwUC9wc20xckpa?= =?utf-8?B?MW1pYk1YYytPTXNrTk41M1QrSXRVbWY2djRiS2NDb0x1bSszM09MR3o0RG5L?= =?utf-8?B?aGR6TWpYSXcwY0k2cE56NGNNbGZUbFVFbVZtN0x0YWc1eld4SkdxdTdGd2VQ?= =?utf-8?B?YUJiampvMEdabzcwcTZwbGpROWJUT0UrQUZhZ0E3ZG5hQ0pkenJuZlFKRU1F?= =?utf-8?B?K0Jld3JoWVZ1SW1XaFZM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Ax?= =?utf-8?B?eHk0ZHdyMHlKc3I3RlJ4VitrMEh5RzBwQStRa2FnQVQ4UmRwTlVRaU8zYUkv?= =?utf-8?B?OVkzU2lCcUdZeVZSS2EzVFkvc0FMTVBFT2dPZ0xtSWp6Q1NRNTc0RnBscDRC?= =?utf-8?B?ZVgwSTA5V1VXc01PNlhWS2xMTkxzZjZhYUxYQVJUZzJOQnBlMW5NTU01ekFN?= =?utf-8?B?djBROGVTamEzSFJLQkNVYlpuYUdhTDcyMUNQcEFYTnAzVFE9PQ==?= 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)(1800799024)(82310400026)(36860700013)(376014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: EZQRHVLrtctKQQy8Yj/vtJ9KI1j/Ol15/2BI/+nBdnblSrtAdKEURpUATJnLV094YEJWPQvpFN2qJkSz2+0Go0ZFtMPMkpX3vxLGgRrtzxQqrTsII48F/1FS4FPTbe/RO9BZs8dpOxj/DpsjSHQM7PN6zFK3oeMjsvcVwYHlqxXgBocXW0WmR3tpzdDBf4CwQxwlqLPNexWLrAuk11iirBzv9NiF1dN15+y8foDoF5EwEs6t75w9YYP96mrxxZCm3adyrFGRc91oZ7F6miRNLqfZsnNDC1lMTNquY4c/2iJdHgcJyaF2bSqvG8oeiBbJ+7oSiJNZ/+Rg0wh4uLqUhYTOoPx9ACTsdTl2tv/EkIGdPs6ut6JvXu9i56E2cdp8utcZLcOpIJmtDolFhb5K/fGuStfjjURxfKh0otC4ptUfK0URS0YIDZXaFX6BzktzDAjH5g+/1ROhOqJ1vOEYhZnVd9zzYqRkBhoMPqv8wedCtHYvGNQfq01EjF1bfJmTY8FIb45mnutxJgbcZy/M2IbCEEPwBUhMo5V7IU9KUlJ1Hy5ZmG6adPwGAT/WDlXP41qTasRDK1iEQdPHJYcmeOzo5UfcB+BVaKQyVk0wqRY+1BWQYr9BqgphU1L1pqCUbhssyaH+bB9eHzFlZCUxewPR2mozIOv71uWmXWJsvX4= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 10:25:34.6098 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9085ff7-befc-4440-579e-08dd07bb5689 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: AM2PEPF0001C717.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4P190MB1167 X-BESS-ID: 1731925537-304885-13526-3372-1 X-BESS-VER: 2019.1_20241105.1725 X-BESS-Apparent-Source-IP: 104.47.18.108 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.260504 [from cloudscan20-241.eu-central-1b.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-Mailman-Approved-At: Mon, 18 Nov 2024 18:33:47 +0100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-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