From patchwork Wed May 9 12:47:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wisam Jaddo X-Patchwork-Id: 39598 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F41051B6A7; Wed, 9 May 2018 14:47:58 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0049.outbound.protection.outlook.com [104.47.2.49]) by dpdk.org (Postfix) with ESMTP id 9D9891B664 for ; Wed, 9 May 2018 14:47:45 +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; bh=5Jt/hYCOyn+/nm11Nkew3Uq4PQcaJQQPZtWnmL6hnyE=; b=gsXM+uCKjDH+uMER/cEpyCE5G0wnx6DdPzPaAcSvt3DVnSTL+BkBYd0fO0YxTut1h664WebjecfybyYlrappQEWWOFx2sla4VvQ4FFpe0R2QcBILZbGqhHNav0gG0injIo1u93F3a+x+qZpskq4dN9pJ3QF2I9aKWS+PoHsvH8E= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=wisamm@mellanox.com; Received: from mellanox.com (37.142.13.130) by DB6PR05MB3432.eurprd05.prod.outlook.com (2603:10a6:6:1e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.19; Wed, 9 May 2018 12:47:42 +0000 From: Wisam Jaddo To: jingjing.wu@intel.com, wenzhuo.lu@intel.com, thomas@monjalon.net Cc: rasland@mellanox.com, dev@dpdk.org, shahafs@mellanox.com, wisamm@mellanox.com Date: Wed, 9 May 2018 15:47:18 +0300 Message-Id: <1525870039-11261-2-git-send-email-wisamm@mellanox.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525870039-11261-1-git-send-email-wisamm@mellanox.com> References: <1525870039-11261-1-git-send-email-wisamm@mellanox.com> MIME-Version: 1.0 X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0101CA0056.eurprd01.prod.exchangelabs.com (2603:10a6:800:1f::24) To DB6PR05MB3432.eurprd05.prod.outlook.com (2603:10a6:6:1e::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DB6PR05MB3432; X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3432; 3:HyE37/CwnSIDM3KrdMD4qziX/I5e/1zwafP16jciekdNlJuh8666mSmXQWHxPRRyB38pqWAQ/xVScDY4hoGzXL40PNdN4k7mCD0wTrMJsagYZdXTXRwx6nm1K/arIxforNlpu1NcmojQN5SDiEJZ+mtUWAObPcEbsE0mgZvqlNt20MF6Phj0EnaYgJcB7WuhlgWdlDf5OMdGtkFBqUVavWf52IGDz0+izG8SMbHg4/VESjwTSKKbhaNQPA3yLGos; 25:YtUjWlctGWXUmYd+lU6/shzGaNTiMBPAdQKFGxhrlipotaicMQxIFcC1zhn8y9bve9dcVEB7VbRlJMGnqzbeJcn0n8hWMKwcMWhsw47zY7hJAyEN6EgeRx6+rZ5/TfzD5sZgcIbkI3pl2L0Ra4ArdFtxn9T6TEXaoGSxmHf1XsqyH5qLtU79s2PfYrOdZDsPPG1kgnfhk2USi4Rk8vWu9z/PRHA2f0WJlk3wKwB0BEEDQ5dhGEBoNG5gPGaQ0xd9iExliC/pNxdVPhuCGwo8diQP6geYk/ULBpQpw95l/EBSFSIk40b4V3LtW234eFYRcIISpou8bAfahTieou4ocQ==; 31:Zj5vpija4bxY9odCNYlY8mYZPQswnr2qAW1oUqjsRuUbPR+T3KqoVXwJ5+jO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FOPoQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:DB6PR05MB3432; BCL:0; PCL:0; RULEID:; SRVR:DB6PR05MB3432; X-Forefront-PRVS: 0667289FF8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(39860400002)(39380400002)(396003)(199004)(189003)(6666003)(8676002)(59450400001)(33026002)(5660300001)(16526019)(26005)(3846002)(478600001)(107886003)(186003)(386003)(316002)(4326008)(6116002)(86362001)(16586007)(106356001)(305945005)(11346002)(48376002)(53936002)(446003)(476003)(7736002)(36756003)(25786009)(52116002)(81156014)(21086003)(7696005)(68736007)(2906002)(66066001)(105586002)(51416003)(55016002)(81166006)(2616005)(486006)(47776003)(69596002)(50226002)(956004)(97736004)(50466002)(8936002)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR05MB3432; 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; DB6PR05MB3432; 23:+1TRxb2MYInxC2HOBf3T79pxB4V1CJBZOZUMKdU6b?= 2A+hY2LYLjNr+/WIU45yDHjiKz96XhMTiCc61UZarL2zHn40Hh951JO1Px5V/jTzzWnZWx/VzrbadKXoBE91/tLjTO+LcnZrEf1lHdo/K9amN55C+IFuflXyI3R0ZiM4r491KS7FGI32K/JvpOh345HEZK9M7ER51ovpS7JQlQf55lMWK2+O2Lk8oo4VcTE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WNv/Z/R3IM/f9/7tAQZ/9apvh8NcP+p3Ng+XgYHZ25xRwy+S4/UQxqBug9BKVvSmxV8Yb4n9bSbwRNU32dF3PtLZlwPmVRv+inGbDHcrufhUmgnAYqCINlCJdmxRZZL0ZVl9T2Pc8txf/vbJLkbcS9kYMqbuuL1NR5bR0pXIeTvhWLyeClOTu6S X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3432; 6:B74qfy716P0Weyfp2xH8ZOEYMCfn532loNg3L9m5KKWI9m3xVVz43wJa2PkuN7JDS0DePVq6u8LQQdKrN8COmIMb8aSabvlYWJgoXEnCCLrkCbuI6q1UpjUtLmCQxeQdc7uc5pmQsRzWN++BLrMw4VPg48hKwmzzMwyMiCA83evFpIOfVJ326bIEOyRrB0d4+lIZaI5w8P82ua0JT4xItG7buDtOfp99Kxfq/u3jTNqf+PhF+1mRDA1Bl4VifgjXq8vcqiqWryW45sAH1jAZbLCUUdKm/b1aLymG45qzx/qtwCcNgKfsQl6eo8S3ALoOLyPiXTuMQbwkMiVLd+AvFAjQUrlWVeNvZPg6mWUG5L2DRj9ES7z2PDObhYgdZjD8QmVrIQvNH3Y9BTvi7RXTdt/+NKBKA90S/W1lAqlu1m/CkAPSFx9mtzvfMkIQc1sT+a4gEQohIAbQHQr65k+gxg==; 5:Sh+Uf9thCGuiVZjsnsn2ZFm9ca8woJTOkzfFw/DCSx93wN9ePw3JIklkm4JVWHOBVIodycqLUMK6GVyvA1zI/3KjfxvZmW4kbOimG1wq1R85oZwTZaFVyg2nvTNc4yY04499F7v0ygBeqfQtX1rXlgf1HBF5YEgmEUpT36jlQW8=; 24:ePQQEpxe1ggrZ6Jv5AdAYzYTX1temxIPHKjxUNj2mPx4qgiJzlswjDRqbsmpsulYCqOUqv1hkjfc1YEeuedhI2ipO623neKINSnkknLQV7g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3432; 7:92nZrowxhCoqm8TGhb2xtwKzvmhykxSeeBU/dM7t+LaZagOsc+4C9WO9KJZyvkb8Dw15h9IVR9NNS10yyxLrrh6ultq3pPNR7XCyAhDFEf/tkN+Q4AgfRkWQO3oYx7FRIcF/ZAulpcPZ/43/XolPlf2bHB5t88gqhsz0Yyp1mDWtdUgYcWgh3+SONbf34QzFMhXE/WBFAzllucCkZRPlzYtDbXDGo8GNavFhLJADFlPQcCM1bG+ytq7dAghWp2H5 X-MS-Office365-Filtering-Correlation-Id: e2cf6152-e6be-4782-37d2-08d5b5ab0f43 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2018 12:47:42.9610 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e2cf6152-e6be-4782-37d2-08d5b5ab0f43 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR05MB3432 Subject: [dpdk-dev] [PATCH v3 1/2] app/testpmd: add custom topology command 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" Set custom topology for forwading packets by making the given two ports as pair, in custom topology the active ports will be the defiend in custum-topo only. This command will be useful in testing, when special topology is needed. usage: testpmd> set custom-topo (port_id_1) (port_id_2) Signed-off-by: Wisam Jaddo --- app/test-pmd/cmdline.c | 49 +++++++++++++++++++++++++++++ app/test-pmd/config.c | 41 ++++++++++++++++++++++++ app/test-pmd/parameters.c | 6 ++-- app/test-pmd/testpmd.h | 8 ++++- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 +++++ 5 files changed, 109 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 9615670..9d48048 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -466,6 +466,9 @@ static void cmd_help_long_parsed(void *parsed_result, "set eth-peer (port_id) (peer_addr)\n" " set the peer address for certain port.\n\n" + "set custom-topo (port_id_1) (port_id_2)\n" + " set custom topo.\n\n" + "set port (port_id) uta (mac_address|all) (on|off)\n" " Add/Remove a or all unicast hash filter(s)" "from port X.\n\n" @@ -7649,6 +7652,51 @@ cmdline_parse_inst_t cmd_set_fwd_eth_peer = { }, }; +/* *** SET CUSTOM TOPO FOR CERTAIN PORT *** */ +struct cmd_custom_topo_result { + cmdline_fixed_string_t set; + cmdline_fixed_string_t custom_topo; + portid_t port_id_1; + portid_t port_id_2; +}; + +static void cmd_set_custom_topo_parsed(void *parsed_result, + __attribute__((unused)) struct cmdline *cl, + __attribute__((unused)) void *data) +{ + struct cmd_custom_topo_result *res = parsed_result; + + if (test_done == 0) { + printf("Please stop forwarding first\n"); + return; + } + if (!strcmp(res->custom_topo, "custom-topo")) { + set_custom_topo(res->port_id_1, res->port_id_2); + fwd_config_setup(); + } +} +cmdline_parse_token_string_t cmd_set_custom_topo_set = + TOKEN_STRING_INITIALIZER(struct cmd_custom_topo_result, set, "set"); +cmdline_parse_token_string_t cmd_set_custom_topo_custom_topo = + TOKEN_STRING_INITIALIZER(struct cmd_custom_topo_result, custom_topo, "custom-topo"); +cmdline_parse_token_num_t cmd_set_custom_topo_port_id_1 = + TOKEN_NUM_INITIALIZER(struct cmd_custom_topo_result, port_id_1, UINT16); +cmdline_parse_token_num_t cmd_set_custom_topo_port_id_2 = + TOKEN_NUM_INITIALIZER(struct cmd_custom_topo_result, port_id_2, UINT16); + +cmdline_parse_inst_t cmd_set_custom_topo = { + .f = cmd_set_custom_topo_parsed, + .data = NULL, + .help_str = "set custom-topo (port_id_1) (port_id_2)", + .tokens = { + (void *)&cmd_set_custom_topo_set, + (void *)&cmd_set_custom_topo_custom_topo, + (void *)&cmd_set_custom_topo_port_id_1, + (void *)&cmd_set_custom_topo_port_id_2, + NULL, + }, +}; + /* *** CONFIGURE QUEUE STATS COUNTER MAPPINGS *** */ struct cmd_set_qmap_result { cmdline_fixed_string_t set; @@ -16540,6 +16588,7 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_stop, (cmdline_parse_inst_t *)&cmd_mac_addr, (cmdline_parse_inst_t *)&cmd_set_fwd_eth_peer, + (cmdline_parse_inst_t *)&cmd_set_custom_topo, (cmdline_parse_inst_t *)&cmd_set_qmap, (cmdline_parse_inst_t *)&cmd_set_xstats_hide_zero, (cmdline_parse_inst_t *)&cmd_operate_port, diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 16fc481..23799ad 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2069,6 +2069,8 @@ fwd_topology_tx_port_get(portid_t rxp) return (rxp + 1) % cur_fwd_config.nb_fwd_ports; case PORT_TOPOLOGY_LOOP: return rxp; + case PORT_TOPOLOGY_CUSTOM: + return fwd_streams[rxp]->tx_port; } } @@ -2378,6 +2380,45 @@ set_fwd_eth_peer(portid_t port_id, char *peer_addr) new_peer_addr[c]; } +static void +print_ports_range(void) +{ + portid_t pid; + printf("Valid port range is ["); + RTE_ETH_FOREACH_DEV(pid) + printf(", %d", pid); + printf("]\n"); +} + +void +set_custom_topo(portid_t port_id_1, portid_t port_id_2) +{ + unsigned int portlist[RTE_MAX_ETHPORTS]; + unsigned int i; + unsigned int nb_pt = 0; + if (port_topology != PORT_TOPOLOGY_CUSTOM) { + printf("Please set the forward topology to custom first.\n"); + return; + } + if (port_id_is_invalid(port_id_1, ENABLED_WARN)) { + print_ports_range(); + return; + } + if (port_id_is_invalid(port_id_2, ENABLED_WARN)) { + print_ports_range(); + return; + } + fwd_streams[port_id_1]->tx_port = port_id_2; + fwd_streams[port_id_2]->tx_port = port_id_1; + fwd_ports[port_id_1] = port_id_1; + fwd_ports[port_id_2] = port_id_2; + + for (i = 0; i < RTE_MAX_ETHPORTS; i++) + if (fwd_ports[i] == i) + portlist[nb_pt++] = i; + set_fwd_ports_list(portlist, nb_pt); +} + int set_fwd_lcores_list(unsigned int *lcorelist, unsigned int nb_lc) { diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index aea8af8..0db411d 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -139,8 +139,8 @@ usage(char* progname) printf(" --enable-hw-vlan-extend: enable hardware vlan extend.\n"); printf(" --enable-drop-en: enable per queue packet drop.\n"); printf(" --disable-rss: disable rss.\n"); - printf(" --port-topology=N: set port topology (N: paired (default) or " - "chained).\n"); + printf(" --port-topology=N: set port topology (N: paired (default)" + "(loop), (custom) or (chained).\n"); printf(" --forward-mode=N: set forwarding mode (N: %s).\n", list_pkt_forwarding_modes()); printf(" --rss-ip: set RSS functions to IPv4/IPv6 only .\n"); @@ -920,6 +920,8 @@ launch_args_parse(int argc, char** argv) port_topology = PORT_TOPOLOGY_CHAINED; else if (!strcmp(optarg, "loop")) port_topology = PORT_TOPOLOGY_LOOP; + else if (!strcmp(optarg, "custom")) + port_topology = PORT_TOPOLOGY_CUSTOM; else rte_exit(EXIT_FAILURE, "port-topology %s invalid -" " must be: paired, chained or loop\n", diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 1af87b8..3250683 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -67,6 +67,7 @@ enum { PORT_TOPOLOGY_PAIRED, PORT_TOPOLOGY_CHAINED, PORT_TOPOLOGY_LOOP, + PORT_TOPOLOGY_CUSTOM, }; #ifdef RTE_TEST_PMD_RECORD_BURST_STATS @@ -363,6 +364,11 @@ extern uint8_t txring_numa[RTE_MAX_ETHPORTS]; extern uint8_t socket_num; /* + * Store the custom topo. + */ +portid_t fwd_ports[RTE_MAX_ETHPORTS]; + +/* * Configuration of logical cores: * nb_fwd_lcores <= nb_cfg_lcores <= nb_lcores */ @@ -598,7 +604,7 @@ void reconfig(portid_t new_port_id, unsigned socket_id); int init_fwd_streams(void); void set_fwd_eth_peer(portid_t port_id, char *peer_addr); - +void set_custom_topo(portid_t port_id_1, portid_t port_id_2); void port_mtu_set(portid_t port_id, uint16_t mtu); void port_reg_bit_display(portid_t port_id, uint32_t reg_off, uint8_t bit_pos); void port_reg_bit_set(portid_t port_id, uint32_t reg_off, uint8_t bit_pos, diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 013a405..5edf210 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1090,6 +1090,14 @@ Set the forwarding peer address for certain port:: This is equivalent to the ``--eth-peer`` command-line option. +set custom-topo +~~~~~~~~~~~~~~ + +Set custom topology for forwading packets by making the given two ports as pair. +In custom topology the active ports will be the defiend in custum-topo only:: + + testpmd> set custom-topo (port_id_1) (port_id_2) + set port-uta ~~~~~~~~~~~~