From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 7BB2F5A84 for ; Fri, 6 Mar 2015 09:28:22 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 06 Mar 2015 00:26:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,351,1422950400"; d="scan'208";a="536966099" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by orsmga003.jf.intel.com with ESMTP; 06 Mar 2015 00:28:07 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.110.15) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 6 Mar 2015 16:22:53 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.192]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.161]) with mapi id 14.03.0195.001; Fri, 6 Mar 2015 16:22:52 +0800 From: "Qiu, Michael" To: "Ouyang, Changchun" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 1/2] testpmd: HW vlan command Thread-Index: AQHQV+UVxnarUeFjPE+PESQjcnE5gw== Date: Fri, 6 Mar 2015 08:22:51 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CEF8FC@SHSMSX101.ccr.corp.intel.com> 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> Accept-Language: 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:28:23 -0000 On 3/6/2015 4:11 PM, Ouyang Changchun wrote:=0A= > This patch enables testpmd user can config port hw_vlan with more fine gr= anularity:=0A= > hw vlan filter, hw vlan strip, and hw vlan extend.=0A= >=0A= > Don't remove the original command(hw-vlan) considering that some user sti= ll want to use=0A= > only one command to switch on/off all 3 options.=0A= >=0A= > Signed-off-by: Changchun Ouyang =0A= > Acked-by: Pablo de Lara =0A= > ---=0A= > app/test-pmd/cmdline.c | 36 +++++++++++++++++++++++++++++++++---=0A= > app/test-pmd/parameters.c | 18 ++++++++++++++++++=0A= > 2 files changed, 51 insertions(+), 3 deletions(-)=0A= >=0A= > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c=0A= > index 590e427..99cc307 100644=0A= > --- a/app/test-pmd/cmdline.c=0A= > +++ b/app/test-pmd/cmdline.c=0A= > @@ -584,7 +584,8 @@ static void cmd_help_long_parsed(void *parsed_result,= =0A= > "port config all max-pkt-len (value)\n"=0A= > " Set the max packet length.\n\n"=0A= > =0A= > - "port config all (crc-strip|rx-cksum|hw-vlan|drop-en)"=0A= > + "port config all (crc-strip|rx-cksum|hw-vlan|hw-vlan-filter|"=0A= > + "hw-vlan-strip|hw-vlan-extend|drop-en)"=0A= > " (on|off)\n"=0A= > " Set crc-strip/rx-checksum/hardware-vlan/drop_en"=0A= > " for ports.\n\n"=0A= > @@ -1327,6 +1328,33 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result= ,=0A= > printf("Unknown parameter\n");=0A= > return;=0A= > }=0A= > + } else if (!strcmp(res->name, "hw-vlan-filter")) {=0A= > + if (!strcmp(res->value, "on"))=0A= > + rx_mode.hw_vlan_filter =3D 1;=0A= > + else if (!strcmp(res->value, "off"))=0A= > + rx_mode.hw_vlan_filter =3D 0;=0A= > + else {=0A= > + printf("Unknown parameter\n");=0A= > + return;=0A= > + }=0A= > + } else if (!strcmp(res->name, "hw-vlan-strip")) {=0A= > + if (!strcmp(res->value, "on"))=0A= > + rx_mode.hw_vlan_strip =3D 1;=0A= > + else if (!strcmp(res->value, "off"))=0A= > + rx_mode.hw_vlan_strip =3D 0;=0A= > + else {=0A= > + printf("Unknown parameter\n");=0A= > + return;=0A= > + }=0A= > + } else if (!strcmp(res->name, "hw-vlan-extend")) {=0A= > + if (!strcmp(res->value, "on"))=0A= > + rx_mode.hw_vlan_extend =3D 1;=0A= > + else if (!strcmp(res->value, "off"))=0A= > + rx_mode.hw_vlan_extend =3D 0;=0A= > + else {=0A= > + printf("Unknown parameter\n");=0A= > + return;=0A= > + }=0A= > } else if (!strcmp(res->name, "drop-en")) {=0A= > if (!strcmp(res->value, "on"))=0A= > rx_drop_en =3D 1;=0A= > @@ -1355,7 +1383,8 @@ cmdline_parse_token_string_t cmd_config_rx_mode_fla= g_all =3D=0A= > TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, all, "all");= =0A= > cmdline_parse_token_string_t cmd_config_rx_mode_flag_name =3D=0A= > TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, name,=0A= > - "crc-strip#rx-cksum#hw-vlan");=0A= > + "crc-strip#rx-cksum#hw-vlan#"=0A= > + "hw-vlan-filter#hw-vlan-strip#hw-vlan-extend");=0A= > cmdline_parse_token_string_t cmd_config_rx_mode_flag_value =3D=0A= > TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, value,=0A= > "on#off");=0A= > @@ -1363,7 +1392,8 @@ cmdline_parse_token_string_t cmd_config_rx_mode_fla= g_value =3D=0A= > cmdline_parse_inst_t cmd_config_rx_mode_flag =3D {=0A= > .f =3D cmd_config_rx_mode_flag_parsed,=0A= > .data =3D NULL,=0A= > - .help_str =3D "port config all crc-strip|rx-cksum|hw-vlan on|off",=0A= > + .help_str =3D "port config all crc-strip|rx-cksum|hw-vlan|"=0A= > + "hw-vlan-filter|hw-vlan-strip|hw-vlan-extend on|off",=0A= > .tokens =3D {=0A= > (void *)&cmd_config_rx_mode_flag_port,=0A= > (void *)&cmd_config_rx_mode_flag_keyword,=0A= > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c=0A= > index adf3203..04dc129 100644=0A= > --- a/app/test-pmd/parameters.c=0A= > +++ b/app/test-pmd/parameters.c=0A= > @@ -157,6 +157,9 @@ usage(char* progname)=0A= > printf(" --crc-strip: enable CRC stripping by hardware.\n");=0A= > printf(" --enable-rx-cksum: enable rx hardware checksum offload.\n");= =0A= > printf(" --disable-hw-vlan: disable hardware vlan.\n");=0A= > + printf(" --disable-hw-vlan-filter: disable hardware vlan filter.\n");= =0A= > + printf(" --disable-hw-vlan-strip: disable hardware vlan strip.\n");=0A= > + printf(" --disable-hw-vlan-extend: disable hardware vlan extend.\n");= =0A= > printf(" --enable-drop-en: enable per queue packet drop.\n");=0A= > printf(" --disable-rss: disable rss.\n");=0A= > printf(" --port-topology=3DN: set port topology (N: paired (default) o= r "=0A= > @@ -528,6 +531,9 @@ launch_args_parse(int argc, char** argv)=0A= > { "crc-strip", 0, 0, 0 },=0A= > { "enable-rx-cksum", 0, 0, 0 },=0A= > { "disable-hw-vlan", 0, 0, 0 },=0A= > + { "disable-hw-vlan-filter", 0, 0, 0 },=0A= > + { "disable-hw-vlan-strip", 0, 0, 0 },=0A= > + { "disable-hw-vlan-extend", 0, 0, 0 },=0A= > { "enable-drop-en", 0, 0, 0 },=0A= =0A= Hi, Ouyang=0A= =0A= Could you help to make this line the same as others?=0A= Also below line:=0A= { "no-flush-rx", 0, 0, 0 },=0A= =0A= I found that, not all of those lines use "Tab" after first field, lots=0A= of them use white space, if all use "Tab", then will keep the same style.= =0A= =0A= Thanks,=0A= Michael=0A= > { "disable-rss", 0, 0, 0 },=0A= > { "port-topology", 1, 0, 0 },=0A= > @@ -778,6 +784,18 @@ launch_args_parse(int argc, char** argv)=0A= > rx_mode.hw_vlan_extend =3D 0;=0A= > }=0A= > =0A= > + if (!strcmp(lgopts[opt_idx].name,=0A= > + "disable-hw-vlan-filter"))=0A= > + rx_mode.hw_vlan_filter =3D 0;=0A= > +=0A= > + if (!strcmp(lgopts[opt_idx].name,=0A= > + "disable-hw-vlan-strip"))=0A= > + rx_mode.hw_vlan_strip =3D 0;=0A= > +=0A= > + if (!strcmp(lgopts[opt_idx].name,=0A= > + "disable-hw-vlan-extend"))=0A= > + rx_mode.hw_vlan_extend =3D 0;=0A= > +=0A= > if (!strcmp(lgopts[opt_idx].name, "enable-drop-en"))=0A= > rx_drop_en =3D 1;=0A= > =0A= =0A=