From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id B487911C5 for ; Fri, 6 Mar 2015 09:45:40 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 06 Mar 2015 00:45:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,351,1422950400"; d="scan'208";a="687866598" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by fmsmga002.fm.intel.com with ESMTP; 06 Mar 2015 00:45:38 -0800 Received: from kmsmsx154.gar.corp.intel.com (172.21.73.14) by KMSMSX152.gar.corp.intel.com (172.21.73.87) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 6 Mar 2015 16:44:57 +0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by KMSMSX154.gar.corp.intel.com (172.21.73.14) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 6 Mar 2015 16:44:56 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.62]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.197]) with mapi id 14.03.0195.001; Fri, 6 Mar 2015 16:44:49 +0800 From: "Ouyang, Changchun" To: "Qiu, Michael" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 1/2] testpmd: HW vlan command Thread-Index: AQHQV+T+m8KJD2VZgk+3Vstc0UHH2J0PItRw Date: Fri, 6 Mar 2015 08:44:49 +0000 Message-ID: References: <1425628813-1546-1-git-send-email-changchun.ouyang@intel.com> <1425629406-1838-1-git-send-email-changchun.ouyang@intel.com> <1425629406-1838-2-git-send-email-changchun.ouyang@intel.com> <533710CFB86FA344BFBF2D6802E60286CEF8FC@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <533710CFB86FA344BFBF2D6802E60286CEF8FC@SHSMSX101.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 1/2] testpmd: HW vlan command X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2015 08:45:41 -0000 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 >=20 > 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 > > Acked-by: Pablo de Lara > > --- > > 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 =3D 1; > > + else if (!strcmp(res->value, "off")) > > + rx_mode.hw_vlan_filter =3D 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 =3D 1; > > + else if (!strcmp(res->value, "off")) > > + rx_mode.hw_vlan_strip =3D 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 =3D 1; > > + else if (!strcmp(res->value, "off")) > > + rx_mode.hw_vlan_extend =3D 0; > > + else { > > + printf("Unknown parameter\n"); > > + return; > > + } > > } else if (!strcmp(res->name, "drop-en")) { > > if (!strcmp(res->value, "on")) > > rx_drop_en =3D 1; > > @@ -1355,7 +1383,8 @@ cmdline_parse_token_string_t > cmd_config_rx_mode_flag_all =3D > > TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, all, > > "all"); cmdline_parse_token_string_t cmd_config_rx_mode_flag_name =3D > > 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 =3D > > 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 =3D cmdline_parse_inst_t > cmd_config_rx_mode_flag =3D { > > .f =3D cmd_config_rx_mode_flag_parsed, > > .data =3D NULL, > > - .help_str =3D "port config all crc-strip|rx-cksum|hw-vlan on|off", > > + .help_str =3D "port config all crc-strip|rx-cksum|hw-vlan|" > > + "hw-vlan-filter|hw-vlan-strip|hw-vlan-extend on|off", > > .tokens =3D { > > (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=3DN: 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 }, >=20 > Hi, Ouyang >=20 > Could you help to make this line the same as others? > Also below line: > { "no-flush-rx", 0, 0, 0 }, >=20 > 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. >=20 It should be another separate patch to do such kind of code cleanup work, n= ot necessary in this patch, Actually these 3 lines align very well with codes above and below them. Thanks Changchun