From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.217.80.70]) by dpdk.org (Postfix) with ESMTP id 2FA392C2A for ; Fri, 30 Jun 2017 09:59:04 +0200 (CEST) X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170630155047 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 30 Jun 2017 07:50:47 -0000 Received: (from root@localhost) by mse01.zte.com.cn id v5U7wu8t037841; Fri, 30 Jun 2017 15:58:56 +0800 (GMT-8) (envelope-from xie.rongqiang@zte.com.cn) Message-Id: <201706300758.v5U7wu8t037841@mse01.zte.com.cn> Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v5U7vaPh031830; Fri, 30 Jun 2017 15:57:36 +0800 (GMT-8) (envelope-from xie.rongqiang@zte.com.cn) Received: from localhost.localdomain.localdomain ([10.43.166.171]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017063015574195-2778034 ; Fri, 30 Jun 2017 15:57:41 +0800 From: RongQiang Xie To: jingjing.wu@intel.com Cc: dev@dpdk.org, RongQiang Xie Date: Fri, 30 Jun 2017 15:56:30 +0800 X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-06-30 15:57:42, Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-06-30 15:57:20, Serialize complete at 2017-06-30 15:57:20 X-MAIL: mse01.zte.com.cn v5U7wu8t037841 X-MSS: AUDITRELEASE@mse01.zte.com.cn X-HQIP: 127.0.0.1 Subject: [dpdk-dev] [PATCH] app/testpmd:add bond type description 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: Fri, 30 Jun 2017 07:59:06 -0000 In function cmd_show_bonding_config_parsed() used number represent the bond type,in order more detailed,add bond type description otherwise we may confused about the number type. And also,the primary port just use in mode active backup and tlb, so,when the mode is active backup or tlb show the primary port info may be more appropriate. Signed-off-by: RongQiang Xie --- app/test-pmd/cmdline.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index ff8ffd2..45845a4 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -4390,7 +4390,9 @@ static void cmd_show_bonding_config_parsed(void *parsed_result, printf("\tFailed to get bonding mode for port = %d\n", port_id); return; } else - printf("\tBonding mode: %d\n", bonding_mode); + printf("\tBonding mode: %d ", bonding_mode); + printf("[0:Round Robin, 1:Active Backup, 2:Balance, 3:Broadcast, "); + printf("\n\t\t\t4:802.3AD, 5:Adaptive TLB, 6:Adaptive Load Balancing]\n"); if (bonding_mode == BONDING_MODE_BALANCE) { int balance_xmit_policy; @@ -4454,12 +4456,15 @@ static void cmd_show_bonding_config_parsed(void *parsed_result, } - primary_id = rte_eth_bond_primary_get(port_id); - if (primary_id < 0) { - printf("\tFailed to get primary slave for port = %d\n", port_id); - return; - } else + if (bonding_mode == BONDING_MODE_ACTIVE_BACKUP || + bonding_mode == BONDING_MODE_TLB) { + primary_id = rte_eth_bond_primary_get(port_id); + if (primary_id < 0) { + printf("\tFailed to get primary slave for port = %d\n", port_id); + return; + } printf("\tPrimary: [%d]\n", primary_id); + } } -- 1.8.3.1