From: xie.rongqiang@zte.com.cn
To: Thomas Monjalon <thomas@monjalon.net>
Cc: Declan Doherty <declan.doherty@intel.com>,
dev@dpdk.org, jingjing.wu@intel.com
Subject: [dpdk-dev] 答复: Re: [PATCH] app/testpmd:add bond type description
Date: Wed, 16 Aug 2017 10:31:12 +0800 [thread overview]
Message-ID: <201708160250.v7G2o6Nb040299@mse01.zte.com.cn> (raw)
In-Reply-To: <5305497.JiKmSDtoNP@xps>
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 <thomas@monjalon.net> 2017/07/03 02:11:52:
> : Thomas Monjalon <thomas@monjalon.net>
> : Declan Doherty <declan.doherty@intel.com>,
> : dev@dpdk.org, RongQiang Xie <xie.rongqiang@zte.com.cn>,
> 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 <xie.rongqiang@zte.com.cn>
> > > ---
> > > 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?
>
>
next prev parent reply other threads:[~2017-08-16 2:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 7:56 [dpdk-dev] " RongQiang Xie
2017-06-30 15:39 ` Declan Doherty
2017-07-02 18:11 ` Thomas Monjalon
2017-08-16 2:31 ` xie.rongqiang [this message]
2017-08-23 20:22 ` [dpdk-dev] 答复: " Thomas Monjalon
2017-08-24 11:07 ` [dpdk-dev] 答复: " xie.rongqiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201708160250.v7G2o6Nb040299@mse01.zte.com.cn \
--to=xie.rongqiang@zte.com.cn \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).