From patchwork Sat May 27 11:27:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Kulasek X-Patchwork-Id: 24791 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 15CB32C36; Sat, 27 May 2017 13:32:11 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 8C8D728EE for ; Sat, 27 May 2017 13:32:09 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 May 2017 04:32:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.38,402,1491289200"; d="scan'208"; a="1153542069" Received: from unknown (HELO Sent) ([10.103.102.185]) by fmsmga001.fm.intel.com with SMTP; 27 May 2017 04:32:06 -0700 Received: by Sent (sSMTP sendmail emulation); Sat, 27 May 2017 13:30:41 +0200 From: Tomasz Kulasek To: dev@dpdk.org Cc: declan.doherty@intel.com Date: Sat, 27 May 2017 13:27:44 +0200 Message-Id: <1495884464-3548-3-git-send-email-tomaszx.kulasek@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1495884464-3548-1-git-send-email-tomaszx.kulasek@intel.com> References: <1495884464-3548-1-git-send-email-tomaszx.kulasek@intel.com> Subject: [dpdk-dev] [PATCH 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. Signed-off-by: Tomasz Kulasek --- app/test-pmd/cmdline.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 0afac68..11fa4a5 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 @@ -4279,6 +4280,62 @@ 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; + + if (!strcmp(res->mode, "hw")) { + rte_eth_bond_8023ad_slow_queue_enable(port_id); + printf("Hardware slow queue enabled\n"); + } else if (!strcmp(res->mode, "sw")) { + rte_eth_bond_8023ad_slow_queue_disable(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; @@ -13613,6 +13670,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,