From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 575A42C39 for ; Sun, 2 Jul 2017 20:11:57 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id CCD17209E5; Sun, 2 Jul 2017 14:11:56 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Sun, 02 Jul 2017 14:11:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=9lU02utTpq49WYH dcoXXmzZKgdremwIyFL4jZlFcMDs=; b=fxJOfRNjn2qa2D8ZCGYF28TevA83HdN MWbCA16akJoVUZhLHYieujzuYZArBCdbVK+SEAsZEoU4SKsx9KciLKuWF9HFkuGU SwhZakBEGQUQ8rcScUIVUVQLRZGbeAHn+BuelafFsHoR4vAKuJTh7nTRKldcludZ Zv7bvdAfNuVo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=9lU02utTpq49WYHdcoXXmzZKgdremwIyFL4jZlFcMDs=; b=lO37yFq+ G36D27J/AOHL51oFPwuWodXb8Z4KTmyJuRQs8ynDxJUiOMyGEXqp2csxPUHYaKTd EPTKVodraRwchDMQX8sfDmb0JsnVDNwXhiyWuJ/oaleup0PcEkU33zy5Diknmm+j +jKaHKheeFoqvCbV5U/PpOfg/HtfbDy0IRp62iXvJwJY/7PosgXbp4aJu6E9cRqU 59DF+8xpuJSswS4zr3KSrVuv/PZtmDKxDQznxQIKAQFLi6FX50xPWkbvCZeeR6fT qvy20vsgeDxdZEEKdkPNtCtQVtLd8MewYX+ty+HJZVa6IfDbMLATBRoUfCh2y/uI t0QLU5kvDa+FPA== X-ME-Sender: X-Sasl-enc: KFPL4r+BglqOMUoIjQdrca18vQhipdUCC45hJNFeboJ5 1499019116 Received: from xps.localnet (40.87.136.77.rev.sfr.net [77.136.87.40]) by mail.messagingengine.com (Postfix) with ESMTPA id 52BF224606; Sun, 2 Jul 2017 14:11:56 -0400 (EDT) From: Thomas Monjalon To: Declan Doherty Cc: dev@dpdk.org, RongQiang Xie , jingjing.wu@intel.com Date: Sun, 02 Jul 2017 20:11:52 +0200 Message-ID: <5305497.JiKmSDtoNP@xps> In-Reply-To: References: <201706300758.v5U7wu8t037841@mse01.zte.com.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [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: Sun, 02 Jul 2017 18:11:57 -0000 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?