From patchwork Thu Jun 29 16:20:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Kulasek X-Patchwork-Id: 25998 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 987312C2A; Thu, 29 Jun 2017 18:25:04 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id BCE1F2904 for ; Thu, 29 Jun 2017 18:25:03 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 29 Jun 2017 09:25:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.40,281,1496127600"; d="scan'208"; a="1166222888" Received: from unknown (HELO Sent) ([10.103.103.85]) by fmsmga001.fm.intel.com with SMTP; 29 Jun 2017 09:25:00 -0700 Received: by Sent (sSMTP sendmail emulation); Thu, 29 Jun 2017 18:23:35 +0200 From: Tomasz Kulasek To: dev@dpdk.org Date: Thu, 29 Jun 2017 18:20:22 +0200 Message-Id: <20170629162022.9984-3-tomaszx.kulasek@intel.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170629162022.9984-1-tomaszx.kulasek@intel.com> References: <1495884464-3548-1-git-send-email-tomaszx.kulasek@intel.com> <20170629162022.9984-1-tomaszx.kulasek@intel.com> Subject: [dpdk-dev] [PATCH v2 2/2] test-pmd: add set bonding slow_queue hw/sw 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" This patch adds new command: set bonding slow_queue [sw|hw] "set bonding slow_queue hw" sets hardware management of slow packets and chooses simplified paths for tx/rx bursts. "set bonding slow_queue sw" turns back to the software handling of slow packets. This option is default. Example: testpmd> create bonded device 4 0 testpmd> add bonding slave 0 testpmd> add bonding slave 1 testpmd> set bonding slow_queue [sw|hw] testpmd> port start Signed-off-by: Tomasz Kulasek --- v2 changes: - changed name of rte_eth_bond_8023ad_slow_queue_enable/disable to rte_eth_bond_8023ad_slow_pkt_hw_filter_enable/disable, - added "set bonding slow_queue [sw|hw]" description in documentation --- app/test-pmd/cmdline.c | 75 +++++++++++++++++++++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 +++ 2 files changed, 83 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 632d6f0..194d986 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -87,6 +87,7 @@ #include #ifdef RTE_LIBRTE_PMD_BOND #include +#include #endif #ifdef RTE_LIBRTE_IXGBE_PMD #include @@ -4300,6 +4301,79 @@ static void cmd_set_bonding_mode_parsed(void *parsed_result, } }; +/* *** SET BONDING SLOW_QUEUE SW/HW *** */ +struct cmd_set_bonding_slow_queue_result { + cmdline_fixed_string_t set; + cmdline_fixed_string_t bonding; + cmdline_fixed_string_t slow_queue; + uint8_t port_id; + cmdline_fixed_string_t mode; +}; + +static void cmd_set_bonding_slow_queue_parsed(void *parsed_result, + __attribute__((unused)) struct cmdline *cl, + __attribute__((unused)) void *data) +{ + struct cmd_set_bonding_slow_queue_result *res = parsed_result; + portid_t port_id = res->port_id; + struct rte_port *port; + + port = &ports[port_id]; + + /** Check if the port is not started **/ + if (port->port_status != RTE_PORT_STOPPED) { + printf("Please stop port %d first\n", port_id); + return; + } + + if (!strcmp(res->mode, "hw")) { + if (rte_eth_bond_8023ad_slow_pkt_hw_filter_enable(port_id) == 0) + printf("Hardware slow queue enabled\n"); + else + printf("Enabling hardware slow queue on port %d " + "failed\n", port_id); + } else if (!strcmp(res->mode, "sw")) { + if (rte_eth_bond_8023ad_slow_pkt_hw_filter_disable(port_id) + == 0) + printf("Software slow queue enabled\n"); + else + printf("Enabling software slow queue on port %d " + "failed\n", port_id); + } +} + +cmdline_parse_token_string_t cmd_setbonding_slow_queue_set = +TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_slow_queue_result, + set, "set"); +cmdline_parse_token_string_t cmd_setbonding_slow_queue_bonding = +TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_slow_queue_result, + bonding, "bonding"); +cmdline_parse_token_string_t cmd_setbonding_slow_queue_slow_queue = +TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_slow_queue_result, + slow_queue, "slow_queue"); +cmdline_parse_token_num_t cmd_setbonding_slow_queue_port = +TOKEN_NUM_INITIALIZER(struct cmd_set_bonding_slow_queue_result, + port_id, UINT8); +cmdline_parse_token_string_t cmd_setbonding_slow_queue_mode = +TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_slow_queue_result, + mode, "sw#hw"); + +cmdline_parse_inst_t cmd_set_slow_queue = { + .f = cmd_set_bonding_slow_queue_parsed, + .help_str = "set bonding slow_queue " + "sw|hw: " + "Set the bonding slow queue acceleration for port_id", + .data = NULL, + .tokens = { + (void *)&cmd_setbonding_slow_queue_set, + (void *)&cmd_setbonding_slow_queue_bonding, + (void *)&cmd_setbonding_slow_queue_slow_queue, + (void *)&cmd_setbonding_slow_queue_port, + (void *)&cmd_setbonding_slow_queue_mode, + NULL + } +}; + /* *** SET BALANCE XMIT POLICY *** */ struct cmd_set_bonding_balance_xmit_policy_result { cmdline_fixed_string_t set; @@ -13846,6 +13920,7 @@ struct cmd_cmdfile_result { (cmdline_parse_inst_t *) &cmd_set_bond_mac_addr, (cmdline_parse_inst_t *) &cmd_set_balance_xmit_policy, (cmdline_parse_inst_t *) &cmd_set_bond_mon_period, + (cmdline_parse_inst_t *) &cmd_set_slow_queue, #endif (cmdline_parse_inst_t *)&cmd_vlan_offload, (cmdline_parse_inst_t *)&cmd_vlan_tpid, diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 18ee8a3..3da2a38 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1759,6 +1759,14 @@ For example, to set the link status monitoring polling period of bonded device ( testpmd> set bonding mon_period 5 150 +set bonding slow_queue +~~~~~~~~~~~~~~~~~~~~~~ + +Set software or hardware slow packet processing in mode 4. + + testpmd> set bonding slow_queue (port_id) (sw|hw) + + show bonding config ~~~~~~~~~~~~~~~~~~~