From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 59B175A9B for ; Wed, 10 Jun 2015 10:34:30 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 10 Jun 2015 01:34:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,586,1427785200"; d="scan'208";a="724457150" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by fmsmga001.fm.intel.com with ESMTP; 10 Jun 2015 01:34:28 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by PGSMSX104.gar.corp.intel.com (10.221.44.91) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 10 Jun 2015 16:33:58 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.129]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.46]) with mapi id 14.03.0224.002; Wed, 10 Jun 2015 16:33:56 +0800 From: "Jiajia, SunX" To: "Wu, Jingjing" , "dev@dpdk.org" Thread-Topic: [PATCH v4 0/4] enable mirror functionality in i40e driver Thread-Index: AQHQo0Yu48bwr+F57kWyKHM0ofMrA52lW6dg Date: Wed, 10 Jun 2015 08:33:56 +0000 Message-ID: References: <1433492166-30758-1-git-send-email-jingjing.wu@intel.com> <1433917473-21508-1-git-send-email-jingjing.wu@intel.com> In-Reply-To: <1433917473-21508-1-git-send-email-jingjing.wu@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 v4 0/4] enable mirror functionality in i40e driver 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: Wed, 10 Jun 2015 08:34:31 -0000 Tested-by: Jiajia Sunx - Tested Commit: 94ef2964148a4540db21034f5c3669ab81fbdc76 - OS: Fedora20 3.18.9 - GCC: gcc version 4.8.3 20140911 - CPU: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz - NIC: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection [80= 86:10fb] - NIC: Intel Corporation Ethernet Controller XL710 for 40GbE QSFP+ [8086:15= 83] - Default x86_64-native-linuxapp-gcc configuration - Prerequisites: vt-d enable in bios and IOMMU enable in kernel - Total 8 cases, 8 passed, 0 failed 2VM prerequisites: VF0 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 -- -i VF0 testpmd-> set fwd rxonly VF0 testpmd-> start =20 VF1 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 -- -i VF1 testpmd-> set fwd mac VF1 testpmd-> start - Case: Mirror Traffic between 2VMs with Pool mirroring Description: Verify the pool mirror rule Set up common 2VM prerequisites. Add one mirror rule that will mirror VM0 income traffic to VM1:: PF testpmd-> set port 0 mirror-rule 0 pool-mirror-up 0x1 dst-pool 1 o= n Send 10 packets to VM0 and verify the packets has been mirrored to VM1 and forwarded the packet. After test need reset mirror rule:: PF testpmd-> reset port 0 mirror-rule 0 =20 - Case: Mirror Traffic between 2VMs with Uplink mirroring Description: Verify the uplink mirror rule Set up common 2VM prerequisites. Add one mirror rule that will mirror VM0 income traffic to VM1:: PF testpmd-> set port 0 mirror-rule 0 uplink-mirror dst-pool 1 on Send 10 packets to VM0 and verify the packets has been mirrored to VM1 and forwarded the packet. After test need reset mirror rule:: =20 PF testpmd-> reset port 0 mirror-rule 0 =20 - Case: Mirror Traffic between 2VMs with Downlink mirroring Description: Verify the downlink mirror rule Run testpmd on VM0 and VM1 and start traffic forward on the VM hosts:: VF0 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 -- -i VF1 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 -- -i Add one mirror rule that will mirror VM0 outcome traffic to VM1:: PF testpmd-> set port 0 mirror-rule 0 downlink-mirror dst-pool 1 = on Make sure VM1 in receive only mode, VM0 send 16 packets, and verify the VM= 0 packets has been mirrored to VM1:: =20 VF1 testpmd-> set fwd rxonly VF1 testpmd-> start VF0 testpmd-> start tx_first=20 =20 Note: don't let VF1 fwd packets since downlink mirror will mirror back the packets to received packets, which will be an infinite loop. After test need reset mirror rule:: PF testpmd-> reset port 0 mirror-rule 0 =20 =20 - Case: Mirror Traffic between VMs with Vlan mirroring Description: Verify the vlan mirror rule Set up common 2VM prerequisites. Add rx vlan-id 0 on VF0, add one mirror rule that will mirror VM0 income traffic with specified vlan to VM1:: PF testpmd-> rx_vlan add 3 port 0 vf 0x1 PF testpmd-> set port 0 mirror-rule 0 vlan-mirror 3 dst-pool 1 on Send 10 packets with vlan-id0/vm0 MAC to VM0 and verify the packets has be= en mirrored to VM1 and forwarded the packet. After test need reset mirror rule:: =20 PF testpmd-> reset port 0 mirror-rule 0 - Case: Mirror Traffic between 2VMs with Vlan & Pool mirroring Description: Verify the misc mirror rules of vlan and pool Set up common 2VM prerequisites. Add rx vlan-id 3 of VF1, and 2 mirror rules, one is VM0 income traffic to = VM1, one is VM1 vlan income traffic to VM0:: PF testpmd-> rx_vlan add 3 port 0 vf 0x2 PF testpmd-> set port 0 mirror-rule 0 pool-mirror-up 0x1 dst-pool 1 o= n PF testpmd-> set port 0 mirror-rule 1 vlan-mirror 3 dst-pool 0 on =20 Send 2 flows one by one, first 10 packets with VM0 mac, and the second 100 packets with VM1 vlan and mac, and verify the first 10 packets has been mirrored first to VM1, second 100 packets go to VM0 and the packets have b= een forwarded. After test need reset mirror rule:: PF testpmd-> reset port 0 mirror-rule 0 PF testpmd-> reset port 0 mirror-rule 1 - Case: Mirror Traffic between 2VMs with Uplink & Downlink mirroring Description: Verify the misc mirror rules of uplink and downlink Run testpmd on VM0 and VM1 and start traffic forward on the VM hosts:: =20 VF0 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 -- -i VF1 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 -- -i Add 2 mirror rules that will mirror VM0 outcome and income traffic to VM1:= : =20 PF testpmd-> set port 0 mirror-rule 0 downlink-mirror dst-pool 1 on PF testpmd-> set port 0 mirror-rule 0 uplink-mirror dst-pool 1 on Make sure VM1 in receive only mode, VM0 first send 16 packets, and verify = the VM0 packets has been mirrored to VM1::=20 =20 VF1 testpmd-> set fwd rxonly VF1 testpmd-> start VF0 testpmd-> start tx_first=20 Note: don't let VF1 fwd packets since downlink mirror will mirror back the packets to received packets, which will be an infinite loop. Send 10 packets to VF0 with VF0 MAC from ixia, verify that all VF0 receive= d packets and transmitted packets will mirror to VF1:: VF0 testpmd-> stop=20 VF0 testpmd-> set fwd mac VF0 testpmd-> start =20 After test need reset mirror rule:: =20 PF testpmd-> reset port 0 mirror-rule 0 =20 - Case: Mirror Traffic between 2VMs with Vlan & Pool & Uplink & Downlink m= irroring Description: Verify the misc mirror rules of vlan and pool and uplink an= d downlink Run testpmd on VM0 and VM1 and start traffic forward on the VM hosts:: =20 VF0 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 -- -i VF1 ./x86_64-default-linuxapp-gcc/app/testpmd -c f -n 4 -- -i Add rx vlan-id 0 on VF0 and add 4 mirror rules:: PF testpmd-> reset port 0 mirror-rule 1 PF testpmd-> set port 0 mirror-rule 0 downlink-mirror dst-pool 1 on PF testpmd-> set port 0 mirror-rule 1 uplink-mirror dst-pool 1 on PF testpmd-> rx_vlan add 0 port 0 vf 0x2 PF testpmd-> set port 0 mirror-rule 2 vlan-mirror 0 dst-pool 0 on PF testpmd-> set port 0 mirror-rule 3 pool-mirror-up 0x1 dst-pool 1 o= n =20 Make sure VM1 in receive only mode, VM0 first send 16 packets, and verify = the VM0 packets has been mirrored to VM1, VF1, RX, 16packets (downlink mirror)= :: VF1 testpmd-> set fwd rxonly VF1 testpmd-> start VF0 testpmd-> start tx_first=20 =20 Note: don't let VF1 fwd packets since downlink mirror will mirror back the packets to received packets, which will be an infinite loop. Send 1 packet to VF0 with VF0 MAC from ixia, check if VF0 RX 1 packet and = TX 1 packet, and VF1 has 2 packets mirror from VF0(uplink mirror/downlink/pool)= :: VF0 testpmd-> stop=20 VF0 testpmd-> set fwd mac VF0 testpmd-> start =20 Send 1 packet with VM1 vlan id and mac, and verify that VF0 have 1 RX pack= et, 1 TX packet, and VF1 have 2 packets(downlink mirror):: =20 VF0 testpmd-> stop=20 VF0 testpmd-> set fwd mac=20 VF0 testpmd-> start=20 =20 After test need reset mirror rule:: PF testpmd-> reset port 0 mirror-rule 0 PF testpmd-> reset port 0 mirror-rule 1 =20 PF testpmd-> reset port 0 mirror-rule 2 PF testpmd-> reset port 0 mirror-rule 3 =20 - Case: Negative input to commands Decription:Input invalid commands on PF/VF to make sure the commands can= 't work:: Both niantic and Fortville: PF testpmd-> set port 0 vf 65 tx on PF testpmd-> set port 2 vf -1 tx off PF testpmd-> set port 0 vf 0 rx oneee PF testpmd-> set port 0 vf 0 rx offdd PF testpmd-> set port 0 vf 64 rxmode BAM on PF testpmd-> set port 0 vf 64 rxmode BAM off PF testpmd-> set port 0 uta 00:11:22:33:44 on PF testpmd-> set port 7 uta 00:55:44:33:22:11 off PF testpmd-> set port 0 vf 34 rxmode ROPE on=20 PF testpmd-> mac_addr add port 0 vf 65 00:55:44:33:22:11 PF testpmd-> mac_addr add port 5 vf 0 00:55:44:88:22:11 PF testpmd-> reset port 0xff mirror-rule 0 PF testpmd-> set port 0 mirror-rule 0 downlink-mirror 0xf dst-pool 2 off Just for niantic: PF testpmd-> set port 0 mirror-rule 0xf uplink-mirror dst-pool 1 on PF testpmd-> set port 0 mirror-rule 2 vlan-mirror 9 dst-pool 1 on PF testpmd-> reset port 0 mirror-rule 4 =20 > -----Original Message----- > From: Wu, Jingjing > Sent: Wednesday, June 10, 2015 2:24 PM > To: dev@dpdk.org > Cc: Wu, Jingjing; Liu, Jijiang; Jiajia, SunX; Zhang, Helin > Subject: [PATCH v4 0/4] enable mirror functionality in i40e driver >=20 > This patch set enables mirror functionality in i40e driver, and > redefines structure and macros used to configure mirror. >=20 > v2 changes: > - correct comments style > - add doc change >=20 > v3 changes: > - change the mirror rule type to support bit mask > - fix code style >=20 > v4 changes: > - correct the rule type check ixgbe >=20 > Jingjing Wu (4): > ethdev: rename rte_eth_vmdq_mirror_conf > ethdev: rename and extend the mirror type > i40e: enable mirror functionality in i40e driver > doc: modify the command about mirror in testpmd guide >=20 > app/test-pmd/cmdline.c | 62 +++--- > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 8 +- > drivers/net/i40e/i40e_ethdev.c | 334 > ++++++++++++++++++++++++++++ > drivers/net/i40e/i40e_ethdev.h | 23 ++ > drivers/net/ixgbe/ixgbe_ethdev.c | 62 ++++-- > drivers/net/ixgbe/ixgbe_ethdev.h | 4 +- > lib/librte_ether/rte_ethdev.c | 28 +-- > lib/librte_ether/rte_ethdev.h | 30 +-- > 8 files changed, 466 insertions(+), 85 deletions(-) >=20 > -- > 1.9.3