Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/101473/?format=api
https://patches.dpdk.org/api/patches/101473/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211013184516.25338-4-viacheslavo@nvidia.com/", "project": { "id": 1, "url": "https://patches.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": "<20211013184516.25338-4-viacheslavo@nvidia.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20211013184516.25338-4-viacheslavo@nvidia.com", "date": "2021-10-13T18:45:14", "name": "[v6,3/5] app/testpmd: update modify field flow action support", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "c1ff18134a747b6d0387d74e4442aa807ef5298b", "submitter": { "id": 1926, "url": "https://patches.dpdk.org/api/people/1926/?format=api", "name": "Slava Ovsiienko", "email": "viacheslavo@nvidia.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20211013184516.25338-4-viacheslavo@nvidia.com/mbox/", "series": [ { "id": 19613, "url": "https://patches.dpdk.org/api/series/19613/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19613", "date": "2021-10-13T18:45:11", "name": "ethdev: update modify field flow action", "version": 6, "mbox": "https://patches.dpdk.org/series/19613/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/101473/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/101473/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 AF4B5A0C55;\n\tWed, 13 Oct 2021 20:46:00 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E1A3741215;\n\tWed, 13 Oct 2021 20:45:43 +0200 (CEST)", "from NAM12-BN8-obe.outbound.protection.outlook.com\n (mail-bn8nam12on2074.outbound.protection.outlook.com [40.107.237.74])\n by mails.dpdk.org (Postfix) with ESMTP id 208F5411F6\n for <dev@dpdk.org>; Wed, 13 Oct 2021 20:45:42 +0200 (CEST)", "from MWHPR14CA0057.namprd14.prod.outlook.com (2603:10b6:300:81::19)\n by MWHPR12MB1167.namprd12.prod.outlook.com (2603:10b6:300:8::15) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Wed, 13 Oct\n 2021 18:45:40 +0000", "from CO1NAM11FT016.eop-nam11.prod.protection.outlook.com\n (2603:10b6:300:81:cafe::f2) by MWHPR14CA0057.outlook.office365.com\n (2603:10b6:300:81::19) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend\n Transport; Wed, 13 Oct 2021 18:45:40 +0000", "from mail.nvidia.com (216.228.112.34) by\n CO1NAM11FT016.mail.protection.outlook.com (10.13.175.141) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4608.15 via Frontend Transport; Wed, 13 Oct 2021 18:45:40 +0000", "from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com\n (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 13 Oct\n 2021 18:45:38 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=Mey3jYnBUxV0DcjTUobhgwTSlBPWfTj1qMVFFknzCOwA5hCeVZ6lhVxtBQcpe1vYFnxBIxIqDR+D2NKDt6tNU3pQfgoTEGpSSZH4TLCYMFAW+76W9pl3p49eyegWmwhjxrqC6+R0gtmXsXOwyx76zYlLLMe0eYofTzZYj6OHWQtVzEyJpvS1PHJRN0TNniFpD/ve78v2Vv3hHt7AXBjweMcToayX5GLhm1dB2DAM2ph75i0FOvbRA2EsOnxvu2ELHp2m7hl7yHlUOB7MbpBpYaxb81WGmcvCNAWAM19Ju81HqHcjb+MZA4vKB5HhYmPCXuzCWXALM3k+7k2XLdP33g==", "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=7dCXAxZpE5+0obHyfmSp680hj9gaTcERFOgjUbNe7MU=;\n b=h0uKuRypwVYeVW+64QTm0RsK4LCpH3LLDvPnU6rbJ8L8RbYg6F+CIqqshFRJ2kYngCGn1xoxFjLUcOsEpKbdB39ybICcdL6UHeEqMdjCH7/2oe6wh/0szLkNfXDXlZtLdoSslhQPgrd/HmfccjxJy9tiy6DmPVgOO2DV9WOWn/RrX6pefOAUEm1J6upPDR4yfCgiZu5heu+CiVI3x0InrCc1D2yyoAwvjmaCPWxNuqOTmMlZaxRQJNokzqaDv/oHbOUwT/0ujxR0U9THoGnieFldr6/sL0GbtvhpHZL4i6FSeNen1KOFNgDpl0SMt2q8fUkfXgkyhR4ZSUyLdsMWTQ==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com;\n dmarc=pass (p=quarantine sp=quarantine pct=100) action=none\n header.from=nvidia.com; dkim=none (message not signed); arc=none", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=7dCXAxZpE5+0obHyfmSp680hj9gaTcERFOgjUbNe7MU=;\n b=tlPJJQypjaklqE2S8je+CJgqYrdDSgrwY9lISL6F2peZ68oncbSpRk8ZBwQRrlTdMAK9KdJtSr0Z5cq/7fsxMq+VvpqDFNqVLecFUpz6LVrtVHwJJMJe+2/QQecqRtqd1UpVRIvuHoze2GRvE9H0G40tlZmqG3Qy7hsCvMhwziDulIPgClEoxR9z0+/C/FBd5blUZwCSgAXjOPpOmfUpmvkNyhQQoWuCpo8Hj62qFDbVtnX0pvVr5TZry/ZsnKJ5GTbDF1PzDRvETnDoHyQWP4r25cbjBDHsbhho/LOTssa+EFvE+1mqepRCvaAwc/77G7ZrOpI1ewpwiQ6FReykyQ==", "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.112.34)\n smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed)\n header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com;", "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.112.34 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.112.34; helo=mail.nvidia.com;", "From": "Viacheslav Ovsiienko <viacheslavo@nvidia.com>", "To": "<dev@dpdk.org>", "CC": "<rasland@nvidia.com>, <matan@nvidia.com>, <shahafs@nvidia.com>,\n <orika@nvidia.com>, <getelson@nvidia.com>, <thomas@monjalon.net>", "Date": "Wed, 13 Oct 2021 21:45:14 +0300", "Message-ID": "<20211013184516.25338-4-viacheslavo@nvidia.com>", "X-Mailer": "git-send-email 2.18.1", "In-Reply-To": "<20211013184516.25338-1-viacheslavo@nvidia.com>", "References": "<20210910141609.8410-1-viacheslavo@nvidia.com>\n <20211013184516.25338-1-viacheslavo@nvidia.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[172.20.187.5]", "X-ClientProxiedBy": "HQMAIL101.nvidia.com (172.20.187.10) To\n HQMAIL107.nvidia.com (172.20.187.13)", "X-EOPAttributedMessage": "0", "X-MS-PublicTrafficType": "Email", "X-MS-Office365-Filtering-Correlation-Id": "cffabcb9-7720-4b9c-b268-08d98e79a777", "X-MS-TrafficTypeDiagnostic": "MWHPR12MB1167:", "X-LD-Processed": "43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr", "X-Microsoft-Antispam-PRVS": "\n <MWHPR12MB1167F8E191ADA380ED83E748DFB79@MWHPR12MB1167.namprd12.prod.outlook.com>", "X-MS-Oob-TLC-OOBClassifiers": "OLM:7219;", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;", "X-Microsoft-Antispam-Message-Info": "\n X9jLCLzRDMro3Ovfd0CHObmLUad4fei6OHDkrZi1vTFKVTPurHIBP5SI9uowO2NtF7PqGDPFOwJgJa4ZawLU3K0Hr1Lkx2zQmwfQev7PRleidLgAl/1iyefSwin5MCKYV5AXbXMP96kaa4VYOU/8tvohjKA86cQs9ljyEj5+flsfULUIx0TFRJdvp7qXhP1+X3fz4HVKVGX1Z1HXzVIV7Srm5GxFB4oAW1fu9S2FWc9kY+G59089kU1YePoQiRYd5OJHGi/2UXEPXo70eUE5aLUkufJ3YyRFzuNvtLbkwcTqxfuupJ+JtIxZPUoJvINguyncgJVJnB07FkWHneGL+vlgtEAEhmo8xAytPrTMjiUt4AExzQrEZisK8JeVvtkdnrRNOfnBhwxOyPm9FoHXKKchYclbyeuSXB7dASR9iRc0do1BcOrWLQRb1r4TNA078cHuKXRh/91LdYj+UaSHiAo30BCqL6I4QmF+Mk8OwSK0V9xwT3DbHt7wm8IE/gvB80hqNDtsvyMIRMzOwZorZqIG6c4F9rm1hDnthaGGTZsMoko+GoF0Md6/Sohmr8jq9uU44fNEeIoLLJukNkwp9A9pQyPPnNzYXaHrio0UNr90QKxxuDBYrfqC+syMgQvsqtcNbDEzu4UV5UmYwvLp2u1cxyFjLxW/ofS/95t2qKCKRrMVvDJGWLR2zrZfJsh6rIAcKvUD0oNoecMPhHROcg==", "X-Forefront-Antispam-Report": "CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE;\n SFS:(4636009)(36840700001)(46966006)(6916009)(55016002)(2616005)(1076003)(4326008)(82310400003)(83380400001)(508600001)(8676002)(426003)(356005)(36756003)(36906005)(7636003)(186003)(36860700001)(6286002)(26005)(16526019)(316002)(336012)(2906002)(6666004)(47076005)(70586007)(70206006)(7696005)(15650500001)(8936002)(54906003)(5660300002)(86362001);\n DIR:OUT; SFP:1101;", "X-OriginatorOrg": "Nvidia.com", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "13 Oct 2021 18:45:40.0434 (UTC)", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n cffabcb9-7720-4b9c-b268-08d98e79a777", "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a", "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34];\n Helo=[mail.nvidia.com]", "X-MS-Exchange-CrossTenant-AuthSource": "\n CO1NAM11FT016.eop-nam11.prod.protection.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous", "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "MWHPR12MB1167", "Subject": "[dpdk-dev] [PATCH v6 3/5] app/testpmd: update modify field flow\n action support", "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", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "The testpmd flow create command updates provided:\n\n - modify field action supports the updated actions\n - pointer type added for action source field\n - pointer and value source field takes hex string\n instead of unsigned int in host endianness\n\nThere are some examples of flow with update modified\nfield action:\n\n1. IPv6 destination address bytes 4-7 assignment:\n 0000::1111 - > 0000:xxxx:4455:6677::1111\n\n flow create 0 egress group 1\n pattern eth / ipv6 dst is 0000::1111 / udp / end\n actions modify_field op set\n dst_type ipv6_dst\n\t dst_offset 32\n src_type value\n src_value 0011223344556677\n\t width 32 / end\n\n2. Copy second byte of IPv4 destination address to the\n third byte of source address:\n 10.0.118.4 -> 192.168.100.1\n 10.0.168.4 -> 192.168.100.1\n\n flow create 0 egress group 1\n pattern eth / ipv4 / udp / end\n actions modify_field op set\n dst_type ipv4_src\n dst_offset 16\n\t src_type ipv4_dst\n\t src_offset 8\n\t width 8 / end\n\n3. Assign METADATA value with 11223344 value from the\n hex string in the linear buffer. Please note, the value\n definition should follow host-endian, example is given\n for x86 (little-endian):\n\n flow create 0 egress group 1\n pattern eth / ipv4 / end\n actions modify_field op set\n dst_type meta\n\t src_type pointer\n\t src_ptr 44332211\n\t width 32 / end\n\n4. Assign destination MAC with EA:11:0B:AD:0B:ED value:\n\n flow create 0 egress group 1\n pattern eth / end\n actions modify_field op set\n dst_type mac_dst\n\t src_type value\n\t src_value EA110BAD0BED\n\t width 48 / end\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>\nAcked-by: Ori Kam <orika@nvidia.com>\n---\n app/test-pmd/cmdline_flow.c | 55 +++++++++++++++++++++++++------------\n 1 file changed, 38 insertions(+), 17 deletions(-)", "diff": "diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex bb22294dd3..736029c4fd 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -448,6 +448,7 @@ enum index {\n \tACTION_MODIFY_FIELD_SRC_LEVEL,\n \tACTION_MODIFY_FIELD_SRC_OFFSET,\n \tACTION_MODIFY_FIELD_SRC_VALUE,\n+\tACTION_MODIFY_FIELD_SRC_POINTER,\n \tACTION_MODIFY_FIELD_WIDTH,\n \tACTION_CONNTRACK,\n \tACTION_CONNTRACK_UPDATE,\n@@ -468,6 +469,14 @@ enum index {\n #define ITEM_RAW_SIZE \\\n \t(sizeof(struct rte_flow_item_raw) + ITEM_RAW_PATTERN_SIZE)\n \n+/** Maximum size for external pattern in struct rte_flow_action_modify_data. */\n+#define ACTION_MODIFY_PATTERN_SIZE 32\n+\n+/** Storage size for struct rte_flow_action_modify_field including pattern. */\n+#define ACTION_MODIFY_SIZE \\\n+\t(sizeof(struct rte_flow_action_modify_field) + \\\n+\tACTION_MODIFY_PATTERN_SIZE)\n+\n /** Maximum number of queue indices in struct rte_flow_action_rss. */\n #define ACTION_RSS_QUEUE_NUM 128\n \n@@ -1704,6 +1713,7 @@ static const enum index action_modify_field_src[] = {\n \tACTION_MODIFY_FIELD_SRC_LEVEL,\n \tACTION_MODIFY_FIELD_SRC_OFFSET,\n \tACTION_MODIFY_FIELD_SRC_VALUE,\n+\tACTION_MODIFY_FIELD_SRC_POINTER,\n \tACTION_MODIFY_FIELD_WIDTH,\n \tZERO,\n };\n@@ -4455,8 +4465,7 @@ static const struct token token_list[] = {\n \t[ACTION_MODIFY_FIELD] = {\n \t\t.name = \"modify_field\",\n \t\t.help = \"modify destination field with data from source field\",\n-\t\t.priv = PRIV_ACTION(MODIFY_FIELD,\n-\t\t\tsizeof(struct rte_flow_action_modify_field)),\n+\t\t.priv = PRIV_ACTION(MODIFY_FIELD, ACTION_MODIFY_SIZE),\n \t\t.next = NEXT(NEXT_ENTRY(ACTION_MODIFY_FIELD_OP)),\n \t\t.call = parse_vc,\n \t},\n@@ -4539,11 +4548,26 @@ static const struct token token_list[] = {\n \t\t.name = \"src_value\",\n \t\t.help = \"source immediate value\",\n \t\t.next = NEXT(NEXT_ENTRY(ACTION_MODIFY_FIELD_WIDTH),\n-\t\t\tNEXT_ENTRY(COMMON_UNSIGNED)),\n-\t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_action_modify_field,\n+\t\t\t NEXT_ENTRY(COMMON_HEX)),\n+\t\t.args = ARGS(ARGS_ENTRY_ARB(0, 0),\n+\t\t\t ARGS_ENTRY_ARB(0, 0),\n+\t\t\t ARGS_ENTRY(struct rte_flow_action_modify_field,\n \t\t\t\t\tsrc.value)),\n \t\t.call = parse_vc_conf,\n \t},\n+\t[ACTION_MODIFY_FIELD_SRC_POINTER] = {\n+\t\t.name = \"src_ptr\",\n+\t\t.help = \"pointer to source immediate value\",\n+\t\t.next = NEXT(NEXT_ENTRY(ACTION_MODIFY_FIELD_WIDTH),\n+\t\t\t NEXT_ENTRY(COMMON_HEX)),\n+\t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_action_modify_field,\n+\t\t\t\t\tsrc.pvalue),\n+\t\t\t ARGS_ENTRY_ARB(0, 0),\n+\t\t\t ARGS_ENTRY_ARB\n+\t\t\t\t(sizeof(struct rte_flow_action_modify_field),\n+\t\t\t\t ACTION_MODIFY_PATTERN_SIZE)),\n+\t\t.call = parse_vc_conf,\n+\t},\n \t[ACTION_MODIFY_FIELD_WIDTH] = {\n \t\t.name = \"width\",\n \t\t.help = \"number of bits to copy\",\n@@ -7830,15 +7854,11 @@ static int\n comp_set_modify_field_op(struct context *ctx, const struct token *token,\n \t\t unsigned int ent, char *buf, unsigned int size)\n {\n-\tuint16_t idx = 0;\n-\n \tRTE_SET_USED(ctx);\n \tRTE_SET_USED(token);\n-\tfor (idx = 0; modify_field_ops[idx]; ++idx)\n-\t\t;\n \tif (!buf)\n-\t\treturn idx + 1;\n-\tif (ent < idx)\n+\t\treturn RTE_DIM(modify_field_ops);\n+\tif (ent < RTE_DIM(modify_field_ops) - 1)\n \t\treturn strlcpy(buf, modify_field_ops[ent], size);\n \treturn -1;\n }\n@@ -7848,16 +7868,17 @@ static int\n comp_set_modify_field_id(struct context *ctx, const struct token *token,\n \t\t unsigned int ent, char *buf, unsigned int size)\n {\n-\tuint16_t idx = 0;\n+\tconst char *name;\n \n-\tRTE_SET_USED(ctx);\n \tRTE_SET_USED(token);\n-\tfor (idx = 0; modify_field_ids[idx]; ++idx)\n-\t\t;\n \tif (!buf)\n-\t\treturn idx + 1;\n-\tif (ent < idx)\n-\t\treturn strlcpy(buf, modify_field_ids[ent], size);\n+\t\treturn RTE_DIM(modify_field_ids);\n+\tif (ent >= RTE_DIM(modify_field_ids) - 1)\n+\t\treturn -1;\n+\tname = modify_field_ids[ent];\n+\tif (ctx->curr == ACTION_MODIFY_FIELD_SRC_TYPE ||\n+\t (strcmp(name, \"pointer\") && strcmp(name, \"value\")))\n+\t\treturn strlcpy(buf, name, size);\n \treturn -1;\n }\n \n", "prefixes": [ "v6", "3/5" ] }{ "id": 101473, "url": "