From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx7.zte.com.cn (mx7.zte.com.cn [202.103.147.169]) by dpdk.org (Postfix) with ESMTP id AE0927D0A for ; Wed, 16 Aug 2017 04:50:09 +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,20170816104650 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 16 Aug 2017 02:46:50 -0000 Received: (from root@localhost) by mse01.zte.com.cn id v7G2o6Nb040299; Wed, 16 Aug 2017 10:50:06 +0800 (GMT-8) (envelope-from xie.rongqiang@zte.com.cn) Message-Id: <201708160250.v7G2o6Nb040299@mse01.zte.com.cn> Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v7G2hNWg003486; Wed, 16 Aug 2017 10:43:23 +0800 (GMT-8) (envelope-from xie.rongqiang@zte.com.cn) In-Reply-To: <5305497.JiKmSDtoNP@xps> References: <201706300758.v5U7wu8t037841@mse01.zte.com.cn> <5305497.JiKmSDtoNP@xps> To: Thomas Monjalon Cc: Declan Doherty , dev@dpdk.org, jingjing.wu@intel.com MIME-Version: 1.0 X-KeepSent: 2C6A6654:D0C5905C-4825817E:000B4EEA; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3 September 15, 2011 From: xie.rongqiang@zte.com.cn Date: Wed, 16 Aug 2017 10:31:12 +0800 X-MIMETrack: Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2017-08-16 10:43:16, Serialize complete at 2017-08-16 10:43:16 X-MAIL: mse01.zte.com.cn v7G2o6Nb040299 X-MSS: AUDITRELEASE@mse01.zte.com.cn X-HQIP: 127.0.0.1 Content-Type: text/plain; charset="US-ASCII" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] =?gb2312?b?tPC4tDogUmU6ICBbUEFUQ0hdIGFwcC90ZXN0cG1k?= =?gb2312?b?OmFkZCBib25kIHR5cGUgZGVzY3JpcHRpb24=?= 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: Wed, 16 Aug 2017 02:50:13 -0000 I am sorry to reply so late for some reason. And i figure out two ways to implement this kind of things inside the bonding code, First,if can the function rte_eth_bond_mode_get() return string, so we can print the bond mode straight, but in this way, we need fix the other c source where call the function. Second, we add an interface return bond mode string, in this way, we just call it in function cmd_show_bonding_config_parsed(). Finally, which way do you agree more? Looking forward to your early reply,Thank your. Thomas Monjalon 2017/07/03 02:11:52: > : Thomas Monjalon > : Declan Doherty , > : dev@dpdk.org, RongQiang Xie , > jingjing.wu@intel.com > : 2017/07/03 02:12 > : Re: [dpdk-dev] [PATCH] app/testpmd:add bond type description > > 30/06/2017 17:39, Declan Doherty: > > On 30/06/17 08:56, RongQiang Xie wrote: > > > 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"); > > > > > > > Good idea, but it would be clearer if we just returned the actual mode > > string so the user doesn't need to parse it themselves, like below. > > > > - } else > > - 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"); > > + } > > + > > + printf("\tBonding mode: %d (", bonding_mode); > > + switch (bonding_mode) { > > + case BONDING_MODE_ROUND_ROBIN: > > + printf("round-robin"); > > + break; > > + case BONDING_MODE_ACTIVE_BACKUP: > > + printf("active-backup"); > > + break; > > + case BONDING_MODE_BALANCE: > > + printf("link-aggregation"); > > + break; > > + case BONDING_MODE_BROADCAST: > > + printf("broadcast"); > > + break; > > + case BONDING_MODE_8023AD: > > + printf("link-aggregation-802.3ad"); > > + break; > > + case BONDING_MODE_TLB: > > + printf("transmit-load-balancing"); > > + break; > > + case BONDING_MODE_ALB: > > + printf("adaptive-load-balancing"); > > + break; > > + default: > > + printf("unknown-mode"); > > + } > > + printf(")\n"); > > I would say no. > Can we think how to implement this kind of things inside the bonding code? > >