Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/137459/?format=api
http://patchwork.dpdk.org/api/patches/137459/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240229021511.5850-1-okl-plv@napatech.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20240229021511.5850-1-okl-plv@napatech.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20240229021511.5850-1-okl-plv@napatech.com", "date": "2024-02-29T02:15:11", "name": "[v5] app/testpmd: support updating flow rule actions", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "1424ba9bb6118711ac152eacdd8cdc6ee1d56c81", "submitter": { "id": 3265, "url": "http://patchwork.dpdk.org/api/people/3265/?format=api", "name": "Oleksandr Kolomeiets", "email": "okl-plv@napatech.com" }, "delegate": { "id": 319, "url": "http://patchwork.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240229021511.5850-1-okl-plv@napatech.com/mbox/", "series": [ { "id": 31284, "url": "http://patchwork.dpdk.org/api/series/31284/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31284", "date": "2024-02-29T02:15:11", "name": "[v5] app/testpmd: support updating flow rule actions", "version": 5, "mbox": "http://patchwork.dpdk.org/series/31284/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/137459/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/137459/checks/", "tags": {}, "related": [], "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 283BC43BAE;\n\tThu, 29 Feb 2024 03:12:42 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id F029D402AF;\n\tThu, 29 Feb 2024 03:12:41 +0100 (CET)", "from egress-ip11a.ess.de.barracuda.com\n (egress-ip11a.ess.de.barracuda.com [18.184.203.234])\n by mails.dpdk.org (Postfix) with ESMTP id 25D0F402A3\n for <dev@dpdk.org>; Thu, 29 Feb 2024 03:12:40 +0100 (CET)", "from EUR03-AM7-obe.outbound.protection.outlook.com\n (mail-am7eur03lp2233.outbound.protection.outlook.com [104.47.51.233]) by\n mx-outbound46-194.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2\n cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);\n Thu, 29 Feb 2024 02:12:39 +0000", "from AM0PR01CA0169.eurprd01.prod.exchangelabs.com\n (2603:10a6:208:aa::38) by PRAP190MB1738.EURP190.PROD.OUTLOOK.COM\n (2603:10a6:102:27b::9) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Thu, 29 Feb\n 2024 02:12:37 +0000", "from AM3PEPF0000A79A.eurprd04.prod.outlook.com\n (2603:10a6:208:aa:cafe::18) by AM0PR01CA0169.outlook.office365.com\n (2603:10a6:208:aa::38) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.28 via Frontend\n Transport; Thu, 29 Feb 2024 02:12:37 +0000", "from localhost.localdomain.com (178.72.21.4) by\n AM3PEPF0000A79A.mail.protection.outlook.com (10.167.16.105) with Microsoft\n SMTP Server id 15.20.7292.25 via Frontend Transport; Thu, 29 Feb 2024\n 02:12:36 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=cE/dxNOnARzAFJXAgdk6rkMRajej1EpMKFuK11M5DSBlHhVoVdL/Xo9z0fpqYqZBK2HEpHjTMPCCxsk5kMYVWpJZgXSbrZm0hhg458nPj5AFaobisYBeh/F1PNy9oTHRRqNhbymyaLPpWFpRGjYNdzjOgfPTH58bs12qCAErp+Kowue+LSnVS4qsAdK6/N1jWoJiIgc5qRR0/KKMWZh/eMQcJq1BtY93Lhokm09SAtVD1HZlRli1DYDBPEADcMymmH9UY83GAHCB3RTez0fHSfbe+Ps89O4k0GS176bfhIS2c4NhWZlLFtjX2WEsgEabkthtKqu4+L7teZ4M9On9VQ==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n 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;\n bh=MeKUz7WnvOI6sfqjeAHtWKzbS8ChI+1NhYyd2toucjI=;\n b=WyjwnKZwXLwuqQ6A5SI3saUmRT0AHDmdU9gbLJAjwqpOrjuhTDCvPsXOkIE3rF0jxYT/ITiBl+elljx6HdxbOq2nuhYqUk/6+prAVC3d5jS5W3sqFyWvydXkchkpFqX+ihgXdbeMeUHSVaw5pm2/yJ63dd5sm5OstYU/ISFcfVIf9hHZhjlGO1h0F0BXHChpkU1cFuuihbO5XvinNpMdxf2E/fTyvReyvWPJ3h2WUrTvpPlPGPjvHmSVYtpqh/paCzZNRXStu0nReR+u7w8ZPYW1M7ZcdREnidndOQU77sVsPyl0vVJyK1tmbYu6lu/Yu7B+TgwBwozQxXCT/jHIiA==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=fail (sender ip is\n 178.72.21.4) smtp.rcpttodomain=monjalon.net smtp.mailfrom=napatech.com;\n dmarc=fail (p=none sp=none pct=100) action=none header.from=napatech.com;\n dkim=none (message not signed); arc=none (0)", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=MeKUz7WnvOI6sfqjeAHtWKzbS8ChI+1NhYyd2toucjI=;\n b=LxCoHRfrZGh2qcQQ8rB9N4p7D985h0UnabZFeN8yrKFePwRVQc/Zbl1Y2S8ZJuLJVD5VlDd1KbAUuda7Qk1wKuHSRp5z5dn8Dgy8UsH2UTpPSuVn/ZcmNi0+qQG218gE/xbsztISzEnhVYiKEk6nZGr4Fy6OMzSH4ZNiUMisYOs=", "X-MS-Exchange-Authentication-Results": "spf=fail (sender IP is 178.72.21.4)\n smtp.mailfrom=napatech.com; dkim=none (message not signed)\n header.d=none;dmarc=fail action=none header.from=napatech.com;", "Received-SPF": "Fail (protection.outlook.com: domain of napatech.com does not\n designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com;\n client-ip=178.72.21.4; helo=localhost.localdomain.com;", "From": "Oleksandr Kolomeiets <okl-plv@napatech.com>", "To": "thomas@monjalon.net, aman.deep.singh@intel.com, yuying.zhang@intel.com,\n orika@nvidia.com, mko-plv@napatech.com, ckm@napatech.com", "Cc": "dev@dpdk.org", "Subject": "[PATCH v5] app/testpmd: support updating flow rule actions", "Date": "Thu, 29 Feb 2024 03:15:11 +0100", "Message-ID": "<20240229021511.5850-1-okl-plv@napatech.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20240223041919.131526-1-okl-plv@napatech.com>", "References": "<20240223041919.131526-1-okl-plv@napatech.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-EOPAttributedMessage": "0", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "AM3PEPF0000A79A:EE_|PRAP190MB1738:EE_", "Content-Type": "text/plain", "X-MS-Office365-Filtering-Correlation-Id": "b833ffcf-7c36-45b0-8879-08dc38cbe5e8", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;", "X-Microsoft-Antispam-Message-Info": "\n VR7T1FlAdWvXuqwp4vR1NVMsvSI+ZwU7RSgrJcbnBSJC2OlmFA17ESKLSznDXOh3vjOehhstZmckjit8qPkEs28CZP+Divy45WaZ5n2by6qKRLNODq2DTm9csM7IptW1gwbqBno3p0Kv4aGjfmeVgqO7sLRMIQw1cCSiyqy7Z30iFTu6lWZaNl1vG4zFP+ZGHfSlZOf9tp8sTmE+QBhtyqAsfm4+Pm/jpm3jlFlnmb43IPz13w/JLoH+AJVd0NBN0Wt7WfYAuzVbytZfduMYWZ2w2Q2UJaSuGVJqrDPid//er1jHY2HoCIgbwY9AcR/seh0BXVyGgtvb81PBMczffXvH2wL7wW0ucpJxkI7YCznVVVtdLKBEGiq46gxqjZNY3UJAPU4ZtBDDby3I01EcChUMO+8IHe60wcxWOZ80Ol5o0G59Y1gwmzlWljC4J7MOPZ1Yl8dBf76seYkXsWLICJbRdWB80d5/zaA8ZosU1RmoTROX5UEm72JnffXdvRtN2uxfSrdV/Gw8+zM577XPcurUzqIrzpxcK15ieSt2nCMh6HHZJYM6h0UpSzyKLjyEgKzgfJgrRdK77MZDMDccJbbNJMKMUID0qRhNSIItHQ3ctK7743CJ8WviAG/LFhS8pAzNPnZt9PcfTWgwE2rtRpZgfFnu73sjCiYwRbvq+V3xFSQeXlTcE4Fttzy8l+JeMcqat1/CJXkuHobiXBc0ejhoIZC96G/mbhEUI1I42piVvl9LTOnKvGDBqMq+B6iFmIrc6M1vW3svs6fdidauWU9E6p2gi4UzvJTRSxs5kSs=", "X-Forefront-Antispam-Report": "CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:localhost.localdomain.com; PTR:InfoDomainNonexistent;\n CAT:NONE; SFS:(13230031)(36860700004)(82310400014)(15866825006); DIR:OUT;\n SFP:1102;", "X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount": "1", "X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0": "\n rVOSLL4oLtSSbQHWvYBKaI3rBWI/zEnFVnYW9EzsRtOXwvQtye88NYNc6ihituecIgbsgKZpCPfOhOpS8m2/YvJcPpV3QwFbMG9HgYLD0q445afiDx+/t1NKR1tN52cPIJoVgMGhzGirAr9Em8O/M5q43VyP+PXZcgVYHoaAQsDMKV2IHp5j45wFV5lAgsEWrQyeFmihSJDgn56SCKIDrJRfeQH1s7vGF0Ns8TUvpUHjorv1hTyYBhPMHbMCqnKuyRD1fXaJFDogVvS0FWgsfRSnLjDylv1xlk9FsnciX9HEKcfbudbKA7GYIwWcA0Q4xa3Agi40/cZKMmkLwDLwX8cTaRnBm3Zk+JLvnT72CxWkMntxI831Xwz+V5uvCG2pF9+7nnIXIRNsAihVK/pUuU20s+t2mBmnzKFcps/Hw0/MXLp25TDCLTCOwe0IFc2hNNS/N2o6xSRBzOHol+0vG+uLGLP0FFpgYw2D7nbGRdgoSxed2Kg1lQ9PktfDROrPQ94cBNGu6BFWZJoajCQnNjehRvkhu1lgH63v8jEIPcBioqXfSlHZ7kUj3LjgmxHq+px4qWqv+8x99mAZ3rq6vhNFCJ3e7rfCvCkgg+2AHpPZO8Y38HebRZwqrvOIc/0ATgbHrdbMCYmY6jmq1H4AkQ==", "X-OriginatorOrg": "napatech.com", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "29 Feb 2024 02:12:36.4787 (UTC)", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n b833ffcf-7c36-45b0-8879-08dc38cbe5e8", "X-MS-Exchange-CrossTenant-Id": "c4540d0b-728a-4233-9da5-9ea30c7ec3ed", "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4];\n Helo=[localhost.localdomain.com]", "X-MS-Exchange-CrossTenant-AuthSource": "\n AM3PEPF0000A79A.eurprd04.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous", "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "PRAP190MB1738", "X-BESS-ID": "1709172759-311970-12432-40573-1", "X-BESS-VER": "2019.1_20240227.2356", "X-BESS-Apparent-Source-IP": "104.47.51.233", "X-BESS-Parts": "H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVpbmZmZAVgZQ0CQl2dTc3NjCIN\n nYyCAxxcjSxDTV2MLc0tQAyE82MlKqjQUAxTbQE0EAAAA=", "X-BESS-Outbound-Spam-Score": "0.00", "X-BESS-Outbound-Spam-Report": "Code version 3.2,\n rules version 3.2.2.254540 [from\n cloudscan8-245.eu-central-1a.ess.aws.cudaops.com]\n Rule breakdown below\n pts rule name description\n ---- ---------------------- --------------------------------\n 0.00 MAILTO_TO_SPAM_ADDR META: Includes a link to a likely spammer email\n 0.00 BSF_BESS_OUTBOUND META: BESS Outbound\n 0.00 BSF_SC0_MISMATCH_TO META: Envelope rcpt doesn't match header", "X-BESS-Outbound-Spam-Status": "SCORE=0.00 using account:ESS113687 scores of\n KILL_LEVEL=7.0 tests=MAILTO_TO_SPAM_ADDR, BSF_BESS_OUTBOUND,\n BSF_SC0_MISMATCH_TO", "X-BESS-BRTS-Status": "1", "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>,\n <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>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "\"flow update\" updates a flow rule specified by a rule ID with a\nnew action list by making a call to \"rte_flow_actions_update()\":\n\n flow update {port_id} {rule_id}\n actions {action} [/ {action} [...]] / end [user_id]\n\nCreating, updating and destroying a flow rule:\n\n testpmd> flow create 0 group 1 pattern eth / end actions drop / end\n Flow rule #0 created\n testpmd> flow update 0 0 actions queue index 1 / end\n Flow rule #0 updated with new actions\n testpmd> flow destroy 0 rule 0\n Flow rule #0 destroyed\n\nSigned-off-by: Oleksandr Kolomeiets <okl-plv@napatech.com>\nReviewed-by: Mykola Kostenok <mko-plv@napatech.com>\nReviewed-by: Christian Koue Muf <ckm@napatech.com>\n---\nv5:\n* No changes.\n\nv4:\n* No changes.\n\nv3:\n* Renamed \"flow actions_update\" command to \"flow update\".\n\nv2:\n* No changes.\n---\n .mailmap | 3 ++\n app/test-pmd/cmdline.c | 4 ++\n app/test-pmd/cmdline_flow.c | 33 +++++++++++++++-\n app/test-pmd/config.c | 43 ++++++++++++++++++++\n app/test-pmd/testpmd.h | 2 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 44 +++++++++++++++++++++\n 6 files changed, 128 insertions(+), 1 deletion(-)", "diff": "diff --git a/.mailmap b/.mailmap\nindex 58cca13ef6..157ccab909 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -236,6 +236,7 @@ Chintu Hetam <rometoroam@gmail.com>\n Choonho Son <choonho.son@gmail.com>\n Chris Metcalf <cmetcalf@mellanox.com>\n Christian Ehrhardt <christian.ehrhardt@canonical.com>\n+Christian Koue Muf <ckm@napatech.com>\n Christian Maciocco <christian.maciocco@intel.com>\n Christophe Fontaine <cfontain@redhat.com>\n Christophe Grosse <christophe.grosse@6wind.com>\n@@ -993,6 +994,7 @@ Mukesh Dua <mukesh.dua81@gmail.com>\n Murphy Yang <murphyx.yang@intel.com>\n Murthy NSSR <nidadavolu.murthy@caviumnetworks.com>\n Muthurajan Jayakumar <muthurajan.jayakumar@intel.com>\n+Mykola Kostenok <mko-plv@napatech.com>\n Nachiketa Prachanda <nprachan@brocade.com> <nprachan@vyatta.att-mail.com>\n Nagadheeraj Rottela <rnagadheeraj@marvell.com>\n Naga Harish K S V <s.v.naga.harish.k@intel.com>\n@@ -1047,6 +1049,7 @@ Odi Assli <odia@nvidia.com>\n Ognjen Joldzic <ognjen.joldzic@gmail.com>\n Ola Liljedahl <ola.liljedahl@arm.com>\n Oleg Polyakov <olegp123@walla.co.il>\n+Oleksandr Kolomeiets <okl-plv@napatech.com>\n Olga Shern <olgas@nvidia.com> <olgas@mellanox.com>\n Olivier Gournet <ogournet@corp.free.fr>\n Olivier Matz <olivier.matz@6wind.com>\ndiff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 566057caa5..f521a1fe9e 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -851,6 +851,10 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"flow destroy {port_id} rule {rule_id} [...]\\n\"\n \t\t\t\" Destroy specific flow rules.\\n\\n\"\n \n+\t\t\t\"flow update {port_id} {rule_id}\"\n+\t\t\t\" actions {action} [/ {action} [...]] / end [user_id]\\n\"\n+\t\t\t\" Update a flow rule with new actions.\\n\\n\"\n+\n \t\t\t\"flow flush {port_id}\\n\"\n \t\t\t\" Destroy all flow rules.\\n\\n\"\n \ndiff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex f69516faf2..5f761903c1 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -91,6 +91,7 @@ enum index {\n \tVALIDATE,\n \tCREATE,\n \tDESTROY,\n+\tUPDATE,\n \tFLUSH,\n \tDUMP,\n \tQUERY,\n@@ -260,6 +261,7 @@ enum index {\n \tVC_TUNNEL_SET,\n \tVC_TUNNEL_MATCH,\n \tVC_USER_ID,\n+\tVC_IS_USER_ID,\n \n \t/* Dump arguments */\n \tDUMP_ALL,\n@@ -3209,6 +3211,7 @@ static const struct token token_list[] = {\n \t\t\t VALIDATE,\n \t\t\t CREATE,\n \t\t\t DESTROY,\n+\t\t\t UPDATE,\n \t\t\t FLUSH,\n \t\t\t DUMP,\n \t\t\t LIST,\n@@ -4074,6 +4077,17 @@ static const struct token token_list[] = {\n \t\t.args = ARGS(ARGS_ENTRY(struct buffer, port)),\n \t\t.call = parse_destroy,\n \t},\n+\t[UPDATE] = {\n+\t\t.name = \"update\",\n+\t\t.help = \"update a flow rule with new actions\",\n+\t\t.next = NEXT(NEXT_ENTRY(VC_IS_USER_ID, END),\n+\t\t\t NEXT_ENTRY(ACTIONS),\n+\t\t\t NEXT_ENTRY(COMMON_RULE_ID),\n+\t\t\t NEXT_ENTRY(COMMON_PORT_ID)),\n+\t\t.args = ARGS(ARGS_ENTRY(struct buffer, args.vc.rule_id),\n+\t\t\t ARGS_ENTRY(struct buffer, port)),\n+\t\t.call = parse_vc,\n+\t},\n \t[FLUSH] = {\n \t\t.name = \"flush\",\n \t\t.help = \"destroy all flow rules\",\n@@ -4320,6 +4334,11 @@ static const struct token token_list[] = {\n \t\t.args = ARGS(ARGS_ENTRY(struct buffer, args.vc.user_id)),\n \t\t.call = parse_vc,\n \t},\n+\t[VC_IS_USER_ID] = {\n+\t\t.name = \"user_id\",\n+\t\t.help = \"rule identifier is user-id\",\n+\t\t.call = parse_vc,\n+\t},\n \t/* Validate/create pattern. */\n \t[ITEM_PATTERN] = {\n \t\t.name = \"pattern\",\n@@ -8483,8 +8502,13 @@ parse_vc(struct context *ctx, const struct token *token,\n \tif (!out->command) {\n \t\tif (ctx->curr != VALIDATE && ctx->curr != CREATE &&\n \t\t ctx->curr != PATTERN_TEMPLATE_CREATE &&\n-\t\t ctx->curr != ACTIONS_TEMPLATE_CREATE)\n+\t\t ctx->curr != ACTIONS_TEMPLATE_CREATE &&\n+\t\t ctx->curr != UPDATE)\n \t\t\treturn -1;\n+\t\tif (ctx->curr == UPDATE)\n+\t\t\tout->args.vc.pattern =\n+\t\t\t\t(void *)RTE_ALIGN_CEIL((uintptr_t)(out + 1),\n+\t\t\t\t\t\t sizeof(double));\n \t\tif (sizeof(*out) > size)\n \t\t\treturn -1;\n \t\tout->command = ctx->curr;\n@@ -8556,6 +8580,9 @@ parse_vc(struct context *ctx, const struct token *token,\n \t\tctx->object = out->args.vc.actions;\n \t\tctx->objmask = NULL;\n \t\treturn len;\n+\tcase VC_IS_USER_ID:\n+\t\tout->args.vc.user_id = true;\n+\t\treturn len;\n \tdefault:\n \t\tif (!token->priv)\n \t\t\treturn -1;\n@@ -13289,6 +13316,10 @@ cmd_flow_parsed(const struct buffer *in)\n \t\t\t\t in->args.destroy.rule,\n \t\t\t\t in->args.destroy.is_user_id);\n \t\tbreak;\n+\tcase UPDATE:\n+\t\tport_flow_update(in->port, in->args.vc.rule_id,\n+\t\t\t\t in->args.vc.actions, in->args.vc.user_id);\n+\t\tbreak;\n \tcase FLUSH:\n \t\tport_flow_flush(in->port);\n \t\tbreak;\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 08d7d0e2f8..cd2a436cd7 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -3829,6 +3829,49 @@ port_flow_destroy(portid_t port_id, uint32_t n, const uint64_t *rule,\n \treturn ret;\n }\n \n+/** Update a flow rule with new actions. */\n+int\n+port_flow_update(portid_t port_id, uint32_t rule_id,\n+\t\t const struct rte_flow_action *actions, bool is_user_id)\n+{\n+\tstruct rte_port *port;\n+\tstruct port_flow **flow_list;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN) ||\n+\t port_id == (portid_t)RTE_PORT_ALL)\n+\t\treturn -EINVAL;\n+\tport = &ports[port_id];\n+\tflow_list = &port->flow_list;\n+\twhile (*flow_list) {\n+\t\tstruct port_flow *flow = *flow_list;\n+\t\tstruct rte_flow_error error;\n+\n+\t\tif (rule_id != (is_user_id ? flow->user_id : flow->id)) {\n+\t\t\tflow_list = &flow->next;\n+\t\t\tcontinue;\n+\t\t}\n+\t\t/*\n+\t\t * Poisoning to make sure PMDs update it in case\n+\t\t * of error.\n+\t\t */\n+\t\tmemset(&error, 0x33, sizeof(error));\n+\t\tif (rte_flow_actions_update(port_id, flow->flow, actions,\n+\t\t\t\t\t &error))\n+\t\t\treturn port_flow_complain(&error);\n+\t\tif (is_user_id)\n+\t\t\tprintf(\"Flow rule #%\"PRIu64\" updated with new actions,\"\n+\t\t\t \" user-id 0x%\"PRIx64\"\\n\",\n+\t\t\t flow->id, flow->user_id);\n+\t\telse\n+\t\t\tprintf(\"Flow rule #%\"PRIu64\n+\t\t\t \" updated with new actions\\n\",\n+\t\t\t flow->id);\n+\t\treturn 0;\n+\t}\n+\tprintf(\"Failed to find flow %\"PRIu32\"\\n\", rule_id);\n+\treturn -EINVAL;\n+}\n+\n /** Remove all flow rules. */\n int\n port_flow_flush(portid_t port_id)\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 467ef3a8ab..55df12033a 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -1043,6 +1043,8 @@ void update_age_action_context(const struct rte_flow_action *actions,\n int mcast_addr_pool_destroy(portid_t port_id);\n int port_flow_destroy(portid_t port_id, uint32_t n, const uint64_t *rule,\n \t\t bool is_user_id);\n+int port_flow_update(portid_t port_id, uint32_t rule,\n+\t\t const struct rte_flow_action *actions, bool is_user_id);\n int port_flow_flush(portid_t port_id);\n int port_flow_dump(portid_t port_id, bool dump_all,\n \t\t\tuint64_t rule, const char *file_name,\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex d837aa797f..2fbf9220d8 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -3057,6 +3057,11 @@ following sections.\n \n flow destroy {port_id} rule {rule_id} [...] [user_id]\n \n+- Update a flow rule with new actions::\n+\n+ flow update {port_id} {rule_id}\n+ actions {action} [/ {action} [...]] / end [user_id]\n+\n - Destroy all flow rules::\n \n flow flush {port_id}\n@@ -4278,6 +4283,45 @@ Non-existent rule IDs are ignored::\n Flow rule #0 destroyed\n testpmd>\n \n+Updating flow rules with new actions\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+``flow update`` updates a flow rule specified by a rule ID with a new action\n+list by making a call to ``rte_flow_actions_update()``::\n+\n+ flow update {port_id} {rule_id}\n+ actions {action} [/ {action} [...]] / end [user_id]\n+\n+If successful, it will show::\n+\n+ Flow rule #[...] updated with new actions\n+\n+Or if ``user_id`` flag is provided::\n+\n+ Flow rule #[...] updated with new actions, user-id [...]\n+\n+If a flow rule can not be found::\n+\n+ Failed to find flow [...]\n+\n+Otherwise it will show the usual error message of the form::\n+\n+ Caught error type [...] ([...]): [...]\n+\n+Optional ``user_id`` is a flag that signifies the rule ID is the one provided\n+by the user at creation.\n+\n+Action list is identical to the one described for the ``flow create``.\n+\n+Creating, updating and destroying a flow rule::\n+\n+ testpmd> flow create 0 group 1 pattern eth / end actions drop / end\n+ Flow rule #0 created\n+ testpmd> flow update 0 0 actions queue index 1 / end\n+ Flow rule #0 updated with new actions\n+ testpmd> flow destroy 0 rule 0\n+ Flow rule #0 destroyed\n+\n Enqueueing destruction of flow rules\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n \n", "prefixes": [ "v5" ] }{ "id": 137459, "url": "