From: "Ouyang, Changchun" <changchun.ouyang@intel.com>
To: "Qiu, Michael" <michael.qiu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3 1/2] testpmd: HW vlan command
Date: Fri, 6 Mar 2015 08:44:49 +0000 [thread overview]
Message-ID: <F52918179C57134FAEC9EA62FA2F962511A0C86A@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <533710CFB86FA344BFBF2D6802E60286CEF8FC@SHSMSX101.ccr.corp.intel.com>
Hi Michael,
> -----Original Message-----
> From: Qiu, Michael
> Sent: Friday, March 6, 2015 4:23 PM
> To: Ouyang, Changchun; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3 1/2] testpmd: HW vlan command
>
> On 3/6/2015 4:11 PM, Ouyang Changchun wrote:
> > This patch enables testpmd user can config port hw_vlan with more fine
> granularity:
> > hw vlan filter, hw vlan strip, and hw vlan extend.
> >
> > Don't remove the original command(hw-vlan) considering that some user
> > still want to use only one command to switch on/off all 3 options.
> >
> > Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
> > Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> > ---
> > app/test-pmd/cmdline.c | 36
> +++++++++++++++++++++++++++++++++---
> > app/test-pmd/parameters.c | 18 ++++++++++++++++++
> > 2 files changed, 51 insertions(+), 3 deletions(-)
> >
> > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> > 590e427..99cc307 100644
> > --- a/app/test-pmd/cmdline.c
> > +++ b/app/test-pmd/cmdline.c
> > @@ -584,7 +584,8 @@ static void cmd_help_long_parsed(void
> *parsed_result,
> > "port config all max-pkt-len (value)\n"
> > " Set the max packet length.\n\n"
> >
> > - "port config all (crc-strip|rx-cksum|hw-vlan|drop-
> en)"
> > + "port config all (crc-strip|rx-cksum|hw-vlan|hw-vlan-
> filter|"
> > + "hw-vlan-strip|hw-vlan-extend|drop-en)"
> > " (on|off)\n"
> > " Set crc-strip/rx-checksum/hardware-
> vlan/drop_en"
> > " for ports.\n\n"
> > @@ -1327,6 +1328,33 @@ cmd_config_rx_mode_flag_parsed(void
> *parsed_result,
> > printf("Unknown parameter\n");
> > return;
> > }
> > + } else if (!strcmp(res->name, "hw-vlan-filter")) {
> > + if (!strcmp(res->value, "on"))
> > + rx_mode.hw_vlan_filter = 1;
> > + else if (!strcmp(res->value, "off"))
> > + rx_mode.hw_vlan_filter = 0;
> > + else {
> > + printf("Unknown parameter\n");
> > + return;
> > + }
> > + } else if (!strcmp(res->name, "hw-vlan-strip")) {
> > + if (!strcmp(res->value, "on"))
> > + rx_mode.hw_vlan_strip = 1;
> > + else if (!strcmp(res->value, "off"))
> > + rx_mode.hw_vlan_strip = 0;
> > + else {
> > + printf("Unknown parameter\n");
> > + return;
> > + }
> > + } else if (!strcmp(res->name, "hw-vlan-extend")) {
> > + if (!strcmp(res->value, "on"))
> > + rx_mode.hw_vlan_extend = 1;
> > + else if (!strcmp(res->value, "off"))
> > + rx_mode.hw_vlan_extend = 0;
> > + else {
> > + printf("Unknown parameter\n");
> > + return;
> > + }
> > } else if (!strcmp(res->name, "drop-en")) {
> > if (!strcmp(res->value, "on"))
> > rx_drop_en = 1;
> > @@ -1355,7 +1383,8 @@ cmdline_parse_token_string_t
> cmd_config_rx_mode_flag_all =
> > TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, all,
> > "all"); cmdline_parse_token_string_t cmd_config_rx_mode_flag_name =
> > TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag,
> name,
> > - "crc-strip#rx-cksum#hw-vlan");
> > + "crc-strip#rx-cksum#hw-vlan#"
> > + "hw-vlan-filter#hw-vlan-strip#hw-
> vlan-extend");
> > cmdline_parse_token_string_t cmd_config_rx_mode_flag_value =
> > TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, value,
> > "on#off");
> > @@ -1363,7 +1392,8 @@ cmdline_parse_token_string_t
> > cmd_config_rx_mode_flag_value = cmdline_parse_inst_t
> cmd_config_rx_mode_flag = {
> > .f = cmd_config_rx_mode_flag_parsed,
> > .data = NULL,
> > - .help_str = "port config all crc-strip|rx-cksum|hw-vlan on|off",
> > + .help_str = "port config all crc-strip|rx-cksum|hw-vlan|"
> > + "hw-vlan-filter|hw-vlan-strip|hw-vlan-extend on|off",
> > .tokens = {
> > (void *)&cmd_config_rx_mode_flag_port,
> > (void *)&cmd_config_rx_mode_flag_keyword,
> > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
> > index adf3203..04dc129 100644
> > --- a/app/test-pmd/parameters.c
> > +++ b/app/test-pmd/parameters.c
> > @@ -157,6 +157,9 @@ usage(char* progname)
> > printf(" --crc-strip: enable CRC stripping by hardware.\n");
> > printf(" --enable-rx-cksum: enable rx hardware checksum
> offload.\n");
> > printf(" --disable-hw-vlan: disable hardware vlan.\n");
> > + printf(" --disable-hw-vlan-filter: disable hardware vlan filter.\n");
> > + printf(" --disable-hw-vlan-strip: disable hardware vlan strip.\n");
> > + printf(" --disable-hw-vlan-extend: disable hardware vlan
> > +extend.\n");
> > printf(" --enable-drop-en: enable per queue packet drop.\n");
> > printf(" --disable-rss: disable rss.\n");
> > printf(" --port-topology=N: set port topology (N: paired (default) or "
> > @@ -528,6 +531,9 @@ launch_args_parse(int argc, char** argv)
> > { "crc-strip", 0, 0, 0 },
> > { "enable-rx-cksum", 0, 0, 0 },
> > { "disable-hw-vlan", 0, 0, 0 },
> > + { "disable-hw-vlan-filter", 0, 0, 0 },
> > + { "disable-hw-vlan-strip", 0, 0, 0 },
> > + { "disable-hw-vlan-extend", 0, 0, 0 },
> > { "enable-drop-en", 0, 0, 0 },
>
> Hi, Ouyang
>
> Could you help to make this line the same as others?
> Also below line:
> { "no-flush-rx", 0, 0, 0 },
>
> I found that, not all of those lines use "Tab" after first field, lots of them use
> white space, if all use "Tab", then will keep the same style.
>
It should be another separate patch to do such kind of code cleanup work, not necessary in this patch,
Actually these 3 lines align very well with codes above and below them.
Thanks
Changchun
next prev parent reply other threads:[~2015-03-06 8:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-13 12:03 [dpdk-dev] [PATCH] " Ouyang Changchun
2015-03-03 23:52 ` De Lara Guarch, Pablo
2015-03-05 10:48 ` Thomas Monjalon
2015-03-06 8:00 ` [dpdk-dev] [PATCH v2 0/2] Ouyang Changchun
2015-03-06 8:00 ` [dpdk-dev] [PATCH v2 1/2] testpmd: HW vlan command Ouyang Changchun
2015-03-06 8:00 ` [dpdk-dev] [PATCH v2 2/2] doc: Update for new " Ouyang Changchun
2015-03-06 8:09 ` [dpdk-dev] [PATCH v2 0/2] Ouyang, Changchun
2015-03-06 8:10 ` [dpdk-dev] [PATCH v3 0/2] New HW VLAN command in testpmd Ouyang Changchun
2015-03-06 8:10 ` [dpdk-dev] [PATCH v3 1/2] testpmd: HW vlan command Ouyang Changchun
2015-03-06 8:22 ` Qiu, Michael
2015-03-06 8:44 ` Ouyang, Changchun [this message]
2015-03-06 8:10 ` [dpdk-dev] [PATCH v3 2/2] doc: Update for new " Ouyang Changchun
2015-03-06 8:25 ` Qiu, Michael
2015-03-08 17:52 ` Butler, Siobhan A
2015-03-09 11:23 ` [dpdk-dev] [PATCH v3 0/2] New HW VLAN command in testpmd Thomas Monjalon
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=F52918179C57134FAEC9EA62FA2F962511A0C86A@shsmsx102.ccr.corp.intel.com \
--to=changchun.ouyang@intel.com \
--cc=dev@dpdk.org \
--cc=michael.qiu@intel.com \
/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).