From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A9E9A04AB; Sun, 30 Aug 2020 13:22:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5DA0D1C11F; Sun, 30 Aug 2020 13:16:37 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00049.outbound.protection.outlook.com [40.107.0.49]) by dpdk.org (Postfix) with ESMTP id A1AD51C0CE for ; Sun, 30 Aug 2020 13:16:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AURPFfIug0e5i2ZI62dMli2PGC09OYhptnHzUXoJSacLCz/s4sQgo3d9pVAba2Gr7op+QBN6caaYSNp+iOmHy+ZOvEkedI64hCBhXd/PGbCEpJmkNkEIPFSV7RvDfrLHQpMHcx17mAPwTAlbUs7RpAC/a0+amv11CD0UwlJ7TkeH4C0vwWe5S0S5fdgCwDthSmVTggH+x9XXN5O3q13veSVt0AMS8NlXKYAv+jX5ekzMWZCnv4WOizas5vqmdM+tS1iUtcSmmRo4zvxJg1MzF6U6RBYmPm333qmjx5R5r0ztYcePoVlSTC7RnNeVqgvXKYjRE9kF1GfE6Mfog9OXOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4ktMJd7QfpvclW7synUk707IRz6g0vSNM8Ik2q6IpOI=; b=Fw+G//S1ia9W0hOvh2Rzo7HIQCh/gqJi0pSY7AWBQHzc5wiSVK3kWcZemYvpMXe3Dyx95lblOF/FGk/TyyvcpWeA3FnfeB3qMS22YxlFT91dJYJAqu4qwZPzbWTkSlRjRexyRjJNEDjbj9DdCV01mV74dX8yXbCZMJ9CzEVwEWMsxtYKfPB3mPA/OV9+rVOY4TEfCeBJJqk/BNpN46Xb8L3LwyAyE19GxVh6UeHpDJApSu7baFGh2/mjp1AozYY+242eJ3qFKZughKJO+BHFP7a0VafuvXjhaH2SplllpPS6qp0wNxCt/ZxmG4QTjUtwfOcwy7MKBaT59SZeliWwTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4ktMJd7QfpvclW7synUk707IRz6g0vSNM8Ik2q6IpOI=; b=RuurfDoCp4E+HuSrYKpTLm3w4f+lMQcFkZ7LsUW5tZR+a3RTpSgfR0E//uBlCvu/AxjHj3ND6oxsutw/Q2scUjdk9IJm4ew63FqC/Oa1OGC67VOV6xUcwQTzKLNSQ3Ip6LXmzh4gY0gsB8mOAL+3JuvO3tu/pHA4Bz/XJGivfEU= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR0502MB3762.eurprd05.prod.outlook.com (2603:10a6:208:1b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.21; Sun, 30 Aug 2020 11:16:30 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::4c8a:9848:2e2a:3598]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::4c8a:9848:2e2a:3598%6]) with mapi id 15.20.3326.025; Sun, 30 Aug 2020 11:16:30 +0000 From: Wisam Jaddo To: dev@dpdk.org, thomas@monjalon.net, asafp@mellanox.com, akozyrev@nvidia.com, akozyrev@mellanox.com, arybchenko@solarflare.com, jackmin@mellanox.com Date: Sun, 30 Aug 2020 11:15:39 +0000 Message-Id: <20200830111544.4190-9-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200830111544.4190-1-wisamm@mellanox.com> References: <20200830111544.4190-1-wisamm@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: AM4PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:205::21) To AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM4PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Sun, 30 Aug 2020 11:16:29 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 54e83fe2-8c7b-4236-1fcc-08d84cd6252b X-MS-TrafficTypeDiagnostic: AM0PR0502MB3762: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4Fk+De6ITDO0OVrrQGXq0FE/8txGJ/gPIeoqJJfdBRqaGsbG364BMx0rZegvyfp3f2KnJLW2Y+Em7AH/lDzSddNpBdJ3ACFlCkd1qMtEOkq4RfLLoca12MMxBaIfMP28fNtAachTQYghhsp9uBKykHGOGW7h6XATqvqybY1OyszTPIFoAxuptcIAuXeWXkziP7XjmwXqxTFBdYewNYFJ4JhqpPENwY5HhXak8kFbF2cuq/5sRjpipl4zg5/6RdSlc36GHLw7Lrw0+DsJiIdnsbS3/AQgyslOeqiTqXTk5wGPGfZYRPVdFk8iEKteh26t X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6610.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(136003)(39860400002)(376002)(346002)(478600001)(316002)(5660300002)(8886007)(2906002)(6636002)(86362001)(36756003)(6666004)(1076003)(55016002)(8936002)(26005)(2616005)(7696005)(66946007)(66556008)(52116002)(16526019)(8676002)(186003)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: i55uL0nUvtIPYMjeSA9eaSlL2LzdtAFZWPWyr1lfp32xfJ/9JqX1Be/emCQCYcLj4PbjlShH31hc5u9bir5SsIl/RuLrPZh+pU7lw8ONixjB4WIdqGJiRLWmI9Q5NU5uOIGjV0LFolqTXOAO1O7DLq925BirO2oZlrYvGdhVC2ZN2rpCg8Jdh3kQAqlKWQPcSNEUEO39HjmuZliyS8/xTfpkFQKAdvXlzsOvbq7KLa1qt+hhwOn5ShfITh+aELR7hkjx7AjZL0QyblqV9En5K8N7vRTLDOELrcbq+yhsNsy8N8MXRVIGuewNBpmPnRVjDFuiOmc4FlvjsB6oCLvPNlbpI1R7blgQv+zLovGEQiTWJS80QdfS87/gGnrYuDnsiiEjDsfNl//nvGnSeUbPRSGkt42rACWFEUZKWdaGnaUunY87WSbHjaHRbxkJmY3dCZRjSaOkoxSLH7tRaDSal8jVu287KRRSO4EGDwZS7OIua5szl8D24VDuszQ7+TK7G5KhEKaN9lw9U2fyyrDV5BRF3Qs+OW1FyNPu4oODr4OjvKskXdZfb8QmtjDZltuLEiqIOYgLkzv/Xcs9TgAM3fwGitSaFMFTf0NXF4cSR5lLsATYdijv6MuHnSoadlgSZs9a4S2/VYxw9pIQEvjn4g== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54e83fe2-8c7b-4236-1fcc-08d84cd6252b X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6610.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2020 11:16:30.5289 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: b5R34YIfiMHJMsaYQ6O+1p980lbF1ORBR8tsqS/rqmotmVd5sYL2JOy5PLOIAIAUvTxZeV5gtd7IQPXVVm4QHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3762 Subject: [dpdk-dev] [PATCH 08/13] app/flow-perf: add VXLAN encap/decap actions support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Introduce vxlan-encap and vxlan-decap actions. vxlan-encap have fixed pattern and values for encap data. Usage example: --vxlan-encap --vxlan-decap Signed-off-by: Wisam Jaddo Acked-by: Alexander Kozyrev --- app/test-flow-perf/actions_gen.c | 64 ++++++++++++++++++++++++++ app/test-flow-perf/main.c | 22 +++++++++ doc/guides/rel_notes/release_20_08.rst | 1 + doc/guides/tools/flow-perf.rst | 8 ++++ 4 files changed, 95 insertions(+) diff --git a/app/test-flow-perf/actions_gen.c b/app/test-flow-perf/actions_gen.c index 3ae6059fb1..10ddef4deb 100644 --- a/app/test-flow-perf/actions_gen.c +++ b/app/test-flow-perf/actions_gen.c @@ -17,6 +17,7 @@ #include "flow_gen.h" #include "config.h" + /* Storage for additional parameters for actions */ struct additional_para { uint16_t queue; @@ -750,6 +751,57 @@ add_raw_decap(struct rte_flow_action *actions, actions[actions_counter].conf = &action_decap_data->conf; } +static void +add_vxlan_encap(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_vxlan_encap vxlan_encap; + static struct rte_flow_item items[5]; + static struct rte_flow_item_eth item_eth; + static struct rte_flow_item_ipv4 item_ipv4; + static struct rte_flow_item_udp item_udp; + static struct rte_flow_item_vxlan item_vxlan; + + items[0].spec = &item_eth; + items[0].mask = &item_eth; + items[0].type = RTE_FLOW_ITEM_TYPE_ETH; + + item_ipv4.hdr.src_addr = RTE_IPV4(127, 0, 0, 1); + item_ipv4.hdr.dst_addr = RTE_IPV4(255, 255, 255, 255); + item_ipv4.hdr.version_ihl = RTE_IPV4_VHL_DEF; + items[1].spec = &item_ipv4; + items[1].mask = &item_ipv4; + items[1].type = RTE_FLOW_ITEM_TYPE_IPV4; + + + item_udp.hdr.dst_port = RTE_BE16(RTE_VXLAN_DEFAULT_PORT); + items[2].spec = &item_udp; + items[2].mask = &item_udp; + items[2].type = RTE_FLOW_ITEM_TYPE_UDP; + + + item_vxlan.vni[2] = 1; + items[3].spec = &item_vxlan; + items[3].mask = &item_vxlan; + items[3].type = RTE_FLOW_ITEM_TYPE_VXLAN; + + items[4].type = RTE_FLOW_ITEM_TYPE_END; + + vxlan_encap.definition = items; + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP; + actions[actions_counter].conf = &vxlan_encap; +} + +static void +add_vxlan_decap(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_VXLAN_DECAP; +} + void fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions, uint32_t counter, uint16_t next_table, uint16_t hairpinq, @@ -949,6 +1001,18 @@ fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions, ), .funct = add_raw_decap, }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP + ), + .funct = add_vxlan_encap, + }, + { + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_VXLAN_DECAP + ), + .funct = add_vxlan_decap, + }, }; for (j = 0; j < MAX_ACTIONS_NUM; j++) { diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 1b456e6922..0a030a462c 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -180,6 +180,10 @@ usage(char *progname) printf(" --raw-decap=: add raw decap action to flow actions\n" "Data is the data needed to be decaped\n" "Example: raw-decap=ether,ipv4,udp,vxlan\n"); + printf(" --vxlan-encap: add vxlan-encap action to flow actions\n" + "Encapped data is fixed with pattern: ether,ipv4,udp,vxlan\n" + "With fixed values\n"); + printf(" --vxlan-decap: add vxlan_decap action to flow actions\n"); } static void @@ -484,6 +488,22 @@ args_parse(int argc, char **argv) .map = &flow_actions[0], .map_idx = &actions_idx }, + { + .str = "vxlan-encap", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, + { + .str = "vxlan-decap", + .mask = FLOW_ACTION_MASK( + RTE_FLOW_ACTION_TYPE_VXLAN_DECAP + ), + .map = &flow_actions[0], + .map_idx = &actions_idx + }, }; static const struct option lgopts[] = { @@ -544,6 +564,8 @@ args_parse(int argc, char **argv) { "flag", 0, 0, 0 }, { "raw-encap", 1, 0, 0 }, { "raw-decap", 1, 0, 0 }, + { "vxlan-encap", 0, 0, 0 }, + { "vxlan-decap", 0, 0, 0 }, }; hairpin_queues_num = 0; diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst index 5a94eacded..c0f7ab6293 100644 --- a/doc/guides/rel_notes/release_20_08.rst +++ b/doc/guides/rel_notes/release_20_08.rst @@ -283,6 +283,7 @@ New Features * Start supporting header modify actions. * Start supporting flag action. * Start supporting raw-encap and raw-decap actions. + * Start supporting vxlan-encap and vxlan-decap actions. Removed Items diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst index 10c0c422e4..15b4273cc0 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -316,3 +316,11 @@ Actions: Add raw decap action to all flows actions. Data is the data needed to be decaped, with fixed values. Example: raw-decap=ether,ipv4,gre + +* ``--vxlan-encap`` + Add vxlan encap action to all flows actions. + Data to encap is fixed with pattern: ether,ipv4,udp,vxlan, + all encapped items have fixed values. + +* ``--vxlan-decap`` + Add vxlan decap action to all flows actions. -- 2.17.1