From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 75936804F for ; Fri, 12 Dec 2014 07:00:37 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 11 Dec 2014 22:00:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,561,1413270000"; d="scan'208";a="636519822" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by fmsmga001.fm.intel.com with ESMTP; 11 Dec 2014 22:00:35 -0800 Received: from kmsmsx154.gar.corp.intel.com (172.21.73.14) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 12 Dec 2014 14:00:34 +0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by KMSMSX154.gar.corp.intel.com (172.21.73.14) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 12 Dec 2014 14:00:33 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by shsmsx102.ccr.corp.intel.com ([169.254.2.216]) with mapi id 14.03.0195.001; Fri, 12 Dec 2014 14:00:32 +0800 From: "Fu, JingguoX" To: "Ouyang, Changchun" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] examples/vhost: Fix vlan offload issue Thread-Index: AQHQFcJbR8QaK0X2iUOwrE5UmzmRspyLZ+kg Date: Fri, 12 Dec 2014 06:00:32 +0000 Message-ID: <6BD6202160B55B409D423293115822625938A5@SHSMSX101.ccr.corp.intel.com> References: <1418357726-25141-1-git-send-email-changchun.ouyang@intel.com> In-Reply-To: <1418357726-25141-1-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] examples/vhost: Fix vlan offload issue 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, 12 Dec 2014 06:00:38 -0000 Comments: This patch fixed all cases related to VM to VM scenario hard switch for vi= rtio. Basic Information Patch name: examples/vhost: Fix vlan offload issue Brief description: Verify all VM to VM scenario cases based hard switch Test Flag: Tested-by Tester name: jingguox.fu@intel.com Test environment: OS: Fedora20 3.11.10-301.fc20.x86_64 GCC: gcc version 4.8.3 20140911 CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz NIC: 82599ES 10-Gigabit SFI/SFP+ Network Connection [8086:10fb] Commit ID: 4c8b41715168101dc76fd9b264658837ff54ab76 Detailed Testing Information: DPDK SW Configuration: open CONFIG_RTE_LIBRTE_VHOST x86_64-native-linuxapp-gcc configuration =20 Test Result Summary: Total 6 cases, 6 passed, 0 failed Test Case - name: vm to vm by dpdk forward hard switch (virtio one copy suite) Test Case - Description: Check vhost switch can forward packets received from the first virtio o= n VM1 to the second virtio on VM2 Test Case - command / instruction: Start vhost-switch on host and start testpmd on guests On host: taskset -c 8-10 vhost-switch -c 0xf00 -n 4 --huge-dir /mnt/huge --so= cket-mem 1024,1024 -- -p 1 --mergeable 0 --zero-copy 0 --vm2vm 2 On guests: VM1: ./testpmd -c 0xf -n 4 -- -i --txqflags 0x0f00 --eth-peer=3D0,00:00:0= 0:00:00:0A Set fwd type tx_first testpmd>set fwd mac testpmd>start tx_first VM2: testpmd -c 0xf -n 4 -- -i --txqflags 0x0f00 testpmd>set fwd mac testpmd>start tx_first Send packets without vlan id: ether|ip|udp packets Test Case - expected test result: packet generator can get the packets from the vf on VM2 Test Case - name: =09 vm to vm by linux forward hard switch (virtio one copy suite) Test Case - Description: Check vhost switch can forward packets received from the first virtio o= n VM1 to the second virtio on VM2 Test Case -test command / instruction: Start vhost-switch on host, use virtios as Ethernet devices On host: taskset -c 8-10 vhost-switch -c 0xf00 -n 4 --huge-dir /mnt/huge --sock= et-mem 1024,1024 -- -p 1 --mergeable 0 --zero-copy 0 --vm2vm 2=20 On guests: VM1: ip addr add 192.168.2.2/24 dev eth1 ip neigh add 192.168.2.1 lladdr 00:00:02:00:00:a1 dev eth1 ip link set dev eth1 up=20 ip addr add 192.168.3.2/24 dev eth0 ip neigh add 192.168.3.1 lladdr 52:00:00:54:00:02 dev eth0 ip link set dev eth0 up VM2: ip addr add 192.168.3.2/24 dev eth1 ip neigh add 192.168.3.1 lladdr 00:00:02:00:00:a1 dev eth1 ip link set dev eth1 up ip addr add 192.168.2.2/24 dev eth0 ip neigh add 192.168.2.1 lladdr 00:00:02:00:00:a1 dev eth0 ip link set dev eth0 up =20 arp -s 192.168.3.1 00:00:02:0a:0a Send packets without vlan id: ether|ip|udp packets Test Case - expected test result: packet generator can get the packets from the vf on VM2 Test Case - name: vm to vm by dpdk forward hard switch (virtio one copy jumbo frame suite= ) Test Case - Description: Check vhost switch can forward packets received from the first virtio o= n VM1 to the second virtio on VM2 Test Case - command / instruction: Start vhost-switch on host and start testpmd on guests On host: taskset -c 8-10 vhost-switch -c 0xf00 -n 4 --huge-dir /mnt/huge --so= cket-mem 1024,1024 -- -p 1 --mergeable 1 --zero-copy 0 --vm2vm 2 On guests: VM1: ./testpmd -c 0xf -n 4 -- -i --txqflags 0x0f00 --max-pkt-len 9000 --e= th-peer=3D0,00:00:00:00:00:0A Set fwd type tx_first testpmd>set fwd mac testpmd>start tx_first VM2: testpmd -c 0xf -n 4 -- -i --txqflags 0x0f00 --max-pkt-len 9000 testpmd>set fwd mac testpmd>start tx_first Send packets without vlan id: ether|ip|udp packets Test Case - expected test result: packet generator can get the packets from the vf on VM2 Test Case - name: =09 vm to vm by linux forward hard switch (virtio one copy jumbo frame suit= e) Test Case - Description: Check vhost switch can forward packets received from the first virtio o= n VM1 to the second virtio on VM2 Test Case -test command / instruction: Start vhost-switch on host, use virtios as Ethernet devices On host: taskset -c 8-10 vhost-switch -c 0xf00 -n 4 --huge-dir /mnt/huge --sock= et-mem 1024,1024 -- -p 1 --mergeable 1 --zero-copy 0 --vm2vm 2 On guests: VM1: ip addr add 192.168.2.2/24 dev eth1 ip neigh add 192.168.2.1 lladdr 00:00:02:00:00:a1 dev eth1 ip link set dev eth1 up ip link set dev eth1 mtu 9000 ip addr add 192.168.3.2/24 dev eth0 ip neigh add 192.168.3.1 lladdr 52:00:00:54:00:02 dev eth0 ip link set dev eth0 up ip link set dev eth0 mtu 9000 VM2: ip addr add 192.168.3.2/24 dev eth1 ip neigh add 192.168.3.1 lladdr 00:00:02:00:00:a1 dev eth1 ip link set dev eth1 up ip link set dev eth1 mtu 9000 ip addr add 192.168.2.2/24 dev eth0 ip neigh add 192.168.2.1 lladdr 00:00:02:00:00:a1 dev eth0 ip link set dev eth0 up ip link set dev eth0 mtu 9000 =20 arp -s 192.168.3.1 00:00:02:0a:0a Send packets without vlan id: ether|ip|udp packets Test Case - expected test result: packet generator can get the packets from the vf on VM2 Test Case - name: vm to vm by dpdk forward hard switch (virtio zero suite) Test Case - Description: Check vhost switch can forward packets received from the first virtio o= n VM1 to the second virtio on VM2 Test Case - command / instruction: Start vhost-switch on host and start testpmd on guests On host: taskset -c 8-10 vhost-switch -c 0xf00 -n 4 --huge-dir /mnt/huge --so= cket-mem 1024,1024 -- -p 1 --mergeable 0 --zero-copy 1 --vm2vm 2 On guests: VM1: ./testpmd -c 0xf -n 4 -- -i --txqflags 0x0f00 --eth-peer=3D0,00:00:0= 0:00:00:0A Set fwd type tx_first testpmd>set fwd mac testpmd>start tx_first VM2: testpmd -c 0xf -n 4 -- -i --txqflags 0x0f00 testpmd>set fwd mac testpmd>start tx_first Send packets without vlan id: ether|ip|udp packets Test Case - expected test result: packet generator can get the packets from the vf on VM2 Test Case - name: =09 vm to vm by linux forward hard switch (virtio zero suite) Test Case - Description: Check vhost switch can forward packets received from the first virtio o= n VM1 to the second virtio on VM2 Test Case -test command / instruction: Start vhost-switch on host, use virtios as Ethernet devices On host: taskset -c 8-10 vhost-switch -c 0xf00 -n 4 --huge-dir /mnt/huge --sock= et-mem 1024,1024 -- -p 1 --mergeable 0 --zero-copy 1 --vm2vm 2 On guests: VM1: ip addr add 192.168.2.2/24 dev eth1 ip neigh add 192.168.2.1 lladdr 00:00:02:00:00:a1 dev eth1 ip link set dev eth1 up ip addr add 192.168.3.2/24 dev eth0 ip neigh add 192.168.3.1 lladdr 52:00:00:54:00:02 dev eth0 ip link set dev eth0 up VM2: ip addr add 192.168.3.2/24 dev eth1 ip neigh add 192.168.3.1 lladdr 00:00:02:00:00:a1 dev eth1 ip link set dev eth1 up ip addr add 192.168.2.2/24 dev eth0 ip neigh add 192.168.2.1 lladdr 00:00:02:00:00:a1 dev eth0 ip link set dev eth0 up =20 arp -s 192.168.3.1 00:00:02:0a:0a Send packets without vlan id: ether|ip|udp packets Test Case - expected test result: packet generator can get the packets from the vf on VM2 -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ouyang Changchun Sent: Friday, December 12, 2014 12:15 To: dev@dpdk.org Subject: [dpdk-dev] [PATCH] examples/vhost: Fix vlan offload issue The following commit break vm2vm hard mode test cases: commit db4014f2b65cb31bf209cadd5bcec778ca137fe2 Author: Huawei Xie Date: Thu Nov 13 06:34:07 2014 +0800 examples/vhost: use factorized default Rx/Tx configuration Investigation show that it needs enabling vlan offload since it is turn off= by default, and Tx need it, especially when vm2vm is in hard mode. Signed-off-by: Changchun Ouyang --- examples/vhost/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 9331910..04f0118 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -390,6 +390,9 @@ port_init(uint8_t port) txconf =3D &dev_info.default_txconf; rxconf->rx_drop_en =3D 1; =20 + /* Enable vlan offload */ + txconf->txq_flags &=3D ~ETH_TXQ_FLAGS_NOVLANOFFL; + /* * Zero copy defers queue RX/TX start to the time when guest * finishes its startup and packet buffers from that guest are --=20 1.8.4.2