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 5142045C24; Thu, 31 Oct 2024 16:03:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DF704334A; Thu, 31 Oct 2024 16:03:11 +0100 (CET) Received: from egress-ip11a.ess.de.barracuda.com (egress-ip11a.ess.de.barracuda.com [18.184.203.234]) by mails.dpdk.org (Postfix) with ESMTP id 411CA402B3 for ; Thu, 31 Oct 2024 16:00:32 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2170.outbound.protection.outlook.com [104.47.17.170]) by mx-outbound10-126.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 31 Oct 2024 15:00:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EX/at3AFqQqENF6DbJIdackRSryTs7/ilslpg2H/8ZEmjqI1MWD6ojLm530uvb1QdV35+PmlEd6kafubmDVefnWm7CfhWsLtsgk4w5Y+fA54iDhjC7fWQUL+rTIisvyJBfkuiTKq5+XzDlk61GIn8GYkdkXX0py25uacj8KSLpVH7bHPF3cU4o2VdbtgvlM528rWBnQ+/Va2/pF8A47s2OGTL847HNOJR13B6I01W2e1RUbCHVOY6cMrs0PoAA5sKdF3fF1gRYxdScGPKy3RUSWs0W0xFm4P0V1e6cNctZykAgkFBtBYpUqxjn3jwrexCODNQYlz6+246P/76mMNvw== 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=iulRoJjjv2vG/mwAlLpXobkra2P5OAoVmt9gt35KBOw=; b=jfsFwBLKGIFg4ZTtIMyjol0DVg7SJvs9ZN0o74m+C6CztQ1PTZUcyEUDMrsHOdSCYPRkfdeLoF1XgYdPzWpnxHnG/Z+/yBHwUA/yXR4VWd0vwIe6HOM53Gd+d7xReeIGWi71qaAyjeHn81vAc9uLtlQPHN674m+LnnW5UA3NDE3AKOSx6OTFDmfPQsvAm5AR+Vd7SNb+KtADoKM2CdmMB14S+LFhTp4KarCtE982NKgViS+qVoctq7eJxjZRaMX4ixc9lBsCc8yquCa0Jc6sndnh80h02zo1NP7nt4xu65d/+ESTGjkZEjdrsbzph7WHgILqJQVqkpfuX9V99+NmDQ== 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=iulRoJjjv2vG/mwAlLpXobkra2P5OAoVmt9gt35KBOw=; b=HPmbNEWegKW9MmfTtO3sjE0Y9StvBvZHenQLy4/sxqxRUDRL+PRymyKypxl7UdMXDl2wFqLflRuL++jhnbjAL94nAGWzVou1JHZPENDsyjT/0yJ/LCo/hzg60jA+luFP/n3eG83thY1wcq/XmqSF2XhnQMsVnzJ4I9bC/dQSnjY= Received: from AS4PR10CA0012.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5dc::15) by GVXP190MB1990.EURP190.PROD.OUTLOOK.COM (2603:10a6:150:4::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Thu, 31 Oct 2024 15:00:17 +0000 Received: from AM2PEPF0001C70C.eurprd05.prod.outlook.com (2603:10a6:20b:5dc:cafe::81) by AS4PR10CA0012.outlook.office365.com (2603:10a6:20b:5dc::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.23 via Frontend Transport; Thu, 31 Oct 2024 15:00:17 +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 AM2PEPF0001C70C.mail.protection.outlook.com (10.167.16.200) with Microsoft SMTP Server id 15.20.8114.16 via Frontend Transport; Thu, 31 Oct 2024 15:00:16 +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, sil-plv@napatech.com Cc: dev@dpdk.org, ferruh.yigit@amd.com Subject: [PATCH v1 1/2] app/testpmd: fix flow update Date: Thu, 31 Oct 2024 16:00:09 +0100 Message-ID: <20241031150010.2991953-2-dvo-plv@napatech.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241031150010.2991953-1-dvo-plv@napatech.com> References: <20241031150010.2991953-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: AM2PEPF0001C70C:EE_|GVXP190MB1990:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d445a2c-c346-418f-b89f-08dcf9bcbb31 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860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wd1ZZWFNM?= =?utf-8?B?eGgwOE9NbW9DRWl5WUJPdTliMksxQURheEFsek5qL0w5dTJ2eVRML3poZVc5?= =?utf-8?B?TmVtQ2czUHZxNDlER2FPMHJTR2xNUmxQRmFoNDdNY3FWSFFZMmJOWFNISUdw?= =?utf-8?B?TXN5RU1id0syZkxqaHl1QmdXSmNVNzE3cHZWRWVTUGVUWVE9PQ==?= 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)(82310400026)(36860700013)(1800799024)(376014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: COyWhMR+vjYikOKS5BmRmzfJ6hDUeRwO5em5aREARIWaH5thxrJjScFCHKY8geN8QdmoLq/yKe3zLH+h6sfQ2JUrp7jjmhfVxwSj/hGDd96SfxTM8Yr1yFc28ZikhGMGBOb+5jY/2CuEiIgyUuwHPTaDHMQmZRihpGjQ5x/kA5mAFnnspKaV5yoEBOthhkvhkhgmj5Lqtpn1YjXk1HLROVoP/vpxmrFhY+KLNq72ziUO0R3ED4XK51B6atqvCx2ACEz4v6M58ynhZN8V+x1/G/ItKpP4k/8APSdftnyxZjdqGf8dtWCeedY1KT9nl+3EVDdEPzJzOVGseXXkkldbUeXsupWBkdd4GGbK9hzQfURewOX0vKk4ZqjOEDh67+fK/ZpjGqO6dK+P+ZoYJmVtNa3j8y8ZIvOzOr9bBMqAijii2ZFsENk20/YgkdPSZyTUUWcj7RtbgMnTDgXMjLIY5Tu1o71xaOe4QKirYYy/axUsaAjBQptewUxlL77E2i/+PxTudkrJM5TKJHJtzcMvE7eFyr+yOIaATWH+3/F7vh/7pnVEGz5EYj0dTd5RG7Yxmh1N86N/+Ks9D0sZdrcfgSbfCtlMXP0aZG+1kyQQNZRo6lpi3EPy9xIKhGxxbU5/VGmJtmODQD1BWNexmJ/HA5L7U49Yb//Yl9e441ytzf0= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 15:00:16.7814 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2d445a2c-c346-418f-b89f-08dcf9bcbb31 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: AM2PEPF0001C70C.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXP190MB1990 X-BESS-ID: 1730386830-302686-12636-34744-1 X-BESS-VER: 2019.1_20241018.1852 X-BESS-Apparent-Source-IP: 104.47.17.170 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoaWJoZAVgZQMDnVMNEw2TIxLd XQOCktJcnU2DA52cDYwDQpKSXJ3DBNqTYWADxR06JBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.260105 [from cloudscan8-33.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-Mailman-Approved-At: Thu, 31 Oct 2024 16:03:06 +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 The testpmd command “flow update…“ provides a nullptr as the context variable. 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 contest if exists. 3. Replace flow in the flow list. Fixes: 2d9c7e56e52c ("app/testpmd: support updating flow rule actions") Signed-off-by: Danylo Vodopianov --- app/test-pmd/config.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 88770b4dfc..bf50f6adef 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,13 @@ 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->flow = flow->flow; + *flow_list = uf; + + free(flow); return 0; } printf("Failed to find flow %"PRIu32"\n", rule_id); -- 2.43.5