[dpdk-dev] [PATCH v4 0/4] enable mirror functionality in i40e driver

Jiajia, SunX sunx.jiajia at intel.com
Wed Jun 10 10:33:56 CEST 2015


Tested-by: Jiajia Sunx <sunx.jiajia at intel.com>

- 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 [8086:10fb]
- NIC: Intel Corporation Ethernet Controller XL710 for 40GbE QSFP+ [8086:1583]
- 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
 
    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 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::

    		PF testpmd-> reset port 0 mirror-rule 0
  

 - 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::
    
		PF testpmd-> reset port 0 mirror-rule 0
  
 - 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 VM0
	packets has been mirrored to VM1::
    
    	    VF1 testpmd-> set fwd rxonly
          VF1 testpmd-> start
          VF0 testpmd-> start tx_first 
  
	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  
  
 - 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 been
	mirrored to VM1 and forwarded the packet.

	After test need reset mirror rule::
    
		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 on
    		PF testpmd-> set port 0 mirror-rule 1 vlan-mirror 3 dst-pool 0 on
  
	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 been
	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::
    
    		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::
  
    		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:: 
    
    		VF1 testpmd-> set fwd rxonly
    		VF1 testpmd-> start
    		VF0 testpmd-> start tx_first 

	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 received
	packets and transmitted packets will mirror to VF1::

   		VF0 testpmd-> stop 
   		VF0 testpmd-> set fwd mac
       	VF0 testpmd-> start  

	After test need reset mirror rule::
    
    		PF testpmd-> reset port 0 mirror-rule 0  

 - Case: Mirror Traffic between 2VMs with Vlan & Pool & Uplink & Downlink mirroring
   Description: Verify the misc mirror rules of vlan and pool and uplink and downlink
	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 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 on
  
	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 
  
	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 
    		VF0 testpmd-> set fwd mac
    		VF0 testpmd-> start  

	Send 1 packet with VM1 vlan id and mac, and verify that VF0 have 1 RX packet, 1
	TX packet, and VF1 have 2 packets(downlink mirror)::
    
    		VF0 testpmd-> stop 
    		VF0 testpmd-> set fwd mac 
    		VF0 testpmd-> start 
  
	After test need reset mirror rule::

    		PF testpmd-> reset port 0 mirror-rule 0
    		PF testpmd-> reset port 0 mirror-rule 1  
    		PF testpmd-> reset port 0 mirror-rule 2
    		PF testpmd-> reset port 0 mirror-rule 3  

 - 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 
    		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
    

> -----Original Message-----
> From: Wu, Jingjing
> Sent: Wednesday, June 10, 2015 2:24 PM
> To: dev at dpdk.org
> Cc: Wu, Jingjing; Liu, Jijiang; Jiajia, SunX; Zhang, Helin
> Subject: [PATCH v4 0/4] enable mirror functionality in i40e driver
> 
> This patch set enables mirror functionality in i40e driver, and
> redefines structure and macros used to configure mirror.
> 
> v2 changes:
>  - correct comments style
>  - add doc change
> 
> v3 changes:
>  - change the mirror rule type to support bit mask
>  - fix code style
> 
> v4 changes:
>  - correct the rule type check ixgbe
> 
> 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
> 
>  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(-)
> 
> --
> 1.9.3



More information about the dev mailing list