From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0079.outbound.protection.outlook.com [104.47.37.79]) by dpdk.org (Postfix) with ESMTP id 812E5CF3 for ; Sun, 22 Apr 2018 22:59:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KfPKexsviRDPHYe+ciBvfBObnqnieDRgXw56TKuAsxo=; b=YqZ7QrQc7WamX23sDHFHiBW1eR+N5l7jxU2yeq1W+10q8Gmgq1uVVtRuJYs+JreWGCgENeMrgcx4V8QenPZj1L203heZHbXtMHRYIGVtplBk/rVOA4lsLVlGoIpePi+rgEQfvJJRRwFLXHWXugYXNtKaCduUNucH5S04k4w4DXA= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=cavium.com; Received: from cavium.com (198.186.0.2) by MWHPR0701MB3676.namprd07.prod.outlook.com (2603:10b6:301:7e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Sun, 22 Apr 2018 20:59:35 +0000 From: Rasesh Mody To: wenzhuo.lu@intel.com Cc: Shahed Shaikh , dev@dpdk.org, Dept-EngDPDKDev@cavium.com, Rasesh Mody Date: Sun, 22 Apr 2018 13:59:24 -0700 Message-Id: <1524430764-3160-1-git-send-email-rasesh.mody@cavium.com> X-Mailer: git-send-email 1.7.10.3 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [198.186.0.2] X-ClientProxiedBy: MWHPR2001CA0003.namprd20.prod.outlook.com (2603:10b6:301:15::13) To MWHPR0701MB3676.namprd07.prod.outlook.com (2603:10b6:301:7e::16) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR0701MB3676; X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3676; 3:Sp2xyyXmMipVmnE3smrnusVlrH1AdNOGDz3qMQ1e6mZD2PpHVWBiY3OwQUdREThtqeJQgoBTFEx13Di1TBECiFax57ZhiYTYM3UgzTyDoE+lybAqKpj6l+M4Sse8/ma8IoRum6RQgRL4zvfNFehFRkVnnQ4ILRbpKWzMxNEKowPQ0svTaZJyzO4DIIlI6KfysCQLVi8h2KXdcLAr5uGw3RtfTcQ7lxN1jfRleOFC7Yy4F6gw924BaJ+f7jtHs7Wi; 25:C2JnAG0mdv+BoNdMRkod4mW4wQUwjbMoZTM+LziNwBySCiFNZgys2th/5thZkxE0/DwawFVsPGp6eRfNPn/ZBsf53cEIwy50jOcRuIf6gB+aeqGmx+gyo7qOHozktq4T9sfbigyiXNy0I02UoA1IfOfbZEEU3S/mXmh+iVNaplvTeh8CbH+/f9kCRwYyHceqvxuDUC6XcDL8klZnz2YGSQ4DG9EJnSnnEE/z85aefEAUhPMLpibuAulqCpWoWNVKcPr2YWyTnzbjh3mzMLj9oBhUpwItO1o+dwwp68r96QfdIS9bVzc2SZYqMhOkpFddB39uwXHK1fEWaJS1fexetQ==; 31:HOtGXU4BS24JaiMo78skJKmCmPAq+eg3tGRY0lHiChxQuWH2W6/m6JQ/Onjaw0bTItTuAXBqcuFIpNY4r1jtlWv/KRjiV/xVfIDYU2EIQCgAgWW55EjQYhP8odxqlBUjMGaVn+j2naE+Bj1QSHu/mv3hMSc5aYGfnOeIIRDVHwoSSBvPAG9Tl9HiuWIhfQqK14wTQygyFbyRgLxQFXPkYKOMO7P3/+VtThfOHxXCmpg= X-MS-TrafficTypeDiagnostic: MWHPR0701MB3676: X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3676; 20:ZlbBZV1e10m8kDBsD1pg+/gscAZ5cxR0PP53FPIjQvoBaGB8U5Z/t3wUo+k6pZ42iUkf994252SZ0+S20/OEe44I4u8UfJI53oZgaiw2lDMormk8oPmCs/y0vSOgvY2I5dXFBrUBzxZnd/TB32hp+mMceFparXoM+ocr1TSg80MITmMRd1PVTAzyjXlb8qxpFYGs+IXoQvjOhevk+AXeJ6NPPJr0HVDeKw85BCAMbH2GgYN0dMRgLKzsIO3w55t951eGGaCnmrNRDpGE2bVLXUqR1jmnbH2G1ntjL2RB3OHl1bxjQ9Dp8DA+UVq/QEGWG6eJhlEyC0SdKqiVOfN5HeimPiLDcv2koa1BKtU075WI03KcG3OWqFuGzdi841KdnDYJ27Fkscqqdw8P1nXqTeYwwRufZf3s65PzajIVkQnelDW20wM3DRq/tOvioCfdr4diXi9jrKGOHZhpDQs7IPyQdXx9ml25oQ3srI43v8GAW710bykGgjo4QPEkoEWO; 4:j4A27mHsJvNb2MC6BiVUWmntXKKetAuxSum8x9y6WyJR2zHTimbMgFwXKuGvkHENpcVfsHuU12NtXEZ5XUfVmssU1MiHQC01UjAQKzjy6vGaWAZuYkh7VmjePFpfv1wsKnf+0SV2MOzptAMbiUyDe/LVP0FuGGMuGCEu0UyeVyHqYDy3dWP8yy9ACWJt8uxnE6veNnmZ2PLZlUNT93B8CudY74pix4pZtBIOGezYhNH+muSno4BECdRct/gFfLw8Pt5UPB5btgcu9GAoN/FrsQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231232)(944501410)(52105095)(3002001)(10201501046)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:MWHPR0701MB3676; BCL:0; PCL:0; RULEID:; SRVR:MWHPR0701MB3676; X-Forefront-PRVS: 0650714AAA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39380400002)(366004)(39850400004)(376002)(396003)(2616005)(956004)(476003)(44832011)(50226002)(26005)(47776003)(66066001)(7736002)(316002)(16586007)(54906003)(6666003)(6916009)(4720700003)(8676002)(8936002)(36756003)(81166006)(6116002)(3846002)(4326008)(86362001)(5660300001)(2906002)(2361001)(72206003)(25786009)(478600001)(2351001)(53936002)(386003)(50466002)(52116002)(7696005)(16526019)(186003)(55016002)(1857600001)(59450400001)(48376002)(305945005)(107886003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR0701MB3676; H:cavium.com; FPR:; SPF:None; LANG:en; MLV:sfv; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR0701MB3676; 23:MLnEXLkEsb5HKlXITLqshyov0yrY6U97bRlAiq/?= =?us-ascii?Q?TKwsErNW9uH6K4xzZQRfq3dnQYUorn/AWNOmxydxczTBo4PASGw9wf0iH+oQ?= =?us-ascii?Q?oOgUfAn8JlKIxVCagWI6Bnv4E+kyMrAHZsFCw3zTLOkJZVhjLxYWVR0pL1Oh?= =?us-ascii?Q?4yTB8PO1POmZibiJzU+AvfKFPneT3DchAU5E8vbzwhyKOZbv9rStQTIZXgK9?= =?us-ascii?Q?oUo+VWpfXr9gk8GGWY/8hevHYpS2rvmoxu7swgDb3i+bJ7gKtaD3LP9o6SfD?= =?us-ascii?Q?LL9w6EAdWwv67MLLXQuJGfUgtUkjWw94L2NK4srlHl7rZScmT63xfWcatJJA?= =?us-ascii?Q?zn9qV5DD2lNf8XWqtQvOXjD5tRTQZ4OSlZNgyi113HR8joWngAOjduQ76TPY?= =?us-ascii?Q?ycDL7SXd6yAIEtGlrYafP8LAbLHTNR9M+hB0gAF9T2x+ingpHEM98wCvwM6O?= =?us-ascii?Q?A/2+XbSWYXS1srxI0JhTGLKAgvIm0UWJRbqogq6T9fQEV6g1OS1QbqM50RQV?= =?us-ascii?Q?c9yOCXYAD5KqA9gtgGF4fy+4E2nRBDaTc7OX2FQhnpSh5etSXRQ2WoOO4hEJ?= =?us-ascii?Q?ErwThU/7lPzvoB39P7lSdd+xPsCXudt89OPv2pKQeV4/Z9sELe9p/8nWXwlK?= =?us-ascii?Q?8LqQy3MxhXKzVoCLQqrL2IsfCpdmMIfVIftzjRc9oUTKCyXWIAujjI99lVHA?= =?us-ascii?Q?xaQfYUaHkaEKkKfvLd9cDzOWBUlmcNvtn9PpjxqAq9foygighFwHlLrKxuTd?= =?us-ascii?Q?4MniJaa/r0nZwiir8brCAWyO/4czAcPExMxxovqmdfwxZWqlUPIiitBOdc/O?= =?us-ascii?Q?+nMPqsl1ojaT0D5nkNoyW/Zqk2EgEZ9T0x2fUbm4oTFT8ZgXE+l2EiqfYzc7?= =?us-ascii?Q?6/d9rnAB44XNThzZfa+JrapQp8PWA5a7g5rxuSxuoONhqnYIpV5svbNc3rYi?= =?us-ascii?Q?agSCWKs4l2B4A40qyCwyGzrRiyemYXcWmJJjTAAX2AH0Wi5+U60bS1JxuVAk?= =?us-ascii?Q?6QUg9MoPTqrk48i0LfsCSTHCeQFObK1P1i+MR7zIh9d2FwTgI7Q9ffT2vUED?= =?us-ascii?Q?q3BWPYhdshJA7j2xH0ePbjLJ8qQ0pj/7QztoPsA1hR5XtgikIYbHb/1YS07m?= =?us-ascii?Q?i4BdmVSvRXAc=3D?= X-Microsoft-Antispam-Message-Info: eRYu2rPL7R9LQc9WxLUJaN8dNedBPl/HRxTKSscVuE3hLoQOxKgT3AAJo2gt4ZNj4Aft2nzSQ9lMNC7g4GhpNjPdLO7peeu8pdBmXqSS3kBdtZVmiLS0d4ksoZN+m1RFlIq45RVRhW5MYuVLShip9+ezjDHZROg7W34bp9stphO1wg7RM4OAdVHNCSNku++a X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3676; 6:A7H/fNkYAISE5n3kzVjwqSQwr/M4ZXbUxennw9P4hrUAhprz7hD3dSHfOpMCzrU3vEkgVG+5ZbPS7iK5a6JC77Tz2KJHwdFcjlrVZF+a2SQKTRcAN4R3j5FJhsrqQhD8dqkHGWsvbbkVZhzR9QGfZYXLrTnFT8hrtB0mqwl1T4Y3VLBq1FpC9nltXD8RYmEq0akUwZCV3ZNd2vsr1moxfoimk3I4RV8uJn76Nimmz0iAbXHYtdbAfRtp4aH5lOK0KvfMnCuYC9DfW7DTxoNeO8Olallfe1fJUgLQdflKZ8nPvNOl6x4Iqjigy7dPAtCrfnwPMNG6T+rLL6w8qE59hNbI0FnQOFKG+V+lpCFiaqiKhLKcsttN5DKruQqZxSFoqzgajRi0WiWOiHHMhizKZgLPYZjNjZurDxVGDSPw7fiBuWgXSB78vCB2KWg6HDYzo5fEO1I6lvPEoscrGNYhfA==; 5:K82XqTVUNIPwEoLGDF0n9PEPdewIlkQ3x9CbfmUMiPX9iVD49755l5OA143L3kmLmOd2ltcQFFt/Y5xHYUhAC4p9/Cbpj6fM1ILivmdFJTe71GI3s0U+r5mUbzVLwiWfotuC1mvv+1ZcpwYxdK4y+J+G2lggP4imIlPXLCfTkJs=; 24:RQQl10vVPeGjPk4o3WCR3LpYNoQ03JC/PGFmFBQt/JtEv2dDsRk1sw6jE7gwAVzb79eGNlMImyLIu5yylgIVP1RNz0jsYME1WraWetBEIII= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3676; 7:0v5W1N3TEWQMPVXQLF6vgUHS1vM9lRVoM7HnSEbrVQMDqGxPK8YBAM1zOlxSqKpWV4Gg5swc+t6ZggA3xKs37FwOjKmOEW8CLvVHgMw1TWfX+NrNmJcx3gSMHadSY2OShG+z4z2dj9q+KWMH1Euuxqn7Tm+y20sy5o/FCtYRzHoPyUTjcziYCCeNygqJwqjgs7o2rkUq2/eFiMUNLZdnA9HymM9GKoA4S3u2lTBrFANXSw5Q8laYIOArJnsxCcu5 X-MS-Office365-Filtering-Correlation-Id: a412513c-e26f-4601-11d6-08d5a893f4b9 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2018 20:59:35.9877 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a412513c-e26f-4601-11d6-08d5a893f4b9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0701MB3676 Subject: [dpdk-dev] [PATCH] app/testpmd: add option to configure udp tunnel port 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: Sun, 22 Apr 2018 20:59:39 -0000 From: Shahed Shaikh This change adds a new option to "port config" command to add udp tunnel port for VXLAN and GENEVE tunneling protocols. This command can be extended for other tunneling protocols listed in "enum rte_eth_tunnel_type" as and when needed. usage: port config udp_tunnel_port add|rm vxlan|geneve Signed-off-by: Shahed Shaikh Signed-off-by: Rasesh Mody --- app/test-pmd/cmdline.c | 87 +++++++++++++++++++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 6 ++ 2 files changed, 93 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index d9b1435..fb2a42f 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -873,6 +873,9 @@ static void cmd_help_long_parsed(void *parsed_result, "port config (port_id) pctype (pctype_id) hash_inset|" "fdir_inset|fdir_flx_inset clear all" " Clear RSS|FDIR|FDIR_FLX input set completely for some pctype\n\n" + + "port config (port_id) udp_tunnel_port add|rm vxlan|geneve (udp_port)\n\n" + " Add/remove UDP tunnel port for tunneling offload\n\n" ); } @@ -8413,6 +8416,89 @@ struct cmd_tunnel_udp_config { }, }; +struct cmd_config_tunnel_udp_port { + cmdline_fixed_string_t port; + cmdline_fixed_string_t config; + portid_t port_id; + cmdline_fixed_string_t udp_tunnel_port; + cmdline_fixed_string_t action; + cmdline_fixed_string_t tunnel_type; + uint16_t udp_port; +}; + +static void +cmd_cfg_tunnel_udp_port_parsed(void *parsed_result, + __attribute__((unused)) struct cmdline *cl, + __attribute__((unused)) void *data) +{ + struct cmd_config_tunnel_udp_port *res = parsed_result; + struct rte_eth_udp_tunnel tunnel_udp; + int ret = 0; + + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) + return; + + tunnel_udp.udp_port = res->udp_port; + + if (!strcmp(res->tunnel_type, "vxlan")) { + tunnel_udp.prot_type = RTE_TUNNEL_TYPE_VXLAN; + } else if (!strcmp(res->tunnel_type, "geneve")) { + tunnel_udp.prot_type = RTE_TUNNEL_TYPE_GENEVE; + } else { + printf("Invalid tunnel type\n"); + return; + } + + if (!strcmp(res->action, "add")) + ret = rte_eth_dev_udp_tunnel_port_add(res->port_id, + &tunnel_udp); + else + ret = rte_eth_dev_udp_tunnel_port_delete(res->port_id, + &tunnel_udp); + + if (ret < 0) + printf("udp tunneling port add error: (%s)\n", strerror(-ret)); +} + +cmdline_parse_token_string_t cmd_config_tunnel_udp_port_port = + TOKEN_STRING_INITIALIZER(struct cmd_config_tunnel_udp_port, port, + "port"); +cmdline_parse_token_string_t cmd_config_tunnel_udp_port_config = + TOKEN_STRING_INITIALIZER(struct cmd_config_tunnel_udp_port, config, + "config"); +cmdline_parse_token_num_t cmd_config_tunnel_udp_port_port_id = + TOKEN_NUM_INITIALIZER(struct cmd_config_tunnel_udp_port, port_id, + UINT16); +cmdline_parse_token_string_t cmd_config_tunnel_udp_port_tunnel_port = + TOKEN_STRING_INITIALIZER(struct cmd_config_tunnel_udp_port, + udp_tunnel_port, + "udp_tunnel_port"); +cmdline_parse_token_string_t cmd_config_tunnel_udp_port_action = + TOKEN_STRING_INITIALIZER(struct cmd_config_tunnel_udp_port, action, + "add#rm"); +cmdline_parse_token_string_t cmd_config_tunnel_udp_port_tunnel_type = + TOKEN_STRING_INITIALIZER(struct cmd_config_tunnel_udp_port, tunnel_type, + "vxlan#geneve"); +cmdline_parse_token_num_t cmd_config_tunnel_udp_port_value = + TOKEN_NUM_INITIALIZER(struct cmd_config_tunnel_udp_port, udp_port, + UINT16); + +cmdline_parse_inst_t cmd_cfg_tunnel_udp_port = { + .f = cmd_cfg_tunnel_udp_port_parsed, + .data = NULL, + .help_str = "port config udp_tunnel_port add|rm vxlan|geneve ", + .tokens = { + (void *)&cmd_config_tunnel_udp_port_port, + (void *)&cmd_config_tunnel_udp_port_config, + (void *)&cmd_config_tunnel_udp_port_port_id, + (void *)&cmd_config_tunnel_udp_port_tunnel_port, + (void *)&cmd_config_tunnel_udp_port_action, + (void *)&cmd_config_tunnel_udp_port_tunnel_type, + (void *)&cmd_config_tunnel_udp_port_value, + NULL, + }, +}; + /* *** GLOBAL CONFIG *** */ struct cmd_global_config_result { cmdline_fixed_string_t cmd; @@ -16369,6 +16455,7 @@ struct cmd_cmdfile_result { (cmdline_parse_inst_t *)&cmd_del_port_tm_node, (cmdline_parse_inst_t *)&cmd_set_port_tm_node_parent, (cmdline_parse_inst_t *)&cmd_port_tm_hierarchy_commit, + (cmdline_parse_inst_t *)&cmd_cfg_tunnel_udp_port, NULL, }; diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index cb6f201..6e84f7a 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1856,6 +1856,12 @@ where: * ``pctype_id``: hardware packet classification types. * ``field_idx``: hardware field index. +port config udp_tunnel_port +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Add/remove UDP tunnel port for VXLAN/GENEVE tunneling protocols:: + testpmd> port config (port_id) udp_tunnel_port add|rm vxlan|geneve (udp_port) + Link Bonding Functions ---------------------- -- 1.7.10.3