From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0060.outbound.protection.outlook.com [104.47.1.60]) by dpdk.org (Postfix) with ESMTP id 1F66D1B14F for ; Wed, 17 Oct 2018 19:08:54 +0200 (CEST) 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=EvHMkytlS4QcQot7LMuIDqcMSYS3roH0uv5+6m/6mCU=; b=eHuNz48xDZ5hgHDeIWJW4Dcj8XiHSW64IsJjvAKOL0ein66MWok49S5ThyQOuhEXJiQxNHVi1EYZ3dLYZo27+1HyJAcwbDj5v7gYPUzWc03SC1qb781j/DykPg32hV4FH1AzmYKNiIXPflcC3E5avwqaf8+cNnc3xJWic+4G9Zg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; Received: from mellanox.com (37.142.13.130) by VI1PR05MB3440.eurprd05.prod.outlook.com (2603:10a6:802:1e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.26; Wed, 17 Oct 2018 17:08:48 +0000 From: Ori Kam To: wenzhuo.lu@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com, arybchenko@solarflare.com, ferruh.yigit@intel.com, stephen@networkplumber.org, adrien.mazarguil@6wind.com Cc: dev@dpdk.org, dekelp@mellanox.com, thomas@monjalon.net, nelio.laranjeiro@6wind.com, yskoh@mellanox.com, orika@mellanox.com, shahafs@mellanox.com Date: Wed, 17 Oct 2018 17:07:52 +0000 Message-Id: <1539796072-111646-4-git-send-email-orika@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1539796072-111646-1-git-send-email-orika@mellanox.com> References: <1539726023-14402-1-git-send-email-orika@mellanox.com> <1539796072-111646-1-git-send-email-orika@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: CWLP265CA0320.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:57::20) To VI1PR05MB3440.eurprd05.prod.outlook.com (2603:10a6:802:1e::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7226a99b-59fc-47cb-1604-08d634533535 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB3440; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3440; 3:m6SvOlCiFM4OY95Hz0Zi67FP1lz3QosC/PPlKZ/05NL4Ra+UMdvE/mU04P1//qKDn77GIsuo+FzNgSpK1K//m5WF+UNdWUh9AmrV2ArIX3RGKVacIzi1XpT9Zmbk+R8fa9AcmS+LH+Cx7yxbvgftEBbqwuKqzkj/wQVZdVvfFMtAPgTCFGilAo+4ukg6SSnh3ru+bGU6foAO0dbY9qPdrRVhuFdkBIrJwojABPcdLeVZgIB+vRvAXKAHI8QkFMLs; 25:kzcJZoZgJlZ+ZpxOMdqGS1w8qYG+rdqX6y8OnEloOlXuh8P/kUWkF4RrC4cUeWYcl7kI+rxAhgbvpEx/T4wcdFVy/Q6ZZ+apbpPbCTWwQmVJi1C7EbdnsnQ5td44HC83P68nbEb1FsRc1Hhk5usg2H3ck/Zu5FYSiwpYQqMBErFwBnjJPu6oJiBHsCVorXibsS0L4f0EH1l7MO45T9Jqp2xv2CyJslJG19RYBZp5MHgQcCZD7IQDzaF2R7Mh9IC/zURbLURlmqB/cGrPj9Cyf69B589d5QlI2HRo+n/CnLJjV5tO2ggasergCttjAFy8EGUZZcP/ysjvuO8eqwJSMg==; 31:ftuHkyQ1+Kdd8EToNixZZcohej/aM5rVgBpzKtjICWjTe3Umt94/V/6yUJtzDT6bAh0oHb3FsAqJgt64UShdrP/qw3AukwZU1Z/QEMaYtZspNxBovk+ISRTPF2BdMaC5ONfgg6QwQurxvy32quT+d0e4Le7iUesWDp2vhY8xKvk7utjAIDCcjBwEK7pCcRPAfpq7q4i8oFgQvvrUEdz7So2u5melniEVAh3uip9Gfwk= X-MS-TrafficTypeDiagnostic: VI1PR05MB3440: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3440; 20:loKq81BWoCX14fa+dJvzVxrn6dkwF4yH7rXr+tn0IqHwy8p15gWsZWqpLzIr5OcCY4X2kHrovHzNFhW5GDFC6CpU3dR/LzgqXrmmknClR+9BZWnrv2RLpkwmWDwi4tMw9AL5ZmNd8zqdEI9dEgtP/S/X+Bqd8ee5gJniuj3ypN7ad/cqo61YadhEloFGfUpWG73xgLa9QzmBDSNYc5bac/UDPiPdm+WURCqUarL904OFRou0BO6j3nGRMiwtzk35IXTIP0I1RKZ1apWPt1pFvAAlUKnBOdzH7dZyFV6qXzd761LE1NL6GmTy3HUL8yKFjcMRTqKPVTR1BFNOCmYmhMTFFFsyKBw3+kXbQTlisGb/1XW5ac+N5MR2pcZySYuD1gICqdtgC4OxNQK/nTKGtHY/caNCMsSpwGEwiJxbuf2nwl24hxp1A4BleCwfzcwZs60OcmRIN6L8qIShlCjMOFq6zZoXRArGmDrYh7QeSTGbgWgP7bOsJJsn/mVA/ELJ; 4:C0ufdztKyWZvtJc/xoKBjiPtaVtibJq95TfX2Lwa9zf4bHP/zD3WSgi/EfRYG31zTYMX4cyEV3O4sv6EFyN3gW/LuDSaNgoNM7vAhbmx1dBZ4/SZFYbECiDHgYp/6qnJW2o3VzqWV+2WzLkxvn4w9SQhPghRwULhAzBRWVEdVWsQgVGbXyxnOMW24l8yb83/hUlA5ogvkOVUcrhHlK7KLvbP3qxq9YfNAozEIXQm6lDx9+CWg7d9mSY39wLmioGyn0rXp0XzRPyNmCf4F15REgaMk1w5PimTlwcef2ZRjVR/VFSPuYlYuWtTlfhjjmNN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:VI1PR05MB3440; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB3440; X-Forefront-PRVS: 08286A0BE2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(136003)(396003)(376002)(366004)(199004)(189003)(48376002)(186003)(25786009)(53936002)(4720700003)(4326008)(16526019)(47776003)(7416002)(66066001)(8936002)(7736002)(305945005)(86362001)(14444005)(26005)(6666004)(55016002)(4744004)(3846002)(33026002)(6116002)(2906002)(68736007)(386003)(50226002)(446003)(478600001)(51416003)(476003)(2616005)(8886007)(50466002)(81166006)(97736004)(956004)(21086003)(69596002)(52116002)(81156014)(7696005)(316002)(36756003)(8676002)(5660300001)(106356001)(107886003)(486006)(76176011)(11346002)(105586002)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3440; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB3440; 23:OpaULnlELmV+z1TBbrokad1T7cis2OIqZy1Zj/nMZ?= =?us-ascii?Q?fh2B37KPNeobLgKV9hIhtrc3KBnwWJAlCVdxFagAnRSG3uRGvbE0QoFjeuJd?= =?us-ascii?Q?Jt84H6/uk6MwMGiFkww5YA+AIT9jRk1MuP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wfG2FX//c7LlQo8X7Wl/HFd78CrTSaRi6S1bwA1/NCzyxIwCziPTlgk4cKJRaxukB3qi5yKyVYOJZaUCHRSHwII0rTUndCEMJ43tMTuIXU113KpK/Gf0mhJrfvjF9OtUhaJ1LRw4qfIGM7F6VRO6qSxaaeTAgqfCxKJVE5Fs8n/cVcvJlQr0tB9J6ZGsTOzT+hmZ2dmw==; 5:rmNUr5tk86GTcJY3vyE/GjLM2dxi3ELJYEJcTVrtjIUNDtq+lBiZa4AaoWF8lTUZMMv2+uzzQqLJRPycm/xikYZ3/GTBnt6shhmQtwWK26l0JXXgbElztCDjR19YriaB6t0pT//MDFCPQBE8M/TNvP9UNonZ3UDoJB3wjBLhYTY=; 7:Za6FJ0Y2ZpZRGBeOE9kmB00D8hmmUe39ZTea7UAT1MH5Kk+f15QvndiFp0iqeixhDTugetZXZD/e0SLricFkkMh1o4oR7+LTY4gX71xdaeR9DicpwtvGrA6cgGzqdp7rDly01z7K7EQDSqgCpz+SLODw5837lUe3Mk4q/0PjYGa2WWoXEaTJ5y6BDMnXLW/76D9t5jZ4bzLHGJ7P/PI3VnoGwTXz1H7SG8AtUCgOCc7QgsFI/1+tEPAA7gMG4fc3 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2018 17:08:48.2913 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7226a99b-59fc-47cb-1604-08d634533535 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3440 Subject: [dpdk-dev] [PATCH v5 3/3] app/testpmd: add MPLSoGRE encapsulation 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: , X-List-Received-Date: Wed, 17 Oct 2018 17:08:54 -0000 Example for MPLSoGRE tunnel: ETH / IPV4 / GRE / MPLS / IP / L4..L7 In order to encapsulate such a tunnel there is a need to remove L2 of the inner packet and encap the remaining tunnel, this is done by applying 2 rte flow commands l2_decap followed by mplsogre_encap. Both commands must appear in the same flow, and from the point of the packet it both actions are applyed at the same time. (There is no part where a packet doesn't have L2 header). Decapsulating such a tunnel works the other way, first we need to decap the outer tunnel header and then apply the new L2. So the commands will be mplsogre_decap / l2_encap Due to the complex encapsulation of MPLSoGRE flow action and based on the fact testpmd does not allocate memory, this patch adds a new command in testpmd to initialise a global structure containing the necessary information to make the outer layer of the packet. This same global structures will then be used by the flow commands in testpmd when the action mplsogre_encap, mplsogre_decap, will be parsed, at this point, the conversion into such action becomes trivial. Signed-off-by: Ori Kam --- app/test-pmd/cmdline.c | 227 ++++++++++++++++++++++++++ app/test-pmd/cmdline_flow.c | 238 ++++++++++++++++++++++++++-- app/test-pmd/testpmd.h | 22 +++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 103 ++++++++++++ 4 files changed, 579 insertions(+), 11 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index e807dbb..6e14345 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -15436,6 +15436,229 @@ static void cmd_set_l2_decap_parsed(void *parsed_result, }, }; +/** Set MPLSoGRE encapsulation details */ +struct cmd_set_mplsogre_encap_result { + cmdline_fixed_string_t set; + cmdline_fixed_string_t mplsogre; + cmdline_fixed_string_t pos_token; + cmdline_fixed_string_t ip_version; + uint32_t vlan_present:1; + uint32_t label; + cmdline_ipaddr_t ip_src; + cmdline_ipaddr_t ip_dst; + uint16_t tci; + struct ether_addr eth_src; + struct ether_addr eth_dst; +}; + +cmdline_parse_token_string_t cmd_set_mplsogre_encap_set = + TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, set, + "set"); +cmdline_parse_token_string_t cmd_set_mplsogre_encap_mplsogre_encap = + TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, mplsogre, + "mplsogre_encap"); +cmdline_parse_token_string_t cmd_set_mplsogre_encap_mplsogre_encap_with_vlan = + TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, + mplsogre, "mplsogre_encap-with-vlan"); +cmdline_parse_token_string_t cmd_set_mplsogre_encap_ip_version = + TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, + pos_token, "ip-version"); +cmdline_parse_token_string_t cmd_set_mplsogre_encap_ip_version_value = + TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, + ip_version, "ipv4#ipv6"); +cmdline_parse_token_string_t cmd_set_mplsogre_encap_label = + TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, + pos_token, "label"); +cmdline_parse_token_num_t cmd_set_mplsogre_encap_label_value = + TOKEN_NUM_INITIALIZER(struct cmd_set_mplsogre_encap_result, label, + UINT32); +cmdline_parse_token_string_t cmd_set_mplsogre_encap_ip_src = + TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, + pos_token, "ip-src"); +cmdline_parse_token_ipaddr_t cmd_set_mplsogre_encap_ip_src_value = + TOKEN_IPADDR_INITIALIZER(struct cmd_set_mplsogre_encap_result, ip_src); +cmdline_parse_token_string_t cmd_set_mplsogre_encap_ip_dst = + TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, + pos_token, "ip-dst"); +cmdline_parse_token_ipaddr_t cmd_set_mplsogre_encap_ip_dst_value = + TOKEN_IPADDR_INITIALIZER(struct cmd_set_mplsogre_encap_result, ip_dst); +cmdline_parse_token_string_t cmd_set_mplsogre_encap_vlan = + TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, + pos_token, "vlan-tci"); +cmdline_parse_token_num_t cmd_set_mplsogre_encap_vlan_value = + TOKEN_NUM_INITIALIZER(struct cmd_set_mplsogre_encap_result, tci, + UINT16); +cmdline_parse_token_string_t cmd_set_mplsogre_encap_eth_src = + TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, + pos_token, "eth-src"); +cmdline_parse_token_etheraddr_t cmd_set_mplsogre_encap_eth_src_value = + TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_mplsogre_encap_result, + eth_src); +cmdline_parse_token_string_t cmd_set_mplsogre_encap_eth_dst = + TOKEN_STRING_INITIALIZER(struct cmd_set_mplsogre_encap_result, + pos_token, "eth-dst"); +cmdline_parse_token_etheraddr_t cmd_set_mplsogre_encap_eth_dst_value = + TOKEN_ETHERADDR_INITIALIZER(struct cmd_set_mplsogre_encap_result, + eth_dst); + +static void cmd_set_mplsogre_encap_parsed(void *parsed_result, + __attribute__((unused)) struct cmdline *cl, + __attribute__((unused)) void *data) +{ + struct cmd_set_mplsogre_encap_result *res = parsed_result; + union { + uint32_t mplsogre_label; + uint8_t label[3]; + } id = { + .mplsogre_label = + rte_cpu_to_be_32(res->label) & RTE_BE32(0x00ffffff), + }; + + if (strcmp(res->mplsogre, "mplsogre_encap") == 0) + mplsogre_encap_conf.select_vlan = 0; + else if (strcmp(res->mplsogre, "mplsogre_encap-with-vlan") == 0) + mplsogre_encap_conf.select_vlan = 1; + if (strcmp(res->ip_version, "ipv4") == 0) + mplsogre_encap_conf.select_ipv4 = 1; + else if (strcmp(res->ip_version, "ipv6") == 0) + mplsogre_encap_conf.select_ipv4 = 0; + else + return; + rte_memcpy(mplsogre_encap_conf.label, &id.label[1], 3); + if (mplsogre_encap_conf.select_ipv4) { + IPV4_ADDR_TO_UINT(res->ip_src, mplsogre_encap_conf.ipv4_src); + IPV4_ADDR_TO_UINT(res->ip_dst, mplsogre_encap_conf.ipv4_dst); + } else { + IPV6_ADDR_TO_ARRAY(res->ip_src, mplsogre_encap_conf.ipv6_src); + IPV6_ADDR_TO_ARRAY(res->ip_dst, mplsogre_encap_conf.ipv6_dst); + } + if (mplsogre_encap_conf.select_vlan) + mplsogre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci); + rte_memcpy(mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes, + ETHER_ADDR_LEN); + rte_memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes, + ETHER_ADDR_LEN); +} + +cmdline_parse_inst_t cmd_set_mplsogre_encap = { + .f = cmd_set_mplsogre_encap_parsed, + .data = NULL, + .help_str = "set mplsogre_encap ip-version ipv4|ipv6 label