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 6FA185900 for ; Thu, 26 Feb 2015 03:31:14 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 25 Feb 2015 18:26:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,649,1418112000"; d="scan'208";a="657334123" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by orsmga001.jf.intel.com with ESMTP; 25 Feb 2015 18:31:11 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 26 Feb 2015 10:31:10 +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; Thu, 26 Feb 2015 10:31:08 +0800 From: "Xu, Qian Q" To: "dev@dpdk.org" Thread-Topic: [PATCH] testpmd: HW vlan command Thread-Index: AQHQR4UmFJbiR+DIWU2fD7NjKRBHIJ0CRZjQgAAAhgA= Date: Thu, 26 Feb 2015 02:31:08 +0000 Message-ID: <82F45D86ADE5454A95A89742C8D1410E01CC7C14@shsmsx102.ccr.corp.intel.com> References: In-Reply-To: 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] 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: Thu, 26 Feb 2015 02:31:15 -0000 Tested-by: Qian Xu - Tested Commit: b67578ccdf45df9fd0f0204578b71acd854ca834 - OS: Fedora20 3.11 - GCC: gcc version 4.8.3 20140624 - CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz - NIC: Intel 82599 Ethernet 10G SFI/SFP+ Network Connection - Default x86_64-native-linuxapp-gcc configuration - Total 1 case, 1 passed, 0 failed - Case: test_perf_virtio_one_vm_dpdk_fwd_vhost-user Description: in one-copy mode, vhost sample is in vhost user mode, launch o= ne VM with 2 virtio devices and run testpmd in the VM.=20 Steps: =20 On host: 1. Start vhost-switch. vm2vm 0 means only one vm without vm to vm communica= tion:: taskset -c 1-3 /examples/vhost/build/vhost-switch -c 0xf -= n 4 --huge-dir /mnt/huge --socket-mem 1024,1024 -- -p 1 --mergeable 0 --zer= o-copy 0 --vm2vm 0 =20 2. Start VM with vhost user as backend:: /x86_64-softmmu/qemu-system-x86_64 -name us-vhost-vm= 1 -cpu host -enable-kvm -m 2048 -object memory-backend-file,id=3Dmem,size= =3D2048M,mem-path=3D/mnt/huge,share=3Don -numa node,memdev=3Dmem -mem-preal= loc -smp 2 -drive file=3D/home/img/dpdk1-vm1.img -chardev socket,id=3Dchar0= ,path=3D/tools/dpdk_nic_bind.py --bind igb_uio 00:03.0 00:04.0 .//x86_64-native-linuxapp-gcc/app/test-pmd/testpmd -c f -n= 4 -- -i --txqflags 0x0f00 --disable-hw-vlan-filter =20 $ >set fwd mac =20 $ >start tx_first 4. After typing start tx_first in testpmd, user can see there would be 2 vi= rtio device with MAC and vlan id registered in vhost-user server, the log w= ould be shown in host's vhost-sample output. 5. Send traffic(30second) to virtio1 and virtio2, and set the packet size f= rom 64 to 1518 as well as the jumbo frame 3000. Check the performance in Mp= ps. The traffic sent to virtio1 should have the DEST MAC of Virtio1's MAC, = Vlan id of Virtio1. The traffic sent to virtio2 should have the DEST MAC of= Virtio2's MAC, Vlan id of Virtio2. As to the functionality criteria, The r= eceived rate should not be zero. As to the performance criteria, need check= it with developer or design doc/PRD. -----Original Message----- From: Ouyang, Changchun=20 Sent: Friday, February 13, 2015 8:04 PM To: dev@dpdk.org Cc: Cao, Waterman; Ouyang, Changchun Subject: [PATCH] testpmd: HW vlan command This patch enables testpmd user can config port hw_vlan with more fine gran= ularity: 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 --- 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" =20 - "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"); cm= dline_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 ad= f3203..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 }, { "disable-rss", 0, 0, 0 }, { "port-topology", 1, 0, 0 }, @@ -778,6 +784,18 @@ launch_args_parse(int argc, char** argv) rx_mode.hw_vlan_extend =3D 0; } =20 + if (!strcmp(lgopts[opt_idx].name, + "disable-hw-vlan-filter")) + rx_mode.hw_vlan_filter =3D 0; + + if (!strcmp(lgopts[opt_idx].name, + "disable-hw-vlan-strip")) + rx_mode.hw_vlan_strip =3D 0; + + if (!strcmp(lgopts[opt_idx].name, + "disable-hw-vlan-extend")) + rx_mode.hw_vlan_extend =3D 0; + if (!strcmp(lgopts[opt_idx].name, "enable-drop-en")) rx_drop_en =3D 1; =20 -- 1.8.4.2