Message ID | 20241031150010.2991953-2-dvo-plv@napatech.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Thomas Monjalon |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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 <dev@dpdk.org>; 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 <dvo-plv@napatech.com> 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|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Aso2QP4Tg22nARj+aaAlh4KDFatKMZX?= =?utf-8?q?OpQlqH3eUyObfBXg5WzzsrWVFGPtz7jw+KUJiTK9wXy4fQAXR10RTfG7Mr4d6sutR?= =?utf-8?q?rjDm3I90EVx3ZzfikScxxtBdXzds1jXVFbVwKtbfoJ6EQk/LnLD4kO9Lp4bkIxXC5?= =?utf-8?q?hk1bP/Dcmap51iUUijKyweeXtyhb7UhVda6JtSAxtH4qb6bv1uB2o1BfG9fS3/cPU?= =?utf-8?q?DaadUhrfGUwEGPYDckcJGRjgr27EthPiTWx3Ya2Rxrq2fQX6mBQ6n0Q8+CsO3xzj2?= =?utf-8?q?x4Ic3FodnWL0f4jignnHX57FEnBNq+gFtkucuxG3Yn6lmFGWKe+8EbI/mtrcMfcr8?= =?utf-8?q?7K5E+bpnoyv9tGRznC9GDaaXJaTZfjg6RDvGDEEfpNhsuWdidTV34LULaq3fgzILn?= =?utf-8?q?e0BUfze6Pqr2+zDjYENdOBX5VRoEoC48GliTrw0x0PayihqVAic/csbJqJ69DM8cr?= =?utf-8?q?FYQKfEwMESN6LgkgBawYXMmXRiMYzQqwwK9zf57IU3TiPiIkTymrvLuxJi0Zki32b?= =?utf-8?q?OEgzfb8/AS+wsUQr26jIYyRZ5gzsPhtZ4yE+Bo5+25xSOVGrRBsIFFTWCjr+p00nS?= =?utf-8?q?Ap1p8WPlcR+NArbuG2zVDcp42ymMa54dc44UZFb/XW5X6YRtJJCpQoU9jedK7ru8n?= =?utf-8?q?e/4XbvABnRpmPhYXHzi9GSdSyeFo2rAtO3xlQ68Wuvzd4majh1mBeXup38gqEBQnb?= =?utf-8?q?B64RmY4TYN7PWCLb9+rlmRZ+8EV4NzE/AK+oNv89lkUtfkfvA6IXR3K2HV6X3lG6m?= =?utf-8?q?CEpPn3a2avQJhDWK438syFXZSuYFHXwwjyPvlb3Qcxj23bRiV4yTIGQiicqZqO83N?= =?utf-8?q?+Es7J7rOaUXyozqFdIHarwzhn+dkDpoLSibEl+psqLz1pyubF785P+tfgfQ7Mn+63?= =?utf-8?q?IFBdt5bcu8dxYV1rgqL8nmL1r7cSyZaA0MXTQliZfDh55Z/rMvcfTu9Nap+NpwIEO?= =?utf-8?q?/RBSz/hM8Txs7xfzBN7rYAq4pU/jOcV6Tav56bnXmoLBTKuVrhHLgoo7aI77IVxyZ?= =?utf-8?q?cFoPKybjDx0DRmdnhhz9psBkOrlTcrtEBFUctALcqt9XmiRVskPras3MNCyVVyT2b?= =?utf-8?q?QtLR/aDZsTID0b0Rsf8GdfxAAAQL1EzuoR66gxVxMnprBxYzJz2zA2ocwHi70iXGG?= =?utf-8?q?SWaAQWFehMKof2bPLWUU1DPaF7QPkfM7rY1k3+pxubC4C5wZCbZLXp2cTsdaXYKKV?= =?utf-8?q?6rC1QxaYS3tl3TbX4kBKF6U55XPDyUN7pwVYXSLxh08OMmoCEiyYBOu9b2K1ADaxA?= =?utf-8?q?lzNj/L9u2vyTL/zheW9NemCg3Pvq49DGaO0rSGlMRlPFah47McqVHQY2bNXSHIGpM?= =?utf-8?q?syEMbwK2fLjhyuBgWJcU717pvVEeSPeTYQ=3D=3D?= 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 <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
Testpmd flow update/destroy fixes
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
Commit Message
Danylo Vodopianov
Oct. 31, 2024, 3 p.m. UTC
The testpmd command “flow update…“ provides a nullptr as the
context variable.
Thus "flow aged <port_id> 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 <dvo-plv@napatech.com>
---
app/test-pmd/config.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
Comments
Hi, > -----Original Message----- > From: Danylo Vodopianov <dvo-plv@napatech.com> > Sent: Thursday, October 31, 2024 16:00 > To: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>; > aman.deep.singh@intel.com; yuying.zhang@intel.com; Ori Kam > <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 > > The testpmd command “flow update…“ provides a nullptr as the context variable. I would propose the following phrasing, which I think would be more accurate: If actions provided to “flow update…“ command contained an age action, Then testpmd did not update the age action context accordingly. > Thus "flow aged <port_id> 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. s/contest if exists/context if age action is present/ > 3. Replace flow in the flow list. > > Fixes: 2d9c7e56e52c ("app/testpmd: support updating flow rule actions") > > Signed-off-by: Danylo Vodopianov <dvo-plv@napatech.com> > --- > 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; Please copy user_id as well. > + uf->flow = flow->flow; > + *flow_list = uf; > + > + free(flow); > return 0; > } > printf("Failed to find flow %"PRIu32"\n", rule_id); > -- > 2.43.5 Best regards, Dariusz Sosnowski
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);