test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1 1/4] test_plans/ice_dcf_dual_vlan: split test suite
@ 2022-09-07 13:54 Song Jiale
  2022-09-07 13:54 ` [dts] [PATCH V1 2/4] test_plans/ice_iavf_dual_vlan: " Song Jiale
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Song Jiale @ 2022-09-07 13:54 UTC (permalink / raw)
  To: dts; +Cc: Song Jiale

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 120625 bytes --]

split the test suite of ice_qinq into ice_dcf_dual_vlan and ice_iavf_dual_vlan.

Signed-off-by: Song Jiale <songx.jiale@intel.com>
---
 ...an.rst => ice_dcf_dual_vlan_test_plan.rst} | 1635 +++++------------
 test_plans/index.rst                          |    3 +-
 2 files changed, 472 insertions(+), 1166 deletions(-)
 rename test_plans/{ice_qinq_test_plan.rst => ice_dcf_dual_vlan_test_plan.rst} (65%)

diff --git a/test_plans/ice_qinq_test_plan.rst b/test_plans/ice_dcf_dual_vlan_test_plan.rst
similarity index 65%
rename from test_plans/ice_qinq_test_plan.rst
rename to test_plans/ice_dcf_dual_vlan_test_plan.rst
index 3cf20fc3..508eb769 100644
--- a/test_plans/ice_qinq_test_plan.rst
+++ b/test_plans/ice_dcf_dual_vlan_test_plan.rst
@@ -7,12 +7,14 @@ ICE support QinQ protocol
 DPDK support QinQ protocol in Intel® Ethernet 800 Series as below requirements:
 * DCF support QinQ by add steering rule and vlan strip disable.
 * DCF is able to set port vlan by port representor.
-* AVF is able to configure inner VLAN filter when port vlan is enabled base on negotiation.
-* AVF is able to configure outer VLAN (8100) if no port VLANis enabled to compatible with legacy mode.
-this test plan contain 3 parts to cover above requirements:
 * DCF switch filter for QinQ.
 * DCF pvid support for QinQ.
-* AVF VLAN offload for QinQ.
+
+Intel® Ethernet 800 Series support l4 for QinQ switch filter in DCF driver is by
+dst MAC + outer VLAN id + inner VLAN id + dst IP + dst port, and port can support
+as eth / vlan / vlan / IP / tcp|udp.
+* Enable QINQ switch filter for IPv4/IPv6, IPv4 + TCP/UDP in non-pipeline mode.
+* Enable QINQ switch filter for IPv6 + TCP/UDP in pipeline mode.
 
 
 Prerequisites
@@ -78,7 +80,7 @@ Prerequisites
      ip link set dev ens785f0 vf 2 spoofchk off
      ip link set dev ens785f0 vf 3 spoofchk off
 
-12. For test cases for DCF switch filter(01-06), use below cmd to launch testpmd::
+12. For test cases for DCF switch filter(01-08), use below cmd to launch testpmd::
 
      ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:01.0,cap=dcf -a 0000:18:01.1 -a 0000:18:01.2 -a 0000:18:01.3 -- -i
      testpmd> set fwd rxonly
@@ -88,7 +90,7 @@ Prerequisites
 
    check the VF0 driver is net_ice_dcf.
 
-   For test cases for DCF pvid(07-09), use below cmd to launch testpmd::
+   For test cases for DCF pvid(09-11), use below cmd to launch testpmd::
 
     ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:01.0,cap=dcf,representor=[1] -a 0000:18:01.1 -a 0000:18:01.2 -a 0000:18:01.3 -- -i
     testpmd> set fwd mac
@@ -98,20 +100,6 @@ Prerequisites
 
    check the VF0 driver is net_ice_dcf.
 
-13. For AVF QinQ test cases(10-14), recreate Generate 1 VFs on PF0, reconfig the VF then launch testpmd::
-
-     echo 0 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs
-     ethtool --set-priv-flags ens785f0 vf-vlan-pruning on
-     echo 1 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs
-     ip link set ens785f0 vf 0 mac 00:11:22:33:44:11
-     ip link set dev ens785f0 vf 0 spoofchk off
-
-     ./usertools/dpdk-devbind.py -b vfio-pci 0000:18:01.0
-     ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:01.0 -- -i --rxq=16 --txq=16
-     testpmd> set fwd mac
-     testpmd> set verbose 1
-     testpmd> start
-
 DCF switch filter support pattern and input set
 -----------------------------------------------
 .. table::
@@ -594,1434 +582,751 @@ subcase: dst ip
    check the rule not exists in the list.
    send matched packets in step 2, check the packets are not to port 1.
 
+#Non-pipeline mode
+Test case 07: DCF switch for MAC_L4_QINQ
+========================================
+subcase: MAC_QINQ_IPV4
+----------------------
+The test case enable QINQ switch filter for IPv4 in non-pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv4.
 
-Test case 07: vlan strip when pvid enable
-=========================================
+Test Steps
+~~~~~~~~~~
+1. Validate a rule::
 
-1. enable vlan header stripping for VF1 by representor::
+     testpmd> flow validate 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 src is <ipv4 src> dst is <ipv4 dst> / end actions vf id 1 / end
 
-    testpmd> vlan set strip on 1
+   Get the message::
 
-    Port 2: reset event
+     Flow rule validated
 
-2. reset VF1(port 2)::
+2. Create a rule and list rules::
 
-    testpmd> port stop 2
-    testpmd> port reset 2
-    testpmd> port start 2
-    testpmd> start
+     testpmd> flow create 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 src is <ipv4 src> dst is <ipv4 dst> / end actions vf id 1 / end
 
-3. tester send qinq pkt and single vlan pkt to VF1::
+   Get the message::
 
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=21,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+     Flow rule #0 created
 
-4. check the pkts can be received in VF1 and fwd to tester without outer vlan header::
+   Check the flow list::
 
-    testpmd> port 2/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+     testpmd> flow list 0
 
-    port 2/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+   ID      Group   Prio    Attr    Rule
+   0       0       0       i--     ETH VLAN VLAN IPV4 => VF
 
-    10:15:10.958039 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:15:10.958121 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype 802.1Q (0x8100), length 518: vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
 
-    10:15:15.693894 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 21, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:15:15.693942 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+Tester::
 
-5. disable vlan header stripping for VF1::
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP(src="<ipv4 src>",dst="<ipv4 dst>")/("X"*80)],iface="<tester interface>")
 
-    testpmd> vlan set strip off 1
+DUT::
 
-    Port 2: reset event
+    testpmd> port 1/queue 0: received 1 packets
+     src=A4:BF:01:4D:6F:32 - dst=00:11:22:33:44:55 - type=0x8100 - length=122 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Receive queue=0x0
+     ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
 
-6. reset VF1::
+4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
 
-    testpmd> port stop 2
-    testpmd> port reset 2
-    testpmd> port start 2
-    testpmd> start
+Tester::
 
-7. repeat step 3, check the pkts can be received in VF1 and fwd to tester with outer vlan header::
+    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP(src="<ipv4 src>",dst="<ipv4 dst>")/("X"*80)],iface="<tester interface>")
 
-    testpmd> port 2/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP(src="<ipv4 src>",dst="<ipv4 dst>")/("X"*80)],iface="<tester interface>")
 
-    port 2/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IP(src="<ipv4 src>",dst="<ipv4 dst>")/("X"*80)],iface="<tester interface>")
 
-    10:17:55.321952 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:17:55.322008 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP(src="<ipv4 src change inputset>",dst="<ipv4 dst>")/("X"*80)],iface="<tester interface>")
 
-    10:17:58.009862 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 21, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:17:58.009908 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype 802.1Q (0x8100), length 518: vlan 21, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+5. Destroy a rule and list rules::
 
-8. repeat step 1,2, then enable vlan strip by AVF::
+     testpmd> flow destroy 0 rule 0
 
-    testpmd> vlan set strip on 2
+   Get the message::
 
-9. repeat step 3, check the pkts can be received in VF1 and fwd to tester without both outer and inner vlan header::
+     Flow rule #0 destroyed
 
-    testpmd> port 2/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+   Check the flow list::
 
-    port 2/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+     testpmd> flow list 0
 
-    10:28:01.642361 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:28:01.642438 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+   Check the rule not exists in the list.
+   Send matched packets in step 3, check the packets are not to port 1.
 
-    10:28:10.185876 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 21, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:28:10.185916 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+subcase: MAC_QINQ_IPV6
+----------------------
+The test case enable QINQ switch filter for IPv6 in non-pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv6.
 
-10. relaunch testpmd and enable vlan strip by AVF::
+Test Steps
+~~~~~~~~~~
+1. Validate a rule::
 
-     testpmd> vlan set strip on 2
+     testpmd> flow validate 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / end actions vf id 1 / end
 
-11. repeat step 1,2 and 3, check the pkts can be received in VF1 and fwd to tester without both outer and inner vlan header::
+   Get the message::
 
-     testpmd> port 2/queue 0: received 1 packets
-     src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
-     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+     Flow rule validated
 
-     port 2/queue 0: received 1 packets
-     src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
-     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+2. Create a rule and list rules::
 
-     10:28:01.642361 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-     10:28:01.642438 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     testpmd> flow create 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / end actions vf id 1 / end
 
-     10:28:10.185876 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 21, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-     10:28:10.185916 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+   Get the message::
 
+     Flow rule #0 created
 
-Test case 08: vlan insertion when pvid enable
-=============================================
+   Check the flow list::
 
-1. add tx port vlan for VF1 by representor 1::
+     testpmd> flow list 0
 
-    testpmd> tx_vlan set pvid 1 24 on
+   ID      Group   Prio    Attr    Rule
+   0       0       0       i--     ETH VLAN VLAN IPV6 => VF
 
-    Port 2: reset event
+3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
 
-2. reset VF1::
+Tester::
 
-    testpmd> port stop 2
-    testpmd> port reset 2
-    testpmd> port start 2
-    testpmd> start
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/("X"*80)],iface="<tester interface>")
 
-3. send a pkt without vlan header to VF2(VF2 rx, VF1 tx)::
+DUT::
 
-    sendp([Ether(dst="00:11:22:33:44:22",type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
-    sendp([Ether(dst="00:11:22:33:44:22",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    testpmd> port 1/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:55 - type=0x8100 - length=142 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV6_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV6  - l2_len=18 - inner_l2_len=4 - inner_l3_len=40 - Receive queue=0x0
+     ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
 
-4. check the dpdk can receive this pkt with VF2 and fwd this pkt with outer vlan header id 24 by VF1, and the vlan header ptype is 8100::
+4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
 
-    testpmd> port 4/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+Tester::
 
-    port 4/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/("X"*80)],iface="<tester interface>")
 
-    tcpdump -i ens786f0 -nn -e -v
-    11:08:01.061908 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    11:08:01.061987 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 518: vlan 24, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/("X"*80)],iface="<tester interface>")
 
-    11:08:06.773884 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    11:08:06.773928 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 522: vlan 24, p 0, ethertype 802.1Q, vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IPv6(dst="<ipv6 dst>")/("X"*80)],iface="<tester interface>")
 
-5. change the tpid of vlan header to 88A8 for VF1::
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst change inputset>")/("X"*80)],iface="<tester interface>")
 
-    testpmd> vlan set outer tpid 0x88a8 1
+5. Destroy a rule and list rules::
 
-6. reset VF1::
+     testpmd> flow destroy 0 rule 0
 
-    testpmd> port stop 2
-    testpmd> port reset 2
-    testpmd> port start 2
-    testpmd> start
+   Get the message::
 
-7. repeat step 3, check the dpdk can receive this pkt with VF2 and fwd this pkt with outer vlan header id 24 by VF1, and the vlan header ptype is 88a8::
+     Flow rule #0 destroyed
 
-    testpmd> port 4/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+   Check the flow list::
 
-    port 4/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+     testpmd> flow list 0
 
-    tcpdump -i ens786f0 -nn -e -v
-    11:10:32.441834 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    11:10:32.441883 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q-QinQ (0x88a8), length 518: vlan 24, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+   Check the rule not exists in the list.
+   Send matched packets in step 3, check the packets are not to port 1.
 
-    11:10:34.081863 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    11:10:34.081913 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q-QinQ (0x88a8), length 522: vlan 24, p 0, ethertype 802.1Q, vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+subcase: MAC_QINQ_IPV4_UDP
+--------------------------
+The test case enable QINQ switch filter for IPv4 + UDP in non-pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv4 + UDP.
 
-8. change the tpid of vlan header to 9100 for VF1::
+Test steps
+~~~~~~~~~~
+1. Validate a rule::
 
-    testpmd> vlan set outer tpid 0x9100 1
+     testpmd> flow validate 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 / udp src is <sport> dst is <dport> / end actions vf id 1 / end
 
-9. reset VF1::
+   Get the message::
 
-    testpmd> port stop 2
-    testpmd> port reset 2
-    testpmd> port start 2
-    testpmd> start
+     Flow rule validated
 
-10. repeat step 3, check the dpdk can receive this pkt with VF2 and fwd this pkt with outer vlan header id 24 by VF1, and the vlan header ptype is 9100::
+2. Create a rule and list rules::
 
-     testpmd> port 4/queue 0: received 1 packets
-     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
-     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+     testpmd> flow create 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 / udp src is <sport> dst is <dport> / end actions vf id 1 / end
 
-     port 4/queue 0: received 1 packets
-     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
-     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+   Get the message::
 
-     tcpdump -i ens786f0 -nn -e -v
-     11:12:13.237834 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-     11:12:13.237890 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q-9100 (0x9100), length 518: vlan 24, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     Flow rule #0 created
 
-     11:12:26.049869 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-     11:12:26.049920 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q-9100, vlan 24, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+   Check the flow list::
 
-11. enable tx_vlan for VF1 by AVF::
+     testpmd> flow list 0
 
-     testpmd> port stop 2
-     Stopping ports...
-     Checking link statuses...
-     Done
-     testpmd> tx_vlan set 2 11
-     testpmd> port start 2
+   ID      Group   Prio    Attr    Rule
+   0       0       0       i--     ETH VLAN VLAN IPV4 UDP => VF
 
-12. repeat step 3, check the dpdk can receive this pkt with VF2 and fwd this pkt with outer vlan header id 24, inner vlan id 11 by VF1::
+3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
 
-     testpmd> port 3/queue 0: received 1 packets
-     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
-     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+Tester::
 
-     port 3/queue 0: received 1 packets
-     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
-     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-     11:22:29.561918 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-     11:22:29.561992 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 522: vlan 24, p 0, ethertype 802.1Q, vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+DUT::
 
-     11:22:44.481889 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-     11:22:44.481922 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 526: vlan 24, p 0, ethertype 802.1Q, vlan 11, p 0, ethertype 802.1Q, vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    testpmd> port 1/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:55 - type=0x8100 - length=130 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_UDP  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4 INNER_L4_UDP  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - inner_l4_len=8 - Receive queue=0x0
+     ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
 
-13. relaunch testpmd and execute step 11 then step 1, 2 and 3, check the dpdk can receive this pkt with VF2 and fwd this pkt with outer vlan header id 24, inner vlan id 11 by VF1::
+4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
 
-     testpmd> port 3/queue 0: received 1 packets
-     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
-     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+Tester::
 
-     port 3/queue 0: received 1 packets
-     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
-     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-     11:22:29.561918 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-     11:22:29.561992 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 522: vlan 24, p 0, ethertype 802.1Q, vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-     11:22:44.481889 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-     11:22:44.481922 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 526: vlan 24, p 0, ethertype 802.1Q, vlan 11, p 0, ethertype 802.1Q, vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IP()/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/UDP(sport=<sport>,dport=<dport change inputset>)/("X"*80)],iface="<tester interface>")
 
-Test case 09: vlan filter when pvid enable
-==========================================
+5. Destroy a rule and list rules::
 
-1. reset test environment, create vfs and enable vlan prune flag::
+     testpmd> flow destroy 0 rule 0
 
-    ethtool --set-priv-flags ens785f0 vf-vlan-pruning on
+   Get the message::
 
-2. repeat Prerequisites steps from 7 to 12
+     Flow rule #0 destroyed
 
-3. enable vlan filter and add rx_vlan for VF1 by representor::
+   Check the flow list::
 
-    testpmd> vlan set filter on 1
-    testpmd> rx_vlan add 11 1
-    rte_eth_dev_vlan_filter(port_pi=1, vlan_id=11, on=1) failed diag=-95
+     testpmd> flow list 0
 
-4. enable vlan filter and add rx_vlan for VF1 by AVF::
+   Check the rule not exists in the list.
+   Send matched packets in step 3, check the packets are not to port 1.
 
-    testpmd> vlan set filter on 2
-    testpmd> rx_vlan add 11 2
+subcase: MAC_QINQ_IPV4_TCP
+--------------------------
+The test case enable QINQ switch filter for IPv4 + TCP in non-pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv4 + TCP.
 
-5. tester send qinq pkt and single vlan pkt which outer vlan id is 11 to VF1::
+Test Steps
+~~~~~~~~~~
+1. Validate a rule::
 
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+     testpmd> flow validate 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 / tcp src is <sport> dst is <dport> / end actions vf id 1 / end
 
-6. check the pkts can be received by VF1 and fwd to tester::
+   Get the message::
 
-    testpmd> port 2/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
-    port 2/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+     Flow rule validated
 
-    10:21:53.418039 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 11, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:21:53.418114 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype 802.1Q (0x8100), length 522: vlan 11, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+2. Create a rule and list rules::
 
-    10:22:00.005885 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:22:00.005919 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype 802.1Q (0x8100), length 518: vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     testpmd> flow create 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 / tcp src is <sport> dst is <dport> / end actions vf id 1 / end
 
-7. tester send qinq pkt and single vlan pkt which outer vlan id is 21 to VF1::
+   Get the message::
 
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=21,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=21,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+     Flow rule #0 created
 
-8. check the pkts can not be received by VF1.
+   Check the flow list::
 
-9. remove rx_vlan::
+     testpmd> flow list 0
 
-    testpmd> rx_vlan rm 11 2
+   ID      Group   Prio    Attr    Rule
+   0       0       0       i--     ETH VLAN VLAN IPV4 TCP => VF
 
-10. repeat step 5, check the pkts can not be received by VF1.
+3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
 
+Tester::
 
-Test case 10: Enable/Disable IAVF VLAN filtering
-================================================
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-1. enable vlan filtering on port VF::
+DUT::
 
-    testpmd> set fwd mac
-    Set mac packet forwarding mode
-    testpmd> vlan set filter on 0
+    testpmd> port 1/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:55 - type=0x8100 - length=142 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_TCP  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4 INNER_L4_TCP  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - inner_l4_len=20 - Receive queue=0x0
+     ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
 
-2. check the vlan mode is set successfully::
+4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
 
-    testpmd> show port info 0
+Tester::
 
-    ********************* Infos for port 0  *********************
-    ......
-    VLAN offload:
-    strip off, filter on, extend off, qinq strip off
+    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-3. tester send qinq pkt and single vlan pkt which outer vlan id is 1 to VF::
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IP()/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-4. check the pkts can't be received in VF.
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/TCP(sport=<sport>,dport=<dport change inputset>)/("X"*80)],iface="<tester interface>")
 
-5. add rx_vlan in VF::
+5. Destroy a rule and list rules::
 
-    testpmd> rx_vlan add 1 0
+     testpmd> flow destroy 0 rule 0
 
-6. repeat step 3, check the pkts can be received by VF and fwd to tester::
+   Get the message::
 
-    testpmd> port 0/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - hw ptype: L2_ETHER  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN  - l2_len=18 - inner_l2_len=4 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
-    port 0/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER  - sw ptype: L2_ETHER_VLAN  - l2_len=18 - Receive queue=0x0
-    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+     Flow rule #0 destroyed
 
-    tcpdump -i ens786f0 -nn -e -v
+   Check the flow list::
 
-    16:50:38.807158 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype 0x0800,
-    16:50:38.807217 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype 0x0800,
+     testpmd> flow list 0
 
-    16:51:06.083084 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype 0x0800,
-    16:51:06.083127 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype 0x0800,
+   Check the rule not exists in the list.
+   Send matched packets in step 3, check the packets are not to port 1.
 
-7. tester send qinq pkt and single vlan pkt which outer vlan id is 11 to VF::
+#Pipeline mode
+Test case 08: DCF switch for MAC_L4_QINQ_IPV6
+=============================================
+subcase: MAC_QINQ_IPV6_UDP
+--------------------------
+The test case enable QINQ switch filter for IPv6 + UDP in pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv6 + UDP.
 
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+Test Steps
+~~~~~~~~~~
+1. Validate a rule::
 
-8. check the pkts can not be received by VF.
+     testpmd> flow validate 0 priority 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / udp src is <sport> dst is <dport> / end actions vf id 1 / end
 
-9. remove rx_vlan in VF1::
+   Get the message::
 
-    testpmd> rx_vlan rm 1 0
+     Flow rule validated
 
-10. repeat step 3, check the pkts can not be received by VF.
+2. Create a rule and list rules::
 
+     testpmd> flow create 0 priority 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / udp src is <sport> dst is <dport> / end actions vf id 1 / end
 
-Test case 11: Enable/Disable IAVF VLAN header stripping
-=======================================================
+   Get the message::
 
-1. enable vlan filtering on port VF::
+     Flow rule #0 created
 
-    testpmd> vlan set filter on 0
-    testpmd> rx_vlan add 1 0
+   Check the flow list::
 
-2. check the vlan mode is set successfully::
+     testpmd> flow list 0
 
-    testpmd> show port info 0
+   ID      Group   Prio    Attr    Rule
+   0       0       0       i--     ETH VLAN VLAN IPV6 UDP => VF
 
-    ********************* Infos for port 0  *********************
-    ......
-    VLAN offload:
-    strip off, filter on, extend off, qinq strip off
+3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
 
-3. enable vlan header stripping on VF::
+Tester::
 
-    testpmd> vlan set strip on 0
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-4. check the vlan mode is set successfully::
+DUT::
 
-    testpmd> show port info 0
+    testpmd> port 1/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:55 - type=0x8100 - length=150 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV6_EXT_UNKNOWN L4_UDP  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV6 INNER_L4_UDP  - l2_len=18 - inner_l2_len=4 - inner_l3_len=40 - inner_l4_len=8 - Receive queue=0x0
+     ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
 
-    ********************* Infos for port 0  *********************
-    ......
-    VLAN offload:
-    strip on, filter on, extend off, qinq strip off
+4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
 
-5. tester send qinq pkt and single vlan pkt which outer vlan id is 1 to VF::
+Tester::
 
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-6. check the pkts can be received in VF and fwd to tester without outer vlan header::
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-    testpmd> port 0/queue 10: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0xc7b627aa - RSS queue=0xa - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0xa
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IPv6(dst="<ipv6 dst>")/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-    port 0/queue 10: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0xc7b627aa - RSS queue=0xa - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0xa
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst change inputset>")/UDP(sport=<sport>,dport=<dport change inputset>)/("X"*80)],iface="<tester interface>")
 
-    10:12:38.034948 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:12:38.035025 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+5. Destroy a rule and list rules::
 
-    10:12:44.806825 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:12:44.806865 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     testpmd> flow destroy 0 rule 0
 
-7. disable vlan header stripping on VF1::
+   Get the message::
 
-    testpmd> vlan set strip off 0
+     Flow rule #0 destroyed
 
-8. check the vlan mode is set successfully::
+   Check the flow list::
 
-    testpmd> show port info 0
+     testpmd> flow list 0
 
-    ********************* Infos for port 0  *********************
-    ......
-    VLAN offload:
-    strip off, filter on, extend off, qinq strip off
+   Check the rule not exists in the list.
+   Send matched packets in step 3, check the packets are not to port 1.
 
-9. repeat step 5, check the pkts can be received in VF and fwd to tester with outer vlan header::
+subcase: MAC_QINQ_IPV6_TCP
+--------------------------
+The test case enable QINQ switch filter for IPv6 + TCP in pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv6 + TCP.
 
-    testpmd> port 0/queue 10: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - RSS hash=0xc7b627aa - RSS queue=0xa - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0xa
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+Test steps
+~~~~~~~~~~
+1. Validate a rule::
 
-    port 0/queue 10: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0xc7b627aa - RSS queue=0xa - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0xa
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+     testpmd> flow validate 0 priority 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / tcp src is <sport> dst is <dport> / end actions vf id 1 / end
 
-    09:49:08.295172 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    09:49:08.295239 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+   Get the message::
 
-    09:49:41.043101 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    09:49:41.043166 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     Flow rule validated
 
+2. Create a rule and list rules::
 
-Test case 12: Enable/Disable IAVF VLAN header insertion
-=======================================================
+     testpmd> flow create 0 priority 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / tcp src is <sport> dst is <dport> / end actions vf id 1 / end
 
-1. disable vf-vlan-pruning flag::
+   Get the message::
 
-    echo 0 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs
-    ethtool --set-priv-flags ens785f0 vf-vlan-pruning off
+     Flow rule #0 created
 
-2. set up test environment again::
+   Check the flow list::
 
-    echo 1 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs
-    ip link set ens785f0 vf 0 mac 00:11:22:33:44:11
-    ip link set dev ens785f0 vf 0 spoofchk off
-    ./usertools/dpdk-devbind.py -b vfio-pci 0000:18:01.0
-    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:01.0 -- -i --rxq=16 --txq=16
-    testpmd> set fwd mac
-    testpmd> set verbose 1
+     testpmd> flow list 0
 
-3. enable vlan header insertion on VF::
+   ID      Group   Prio    Attr    Rule
+   0       0       0       i--     ETH VLAN VLAN IPV6 TCP => VF
 
-    testpmd> port stop 0
-    Stopping ports...
-    Checking link statuses...
-    Done
-    testpmd> tx_vlan set 0 1
-    testpmd> port start 0
+3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
 
-4. tester send pkt to VF::
+Tester::
 
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-5. check the pkts with vlan header can be received in tester::
+DUT::
 
-    testpmd> port 0/queue 13: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0xcaf4abfd - RSS queue=0xd - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0xd
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    testpmd> port 1/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:55 - type=0x8100 - length=162 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV6_EXT_UNKNOWN L4_TCP  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV6 INNER_L4_TCP  - l2_len=18 - inner_l2_len=4 - inner_l3_len=40 - inner_l4_len=20 - Receive queue=0x0
+     ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
 
-    port 0/queue 8: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0x28099b78 - RSS queue=0x8 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x8
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
 
-    10:32:55.566801 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:32:55.566856 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+Tester::
 
-    06:29:32.281896 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    06:29:32.281940 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 11, p 0, ethertype 802.1Q, vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-6. disable vlan header insertion on VF1::
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-    testpmd> port stop 0
-    Stopping ports...
-    Checking link statuses...
-    Done
-    testpmd> tx_vlan reset 0
-    testpmd> port start 0
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IPv6(dst="<ipv6 dst>")/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
 
-7. repeat step 4, check the pkts without vlan tag can be received in tester::
+    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst change inputset>")/TCP(sport=<sport>,dport=<dport change inputset>)/("X"*80)],iface="<tester interface>")
 
-    testpmd> port 0/queue 9: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0xa63e8869 - RSS queue=0x9 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x9
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+5. Destroy a rule and list rules::
 
-    port 0/queue 12: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0x6f5533bc - RSS queue=0xc - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0xc
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+     testpmd> flow destroy 0 rule 0
 
-    10:34:40.070754 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    10:34:40.070824 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+   Get the message::
 
-    06:36:57.641871 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    06:36:57.641909 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     Flow rule #0 destroyed
 
+   Check the flow list::
 
-Test case 13: Enable/disable AVF CRC stripping
-==============================================
+     testpmd> flow list 0
 
-1. start testpmd with "--disable-crc-strip"::
+   Check the rule not exists in the list.
+   Send matched packets in step 3, check the packets are not to port 1.
 
-    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 20-23 -n 4 -a 0000:18:01.0 -- -i --rxq=16 --txq=16 --disable-crc-strip
-    testpmd> set fwd mac
-    testpmd> set verbose 1
+Test case 09: DCF vlan strip when pvid enable
+=============================================
 
-2. send pkts to VF::
+1. enable vlan header stripping for VF1 by representor::
 
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    testpmd> vlan set strip on 1
 
-3. check VF1 receive this pkts with CRC::
+    Port 2: reset event
 
-    testpmd> port 0/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0x890d9a70 - RSS queue=0x0 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+2. reset VF1(port 2)::
 
-    show port stats all
+    testpmd> port stop 2
+    testpmd> port reset 2
+    testpmd> port start 2
+    testpmd> start
 
-    ######################## NIC statistics for port 0  ########################
-    RX-packets: 1          RX-missed: 0          RX-bytes:  518
-    RX-errors: 0
-    RX-nombuf:  0
-    TX-packets: 1          TX-errors: 0          TX-bytes:  514
+3. tester send qinq pkt and single vlan pkt to VF1::
 
-    Throughput (since last show)
-    Rx-pps:            0          Rx-bps:            0
-    Tx-pps:            0          Tx-bps:            0
-    ############################################################################
-    clear port stats all
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=21,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
 
-4. enable crc strip in testpmd::
+4. check the pkts can be received in VF1 and fwd to tester without outer vlan header::
 
-    testpmd> stop
-    testpmd> port stop 0
-    testpmd> port config 0 rx_offload keep_crc off
-    testpmd> port start 0
-    testpmd> start
+    testpmd> port 2/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-5. repeat step 2, check VF receive this pkts without CRC::
+    port 2/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-    testpmd> port 0/queue 2: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0xa94c21d2 - RSS queue=0x2 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x2
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    10:15:10.958039 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:15:10.958121 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype 802.1Q (0x8100), length 518: vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-    show port stats all
+    10:15:15.693894 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 21, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:15:15.693942 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-    ######################## NIC statistics for port 0  ########################
-    RX-packets: 1          RX-missed: 0          RX-bytes:  514
-    RX-errors: 0
-    RX-nombuf:  0
-    TX-packets: 1          TX-errors: 0          TX-bytes:  514
+5. disable vlan header stripping for VF1::
 
-    Throughput (since last show)
-    Rx-pps:            0          Rx-bps:            0
-    Tx-pps:            0          Tx-bps:            0
-    ############################################################################
-    clear port stats all
+    testpmd> vlan set strip off 1
 
-6. disable crc strip in testpmd::
+    Port 2: reset event
 
-    testpmd> stop
-    testpmd> port stop 0
-    testpmd> port config 0 rx_offload keep_crc on
-    testpmd> port start 0
-    testpmd> start
+6. reset VF1::
 
-7. repeat step 2, check VF1 receive this pkts with CRC::
+    testpmd> port stop 2
+    testpmd> port reset 2
+    testpmd> port start 2
+    testpmd> start
 
-    testpmd> port 0/queue 0: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0x79c10190 - RSS queue=0x0 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+7. repeat step 3, check the pkts can be received in VF1 and fwd to tester with outer vlan header::
 
-    show port stats all
+    testpmd> port 2/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-    ######################## NIC statistics for port 0  ########################
-    RX-packets: 1          RX-missed: 0          RX-bytes:  518
-    RX-errors: 0
-    RX-nombuf:  0
-    TX-packets: 1          TX-errors: 0          TX-bytes:  514
+    port 2/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-    Throughput (since last show)
-    Rx-pps:            0          Rx-bps:            0
-    Tx-pps:            0          Tx-bps:            0
-    ############################################################################
-    clear port stats all
+    10:17:55.321952 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:17:55.322008 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-8. re-launch testpmd without "--disable-crc-strip"::
+    10:17:58.009862 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 21, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:17:58.009908 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype 802.1Q (0x8100), length 518: vlan 21, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 20-23 -n 4 -a 0000:18:01.0 -- -i --rxq=16 --txq=16
-    testpmd> set fwd mac
-    testpmd> set verbose 1
+8. repeat step 1,2, then enable vlan strip by AVF::
 
-9. repeat step 2, check VF receive this pkts without CRC::
+    testpmd> vlan set strip on 2
 
-    testpmd> port 0/queue 2: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0x898ada82 - RSS queue=0x2 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x2
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+9. repeat step 3, check the pkts can be received in VF1 and fwd to tester without both outer and inner vlan header::
 
-    show port stats all
+    testpmd> port 2/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-    ######################## NIC statistics for port 0  ########################
-    RX-packets: 1          RX-missed: 0          RX-bytes:  514
-    RX-errors: 0
-    RX-nombuf:  0
-    TX-packets: 1          TX-errors: 0          TX-bytes:  514
+    port 2/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-    Throughput (since last show)
-    Rx-pps:            0          Rx-bps:            0
-    Tx-pps:            0          Tx-bps:            0
-    ############################################################################
+    10:28:01.642361 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:28:01.642438 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
+    10:28:10.185876 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 21, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:28:10.185916 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-Test case 14: AVF CRC strip and Vlan strip co-exists
-====================================================
+10. relaunch testpmd and enable vlan strip by AVF::
 
-1. start testpmd with crc strip enable, vlan strip disable::
+     testpmd> vlan set strip on 2
 
-    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 20-23 -n 4 -a 0000:18:01.0 -- -i --rxq=16 --txq=16
-    testpmd> set fwd mac
-    testpmd> set verbose 1
-    testpmd> show port info 0
-    ********************* Infos for port 0  *********************
-    MAC address: 00:11:22:33:44:11
-    Device name: 0000:18:01.1
-    Driver name: net_iavf
-    ......
-    VLAN offload:
-      strip off, filter off, extend off, qinq strip off
-
-2. request disable vlan strip::
-
-    testpmd> vlan set strip off 0
-
-3. check the vlan strip still disable::
-
-    testpmd> show port info 0
-    ********************* Infos for port 0  *********************
-    MAC address: 00:11:22:33:44:11
-    Device name: 0000:18:01.1
-    Driver name: net_iavf
-    ......
-    VLAN offload:
-      strip off, filter off, extend off, qinq strip off
-
-4. set vlan filter on and add rx_vlan 1::
-
-    testpmd> vlan set filter on 0
-    testpmd> rx_vlan add 1 0
-    testpmd> start
+11. repeat step 1,2 and 3, check the pkts can be received in VF1 and fwd to tester without both outer and inner vlan header::
 
-5. send qinq pkts to check vlan strip is off, crc strip is on::
+     testpmd> port 2/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
+     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+     port 2/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
+     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-    testpmd> port 0/queue 6: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - RSS hash=0xf6521426 - RSS queue=0x6 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0x6
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+     10:28:01.642361 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     10:28:01.642438 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-    show port stats all
+     10:28:10.185876 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 21, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     10:28:10.185916 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-    ######################## NIC statistics for port 0  ########################
-    RX-packets: 1          RX-missed: 0          RX-bytes:  522
-    RX-errors: 0
-    RX-nombuf:  0
-    TX-packets: 1          TX-errors: 0          TX-bytes:  522
 
-    Throughput (since last show)
-    Rx-pps:            0          Rx-bps:            0
-    Tx-pps:            0          Tx-bps:            0
-    ############################################################################
+Test case 10: DCF vlan insertion when pvid enable
+=================================================
 
-    09:07:45.863251 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    09:07:45.863340 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+1. add tx port vlan for VF1 by representor 1::
 
-6. request enable vlan strip::
+    testpmd> tx_vlan set pvid 1 24 on
 
-    testpmd> vlan set strip on 0
+    Port 2: reset event
 
-7. check the vlan strip enable successfully::
+2. reset VF1::
 
-    testpmd> show port info 0
-    ********************* Infos for port 0  *********************
-    MAC address: 00:11:22:33:44:11
-    Device name: 0000:18:01.1
-    Driver name: net_iavf
-    ......
-    VLAN offload:
-      strip on, filter off, extend off, qinq strip off
+    testpmd> port stop 2
+    testpmd> port reset 2
+    testpmd> port start 2
+    testpmd> start
 
-8. repeat step 5, send qinq pkts to check vlan strip is on(tx-4), crc strip is on::
+3. send a pkt without vlan header to VF2(VF2 rx, VF1 tx)::
 
-    testpmd> port 0/queue 6: received 1 packets
-    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0xf6521426 - RSS queue=0x6 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0x6
-    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    sendp([Ether(dst="00:11:22:33:44:22",type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    sendp([Ether(dst="00:11:22:33:44:22",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
 
-    show port stats all
+4. check the dpdk can receive this pkt with VF2 and fwd this pkt with outer vlan header id 24 by VF1, and the vlan header ptype is 8100::
 
-    ######################## NIC statistics for port 0  ########################
-    RX-packets: 1          RX-missed: 0          RX-bytes:  522
-    RX-errors: 0
-    RX-nombuf:  0
-    TX-packets: 1          TX-errors: 0          TX-bytes:  518
+    testpmd> port 4/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-    Throughput (since last show)
-    Rx-pps:            0          Rx-bps:            0
-    Tx-pps:            0          Tx-bps:            0
-    ############################################################################
+    port 4/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-    11:09:03.918907 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    tcpdump -i ens786f0 -nn -e -v
+    11:08:01.061908 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-    11:09:03.918952 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    11:08:01.061987 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 518: vlan 24, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-9. request disable vlan strip::
+    11:08:06.773884 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    11:08:06.773928 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 522: vlan 24, p 0, ethertype 802.1Q, vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-    testpmd> vlan set strip off 0
+5. change the tpid of vlan header to 88A8 for VF1::
 
-10. check the vlan strip disable successfully::
+    testpmd> vlan set outer tpid 0x88a8 1
 
-     testpmd> show port info 0
-     ********************* Infos for port 0  *********************
-     MAC address: 00:11:22:33:44:11
-     Device name: 0000:18:01.1
-     Driver name: net_iavf
-     ......
-     VLAN offload:
-       strip off, filter on, extend off, qinq strip off
+6. reset VF1::
 
-11. request disable crc strip::
+    testpmd> port stop 2
+    testpmd> port reset 2
+    testpmd> port start 2
+    testpmd> start
 
-     testpmd> stop
-     testpmd> port stop 0
-     testpmd> port config 0 rx_offload keep_crc on
-     testpmd> port start 0
-     testpmd> start
+7. repeat step 3, check the dpdk can receive this pkt with VF2 and fwd this pkt with outer vlan header id 24 by VF1, and the vlan header ptype is 88a8::
 
-12. repeat step 5, send qinq pkts to check vlan strip is off, crc strip is off(rx+4)::
+    testpmd> port 4/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-     testpmd> port 0/queue 7: received 1 packets
-     src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - RSS hash=0xbc8b1857 - RSS queue=0x7 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Tail/CRC: 0x58585858/0x6d870bf6 - Receive queue=0x7
-     ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    port 4/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-     show port stats all
-     ######################## NIC statistics for port 0  ########################
-     RX-packets: 1          RX-missed: 0          RX-bytes:  526
-     RX-errors: 0
-     RX-nombuf:  0
-     TX-packets: 1          TX-errors: 0          TX-bytes:  522
+    tcpdump -i ens786f0 -nn -e -v
+    11:10:32.441834 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    11:10:32.441883 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q-QinQ (0x88a8), length 518: vlan 24, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-     Throughput (since last show)
-     Rx-pps:            0          Rx-bps:            0
-     Tx-pps:            0          Tx-bps:            0
-     ############################################################################
+    11:10:34.081863 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    11:10:34.081913 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q-QinQ (0x88a8), length 522: vlan 24, p 0, ethertype 802.1Q, vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-     10:23:57.350934 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-     10:23:57.351008 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
-     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+8. change the tpid of vlan header to 9100 for VF1::
 
-13. request enable vlan strip::
+    testpmd> vlan set outer tpid 0x9100 1
 
-     testpmd> vlan set strip on 0
-     iavf_execute_vf_cmd(): No response or return failure (-64) for cmd 54
-     iavf_config_vlan_strip_v2(): fail to execute command VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2
-     rx_vlan_strip_set(port_pi=0, on=1) failed diag=-5
+9. reset VF1::
 
-14. repeat step 5, send qinq pkts to check the vlan strip can not enable::
+    testpmd> port stop 2
+    testpmd> port reset 2
+    testpmd> port start 2
+    testpmd> start
 
-     testpmd> port 0/queue 7: received 1 packets
-     src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0xbc8b1857 - RSS queue=0x7 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Tail/CRC: 0x58585858/0x6d870bf6 - Receive queue=0x7
-     ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+10. repeat step 3, check the dpdk can receive this pkt with VF2 and fwd this pkt with outer vlan header id 24 by VF1, and the vlan header ptype is 9100::
 
-     show port stats all
-     ######################## NIC statistics for port 0  ########################
-     RX-packets: 1          RX-missed: 0          RX-bytes:  526
-     RX-errors: 0
-     RX-nombuf:  0
-     TX-packets: 1          TX-errors: 0          TX-bytes:  522
+     testpmd> port 4/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
+     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-     Throughput (since last show)
-     Rx-pps:            0          Rx-bps:            0
-     Tx-pps:            0          Tx-bps:            0
-     ############################################################################
+     port 4/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
+     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-     10:26:08.346936 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     tcpdump -i ens786f0 -nn -e -v
+     11:12:13.237834 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
      196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-     10:26:08.347006 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     11:12:13.237890 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q-9100 (0x9100), length 518: vlan 24, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
      196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-15. request disable vlan strip::
-
-     vlan set strip off 0
-
-16. check the vlan strip still disable::
-
-     testpmd> show port info 0
-     ********************* Infos for port 0  *********************
-     MAC address: 00:11:22:33:44:11
-     Device name: 0000:18:01.1
-     Driver name: net_iavf
-     ......
-     VLAN offload:
-       strip off, filter on, extend off, qinq strip off
-
-17. request enable crc strip::
-
-     testpmd> stop
-     testpmd> port stop 0
-     testpmd> port config 0 rx_offload keep_crc off
-     testpmd> port start 0
-     testpmd> start
-
-18. repeat step 5, send qinq pkts to check the crc strip enable successfully::
-
-     testpmd> port 0/queue 3: received 1 packets
-     src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - RSS hash=0x2b4ad203 - RSS queue=0x3 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Receive queue=0x3
-     ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
-     port 0/queue 3: sent 1 packets
-     src=00:11:22:33:44:11 - dst=02:00:00:00:00:00 - type=0x8100 - length=522 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Send queue=0x3
-     ol_flags: PKT_RX_L4_CKSUM_UNKNOWN PKT_RX_IP_CKSUM_UNKNOWN PKT_RX_OUTER_L4_CKSUM_UNKNOWN
-
-     show port stats all
-     ######################## NIC statistics for port 0  ########################
-     RX-packets: 1          RX-missed: 0          RX-bytes:  522
-     RX-errors: 0
-     RX-nombuf:  0
-     TX-packets: 1          TX-errors: 0          TX-bytes:  522
-
-     Throughput (since last show)
-     Rx-pps:            0          Rx-bps:            0
-     Tx-pps:            0          Tx-bps:            0
-     ############################################################################
-
-     10:29:19.995352 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     11:12:26.049869 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
      196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-     10:29:19.995424 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     11:12:26.049920 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q-9100, vlan 24, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
      196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-====================================
-ICE DCF QINQ Switch Filter Test Plan
-====================================
-
-Description
-===========
-Intel® Ethernet 800 Series support l4 for QinQ switch filter in DCF driver is by
-dst MAC + outer VLAN id + inner VLAN id + dst IP + dst port, and port can support
-as eth / vlan / vlan / IP / tcp|udp.
-* Enable QINQ switch filter for IPv4/IPv6, IPv4 + TCP/UDP in non-pipeline mode. 
-* Enable QINQ switch filter for IPv6 + TCP/UDP in pipeline mode. 
-
-Prerequisites
-=============
-
-Hardware
---------
-Supportted NICs: Intel® Ethernet Network Adapter E810-XXVDA4/Intel® Ethernet Network Adapter E810-CQDA2
-
-Software
---------
-dpdk: http://dpdk.org/git/dpdk
-scapy: http://www.secdev.org/projects/scapy/
-
-General Set Up
---------------
-1. Compile DPDK::
-
-    # CC=gcc meson --werror -Denable_kmods=True -Dlibdir=lib --default-library=static x86_64-native-linuxapp-gcc
-    # ninja -C x86_64-native-linuxapp-gcc -j 110
-
-2. Get the pci device id and interface of DUT and tester. 
-   For example, 0000:3b:00.0 and 0000:af:00.0 is pci device id,
-   ens785f0 and ens260f0 is interface::
-
-    <dpdk dir># ./usertools/dpdk-devbind.py -s
-
-    0000:3b:00.0 'Ethernet Controller E810-C for SFP 1593' if=ens785f0 drv=ice unused=vfio-pci
-    0000:af:00.0 'Ethernet Controller XXV710 for 25GbE SFP28 158b' if=ens260f0 drv=i40e unused=vfio-pci
-
-4. Generate 2 VFs on PF0::
+11. enable tx_vlan for VF1 by AVF::
 
-    # echo 2 > /sys/bus/pci/devices/0000:3b:00.0/sriov_numvfs
+     testpmd> port stop 2
+     Stopping ports...
+     Checking link statuses...
+     Done
+     testpmd> tx_vlan set 2 11
+     testpmd> port start 2
 
-5. Get VF pci device id and interface of DUT.
+12. repeat step 3, check the dpdk can receive this pkt with VF2 and fwd this pkt with outer vlan header id 24, inner vlan id 11 by VF1::
 
-    # ./usertools/dpdk-devbind.py -s
+     testpmd> port 3/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
+     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-     0000:3b:01.0 'Ethernet Adaptive Virtual Function 1889' if=ens785f0v0 drv=iavf unused=vfio-pci
-     0000:3b:01.1 'Ethernet Adaptive Virtual Function 1889' if=ens785f0v1 drv=iavf unused=vfio-pci
+     port 3/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
+     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-6. Set VF0 as trust::
+     11:22:29.561918 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     11:22:29.561992 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 522: vlan 24, p 0, ethertype 802.1Q, vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-    # ip link set ens785f0 vf 0 trust on
+     11:22:44.481889 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     11:22:44.481922 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 526: vlan 24, p 0, ethertype 802.1Q, vlan 11, p 0, ethertype 802.1Q, vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-7. Bind the DUT port to dpdk::
+13. relaunch testpmd and execute step 11 then step 1, 2 and 3, check the dpdk can receive this pkt with VF2 and fwd this pkt with outer vlan header id 24, inner vlan id 11 by VF1::
 
-    <dpdk dir># ./usertools/dpdk-devbind.py -b vfio-pci <DUT port pci device id>
+     testpmd> port 3/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x0800 - length=514 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
+     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-Test case
-=========
+     port 3/queue 0: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:22 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
+     ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-Common Steps
-------------
-1. Launch the userland ``testpmd`` application on DUT as follows::
+     11:22:29.561918 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     11:22:29.561992 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 522: vlan 24, p 0, ethertype 802.1Q, vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-    <dpdk build dir>/app/dpdk-testpmd <EAL options> -a <DUT port pci device id> -- -i 
+     11:22:44.481889 00:00:00:00:00:00 > 00:11:22:33:44:22, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     11:22:44.481922 00:11:22:33:44:11 > 02:00:00:00:00:02, ethertype 802.1Q (0x8100), length 526: vlan 24, p 0, ethertype 802.1Q, vlan 11, p 0, ethertype 802.1Q, vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-..note:: 
+Test case 11: DCF vlan filter when pvid enable
+==============================================
 
-    For <EAL options>, you can use "-c 0x6 -n 4", you can also refer to testpmd doc for other setings.
-    For <DUT port pci device id>, you can use "0000:3b:01.0,cap=dcf -a 0000:3b:01.1" for this test plan.
+1. reset test environment, create vfs and enable vlan prune flag::
 
-2. Set verbose::
-    
-     testpmd> set verbose 1
-    
-3. Set fwd engine and start::
+    ethtool --set-priv-flags ens785f0 vf-vlan-pruning on
 
-     testpmd> set fwd rxonly
-     testpmd> start
+2. repeat Prerequisites steps from 7 to 12
 
-4. Show port info::
+3. enable vlan filter and add rx_vlan for VF1 by representor::
 
-     testpmd> show port info all
+    testpmd> vlan set filter on 1
+    testpmd> rx_vlan add 11 1
+    rte_eth_dev_vlan_filter(port_pi=1, vlan_id=11, on=1) failed diag=-95
 
-   Check the VF0 driver is net_ice_dcf.
-
-All the packets in this test plan use below settings:
-dst mac: 00:11:22:33:44:55
-dst mac change inputset: 00:11:22:33:44:33
-ipv4 src: 192.168.1.1
-ipv4 dst: 192.168.1.2
-ipv4 src change inputset: 192.168.1.3
-ipv4 dst change inputset: 192.168.1.4
-ipv6 dst: CDCD:910A:2222:5498:8475:1111:3900:2020 
-ipv6 dst change inputset: CDCD:910A:2222:5498:8475:1111:3900:2023
-outer vlan tci: 2
-outer vlan tci change inputset: 1
-inner vlan tci: 1
-inner vlan tci change inputset: 2
-sport: 50
-sport change inputset: 52
-dport: 23
-dport change inputset: 22
+4. enable vlan filter and add rx_vlan for VF1 by AVF::
 
-#Non-pipeline mode
+    testpmd> vlan set filter on 2
+    testpmd> rx_vlan add 11 2
 
-Test Case 1: MAC_QINQ_IPV4
---------------------------
-The test case enable QINQ switch filter for IPv4 in non-pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv4.
+5. tester send qinq pkt and single vlan pkt which outer vlan id is 11 to VF1::
 
-Test Steps
-~~~~~~~~~~
-1. Validate a rule::
-   
-     testpmd> flow validate 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 src is <ipv4 src> dst is <ipv4 dst> / end actions vf id 1 / end
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
 
-   Get the message::
+6. check the pkts can be received by VF1 and fwd to tester::
 
-     Flow rule validated
+    testpmd> port 2/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    port 2/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
 
-2. Create a rule and list rules::
+    10:21:53.418039 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 11, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:21:53.418114 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype 802.1Q (0x8100), length 522: vlan 11, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-     testpmd> flow create 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 src is <ipv4 src> dst is <ipv4 dst> / end actions vf id 1 / end
-     
-   Get the message::
+    10:22:00.005885 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:22:00.005919 00:11:22:33:44:22 > 02:00:00:00:00:03, ethertype 802.1Q (0x8100), length 518: vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
 
-     Flow rule #0 created
-   
-   Check the flow list::
+7. tester send qinq pkt and single vlan pkt which outer vlan id is 21 to VF1::
 
-     testpmd> flow list 0
-   
-   ID      Group   Prio    Attr    Rule
-   0       0       0       i--     ETH VLAN VLAN IPV4 => VF
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=21,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=21,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
 
-3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
+8. check the pkts can not be received by VF1.
 
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP(src="<ipv4 src>",dst="<ipv4 dst>")/("X"*80)],iface="<tester interface>")
-
-DUT::
-
-    testpmd> port 1/queue 0: received 1 packets
-  src=A4:BF:01:4D:6F:32 - dst=00:11:22:33:44:55 - type=0x8100 - length=122 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Receive queue=0x0
-  ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
-
-4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
-
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP(src="<ipv4 src>",dst="<ipv4 dst>")/("X"*80)],iface="<tester interface>")
-    
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP(src="<ipv4 src>",dst="<ipv4 dst>")/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IP(src="<ipv4 src>",dst="<ipv4 dst>")/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP(src="<ipv4 src change inputset>",dst="<ipv4 dst>")/("X"*80)],iface="<tester interface>")
-
-5. Destroy a rule and list rules::
-
-     testpmd> flow destroy 0 rule 0
-  
-   Get the message::
-
-     Flow rule #0 destroyed
-
-   Check the flow list::
-
-     testpmd> flow list 0
-
-   Check the rule not exists in the list.
-   Send matched packets in step 3, check the packets are not to port 1.
-
-Test Case 2: MAC_QINQ_IPV6
---------------------------
-The test case enable QINQ switch filter for IPv6 in non-pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv6.
-
-Test Steps
-~~~~~~~~~~
-1. Validate a rule::
-   
-     testpmd> flow validate 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / end actions vf id 1 / end
-
-   Get the message::
-
-     Flow rule validated
-
-2. Create a rule and list rules::
-
-     testpmd> flow create 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / end actions vf id 1 / end
-
-   Get the message::
-
-     Flow rule #0 created
-   
-   Check the flow list::
-
-     testpmd> flow list 0
-
-   ID      Group   Prio    Attr    Rule
-   0       0       0       i--     ETH VLAN VLAN IPV6 => VF
-
-3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
-
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/("X"*80)],iface="<tester interface>")
-
-DUT::
-
-    testpmd> port 1/queue 0: received 1 packets
-  src=00:00:00:00:00:00 - dst=00:11:22:33:44:55 - type=0x8100 - length=142 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV6_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV6  - l2_len=18 - inner_l2_len=4 - inner_l3_len=40 - Receive queue=0x0
-  ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
-
-4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
-
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/("X"*80)],iface="<tester interface>")
-   
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IPv6(dst="<ipv6 dst>")/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst change inputset>")/("X"*80)],iface="<tester interface>")
-
-5. Destroy a rule and list rules::
-
-     testpmd> flow destroy 0 rule 0
-  
-   Get the message::
-
-     Flow rule #0 destroyed
-
-   Check the flow list::
-
-     testpmd> flow list 0
-
-   Check the rule not exists in the list.
-   Send matched packets in step 3, check the packets are not to port 1.
-
-Test Case 3: MAC_QINQ_IPV4_UDP
-------------------------------
-The test case enable QINQ switch filter for IPv4 + UDP in non-pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv4 + UDP.
-
-Test steps
-~~~~~~~~~~
-1. Validate a rule::
-   
-     testpmd> flow validate 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 / udp src is <sport> dst is <dport> / end actions vf id 1 / end
-
-   Get the message::
-
-     Flow rule validated
-
-2. Create a rule and list rules::
-
-     testpmd> flow create 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 / udp src is <sport> dst is <dport> / end actions vf id 1 / end
-
-   Get the message::
-
-     Flow rule #0 created
-   
-   Check the flow list::
-
-     testpmd> flow list 0
-
-   ID      Group   Prio    Attr    Rule
-   0       0       0       i--     ETH VLAN VLAN IPV4 UDP => VF
-
-3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
-
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-DUT::
-
-    testpmd> port 1/queue 0: received 1 packets
-  src=00:00:00:00:00:00 - dst=00:11:22:33:44:55 - type=0x8100 - length=130 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_UDP  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4 INNER_L4_UDP  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - inner_l4_len=8 - Receive queue=0x0
-  ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
-
-4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
-
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-    
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IP()/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/UDP(sport=<sport>,dport=<dport change inputset>)/("X"*80)],iface="<tester interface>")
-
-5. Destroy a rule and list rules::
-
-     testpmd> flow destroy 0 rule 0
-  
-   Get the message::
-
-     Flow rule #0 destroyed
-
-   Check the flow list::
-
-     testpmd> flow list 0
-
-   Check the rule not exists in the list.
-   Send matched packets in step 3, check the packets are not to port 1.
-
-Test Case 4: MAC_QINQ_IPV4_TCP
-------------------------------
-The test case enable QINQ switch filter for IPv4 + TCP in non-pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv4 + TCP.
-
-Test Steps
-~~~~~~~~~~
-1. Validate a rule::
-   
-     testpmd> flow validate 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 / tcp src is <sport> dst is <dport> / end actions vf id 1 / end
-
-   Get the message::
-
-     Flow rule validated
-
-2. Create a rule and list rules::
-
-     testpmd> flow create 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv4 / tcp src is <sport> dst is <dport> / end actions vf id 1 / end
-
-   Get the message::
-
-     Flow rule #0 created
-   
-   Check the flow list::
-
-     testpmd> flow list 0
-
-   ID      Group   Prio    Attr    Rule
-   0       0       0       i--     ETH VLAN VLAN IPV4 TCP => VF
-
-3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
-
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-DUT::
-
-    testpmd> port 1/queue 0: received 1 packets
-  src=00:00:00:00:00:00 - dst=00:11:22:33:44:55 - type=0x8100 - length=142 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_TCP  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4 INNER_L4_TCP  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - inner_l4_len=20 - Receive queue=0x0
-  ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
-
-4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
-
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IP()/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IP()/TCP(sport=<sport>,dport=<dport change inputset>)/("X"*80)],iface="<tester interface>")
-
-5. Destroy a rule and list rules::
-
-     testpmd> flow destroy 0 rule 0
-  
-   Get the message::
-
-     Flow rule #0 destroyed
-
-   Check the flow list::
-
-     testpmd> flow list 0
-
-   Check the rule not exists in the list.
-   Send matched packets in step 3, check the packets are not to port 1.
-
-#Pipeline mode
-
-Test Case 5: MAC_QINQ_IPV6_UDP
-------------------------------
-The test case enable QINQ switch filter for IPv6 + UDP in pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv6 + UDP.
-
-Test Steps
-~~~~~~~~~~
-1. Validate a rule::
-   
-     testpmd> flow validate 0 priority 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / udp src is <sport> dst is <dport> / end actions vf id 1 / end
-
-   Get the message::
-
-     Flow rule validated
-
-2. Create a rule and list rules::
-
-     testpmd> flow create 0 priority 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / udp src is <sport> dst is <dport> / end actions vf id 1 / end
-
-   Get the message::
-
-     Flow rule #0 created
-   
-   Check the flow list::
-
-     testpmd> flow list 0
-
-   ID      Group   Prio    Attr    Rule
-   0       0       0       i--     ETH VLAN VLAN IPV6 UDP => VF
-
-3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
-
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-DUT::
-
-    testpmd> port 1/queue 0: received 1 packets
-  src=00:00:00:00:00:00 - dst=00:11:22:33:44:55 - type=0x8100 - length=150 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV6_EXT_UNKNOWN L4_UDP  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV6 INNER_L4_UDP  - l2_len=18 - inner_l2_len=4 - inner_l3_len=40 - inner_l4_len=8 - Receive queue=0x0
-  ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
-
-4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
-
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-    
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IPv6(dst="<ipv6 dst>")/UDP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst change inputset>")/UDP(sport=<sport>,dport=<dport change inputset>)/("X"*80)],iface="<tester interface>")
-
-5. Destroy a rule and list rules::
-
-     testpmd> flow destroy 0 rule 0
-  
-   Get the message::
-
-     Flow rule #0 destroyed
-
-   Check the flow list::
-
-     testpmd> flow list 0
-
-   Check the rule not exists in the list.
-   Send matched packets in step 3, check the packets are not to port 1.
-
-Test case 6: MAC_QINQ_IPV6_TCP
-------------------------------
-The test case enable QINQ switch filter for IPv6 + TCP in pipeline mode, and port can support as dst MAC + outer VLAN id + inner VLAN id + IPv6 + TCP.
-
-Test steps
-~~~~~~~~~~
-1. Validate a rule::
-   
-     testpmd> flow validate 0 priority 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / tcp src is <sport> dst is <dport> / end actions vf id 1 / end
-
-   Get the message::
-
-     Flow rule validated
-
-2. Create a rule and list rules::
-
-     testpmd> flow create 0 priority 0 ingress pattern eth dst is <dst mac> / vlan tci is <outer vlan tci> / vlan tci is <inner vlan tci> / ipv6 dst is <ipv6 dst> / tcp src is <sport> dst is <dport> / end actions vf id 1 / end
-
-   Get the message::
-
-     Flow rule #0 created
-   
-   Check the flow list::
-
-     testpmd> flow list 0
-
-   ID      Group   Prio    Attr    Rule
-   0       0       0       i--     ETH VLAN VLAN IPV6 TCP => VF
-   
-3. Send matched packet in scapy on tester, check the port 1 of DUT received this packet.
-
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-DUT::
-
-    testpmd> port 1/queue 0: received 1 packets
-  src=00:00:00:00:00:00 - dst=00:11:22:33:44:55 - type=0x8100 - length=162 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV6_EXT_UNKNOWN L4_TCP  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV6 INNER_L4_TCP  - l2_len=18 - inner_l2_len=4 - inner_l3_len=40 - inner_l4_len=20 - Receive queue=0x0
-  ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
-
-4. Send mismatched packet in scapy on tester, check the port 1 of DUT could not receive this packet.
-
-Tester::
-
-    >>> sendp([Ether(dst="<dst mac change inputset>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-    
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci change inputset>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst>")/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci change inputset>,type=0x0800)/IPv6(dst="<ipv6 dst>")/TCP(sport=<sport>,dport=<dport>)/("X"*80)],iface="<tester interface>")
-
-    >>> sendp([Ether(dst="<dst mac>",type=0x8100)/Dot1Q(vlan=<outer vlan tci>,type=0x8100)/Dot1Q(vlan=<inner vlan tci>,type=0x0800)/IPv6(dst="<ipv6 dst change inputset>")/TCP(sport=<sport>,dport=<dport change inputset>)/("X"*80)],iface="<tester interface>")
-
-5. Destroy a rule and list rules::
-
-     testpmd> flow destroy 0 rule 0
-  
-   Get the message::
-
-     Flow rule #0 destroyed
-
-   Check the flow list::
-
-     testpmd> flow list 0
-
-   Check the rule not exists in the list.
-   Send matched packets in step 3, check the packets are not to port 1.
+9. remove rx_vlan::
 
+    testpmd> rx_vlan rm 11 2
 
+10. repeat step 5, check the pkts can not be received by VF1.
diff --git a/test_plans/index.rst b/test_plans/index.rst
index 6aaf1ab8..239afeb9 100644
--- a/test_plans/index.rst
+++ b/test_plans/index.rst
@@ -42,7 +42,8 @@ The following are the test plans for the DPDK DTS automated test system.
     ice_iavf_rss_configure_test_plan
     ice_iavf_fdir_pppol2tpoudp_test_plan
     ice_limit_value_test_test_plan
-    ice_qinq_test_plan
+    ice_dcf_dual_vlan_test_plan
+    ice_iavf_dual_vlan_test_plan
     ice_rss_configure_test_plan
     ice_switch_filter_test_plan
     ice_switch_filter_pppoe_test_plan
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dts] [PATCH V1 2/4] test_plans/ice_iavf_dual_vlan: split test suite
  2022-09-07 13:54 [dts] [PATCH V1 1/4] test_plans/ice_dcf_dual_vlan: split test suite Song Jiale
@ 2022-09-07 13:54 ` Song Jiale
  2022-09-07 13:54 ` [dts] [PATCH V1 3/4] tests/ice_dcf_dual_vlan: " Song Jiale
  2022-09-07 13:54 ` [dts] [PATCH V1 4/4] tests/ice_iavf_dual_vlan: " Song Jiale
  2 siblings, 0 replies; 6+ messages in thread
From: Song Jiale @ 2022-09-07 13:54 UTC (permalink / raw)
  To: dts; +Cc: Song Jiale

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 33591 bytes --]

split the test suite of ice_qinq into ice_dcf_dual_vlan and ice_iavf_dual_vlan.

Signed-off-by: Song Jiale <songx.jiale@intel.com>
---
 test_plans/ice_iavf_dual_vlan_test_plan.rst | 650 ++++++++++++++++++++
 1 file changed, 650 insertions(+)
 create mode 100644 test_plans/ice_iavf_dual_vlan_test_plan.rst

diff --git a/test_plans/ice_iavf_dual_vlan_test_plan.rst b/test_plans/ice_iavf_dual_vlan_test_plan.rst
new file mode 100644
index 00000000..a780797f
--- /dev/null
+++ b/test_plans/ice_iavf_dual_vlan_test_plan.rst
@@ -0,0 +1,650 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+   Copyright(c) 2021 Intel Corporation
+
+==============================
+ICE IAVF support QinQ protocol
+==============================
+DPDK support QinQ protocol in Intel® Ethernet 800 Series as below requirements:
+* AVF is able to configure inner VLAN filter when port vlan is enabled base on negotiation.
+* AVF is able to configure outer VLAN (8100) if no port VLANis enabled to compatible with legacy mode.
+this test plan contain 3 parts to cover above requirements:
+* AVF VLAN offload for QinQ.
+
+Prerequisites
+=============
+1. Hardware:
+   Intel® Ethernet 800 Series: E810-XXVDA4/E810-CQ
+
+2. Software:
+   dpdk: http://dpdk.org/git/dpdk
+   scapy: http://www.secdev.org/projects/scapy/
+
+3. Copy specific ice package to /lib/firmware/updates/intel/ice/ddp/ice.pkg,
+   then load driver::
+
+    rmmod ice
+    insmod ice.ko
+
+4. Compile DPDK::
+
+    CC=gcc meson --werror -Denable_kmods=True -Dlibdir=lib --default-library=static x86_64-native-linuxapp-gcc
+    ninja -C x86_64-native-linuxapp-gcc -j 110
+
+5. Get the pci device id of DUT, for example::
+
+    ./usertools/dpdk-devbind.py -s
+
+    0000:18:00.0 'Device 159b' if=ens785f0 drv=ice unused=vfio-pci
+    0000:18:00.1 'Device 159b' if=ens785f1 drv=ice unused=vfio-pci
+
+6. Disable vlan prune flag::
+
+    ethtool --set-priv-flags ens785f0 vf-vlan-pruning off
+
+7. Generate 1 VF on PF0(not all the VFs are used)::
+
+    echo 1 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs
+
+    ./usertools/dpdk-devbind.py -s
+    0000:18:01.0 'Ethernet Adaptive Virtual Function 1889' if=ens785f0v0 drv=iavf unused=vfio-pci
+
+9. Set mac addr for VF::
+
+    ip link set ens785f0 vf 0 mac 00:11:22:33:44:11
+
+10. Bind VFs to dpdk driver::
+
+     modprobe vfio-pci
+     ./usertools/dpdk-devbind.py -b vfio-pci 0000:18:01.0 0000:18:01.1 0000:18:01.2 0000:18:01.3
+
+11. Disabel spoofchk for VF::
+
+     ip link set dev ens785f0 vf 0 spoofchk off
+
+12. For AVF QinQ test cases(1-5), recreate Generate 1 VFs on PF0, reconfig the VF then launch testpmd::
+
+     echo 0 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs
+     ethtool --set-priv-flags ens785f0 vf-vlan-pruning on
+     echo 1 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs
+     ip link set ens785f0 vf 0 mac 00:11:22:33:44:11
+     ip link set dev ens785f0 vf 0 spoofchk off
+
+     ./usertools/dpdk-devbind.py -b vfio-pci 0000:18:01.0
+     ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:01.0 -- -i --rxq=16 --txq=16
+     testpmd> set fwd mac
+     testpmd> set verbose 1
+     testpmd> start
+
+Test case 1: Enable/Disable IAVF VLAN filtering
+===============================================
+
+1. enable vlan filtering on port VF::
+
+    testpmd> set fwd mac
+    Set mac packet forwarding mode
+    testpmd> vlan set filter on 0
+
+2. check the vlan mode is set successfully::
+
+    testpmd> show port info 0
+
+    ********************* Infos for port 0  *********************
+    ......
+    VLAN offload:
+    strip off, filter on, extend off, qinq strip off
+
+3. tester send qinq pkt and single vlan pkt which outer vlan id is 1 to VF::
+
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+
+4. check the pkts can't be received in VF.
+
+5. add rx_vlan in VF::
+
+    testpmd> rx_vlan add 1 0
+
+6. repeat step 3, check the pkts can be received by VF and fwd to tester::
+
+    testpmd> port 0/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - hw ptype: L2_ETHER  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN  - l2_len=18 - inner_l2_len=4 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+    port 0/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - hw ptype: L2_ETHER  - sw ptype: L2_ETHER_VLAN  - l2_len=18 - Receive queue=0x0
+    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    tcpdump -i ens786f0 -nn -e -v
+
+    16:50:38.807158 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype 0x0800,
+    16:50:38.807217 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype 0x0800,
+
+    16:51:06.083084 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype 0x0800,
+    16:51:06.083127 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype 0x0800,
+
+7. tester send qinq pkt and single vlan pkt which outer vlan id is 11 to VF::
+
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+
+8. check the pkts can not be received by VF.
+
+9. remove rx_vlan in VF1::
+
+    testpmd> rx_vlan rm 1 0
+
+10. repeat step 3, check the pkts can not be received by VF.
+
+
+Test case 2: Enable/Disable IAVF VLAN header stripping
+======================================================
+
+1. enable vlan filtering on port VF::
+
+    testpmd> vlan set filter on 0
+    testpmd> rx_vlan add 1 0
+
+2. check the vlan mode is set successfully::
+
+    testpmd> show port info 0
+
+    ********************* Infos for port 0  *********************
+    ......
+    VLAN offload:
+    strip off, filter on, extend off, qinq strip off
+
+3. enable vlan header stripping on VF::
+
+    testpmd> vlan set strip on 0
+
+4. check the vlan mode is set successfully::
+
+    testpmd> show port info 0
+
+    ********************* Infos for port 0  *********************
+    ......
+    VLAN offload:
+    strip on, filter on, extend off, qinq strip off
+
+5. tester send qinq pkt and single vlan pkt which outer vlan id is 1 to VF::
+
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+
+6. check the pkts can be received in VF and fwd to tester without outer vlan header::
+
+    testpmd> port 0/queue 10: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0xc7b627aa - RSS queue=0xa - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0xa
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    port 0/queue 10: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0xc7b627aa - RSS queue=0xa - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0xa
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    10:12:38.034948 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:12:38.035025 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+    10:12:44.806825 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:12:44.806865 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+7. disable vlan header stripping on VF1::
+
+    testpmd> vlan set strip off 0
+
+8. check the vlan mode is set successfully::
+
+    testpmd> show port info 0
+
+    ********************* Infos for port 0  *********************
+    ......
+    VLAN offload:
+    strip off, filter on, extend off, qinq strip off
+
+9. repeat step 5, check the pkts can be received in VF and fwd to tester with outer vlan header::
+
+    testpmd> port 0/queue 10: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - RSS hash=0xc7b627aa - RSS queue=0xa - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0xa
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    port 0/queue 10: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0xc7b627aa - RSS queue=0xa - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0xa
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    09:49:08.295172 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    09:49:08.295239 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+    09:49:41.043101 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    09:49:41.043166 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+
+Test case 3: Enable/Disable IAVF VLAN header insertion
+======================================================
+
+1. disable vf-vlan-pruning flag::
+
+    echo 0 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs
+    ethtool --set-priv-flags ens785f0 vf-vlan-pruning off
+
+2. set up test environment again::
+
+    echo 1 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs
+    ip link set ens785f0 vf 0 mac 00:11:22:33:44:11
+    ip link set dev ens785f0 vf 0 spoofchk off
+    ./usertools/dpdk-devbind.py -b vfio-pci 0000:18:01.0
+    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -a 0000:18:01.0 -- -i --rxq=16 --txq=16
+    testpmd> set fwd mac
+    testpmd> set verbose 1
+
+3. enable vlan header insertion on VF::
+
+    testpmd> port stop 0
+    Stopping ports...
+    Checking link statuses...
+    Done
+    testpmd> tx_vlan set 0 1
+    testpmd> port start 0
+
+4. tester send pkt to VF::
+
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+
+5. check the pkts with vlan header can be received in tester::
+
+    testpmd> port 0/queue 13: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0xcaf4abfd - RSS queue=0xd - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0xd
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    port 0/queue 8: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0x28099b78 - RSS queue=0x8 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0x8
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    10:32:55.566801 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:32:55.566856 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+    06:29:32.281896 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    06:29:32.281940 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 11, p 0, ethertype 802.1Q, vlan 1, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+6. disable vlan header insertion on VF1::
+
+    testpmd> port stop 0
+    Stopping ports...
+    Checking link statuses...
+    Done
+    testpmd> tx_vlan reset 0
+    testpmd> port start 0
+
+7. repeat step 4, check the pkts without vlan tag can be received in tester::
+
+    testpmd> port 0/queue 9: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0xa63e8869 - RSS queue=0x9 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x9
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    port 0/queue 12: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0x6f5533bc - RSS queue=0xc - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Receive queue=0xc
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    10:34:40.070754 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    10:34:40.070824 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype IPv4 (0x0800), length 514: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+    06:36:57.641871 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 518: vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    06:36:57.641909 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 11, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+
+Test case 4: Enable/disable AVF CRC stripping
+=============================================
+
+1. start testpmd with "--disable-crc-strip"::
+
+    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 20-23 -n 4 -a 0000:18:01.0 -- -i --rxq=16 --txq=16 --disable-crc-strip
+    testpmd> set fwd mac
+    testpmd> set verbose 1
+
+2. send pkts to VF::
+
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+
+3. check VF1 receive this pkts with CRC::
+
+    testpmd> port 0/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0x890d9a70 - RSS queue=0x0 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    show port stats all
+
+    ######################## NIC statistics for port 0  ########################
+    RX-packets: 1          RX-missed: 0          RX-bytes:  518
+    RX-errors: 0
+    RX-nombuf:  0
+    TX-packets: 1          TX-errors: 0          TX-bytes:  514
+
+    Throughput (since last show)
+    Rx-pps:            0          Rx-bps:            0
+    Tx-pps:            0          Tx-bps:            0
+    ############################################################################
+    clear port stats all
+
+4. enable crc strip in testpmd::
+
+    testpmd> stop
+    testpmd> port stop 0
+    testpmd> port config 0 rx_offload keep_crc off
+    testpmd> port start 0
+    testpmd> start
+
+5. repeat step 2, check VF receive this pkts without CRC::
+
+    testpmd> port 0/queue 2: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0xa94c21d2 - RSS queue=0x2 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x2
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    show port stats all
+
+    ######################## NIC statistics for port 0  ########################
+    RX-packets: 1          RX-missed: 0          RX-bytes:  514
+    RX-errors: 0
+    RX-nombuf:  0
+    TX-packets: 1          TX-errors: 0          TX-bytes:  514
+
+    Throughput (since last show)
+    Rx-pps:            0          Rx-bps:            0
+    Tx-pps:            0          Tx-bps:            0
+    ############################################################################
+    clear port stats all
+
+6. disable crc strip in testpmd::
+
+    testpmd> stop
+    testpmd> port stop 0
+    testpmd> port config 0 rx_offload keep_crc on
+    testpmd> port start 0
+    testpmd> start
+
+7. repeat step 2, check VF1 receive this pkts with CRC::
+
+    testpmd> port 0/queue 0: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0x79c10190 - RSS queue=0x0 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x0
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    show port stats all
+
+    ######################## NIC statistics for port 0  ########################
+    RX-packets: 1          RX-missed: 0          RX-bytes:  518
+    RX-errors: 0
+    RX-nombuf:  0
+    TX-packets: 1          TX-errors: 0          TX-bytes:  514
+
+    Throughput (since last show)
+    Rx-pps:            0          Rx-bps:            0
+    Tx-pps:            0          Tx-bps:            0
+    ############################################################################
+    clear port stats all
+
+8. re-launch testpmd without "--disable-crc-strip"::
+
+    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 20-23 -n 4 -a 0000:18:01.0 -- -i --rxq=16 --txq=16
+    testpmd> set fwd mac
+    testpmd> set verbose 1
+
+9. repeat step 2, check VF receive this pkts without CRC::
+
+    testpmd> port 0/queue 2: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x0800 - length=514 - nb_segs=1 - RSS hash=0x898ada82 - RSS queue=0x2 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x2
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    show port stats all
+
+    ######################## NIC statistics for port 0  ########################
+    RX-packets: 1          RX-missed: 0          RX-bytes:  514
+    RX-errors: 0
+    RX-nombuf:  0
+    TX-packets: 1          TX-errors: 0          TX-bytes:  514
+
+    Throughput (since last show)
+    Rx-pps:            0          Rx-bps:            0
+    Tx-pps:            0          Tx-bps:            0
+    ############################################################################
+
+
+Test case 5: AVF CRC strip and Vlan strip co-exists
+===================================================
+
+1. start testpmd with crc strip enable, vlan strip disable::
+
+    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 20-23 -n 4 -a 0000:18:01.0 -- -i --rxq=16 --txq=16
+    testpmd> set fwd mac
+    testpmd> set verbose 1
+    testpmd> show port info 0
+    ********************* Infos for port 0  *********************
+    MAC address: 00:11:22:33:44:11
+    Device name: 0000:18:01.1
+    Driver name: net_iavf
+    ......
+    VLAN offload:
+      strip off, filter off, extend off, qinq strip off
+
+2. request disable vlan strip::
+
+    testpmd> vlan set strip off 0
+
+3. check the vlan strip still disable::
+
+    testpmd> show port info 0
+    ********************* Infos for port 0  *********************
+    MAC address: 00:11:22:33:44:11
+    Device name: 0000:18:01.1
+    Driver name: net_iavf
+    ......
+    VLAN offload:
+      strip off, filter off, extend off, qinq strip off
+
+4. set vlan filter on and add rx_vlan 1::
+
+    testpmd> vlan set filter on 0
+    testpmd> rx_vlan add 1 0
+    testpmd> start
+
+5. send qinq pkts to check vlan strip is off, crc strip is on::
+
+    sendp([Ether(dst="00:11:22:33:44:11",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)], iface="ens786f0")
+
+    testpmd> port 0/queue 6: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - RSS hash=0xf6521426 - RSS queue=0x6 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0x6
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    show port stats all
+
+    ######################## NIC statistics for port 0  ########################
+    RX-packets: 1          RX-missed: 0          RX-bytes:  522
+    RX-errors: 0
+    RX-nombuf:  0
+    TX-packets: 1          TX-errors: 0          TX-bytes:  522
+
+    Throughput (since last show)
+    Rx-pps:            0          Rx-bps:            0
+    Tx-pps:            0          Tx-bps:            0
+    ############################################################################
+
+    09:07:45.863251 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    09:07:45.863340 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+6. request enable vlan strip::
+
+    testpmd> vlan set strip on 0
+
+7. check the vlan strip enable successfully::
+
+    testpmd> show port info 0
+    ********************* Infos for port 0  *********************
+    MAC address: 00:11:22:33:44:11
+    Device name: 0000:18:01.1
+    Driver name: net_iavf
+    ......
+    VLAN offload:
+      strip on, filter off, extend off, qinq strip off
+
+8. repeat step 5, send qinq pkts to check vlan strip is on(tx-4), crc strip is on::
+
+    testpmd> port 0/queue 6: received 1 packets
+    src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0xf6521426 - RSS queue=0x6 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Tail/CRC: 0x58585858/0x00000000 - Receive queue=0x6
+    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+    show port stats all
+
+    ######################## NIC statistics for port 0  ########################
+    RX-packets: 1          RX-missed: 0          RX-bytes:  522
+    RX-errors: 0
+    RX-nombuf:  0
+    TX-packets: 1          TX-errors: 0          TX-bytes:  518
+
+    Throughput (since last show)
+    Rx-pps:            0          Rx-bps:            0
+    Tx-pps:            0          Tx-bps:            0
+    ############################################################################
+
+    11:09:03.918907 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+    11:09:03.918952 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 518: vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+    196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+9. request disable vlan strip::
+
+    testpmd> vlan set strip off 0
+
+10. check the vlan strip disable successfully::
+
+     testpmd> show port info 0
+     ********************* Infos for port 0  *********************
+     MAC address: 00:11:22:33:44:11
+     Device name: 0000:18:01.1
+     Driver name: net_iavf
+     ......
+     VLAN offload:
+       strip off, filter on, extend off, qinq strip off
+
+11. request disable crc strip::
+
+     testpmd> stop
+     testpmd> port stop 0
+     testpmd> port config 0 rx_offload keep_crc on
+     testpmd> port start 0
+     testpmd> start
+
+12. repeat step 5, send qinq pkts to check vlan strip is off, crc strip is off(rx+4)::
+
+     testpmd> port 0/queue 7: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - RSS hash=0xbc8b1857 - RSS queue=0x7 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Tail/CRC: 0x58585858/0x6d870bf6 - Receive queue=0x7
+     ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+     show port stats all
+     ######################## NIC statistics for port 0  ########################
+     RX-packets: 1          RX-missed: 0          RX-bytes:  526
+     RX-errors: 0
+     RX-nombuf:  0
+     TX-packets: 1          TX-errors: 0          TX-bytes:  522
+
+     Throughput (since last show)
+     Rx-pps:            0          Rx-bps:            0
+     Tx-pps:            0          Tx-bps:            0
+     ############################################################################
+
+     10:23:57.350934 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     10:23:57.351008 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+13. request enable vlan strip::
+
+     testpmd> vlan set strip on 0
+     iavf_execute_vf_cmd(): No response or return failure (-64) for cmd 54
+     iavf_config_vlan_strip_v2(): fail to execute command VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2
+     rx_vlan_strip_set(port_pi=0, on=1) failed diag=-5
+
+14. repeat step 5, send qinq pkts to check the vlan strip can not enable::
+
+     testpmd> port 0/queue 7: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=518 - nb_segs=1 - RSS hash=0xbc8b1857 - RSS queue=0x7 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN L3_IPV4  - l2_len=18 - l3_len=20 - Tail/CRC: 0x58585858/0x6d870bf6 - Receive queue=0x7
+     ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+     show port stats all
+     ######################## NIC statistics for port 0  ########################
+     RX-packets: 1          RX-missed: 0          RX-bytes:  526
+     RX-errors: 0
+     RX-nombuf:  0
+     TX-packets: 1          TX-errors: 0          TX-bytes:  522
+
+     Throughput (since last show)
+     Rx-pps:            0          Rx-bps:            0
+     Tx-pps:            0          Tx-bps:            0
+     ############################################################################
+
+     10:26:08.346936 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     10:26:08.347006 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+
+15. request disable vlan strip::
+
+     vlan set strip off 0
+
+16. check the vlan strip still disable::
+
+     testpmd> show port info 0
+     ********************* Infos for port 0  *********************
+     MAC address: 00:11:22:33:44:11
+     Device name: 0000:18:01.1
+     Driver name: net_iavf
+     ......
+     VLAN offload:
+       strip off, filter on, extend off, qinq strip off
+
+17. request enable crc strip::
+
+     testpmd> stop
+     testpmd> port stop 0
+     testpmd> port config 0 rx_offload keep_crc off
+     testpmd> port start 0
+     testpmd> start
+
+18. repeat step 5, send qinq pkts to check the crc strip enable successfully::
+
+     testpmd> port 0/queue 3: received 1 packets
+     src=00:00:00:00:00:00 - dst=00:11:22:33:44:11 - type=0x8100 - length=522 - nb_segs=1 - RSS hash=0x2b4ad203 - RSS queue=0x3 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Receive queue=0x3
+     ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+     port 0/queue 3: sent 1 packets
+     src=00:11:22:33:44:11 - dst=02:00:00:00:00:00 - type=0x8100 - length=522 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER_VLAN INNER_L2_ETHER_VLAN INNER_L3_IPV4  - l2_len=18 - inner_l2_len=4 - inner_l3_len=20 - Send queue=0x3
+     ol_flags: PKT_RX_L4_CKSUM_UNKNOWN PKT_RX_IP_CKSUM_UNKNOWN PKT_RX_OUTER_L4_CKSUM_UNKNOWN
+
+     testpmd> show port stats all
+     ######################## NIC statistics for port 0  ########################
+     RX-packets: 1          RX-missed: 0          RX-bytes:  522
+     RX-errors: 0
+     RX-nombuf:  0
+     TX-packets: 1          TX-errors: 0          TX-bytes:  522
+
+     Throughput (since last show)
+     Rx-pps:            0          Rx-bps:            0
+     Tx-pps:            0          Tx-bps:            0
+     ############################################################################
+
+     10:29:19.995352 00:00:00:00:00:00 > 00:11:22:33:44:11, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
+     10:29:19.995424 00:11:22:33:44:11 > 02:00:00:00:00:00, ethertype 802.1Q (0x8100), length 522: vlan 1, p 0, ethertype 802.1Q, vlan 2, p 0, ethertype IPv4, (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto Options (0), length 500)
+     196.222.232.221 > 127.0.0.1:  ip-proto-0 480
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dts] [PATCH V1 3/4] tests/ice_dcf_dual_vlan: split test suite
  2022-09-07 13:54 [dts] [PATCH V1 1/4] test_plans/ice_dcf_dual_vlan: split test suite Song Jiale
  2022-09-07 13:54 ` [dts] [PATCH V1 2/4] test_plans/ice_iavf_dual_vlan: " Song Jiale
@ 2022-09-07 13:54 ` Song Jiale
  2022-09-07 13:54 ` [dts] [PATCH V1 4/4] tests/ice_iavf_dual_vlan: " Song Jiale
  2 siblings, 0 replies; 6+ messages in thread
From: Song Jiale @ 2022-09-07 13:54 UTC (permalink / raw)
  To: dts; +Cc: Song Jiale

split the test suite of ice_qinq into ice_dcf_dual_vlan and ice_iavf_dual_vlan.

Signed-off-by: Song Jiale <songx.jiale@intel.com>
---
 ...qinq.py => TestSuite_ice_dcf_dual_vlan.py} | 830 +++++-------------
 1 file changed, 234 insertions(+), 596 deletions(-)
 rename tests/{TestSuite_ice_qinq.py => TestSuite_ice_dcf_dual_vlan.py} (67%)

diff --git a/tests/TestSuite_ice_qinq.py b/tests/TestSuite_ice_dcf_dual_vlan.py
similarity index 67%
rename from tests/TestSuite_ice_qinq.py
rename to tests/TestSuite_ice_dcf_dual_vlan.py
index b13f5729..f8e9ed28 100644
--- a/tests/TestSuite_ice_qinq.py
+++ b/tests/TestSuite_ice_dcf_dual_vlan.py
@@ -2,16 +2,14 @@
 # Copyright(c) 2021 Intel Corporation
 #
 
-import random
 import re
 import time
-
 from framework.packet import Packet
 from framework.pmd_output import PmdOutput
 from framework.test_case import TestCase, check_supported_nic, skip_unsupported_pkg
 from framework.utils import GREEN, RED
 
-from .rte_flow_common import RssProcessing
+from .rte_flow_common import FdirProcessing
 
 mac_qinq_ipv4_pay_src_ip = {
     "name": "mac_qinq_ipv4_pay_src_ip",
@@ -403,7 +401,7 @@ tv_mac_qinq_ipv6_tcp = {
 tvs_mac_l4_qinq_dcf_pipeline_mode = [tv_mac_qinq_ipv6_udp, tv_mac_qinq_ipv6_tcp]
 
 
-class TestICEQinq(TestCase):
+class TestICEDcfDualVlan(TestCase):
     @check_supported_nic(
         ["ICE_25G-E810C_SFP", "ICE_100G-E810C_QSFP", "ICE_25G-E810_XXV_SFP"]
     )
@@ -420,9 +418,7 @@ class TestICEQinq(TestCase):
         self.verify(cores is not None, "Insufficient cores for speed testing")
         self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
         self.tester_port0 = self.tester.get_local_port(self.dut_ports[0])
-        self.tester_port1 = self.tester.get_local_port(self.dut_ports[1])
         self.tester_iface0 = self.tester.get_interface(self.tester_port0)
-        self.tester_iface1 = self.tester.get_interface(self.tester_port1)
 
         self.used_dut_port = self.dut_ports[0]
         self.pf_interface = self.dut.ports_info[self.dut_ports[0]]["intf"]
@@ -440,9 +436,9 @@ class TestICEQinq(TestCase):
         self.path = self.dut.apps_name["test-pmd"]
         self.pkt = Packet()
         self.pmd_output = PmdOutput(self.dut)
-
-    def reload_ice(self):
-        self.dut.send_expect("rmmod ice && modprobe ice", "# ")
+        self.fdirprocess = FdirProcessing(
+            self, self.pmd_output, [self.tester_iface0], rxq=0
+        )
 
     def set_up(self):
         """
@@ -457,35 +453,69 @@ class TestICEQinq(TestCase):
                 "# ",
             )
 
-    def setup_pf_vfs_env(self, vfs_num=4):
+    def reload_ice(self):
+        self.dut.send_expect("rmmod ice && modprobe ice", "# ", timeout=60)
+
+    def launch_testpmd(self, dcf_representor=False):
+        if dcf_representor:
+            port_options = {self.pci_list[0]: "cap=dcf,representor=[1]"}
+        else:
+            port_options = {self.pci_list[0]: "cap=dcf"}
+        param = " "
+        self.pmd_output.start_testpmd(
+            cores="1S/4C/1T",
+            param=param,
+            ports=self.pci_list,
+            socket=self.ports_socket,
+            port_options=port_options,
+        )
+        self.confing_testpmd(dcf_representor)
+
+    def confing_testpmd(self, dcf_representor):
+        driver_type = "Device name.*?%s.*?\n(.*)" % self.sriov_vfs_port[0].pci
+        if dcf_representor:
+            flow_type = "mac"
+            output = self.pmd_output.execute_cmd("show port info all")
+            out = re.findall(driver_type, output)
+            self.verify(len(out) == 2, "port0 and port1 driver not is net_ice_dcf")
+        else:
+            flow_type = "rxonly"
+            output = self.pmd_output.execute_cmd("show port info 0")
+            out = re.findall(driver_type, output)
+            self.verify(len(out) == 1, "vf0 driver not is net_ice_dcf")
+        self.pmd_output.execute_cmd("set fwd %s" % flow_type)
+        self.pmd_output.execute_cmd("set verbose 1")
+        self.pmd_output.execute_cmd("start")
+
+    def reset_vf(self):
+        self.pmd_output.execute_cmd("port stop 2")
+        self.pmd_output.execute_cmd("port reset 2")
+        self.pmd_output.execute_cmd("port start 2")
+        self.pmd_output.execute_cmd("start")
+
+    def setup_pf_4vfs_env(self):
 
         if self.vf_flag is False:
             self.dut.generate_sriov_vfs_by_port(
-                self.used_dut_port, vfs_num, driver=self.kdriver
+                self.used_dut_port, 4, driver=self.kdriver
             )
             self.sriov_vfs_port = self.dut.ports_info[self.used_dut_port]["vfs_port"]
             self.vf_flag = True
-            if vfs_num > 1:
-                self.dut.send_expect(
-                    "ip link set %s vf 0 trust on" % (self.pf_interface), "# "
-                )
-                self.dut.send_expect(
-                    "ip link set %s vf 1 mac %s" % (self.pf_interface, self.vf1_mac),
-                    "# ",
-                )
-                self.dut.send_expect(
-                    "ip link set %s vf 2 mac %s" % (self.pf_interface, self.vf2_mac),
-                    "# ",
-                )
-                self.dut.send_expect(
-                    "ip link set %s vf 3 mac %s" % (self.pf_interface, self.vf3_mac),
-                    "# ",
-                )
-            else:
-                self.dut.send_expect(
-                    "ip link set %s vf 0 mac %s" % (self.pf_interface, self.vf1_mac),
-                    "# ",
-                )
+            self.dut.send_expect(
+                "ip link set %s vf 0 trust on" % (self.pf_interface), "# "
+            )
+            self.dut.send_expect(
+                "ip link set %s vf 1 mac %s" % (self.pf_interface, self.vf1_mac),
+                "# ",
+            )
+            self.dut.send_expect(
+                "ip link set %s vf 2 mac %s" % (self.pf_interface, self.vf2_mac),
+                "# ",
+            )
+            self.dut.send_expect(
+                "ip link set %s vf 3 mac %s" % (self.pf_interface, self.vf3_mac),
+                "# ",
+            )
 
             try:
                 for port in self.sriov_vfs_port:
@@ -497,16 +527,15 @@ class TestICEQinq(TestCase):
                 self.dut.send_expect(
                     "ip link set dev %s vf 0 spoofchk off" % self.pf_interface, "# "
                 )
-                if vfs_num == 4:
-                    self.dut.send_expect(
-                        "ip link set dev %s vf 1 spoofchk off" % self.pf_interface, "# "
-                    )
-                    self.dut.send_expect(
-                        "ip link set dev %s vf 2 spoofchk off" % self.pf_interface, "# "
-                    )
-                    self.dut.send_expect(
-                        "ip link set dev %s vf 3 spoofchk off" % self.pf_interface, "# "
-                    )
+                self.dut.send_expect(
+                    "ip link set dev %s vf 1 spoofchk off" % self.pf_interface, "# "
+                )
+                self.dut.send_expect(
+                    "ip link set dev %s vf 2 spoofchk off" % self.pf_interface, "# "
+                )
+                self.dut.send_expect(
+                    "ip link set dev %s vf 3 spoofchk off" % self.pf_interface, "# "
+                )
             except Exception as e:
                 self.destroy_iavf()
                 raise Exception(e)
@@ -516,174 +545,28 @@ class TestICEQinq(TestCase):
             self.dut.destroy_sriov_vfs_by_port(self.used_dut_port)
             self.vf_flag = False
 
-    def launch_testpmd(self, vfs_num=4, dcf_param=False):
-        if dcf_param:
-            port_options = {self.pci_list[0]: "cap=dcf,representor=[1]"}
-        else:
-            port_options = {self.pci_list[0]: "cap=dcf"}
-        if vfs_num > 1:
-            param = " "
-            self.pmd_output.start_testpmd(
-                cores="1S/4C/1T",
-                param=param,
-                ports=self.pci_list,
-                socket=self.ports_socket,
-                port_options=port_options,
-            )
-        else:
-            param = "--rxq=16 --txq=16"
-            self.pmd_output.start_testpmd(
-                cores="1S/4C/1T",
-                param=param,
-                ports=self.pci_list,
-                socket=self.ports_socket,
-            )
-        self.confing_testpmd(vfs_num, dcf_param)
-
-    def confing_testpmd(self, vfs_num, dcf_param):
-        driver_type = "Device name.*?%s.*?\n(.*)" % self.sriov_vfs_port[0].pci
-        if dcf_param or vfs_num == 1:
-            flow_type = "mac"
-            if vfs_num > 1:
-                output = self.pmd_output.execute_cmd("show port info all")
-                out = re.findall(driver_type, output)
-                self.verify(len(out) == 2, "port0 and port1 driver not is net_ice_dcf")
-        else:
-            flow_type = "rxonly"
-            output = self.pmd_output.execute_cmd("show port info 0")
-            out = re.findall(driver_type, output)
-            self.verify(len(out) == 1, "vf0 driver not is net_ice_dcf")
-        self.pmd_output.execute_cmd("set fwd %s" % flow_type)
-        self.pmd_output.execute_cmd("set verbose 1")
-        self.pmd_output.execute_cmd("start")
-
-    def create_switch_rule(self, rule, session_name="", check_stats=True):
-        if session_name == "":
-            session_name = self.pmd_output
-        p = re.compile(r"Flow rule #(\d+) created")
-        rule_list = []
-        if isinstance(rule, list):
-            for rule in rule:
-                out = session_name.execute_cmd(rule)  # create a rule
-                m = p.search(out)
-                if m:
-                    rule_list.append(m.group(1))
-                else:
-                    rule_list.append(False)
-        else:
-            out = session_name.execute_cmd(rule)  # create a rule
-            m = p.search(out)
-            if m:
-                rule_list.append(m.group(1))
-            else:
-                rule_list.append(False)
-        if check_stats:
-            self.verify(
-                all(rule_list),
-                "some rules not created successfully, result %s, rule %s"
-                % (rule_list, rule),
-            )
-        else:
-            self.verify(
-                not any(rule_list),
-                "all rules should create failed, result %s" % rule_list,
-            )
-        return rule_list
-
-    def check_switch_rule(self, port_id=0, stats=True, rule_list=None):
-        out = self.pmd_output.execute_cmd("flow list %s" % port_id)
-        p = re.compile(r"ID\s+Group\s+Prio\s+Attr\s+Rule")
-        matched = p.search(out)
-        if stats:
-            self.verify(matched, "flow rule on port %s is not existed" % port_id)
-            if rule_list:
-                p = re.compile("^(\d+)\s")
-                li = out.splitlines()
-                res = list(filter(bool, list(map(p.match, li))))
-                result = [i.group(1) for i in res]
-                self.verify(
-                    sorted(result) == sorted(rule_list),
-                    "check rule list failed. expect %s, result %s"
-                    % (rule_list, result),
-                )
-        else:
-            self.verify(not matched, "flow rule on port %s is existed" % port_id)
-
-    def destroy_switch_rule(self, port_id=0, rule_id=None):
-        if rule_id is None:
-            rule_id = 0
-        if isinstance(rule_id, list):
-            for i in rule_id:
-                out = self.dut.send_command(
-                    "flow destroy %s rule %s" % (port_id, i), timeout=1
-                )
-                p = re.compile(r"Flow rule #(\d+) destroyed")
-                m = p.search(out)
-                self.verify(m, "flow rule %s delete failed" % rule_id)
-        else:
-            out = self.dut.send_command(
-                "flow destroy %s rule %s" % (port_id, rule_id), timeout=1
-            )
-            p = re.compile(r"Flow rule #(\d+) destroyed")
-            m = p.search(out)
-            self.verify(m, "flow rule %s delete failed" % rule_id)
-        self.check_switch_rule(stats=False)
-
-    def send_packets(self, pkts, tx_port=None, count=1):
-        self.pkt.update_pkt(pkts)
-        tx_port = self.tester_iface0 if not tx_port else tx_port
-        self.pkt.send_pkt(crb=self.tester, tx_port=tx_port, count=count)
-
-    def send_pkts_getouput(self, pkts, port_id=0, count=1):
-        tx_port = self.tester_iface0 if port_id == 0 else self.tester_iface1
-        self.send_packets(pkts, tx_port=tx_port, count=count)
-        time.sleep(0.5)
-        out = self.pmd_output.get_output()
-        port_stats = self.pmd_output.execute_cmd("show port stats all")
-        self.pmd_output.execute_cmd("clear port stats all")
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("start")
-        return out + port_stats
-
-    def check_packets(self, out, port_id, pkt_num=1, check_stats=True):
-        p = "port (\d+)/queue.*"
-        result_list = re.findall(p, out)
-        if check_stats:
-            self.verify(
-                len(result_list) == pkt_num, "received packets mismatch".format(port_id)
-            )
-        for res in result_list:
-            if check_stats:
-                self.verify(
-                    int(res) == port_id,
-                    "port {} did not received the packets".format(port_id),
-                )
-            else:
-                self.verify(
-                    int(res) != port_id,
-                    "port {} should not received a packets".format(port_id),
-                )
-
     def _rte_flow_validate_pattern(self, test_vector):
         test_results = {}
         for test in test_vector:
             self.logger.info((GREEN("========test subcase: %s========" % test["name"])))
             try:
                 port_id = test["check_param"]["port_id"]
-                rule_list = self.create_switch_rule(test["rule"])
-                self.check_switch_rule()
+                self.fdirprocess.validate_rule(test["rule"], check_stats=True)
+                rule_list = self.fdirprocess.create_rule(test["rule"], check_stats=True)
+                self.fdirprocess.check_rule(0, stats=True, rule_list=rule_list)
                 # send matched packets and check
                 matched_packets = test["scapy_str"]["matched"]
-                out = self.send_pkts_getouput(matched_packets)
+                out = self.fdirprocess.send_pkt_get_out(matched_packets)
                 self.check_packets(out, port_id, len(matched_packets))
                 # send mismatched packets and check
                 mismatched_packets = test["scapy_str"]["mismatched"]
-                out = self.send_pkts_getouput(mismatched_packets)
+                out = self.fdirprocess.send_pkt_get_out(mismatched_packets)
                 self.check_packets(
                     out, port_id, len(mismatched_packets), check_stats=False
                 )
-                self.destroy_switch_rule()
-                out = self.send_pkts_getouput(matched_packets)
+                self.fdirprocess.destroy_rule(0, rule_list)
+                self.fdirprocess.check_rule(0, stats=False, rule_list=rule_list)
+                out = self.fdirprocess.send_pkt_get_out(matched_packets)
                 self.check_packets(
                     out, port_id, len(matched_packets), check_stats=False
                 )
@@ -691,8 +574,8 @@ class TestICEQinq(TestCase):
                 self.logger.info((GREEN("subcase passed: %s" % test["name"])))
             except Exception as e:
                 self.logger.warning((RED(e)))
-                self.dut.send_command("flow flush 0", timeout=1)
-                self.dut.send_command("flow flush 1", timeout=1)
+                self.dut.send_command("flow flush 0")
+                self.dut.send_command("flow flush 1")
                 test_results[test["name"]] = False
                 self.logger.info((RED("subcase failed: %s" % test["name"])))
                 continue
@@ -702,104 +585,48 @@ class TestICEQinq(TestCase):
                 failed_cases.append(k)
         self.verify(all(test_results.values()), "{} failed.".format(failed_cases))
 
-    def start_tcpdump(self, rxItf):
-        self.tester.send_expect("rm -rf getPackageByTcpdump.cap", "#")
+    def check_packets(self, out, port_id, pkt_num=1, check_stats=True):
+        p = "port (\d+)/queue.*"
+        result_list = re.findall(p, out)
+        if check_stats:
+            self.verify(
+                len(result_list) == pkt_num, "received packets mismatch".format(port_id)
+            )
+        for res in result_list:
+            if check_stats:
+                self.verify(
+                    int(res) == port_id,
+                    "port {} did not received the packets".format(port_id),
+                )
+            else:
+                self.verify(
+                    int(res) != port_id,
+                    "port {} should not received a packets".format(port_id),
+                )
+    def tcpdump_send_packet_get_output(self, pkt):
+        self.tester.send_expect("rm -rf getPackageByTcpdump.cap", "# ")
         self.tester.send_expect(
             "tcpdump -A -nn -e -vv -w getPackageByTcpdump.cap -i %s 2> /dev/null& "
-            % rxItf,
+            % (self.tester_iface0),
             "#",
         )
         time.sleep(2)
-
-    def get_tcpdump_package(self):
-        time.sleep(1)
-        self.tester.send_expect("killall tcpdump", "#")
-        return self.tester.send_expect(
-            "tcpdump -A -nn -e -vv -r getPackageByTcpdump.cap", "#"
+        out1 = self.fdirprocess.send_pkt_get_out(pkt)
+        out2 = self.pmd_output.execute_cmd("show port stats 0")
+        out = out1 + out2
+        self.tester.send_expect("killall tcpdump", "# ")
+        tcpdump_out = self.tester.send_expect(
+            "tcpdump -A -nn -vv -er getPackageByTcpdump.cap", "# "
         )
 
-    def test_mac_qinq_ipv4_pay(self):
-        """
-        DCF switch for MAC_QINQ_IPV4_PAY
-        """
-        self.setup_pf_vfs_env()
-        self.launch_testpmd()
-        self._rte_flow_validate_pattern(mac_qinq_ipv4_pay)
-
-    def test_mac_qinq_ipv6_pay(self):
-        """
-        DCF switch for MAC_QINQ_IPV6_PAY
-        """
-        self.setup_pf_vfs_env()
-        self.launch_testpmd()
-        self._rte_flow_validate_pattern(mac_qinq_ipv6_pay)
-
-    @skip_unsupported_pkg("os default")
-    def test_mac_qinq_pppoe_pay(self):
-        """
-        DCF switch for MAC_QINQ_PPPOE_PAY
-        """
-        self.setup_pf_vfs_env()
-        self.launch_testpmd()
-        self._rte_flow_validate_pattern(mac_qinq_pppoe_pay)
-
-    @skip_unsupported_pkg("os default")
-    def test_mac_qinq_pppoe_pay_proto(self):
-        """
-        DCF switch for MAC_QINQ_PPPOE_PAY_Proto
-        """
-        self.setup_pf_vfs_env()
-        self.launch_testpmd()
-        self._rte_flow_validate_pattern(mac_qinq_pppoe_proto)
-
-    @skip_unsupported_pkg("os default")
-    def test_mac_qinq_pppoe_ipv4(self):
-        """
-        DCF switch for MAC_QINQ_PPPOE_IPV4
-        """
-        self.setup_pf_vfs_env()
-        self.launch_testpmd()
-        self._rte_flow_validate_pattern(mac_qinq_pppoe_ipv4)
-
-    @skip_unsupported_pkg("os default")
-    def test_mac_qinq_pppoe_ipv6(self):
-        """
-        DCF switch for MAC_QINQ_PPPOE_IPV6
-        """
-        self.setup_pf_vfs_env()
-        self.launch_testpmd()
-        self._rte_flow_validate_pattern(mac_qinq_pppoe_ipv6)
-
-    def test_mac_l4_qinq_dcf_non_pipeline_mode(self):
-        """
-        DCF switch for MAC_L4_QINQ
-        """
-        self.setup_pf_vfs_env()
-        self.launch_testpmd()
-        self._rte_flow_validate_pattern(tvs_mac_l4_qinq_dcf_non_pipeline_mode)
-
-    def test_mac_l4_qinq_dcf_pipeline_mode(self):
-        """
-        DCF switch for MAC_L4_QINQ_IPV6
-        """
-        self.setup_pf_vfs_env()
-        self.launch_testpmd()
-        self._rte_flow_validate_pattern(tvs_mac_l4_qinq_dcf_pipeline_mode)
-
-    def reset_vf(self):
-        self.pmd_output.execute_cmd("port stop 2")
-        self.pmd_output.execute_cmd("port reset 2")
-        self.pmd_output.execute_cmd("port start 2")
-        self.pmd_output.execute_cmd("start")
+        return (out, tcpdump_out)
 
     def send_packet_check_vlan_strip(self, pkts, outer=False, inner=False):
         for pkt in pkts:
             pkt_index = pkts.index(pkt)
-            self.start_tcpdump(self.tester_iface0)
-            out = self.send_pkts_getouput(pkt)
-            self.check_packets(out, 2, pkt_num=1)
-            tcpdump_out = self.get_tcpdump_package()
-            vlan_list = re.findall("vlan \d+", tcpdump_out)
+            out, tcpdump_out = self.tcpdump_send_packet_get_output(pkt)
+            self.check_packets(out, port_id=2, pkt_num=1)
+            vlan_list = re.findall("vlan\s+\d+", tcpdump_out)
             if pkt_index == 1:
                 vlan_num = 2
                 if outer or inner:
@@ -815,49 +642,14 @@ class TestICEQinq(TestCase):
                     len(vlan_list) == vlan_num, "received outer vlan packet error!!!"
                 )
 
-    def test_vlan_strip_in_pvid_enable(self):
-        """
-        vlan strip when pvid enable
-        """
-        pkts = [
-            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac,
-            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=21,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac,
-        ]
-        self.setup_pf_vfs_env()
-        self.launch_testpmd(dcf_param=True)
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("vlan set strip on 1")
-        self.reset_vf()
-        self.send_packet_check_vlan_strip(pkts, outer=True)
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("vlan set strip off 1")
-        self.reset_vf()
-        self.send_packet_check_vlan_strip(pkts)
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("vlan set strip on 1")
-        self.reset_vf()
-        self.pmd_output.execute_cmd("vlan set strip on 2")
-        self.send_packet_check_vlan_strip(pkts, outer=True, inner=True)
-        self.pmd_output.execute_cmd("quit", "#")
-        self.launch_testpmd(dcf_param=True)
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("vlan set strip on 2")
-        self.pmd_output.execute_cmd("vlan set strip on 1")
-        self.reset_vf()
-        self.send_packet_check_vlan_strip(pkts, outer=True, inner=True)
-
-    def _send_packet_check_vlan_inter(
+    def send_packet_check_vlan_inter(
         self, pkts, out_vlan, port_id=3, vlan_header=None, iner_vlan=None
     ):
         for pkt in pkts:
             pkt_index = pkts.index(pkt)
-            self.start_tcpdump(self.tester_iface0)
-            out = self.send_pkts_getouput(pkt)
+            out, tcpdump_out = self.tcpdump_send_packet_get_output(pkt)
             self.check_packets(out, port_id)
-            p = "vlan (\d+)"
-            tcpdump_out = self.get_tcpdump_package()
+            p = "vlan\s+(\d+)"
             vlan_list = re.findall(p, tcpdump_out)
             if vlan_header:
                 header = re.findall(vlan_header, tcpdump_out)
@@ -916,9 +708,110 @@ class TestICEQinq(TestCase):
                     "vlan header not matched, expect: %s." % vlan_header,
                 )
 
-    def test_vlan_insert_in_pvid_enable(self):
+    def test_dcf_mac_qinq_ipv4_pay(self):
+        """
+        Test case 01: DCF switch for MAC_QINQ_IPV4_PAY
+        """
+        self.setup_pf_4vfs_env()
+        self.launch_testpmd()
+        self._rte_flow_validate_pattern(mac_qinq_ipv4_pay)
+
+    def test_dcf_mac_qinq_ipv6_pay(self):
+        """
+        Test case 02: DCF switch for MAC_QINQ_IPV6_PAY
+        """
+        self.setup_pf_4vfs_env()
+        self.launch_testpmd()
+        self._rte_flow_validate_pattern(mac_qinq_ipv6_pay)
+
+    @skip_unsupported_pkg("os default")
+    def test_dcf_mac_qinq_pppoe_pay(self):
+        """
+        Test case 03: DCF switch for MAC_QINQ_PPPOE_PAY
+        """
+        self.setup_pf_4vfs_env()
+        self.launch_testpmd()
+        self._rte_flow_validate_pattern(mac_qinq_pppoe_pay)
+
+    @skip_unsupported_pkg("os default")
+    def test_dcf_mac_qinq_pppoe_pay_proto(self):
+        """
+        Test case 04: DCF switch for MAC_QINQ_PPPOE_PAY_Proto
+        """
+        self.setup_pf_4vfs_env()
+        self.launch_testpmd()
+        self._rte_flow_validate_pattern(mac_qinq_pppoe_proto)
+
+    @skip_unsupported_pkg("os default")
+    def test_dcf_mac_qinq_pppoe_ipv4(self):
+        """
+        Test case 05: DCF switch for MAC_QINQ_PPPOE_IPV4
+        """
+        self.setup_pf_4vfs_env()
+        self.launch_testpmd()
+        self._rte_flow_validate_pattern(mac_qinq_pppoe_ipv4)
+
+    @skip_unsupported_pkg("os default")
+    def test_dcf_mac_qinq_pppoe_ipv6(self):
+        """
+        Test case 06: DCF switch for MAC_QINQ_PPPOE_IPV6
+        """
+        self.setup_pf_4vfs_env()
+        self.launch_testpmd()
+        self._rte_flow_validate_pattern(mac_qinq_pppoe_ipv6)
+
+    def test_dcf_mac_l4_qinq_non_pipeline_mode(self):
+        """
+        Test case 07: DCF switch for MAC_L4_QINQ
+        """
+        self.setup_pf_4vfs_env()
+        self.launch_testpmd()
+        self._rte_flow_validate_pattern(tvs_mac_l4_qinq_dcf_non_pipeline_mode)
+
+    def test_dcf_mac_l4_qinq_pipeline_mode(self):
+        """
+        Test case 08: DCF switch for MAC_L4_QINQ_IPV6
+        """
+        self.setup_pf_4vfs_env()
+        self.launch_testpmd()
+        self._rte_flow_validate_pattern(tvs_mac_l4_qinq_dcf_pipeline_mode)
+
+    def test_dcf_vlan_strip_in_pvid_enable(self):
+        """
+        Test case 09: DCF vlan strip when pvid enable
+        """
+        pkts = [
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf1_mac,
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=21,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf1_mac,
+        ]
+        self.setup_pf_4vfs_env()
+        self.launch_testpmd(dcf_representor=True)
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("vlan set strip on 1")
+        self.reset_vf()
+        self.send_packet_check_vlan_strip(pkts, outer=True)
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("vlan set strip off 1")
+        self.reset_vf()
+        self.send_packet_check_vlan_strip(pkts)
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("vlan set strip on 1")
+        self.reset_vf()
+        self.pmd_output.execute_cmd("vlan set strip on 2")
+        self.send_packet_check_vlan_strip(pkts, outer=True, inner=True)
+        self.pmd_output.execute_cmd("quit", "#")
+        self.launch_testpmd(dcf_representor=True)
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("vlan set strip on 2")
+        self.pmd_output.execute_cmd("vlan set strip on 1")
+        self.reset_vf()
+        self.send_packet_check_vlan_strip(pkts, outer=True, inner=True)
+
+    def test_dcf_vlan_insert_in_pvid_enable(self):
         """
-        vlan insertion when pvid enable
+        Test case 10: DCF vlan insertion when pvid enable
         """
         out_vlan = 24
         iner_vlan = 11
@@ -929,45 +822,45 @@ class TestICEQinq(TestCase):
             'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
             % self.vf2_mac,
         ]
-        self.setup_pf_vfs_env()
-        self.launch_testpmd(dcf_param=True)
+        self.setup_pf_4vfs_env()
+        self.launch_testpmd(dcf_representor=True)
         self.pmd_output.execute_cmd("stop")
         self.pmd_output.execute_cmd("tx_vlan set pvid 1 %d on" % out_vlan)
         self.reset_vf()
-        self._send_packet_check_vlan_inter(pkt_list, out_vlan, vlan_header=header)
+        self.send_packet_check_vlan_inter(pkt_list, out_vlan, vlan_header=header)
         header = "0x88a8"
         self.pmd_output.execute_cmd("stop")
         self.pmd_output.execute_cmd("vlan set outer tpid %s 1" % header)
         self.reset_vf()
-        self._send_packet_check_vlan_inter(pkt_list, out_vlan, vlan_header=header)
+        self.send_packet_check_vlan_inter(pkt_list, out_vlan, vlan_header=header)
         header = "0x9100"
         self.pmd_output.execute_cmd("stop")
         self.pmd_output.execute_cmd("vlan set outer tpid %s 1" % header)
         self.reset_vf()
-        self._send_packet_check_vlan_inter(pkt_list, out_vlan, vlan_header=header)
+        self.send_packet_check_vlan_inter(pkt_list, out_vlan, vlan_header=header)
         self.pmd_output.execute_cmd("stop")
         self.pmd_output.execute_cmd("port stop 2")
         self.pmd_output.execute_cmd("tx_vlan set 2 %d" % iner_vlan)
         self.pmd_output.execute_cmd("port start 2")
         self.pmd_output.execute_cmd("start")
-        self._send_packet_check_vlan_inter(
+        self.send_packet_check_vlan_inter(
             pkt_list, out_vlan, vlan_header=header, iner_vlan=iner_vlan
         )
         self.pmd_output.execute_cmd("quit", "# ")
-        self.launch_testpmd(dcf_param=True)
+        self.launch_testpmd(dcf_representor=True)
         self.pmd_output.execute_cmd("stop")
         self.pmd_output.execute_cmd("port stop 2")
         self.pmd_output.execute_cmd("tx_vlan set 2 %d" % iner_vlan)
         self.pmd_output.execute_cmd("port start 2")
         self.pmd_output.execute_cmd("tx_vlan set pvid 1 %d on" % out_vlan)
         self.reset_vf()
-        self._send_packet_check_vlan_inter(
+        self.send_packet_check_vlan_inter(
             pkt_list, out_vlan, port_id=3, vlan_header=header, iner_vlan=iner_vlan
         )
 
-    def test_vlan_filter_in_pvid_enable(self):
+    def test_dcf_vlan_filter_in_pvid_enable(self):
         """
-        vlan filter when pvid enable
+        Test case 11: DCF vlan filter when pvid enable
         """
         pkt_list1 = [
             'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
@@ -986,281 +879,26 @@ class TestICEQinq(TestCase):
                 "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
                 "# ",
             )
-        self.setup_pf_vfs_env()
-        self.launch_testpmd(dcf_param=True)
+        self.setup_pf_4vfs_env()
+        self.launch_testpmd(dcf_representor=True)
         self.pmd_output.execute_cmd("vlan set filter on 1")
         out = self.pmd_output.execute_cmd("rx_vlan add 11 1")
         self.verify("failed" in out, "add rx_vlan successfully for VF1 by representor")
         self.pmd_output.execute_cmd("vlan set filter on 2")
         self.pmd_output.execute_cmd("rx_vlan add 11 2")
         for pkt in pkt_list1:
-            out = self.send_pkts_getouput(pkt)
+            out = self.fdirprocess.send_pkt_get_out(pkt)
             self.check_packets(out, 2)
         for pkt in pkt_list2:
-            out = self.send_pkts_getouput(pkt)
+            out = self.fdirprocess.send_pkt_get_out(pkt)
             self.check_packets(out, 2, pkt_num=0, check_stats=False)
         self.pmd_output.execute_cmd("rx_vlan rm 11 2")
         for pkt in pkt_list1:
-            out = self.send_pkts_getouput(pkt)
+            out = self.fdirprocess.send_pkt_get_out(pkt)
             self.check_packets(out, 2, pkt_num=0, check_stats=False)
 
-    def check_vlan_offload(self, vlan_type, stats):
-        p = "VLAN offload.*\n.*?%s (\w+)" % vlan_type
-        out = self.pmd_output.execute_cmd("show port info 0")
-        vlan_stats = re.search(p, out).group(1)
-        self.verify(vlan_stats == stats, "VLAN stats mismatch")
-
-    def test_enable_disable_iavf_vlan_filter(self):
-        """
-        Enable/Disable IAVF VLAN filtering
-        """
-        pkt_list1 = [
-            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac,
-            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac,
-        ]
-        pkt_list2 = [
-            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac,
-            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac,
-        ]
-        if self.default_stats:
-            self.dut.send_expect(
-                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
-                "# ",
-            )
-        self.setup_pf_vfs_env(vfs_num=1)
-        self.launch_testpmd(vfs_num=1)
-        self.pmd_output.execute_cmd("vlan set filter on 0")
-        self.check_vlan_offload(vlan_type="filter", stats="on")
-        out = self.send_pkts_getouput(pkt_list1)
-        receive_pkt = re.findall("dst=%s" % self.vf1_mac, out)
-        self.verify(len(receive_pkt) == 0, "Failed error received vlan packet!")
-
-        self.pmd_output.execute_cmd("rx_vlan add 1 0")
-        self.start_tcpdump(self.tester_iface0)
-        out = self.send_pkts_getouput(pkt_list1)
-        tcpdump_out = self.get_tcpdump_package()
-        receive_pkt = re.findall("dst=%s" % self.vf1_mac, out)
-        self.verify(len(receive_pkt) == 2, "Failed error received vlan packet!")
-        tester_pkt = re.findall("vlan \d+", tcpdump_out)
-        self.verify(len(tester_pkt) == 6, "Failed pass received vlan packet!")
-
-        out = self.send_pkts_getouput(pkt_list2)
-        receive_pkt = re.findall("dst=%s" % self.vf1_mac, out)
-        self.verify(len(receive_pkt) == 0, "Failed error received vlan packet!")
-
-        self.pmd_output.execute_cmd("rx_vlan rm 1 0")
-        out = self.send_pkts_getouput(pkt_list1)
-        receive_pkt = re.findall("dst=%s" % self.vf1_mac, out)
-        self.verify(len(receive_pkt) == 0, "Failed error received vlan packet!")
-
-    def test_enable_disable_iavf_vlan_strip(self):
-        """
-        Enable/Disable IAVF VLAN header stripping
-        """
-        pkt_list = [
-            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac,
-            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac,
-        ]
-        if self.default_stats:
-            self.dut.send_expect(
-                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
-                "# ",
-            )
-        self.setup_pf_vfs_env(vfs_num=1)
-        self.launch_testpmd(vfs_num=1)
-        self.pmd_output.execute_cmd("vlan set filter on 0")
-        self.pmd_output.execute_cmd("rx_vlan add 1 0")
-        self.check_vlan_offload(vlan_type="filter", stats="on")
-        self.pmd_output.execute_cmd("vlan set strip on 0")
-        self.check_vlan_offload(vlan_type="strip", stats="on")
-
-        self.start_tcpdump(self.tester_iface0)
-        out = self.send_pkts_getouput(pkt_list)
-        tcpdump_out = self.get_tcpdump_package()
-        receive_pkt = re.findall("dst=%s" % self.vf1_mac, out)
-        self.verify(len(receive_pkt) == 2, "Failed error received vlan packet!")
-        tester_pkt = re.findall("vlan \d+", tcpdump_out)
-        self.verify(len(tester_pkt) == 4, "Failed pass received vlan packet!")
-
-        self.pmd_output.execute_cmd("vlan set strip off 0")
-        self.check_vlan_offload(vlan_type="strip", stats="off")
-        self.start_tcpdump(self.tester_iface0)
-        out = self.send_pkts_getouput(pkt_list)
-        tcpdump_out = self.get_tcpdump_package()
-        receive_pkt = re.findall("dst=%s" % self.vf1_mac, out)
-        self.verify(len(receive_pkt) == 2, "Failed error received vlan packet!")
-        tester_pkt = re.findall("vlan \d+", tcpdump_out)
-        self.verify(len(tester_pkt) == 6, "Failed pass received vlan packet!")
-
-    def test_enable_disable_iavf_vlan_insert(self):
-        """
-        Enable/Disable IAVF VLAN header insertion
-        """
-        out_vlan = 1
-        pkt_list = [
-            'Ether(dst="%s",type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac,
-            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac,
-        ]
-        if self.default_stats:
-            self.dut.send_expect(
-                "ethtool --set-priv-flags %s %s off" % (self.pf_interface, self.flag),
-                "# ",
-            )
-        self.setup_pf_vfs_env(vfs_num=1)
-        self.launch_testpmd(vfs_num=1)
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("port stop 0")
-        self.pmd_output.execute_cmd("tx_vlan set 0 1")
-        self.pmd_output.execute_cmd("port start 0")
-        self.pmd_output.execute_cmd("start")
-        self._send_packet_check_vlan_inter(pkt_list, out_vlan, port_id=0)
-
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("port stop 0")
-        self.pmd_output.execute_cmd("tx_vlan reset 0")
-        self.pmd_output.execute_cmd("port start 0")
-        self.pmd_output.execute_cmd("start")
-        self._send_packet_check_vlan_inter(pkt_list, out_vlan=0, port_id=0)
-
-    def _send_pkt_check_vlan_and_crc(
-        self, pkt, pkt_len=None, vlan_strip=False, crc_strip=False
-    ):
-        if pkt_len:
-            self.start_tcpdump(self.tester_iface0)
-        out = self.send_pkts_getouput(pkt)
-        pkt_length = re.search("length=(\d+)", out).group(1)
-        rx_bytes = re.search("RX-bytes:\s+(\d+)", out).group(1)
-        if crc_strip:
-            self.verify(rx_bytes == pkt_length, "CRC strip on failed")
-        else:
-            self.verify(int(rx_bytes) == int(pkt_length) + 4, "CRC strip off failed")
-        if pkt_len:
-            tcpdump_out = self.get_tcpdump_package()
-            vlan_list = re.findall("vlan\s+\d+", tcpdump_out)
-            if not vlan_strip:
-                self.verify(pkt_length == pkt_len, "vlan strip off failed")
-                self.verify(len(vlan_list) == 4, "Failed pass received vlan packet")
-            elif vlan_strip:
-                self.verify(
-                    int(pkt_length) + 4 == int(pkt_len), "vlan strip off failed"
-                )
-                self.verify(
-                    len(vlan_list) == 3 and vlan_list[0] != vlan_list[-1],
-                    "Failed error received vlan packet",
-                )
-
-    def test_enable_disable_iavf_CRC_strip(self):
-        """
-        Enable/disable AVF CRC stripping
-        """
-        param = "--rxq=16 --txq=16 --disable-crc-strip"
-        pkt = (
-            'Ether(dst="%s",type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac
-        )
-        if self.default_stats:
-            self.dut.send_expect(
-                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
-                "# ",
-            )
-        self.setup_pf_vfs_env(vfs_num=1)
-        self.pmd_output.start_testpmd(
-            cores="1S/4C/1T", param=param, ports=self.pci_list, socket=self.ports_socket
-        )
-        self.pmd_output.execute_cmd("set fwd mac")
-        self.pmd_output.execute_cmd("set verbose 1")
-        self.pmd_output.execute_cmd("start")
-        self._send_pkt_check_vlan_and_crc(pkt)
-
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("port stop 0")
-        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc off")
-        self.pmd_output.execute_cmd("port start 0")
-        self.pmd_output.execute_cmd("start")
-        self._send_pkt_check_vlan_and_crc(pkt, crc_strip=True)
-
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("port stop 0")
-        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc on")
-        self.pmd_output.execute_cmd("port start 0")
-        self.pmd_output.execute_cmd("start")
-        self._send_pkt_check_vlan_and_crc(pkt)
-
-        self.pmd_output.execute_cmd("quit", "#")
-        self.launch_testpmd(vfs_num=1)
-        self.start_tcpdump(self.tester_iface0)
-        self._send_pkt_check_vlan_and_crc(pkt, crc_strip=True)
-
-    def test_CRC_strip_iavf_vlan_strip_coexists(self):
-        """
-        AVF CRC strip and Vlan strip co-exists
-        """
-        pkt = (
-            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
-            % self.vf1_mac
-        )
-        if self.default_stats:
-            self.dut.send_expect(
-                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
-                "# ",
-            )
-        self.setup_pf_vfs_env(vfs_num=1)
-        self.launch_testpmd(vfs_num=1)
-        self.check_vlan_offload(vlan_type="strip", stats="off")
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("vlan set strip off 0")
-        self.check_vlan_offload(vlan_type="strip", stats="off")
-        self.pmd_output.execute_cmd("vlan set filter on 0")
-        self.pmd_output.execute_cmd("rx_vlan add 1 0")
-        self.pmd_output.execute_cmd("start")
-
-        self.start_tcpdump(self.tester_iface0)
-        out = self.send_pkts_getouput(pkt)
-        tcpdump_out = self.get_tcpdump_package()
-        pkt_len = re.search("length=(\d+)", out).group(1)
-        vlan_list = re.findall("vlan\s+\d+", tcpdump_out)
-        self.verify(len(vlan_list) == 4, "vlan strip off failed")
-        rx_bytes = re.search("RX-bytes:\s+(\d+)", out).group(1)
-        tx_bytes = re.search("TX-bytes:\s+(\d+)", out).group(1)
-        self.verify(rx_bytes == tx_bytes == pkt_len, "CRC strip on failed")
-
-        self.pmd_output.execute_cmd("vlan set strip on 0")
-        self.check_vlan_offload(vlan_type="strip", stats="on")
-        self._send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len, vlan_strip=True)
-
-        self.pmd_output.execute_cmd("vlan set strip off 0")
-        self.check_vlan_offload(vlan_type="strip", stats="off")
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("port stop 0")
-        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc on")
-        self.pmd_output.execute_cmd("port start 0")
-        self.pmd_output.execute_cmd("start")
-        self._send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len)
-
-        out = self.pmd_output.execute_cmd("vlan set strip on 0")
-        p = "iavf_config_vlan_strip_v2(): fail to execute command VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2"
-        self.verify(p in out, "set vlan strip on successfully")
-        self._send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len)
-
-        self.pmd_output.execute_cmd("vlan set strip off 0")
-        self.check_vlan_offload(vlan_type="strip", stats="off")
-        self.pmd_output.execute_cmd("stop")
-        self.pmd_output.execute_cmd("port stop 0")
-        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc off")
-        self.pmd_output.execute_cmd("port start 0")
-        self.pmd_output.execute_cmd("start")
-        self._send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len, crc_strip=True)
-
     def tear_down(self):
-        self.pmd_output.execute_cmd("quit", "#")
+        self.pmd_output.quit()
         self.dut.kill_all()
         self.destroy_iavf()
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dts] [PATCH V1 4/4] tests/ice_iavf_dual_vlan: split test suite
  2022-09-07 13:54 [dts] [PATCH V1 1/4] test_plans/ice_dcf_dual_vlan: split test suite Song Jiale
  2022-09-07 13:54 ` [dts] [PATCH V1 2/4] test_plans/ice_iavf_dual_vlan: " Song Jiale
  2022-09-07 13:54 ` [dts] [PATCH V1 3/4] tests/ice_dcf_dual_vlan: " Song Jiale
@ 2022-09-07 13:54 ` Song Jiale
  2 siblings, 0 replies; 6+ messages in thread
From: Song Jiale @ 2022-09-07 13:54 UTC (permalink / raw)
  To: dts; +Cc: Song Jiale

split the test suite of ice_qinq into ice_dcf_dual_vlan and ice_iavf_dual_vlan.

Signed-off-by: Song Jiale <songx.jiale@intel.com>
---
 tests/TestSuite_ice_iavf_dual_vlan.py | 474 ++++++++++++++++++++++++++
 1 file changed, 474 insertions(+)
 create mode 100644 tests/TestSuite_ice_iavf_dual_vlan.py

diff --git a/tests/TestSuite_ice_iavf_dual_vlan.py b/tests/TestSuite_ice_iavf_dual_vlan.py
new file mode 100644
index 00000000..6defb4ae
--- /dev/null
+++ b/tests/TestSuite_ice_iavf_dual_vlan.py
@@ -0,0 +1,474 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+#
+
+import re
+import time
+from framework.packet import Packet
+from framework.pmd_output import PmdOutput
+from framework.test_case import TestCase, check_supported_nic
+
+from .rte_flow_common import FdirProcessing
+
+
+class TestICEQinq(TestCase):
+    @check_supported_nic(
+        ["ICE_25G-E810C_SFP", "ICE_100G-E810C_QSFP", "ICE_25G-E810_XXV_SFP"]
+    )
+    def set_up_all(self):
+        """
+        Run at the start of each test suite.
+        prerequisites.
+        """
+        # Based on h/w type, choose how many ports to use
+        self.dut_ports = self.dut.get_ports(self.nic)
+        self.verify(len(self.dut_ports) >= 1, "Insufficient ports for testing")
+        # Verify that enough threads are available
+        cores = self.dut.get_core_list("1S/4C/1T")
+        self.verify(cores is not None, "Insufficient cores for speed testing")
+        self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
+        self.tester_port0 = self.tester.get_local_port(self.dut_ports[0])
+        self.tester_iface0 = self.tester.get_interface(self.tester_port0)
+
+        self.used_dut_port = self.dut_ports[0]
+        self.pf_interface = self.dut.ports_info[self.dut_ports[0]]["intf"]
+        port = self.dut.ports_info[0]["port"]
+        port.bind_driver()
+        # get priv-flags default stats
+        self.flag = "vf-vlan-pruning"
+        self.default_stats = self.dut.get_priv_flags_state(self.pf_interface, self.flag)
+
+        self.vf_flag = False
+        self.vf0_mac = "00:11:22:33:44:11"
+
+        self.path = self.dut.apps_name["test-pmd"]
+        self.pkt = Packet()
+        self.pmd_output = PmdOutput(self.dut)
+        self.rxq = 16
+        self.fdirprocess = FdirProcessing(
+            self, self.pmd_output, [self.tester_iface0], rxq=self.rxq
+        )
+
+    def reload_ice(self):
+        self.dut.send_expect("rmmod ice && modprobe ice", "# ", timeout=60)
+
+    def set_up(self):
+        """
+        Run before each test case.
+        """
+        self.reload_ice()
+        self.pci_list = []
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s %s"
+                % (self.pf_interface, self.flag, self.default_stats),
+                "# ",
+            )
+
+    def setup_pf_vfs_env(self):
+        if self.vf_flag is False:
+            self.dut.generate_sriov_vfs_by_port(
+                self.used_dut_port, 1, driver=self.kdriver
+            )
+            self.sriov_vfs_port = self.dut.ports_info[self.used_dut_port]["vfs_port"]
+            self.vf_flag = True
+
+            self.dut.send_expect(
+                "ip link set %s vf 0 mac %s" % (self.pf_interface, self.vf0_mac),
+                "# ",
+            )
+
+            try:
+                for port in self.sriov_vfs_port:
+                    port.bind_driver(self.drivername)
+                    self.pci_list.append(port.pci)
+
+                self.vf0_prop = {"opt_host": self.sriov_vfs_port[0].pci}
+                self.dut.send_expect("ifconfig %s up" % self.pf_interface, "# ")
+                self.dut.send_expect(
+                    "ip link set dev %s vf 0 spoofchk off" % self.pf_interface, "# "
+                )
+
+            except Exception as e:
+                self.destroy_iavf()
+                raise Exception(e)
+
+    def destroy_iavf(self):
+        if self.vf_flag is True:
+            self.dut.destroy_sriov_vfs_by_port(self.used_dut_port)
+            self.vf_flag = False
+
+    def launch_testpmd(self):
+        param = "--rxq={0} --txq={0}".format(self.rxq)
+        self.pmd_output.start_testpmd(
+            cores="1S/4C/1T",
+            param=param,
+            ports=self.pci_list,
+            socket=self.ports_socket,
+        )
+        self.confing_testpmd()
+
+    def confing_testpmd(self):
+        self.pmd_output.execute_cmd("set fwd mac")
+        self.pmd_output.execute_cmd("set verbose 1")
+        self.pmd_output.execute_cmd("start")
+
+    def check_packets(self, out, port_id, pkt_num=1, check_stats=True):
+        p = "port (\d+)/queue.*"
+        result_list = re.findall(p, out)
+        if check_stats:
+            self.verify(
+                len(result_list) == pkt_num, "received packets mismatch".format(port_id)
+            )
+        for res in result_list:
+            if check_stats:
+                self.verify(
+                    int(res) == port_id,
+                    "port {} did not received the packets".format(port_id),
+                )
+            else:
+                self.verify(
+                    int(res) != port_id,
+                    "port {} should not received a packets".format(port_id),
+                )
+
+    def send_packet_check_vlan_inter(
+        self, pkts, out_vlan, port_id=3, vlan_header=None, iner_vlan=None
+    ):
+        for pkt in pkts:
+            pkt_index = pkts.index(pkt)
+            out, tcpdump_out = self.tcpdump_send_packet_get_output(pkt)
+            self.check_packets(out, port_id)
+            p = "vlan (\d+)"
+            vlan_list = re.findall(p, tcpdump_out)
+            if vlan_header:
+                header = re.findall(vlan_header, tcpdump_out)
+            if pkt_index == 0:
+                if out_vlan == 1:
+                    self.verify(
+                        len(vlan_list) == 1,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                elif out_vlan == 0:
+                    self.verify(
+                        len(vlan_list) == 0,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                else:
+                    self.verify(
+                        int(vlan_list[0]) == out_vlan,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                if iner_vlan:
+                    self.verify(
+                        int(vlan_list[1]) == iner_vlan,
+                        "received packet outer vlan not is %s" % iner_vlan,
+                    )
+            else:
+                if out_vlan == 1:
+                    self.verify(
+                        len(vlan_list) == 3 and int(vlan_list[1]) == out_vlan,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                elif out_vlan == 0:
+                    self.verify(
+                        len(vlan_list) == 2,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                else:
+                    self.verify(
+                        int(vlan_list[1]) == out_vlan,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                if iner_vlan:
+                    self.verify(
+                        int(vlan_list[2]) == iner_vlan,
+                        "received packet outer vlan not is %s" % iner_vlan,
+                    )
+            if vlan_header == "0x8100":
+                self.verify(
+                    vlan_header in tcpdump_out,
+                    "vlan header not matched, expect: %s." % vlan_header,
+                )
+            elif vlan_header is None:
+                pass
+            else:
+                self.verify(
+                    len(header) == 1,
+                    "vlan header not matched, expect: %s." % vlan_header,
+                )
+
+    def check_vlan_offload(self, vlan_type, stats):
+        p = "VLAN offload.*\n.*?%s (\w+)" % vlan_type
+        out = self.pmd_output.execute_cmd("show port info 0")
+        vlan_stats = re.search(p, out).group(1)
+        self.verify(vlan_stats == stats, "VLAN stats mismatch")
+
+    def tcpdump_send_packet_get_output(self, pkt):
+        self.tester.send_expect("rm -rf getPackageByTcpdump.cap", "# ")
+        self.tester.send_expect(
+            "tcpdump -A -nn -e -vv -w getPackageByTcpdump.cap -i %s 2> /dev/null& "
+            % (self.tester_iface0),
+            "#",
+        )
+        time.sleep(2)
+        out1 = self.fdirprocess.send_pkt_get_out(pkt)
+        out2 = self.pmd_output.execute_cmd("show port stats 0")
+        out = out1 + out2
+        self.tester.send_expect("killall tcpdump", "# ")
+        tcpdump_out = self.tester.send_expect(
+            "tcpdump -A -nn -vv -er getPackageByTcpdump.cap", "# "
+        )
+
+        return (out, tcpdump_out)
+
+    def send_pkt_check_vlan_and_crc(
+        self, pkt, pkt_len=None, vlan_strip=False, crc_strip=False
+    ):
+        out, tcpdump_out = self.tcpdump_send_packet_get_output(pkt)
+        pkt_length = re.search("length=(\d+)", out).group(1)
+        rx_bytes = re.search("RX-bytes:\s+(\d+)", out).group(1)
+        if crc_strip:
+            self.verify(rx_bytes == pkt_length, "CRC strip on failed")
+        else:
+            self.verify(int(rx_bytes) == int(pkt_length) + 4, "CRC strip off failed")
+        if pkt_len:
+            vlan_list = re.findall("vlan\s+\d+", tcpdump_out)
+            if not vlan_strip:
+                self.verify(pkt_length == pkt_len, "vlan strip off failed")
+                self.verify(len(vlan_list) == 4, "Failed pass received vlan packet")
+            elif vlan_strip:
+                self.verify(
+                    int(pkt_length) + 4 == int(pkt_len), "vlan strip off failed"
+                )
+                self.verify(
+                    len(vlan_list) == 3 and vlan_list[0] != vlan_list[-1],
+                    "Failed error received vlan packet",
+                )
+
+    def send_pkt_check_vlan_filter(self, pkt, expected_pkts, expected_vlan, rx_vlan=0):
+        out, tcpdump_out = self.tcpdump_send_packet_get_output(pkt)
+        received_pkt = re.findall("dst=%s" % self.vf0_mac, out)
+        vlan_captured = re.findall("vlan \d+", tcpdump_out)
+        if self.default_stats:
+            if rx_vlan:
+                self.verify(len(received_pkt) == expected_pkts,
+                            "Failed to get pkt num, expect %s, but got %s" % (expected_pkts, len(received_pkt)))
+                self.verify(len(vlan_captured) == expected_vlan,
+                            "Failed to get pkt vlan num, expect %s, but got %s" % (
+                                expected_vlan, len(vlan_captured)))
+            else:
+                self.verify(len(received_pkt) == 0,
+                            "Failed to get pkt num, expect %s, but got %s" % (0, len(received_pkt)))
+        else:
+            self.verify(len(received_pkt) == expected_pkts,
+                        "Failed to get pkt num, expect %s, but got %s" % (expected_pkts, len(received_pkt)))
+            self.verify(len(vlan_captured) == expected_vlan,
+                        "Failed to get pkt vlan num, expect %s, but got %s" % (
+                            expected_vlan, len(vlan_captured)))
+
+    def test_enable_disable_iavf_vlan_filter(self):
+        """
+        Test case 1: Enable/Disable IAVF VLAN filtering
+        """
+        pkt_list1 = [
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+        ]
+        pkt_list2 = [
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+        ]
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
+                "# ",
+            )
+        self.setup_pf_vfs_env()
+        self.launch_testpmd()
+        self.pmd_output.execute_cmd("vlan set filter on 0")
+        self.check_vlan_offload(vlan_type="filter", stats="on")
+        self.send_pkt_check_vlan_filter(pkt_list1, expected_pkts=len(pkt_list1), expected_vlan=6, rx_vlan=False)
+        self.pmd_output.execute_cmd("rx_vlan add 1 0")
+        self.send_pkt_check_vlan_filter(pkt_list1, expected_pkts=len(pkt_list1), expected_vlan=6, rx_vlan=True)
+
+        self.send_pkt_check_vlan_filter(pkt_list2, expected_pkts=0, expected_vlan=3, rx_vlan=True)
+
+        self.pmd_output.execute_cmd("rx_vlan rm 1 0")
+        self.send_pkt_check_vlan_filter(pkt_list1, expected_pkts=len(pkt_list1), expected_vlan=6, rx_vlan=False)
+
+    def test_enable_disable_iavf_vlan_strip(self):
+        """
+        Test case 2: Enable/Disable IAVF VLAN header stripping
+        """
+        pkt_list = [
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+        ]
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
+                "# ",
+            )
+        self.setup_pf_vfs_env()
+        self.launch_testpmd()
+        self.pmd_output.execute_cmd("vlan set filter on 0")
+        self.pmd_output.execute_cmd("rx_vlan add 1 0")
+        self.check_vlan_offload(vlan_type="filter", stats="on")
+        self.pmd_output.execute_cmd("vlan set strip on 0")
+        self.check_vlan_offload(vlan_type="strip", stats="on")
+        self.send_pkt_check_vlan_filter(pkt_list, expected_pkts=len(pkt_list), expected_vlan=4, rx_vlan=True)
+
+        self.pmd_output.execute_cmd("vlan set strip off 0")
+        self.check_vlan_offload(vlan_type="strip", stats="off")
+        self.send_pkt_check_vlan_filter(pkt_list, expected_pkts=len(pkt_list), expected_vlan=6, rx_vlan=True)
+
+    def test_enable_disable_iavf_vlan_insert(self):
+        """
+        Test case 3: Enable/Disable IAVF VLAN header insertion
+        """
+        out_vlan = 1
+        pkt_list = [
+            'Ether(dst="%s",type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+        ]
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s off" % (self.pf_interface, self.flag),
+                "# ",
+            )
+        self.setup_pf_vfs_env()
+        self.launch_testpmd()
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("tx_vlan set 0 1")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_packet_check_vlan_inter(pkt_list, out_vlan, port_id=0)
+
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("tx_vlan reset 0")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_packet_check_vlan_inter(pkt_list, out_vlan=0, port_id=0)
+
+    def test_enable_disable_iavf_CRC_strip(self):
+        """
+        Test case 4: Enable/disable AVF CRC stripping
+        """
+        param = "--rxq=16 --txq=16 --disable-crc-strip"
+        pkt = (
+            'Ether(dst="%s",type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac
+        )
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
+                "# ",
+            )
+        self.setup_pf_vfs_env()
+        self.pmd_output.start_testpmd(
+            cores="1S/4C/1T", param=param, ports=self.pci_list, socket=self.ports_socket
+        )
+        self.pmd_output.execute_cmd("set fwd mac")
+        self.pmd_output.execute_cmd("set verbose 1")
+        self.pmd_output.execute_cmd("start")
+        self.send_pkt_check_vlan_and_crc(pkt)
+
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc off")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_pkt_check_vlan_and_crc(pkt, crc_strip=True)
+
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc on")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_pkt_check_vlan_and_crc(pkt)
+
+        self.pmd_output.execute_cmd("quit", "#")
+        self.launch_testpmd()
+        self.send_pkt_check_vlan_and_crc(pkt, crc_strip=True)
+
+    def test_CRC_strip_iavf_vlan_strip_coexists(self):
+        """
+        Test case 5: AVF CRC strip and Vlan strip co-exists
+        """
+        pkt = (
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac
+        )
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
+                "# ",
+            )
+        self.setup_pf_vfs_env()
+        self.launch_testpmd()
+        self.check_vlan_offload(vlan_type="strip", stats="off")
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("vlan set strip off 0")
+        self.check_vlan_offload(vlan_type="strip", stats="off")
+        self.pmd_output.execute_cmd("vlan set filter on 0")
+        self.pmd_output.execute_cmd("rx_vlan add 1 0")
+        self.pmd_output.execute_cmd("start")
+
+        out, tcpdump_out = self.tcpdump_send_packet_get_output(pkt)
+        pkt_len = re.search("length=(\d+)", out).group(1)
+        vlan_list = re.findall("vlan\s+\d+", tcpdump_out)
+        self.verify(len(vlan_list) == 4, "vlan strip off failed")
+        rx_bytes = re.search("RX-bytes:\s+(\d+)", out).group(1)
+        tx_bytes = re.search("TX-bytes:\s+(\d+)", out).group(1)
+        self.verify(rx_bytes == tx_bytes == pkt_len, "CRC strip on failed")
+
+        self.pmd_output.execute_cmd("vlan set strip on 0")
+        self.check_vlan_offload(vlan_type="strip", stats="on")
+        self.send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len, vlan_strip=True)
+
+        self.pmd_output.execute_cmd("vlan set strip off 0")
+        self.check_vlan_offload(vlan_type="strip", stats="off")
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc on")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len)
+
+        out = self.pmd_output.execute_cmd("vlan set strip on 0")
+        p = "iavf_config_vlan_strip_v2(): fail to execute command VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2"
+        self.verify(p in out, "set vlan strip on successfully")
+        self.send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len)
+
+        self.pmd_output.execute_cmd("vlan set strip off 0")
+        self.check_vlan_offload(vlan_type="strip", stats="off")
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc off")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len, crc_strip=True)
+
+    def tear_down(self):
+        self.pmd_output.quit()
+        self.dut.kill_all()
+        self.destroy_iavf()
+
+    def tear_down_all(self):
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s %s"
+                % (self.pf_interface, self.flag, self.default_stats),
+                "# ",
+            )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [dts] [PATCH V1 4/4] tests/ice_iavf_dual_vlan: split test suite
  2022-09-07 17:06 ` [dts] [PATCH V1 4/4] tests/ice_iavf_dual_vlan: " Song Jiale
@ 2022-09-13  8:33   ` Fu, Qi
  0 siblings, 0 replies; 6+ messages in thread
From: Fu, Qi @ 2022-09-13  8:33 UTC (permalink / raw)
  To: Jiale, SongX, dts; +Cc: Jiale, SongX

> -----Original Message-----
> From: Song Jiale <songx.jiale@intel.com>
> Sent: Thursday, September 8, 2022 1:07 AM
> To: dts@dpdk.org
> Cc: Jiale, SongX <songx.jiale@intel.com>
> Subject: [dts] [PATCH V1 4/4] tests/ice_iavf_dual_vlan: split test suite
> 
> split the test suite of ice_qinq into ice_dcf_dual_vlan and ice_iavf_dual_vlan.
> 
> Signed-off-by: Song Jiale <songx.jiale@intel.com>
> ---
>  tests/TestSuite_ice_iavf_dual_vlan.py | 496 ++++++++++++++++++++++++++
>  1 file changed, 496 insertions(+)
>  create mode 100644 tests/TestSuite_ice_iavf_dual_vlan.py

Acked-by: Fu, Qi <qi.fu@intel.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dts] [PATCH V1 4/4] tests/ice_iavf_dual_vlan: split test suite
  2022-09-07 17:06 [dts] [PATCH V1 1/4] test_plans/ice_dcf_dual_vlan: " Song Jiale
@ 2022-09-07 17:06 ` Song Jiale
  2022-09-13  8:33   ` Fu, Qi
  0 siblings, 1 reply; 6+ messages in thread
From: Song Jiale @ 2022-09-07 17:06 UTC (permalink / raw)
  To: dts; +Cc: Song Jiale

split the test suite of ice_qinq into ice_dcf_dual_vlan and ice_iavf_dual_vlan.

Signed-off-by: Song Jiale <songx.jiale@intel.com>
---
 tests/TestSuite_ice_iavf_dual_vlan.py | 496 ++++++++++++++++++++++++++
 1 file changed, 496 insertions(+)
 create mode 100644 tests/TestSuite_ice_iavf_dual_vlan.py

diff --git a/tests/TestSuite_ice_iavf_dual_vlan.py b/tests/TestSuite_ice_iavf_dual_vlan.py
new file mode 100644
index 00000000..ae3b8bef
--- /dev/null
+++ b/tests/TestSuite_ice_iavf_dual_vlan.py
@@ -0,0 +1,496 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+#
+
+import re
+import time
+
+from framework.packet import Packet
+from framework.pmd_output import PmdOutput
+from framework.test_case import TestCase, check_supported_nic
+
+from .rte_flow_common import FdirProcessing
+
+
+class TestICEQinq(TestCase):
+    @check_supported_nic(
+        ["ICE_25G-E810C_SFP", "ICE_100G-E810C_QSFP", "ICE_25G-E810_XXV_SFP"]
+    )
+    def set_up_all(self):
+        """
+        Run at the start of each test suite.
+        prerequisites.
+        """
+        # Based on h/w type, choose how many ports to use
+        self.dut_ports = self.dut.get_ports(self.nic)
+        self.verify(len(self.dut_ports) >= 1, "Insufficient ports for testing")
+        # Verify that enough threads are available
+        cores = self.dut.get_core_list("1S/4C/1T")
+        self.verify(cores is not None, "Insufficient cores for speed testing")
+        self.ports_socket = self.dut.get_numa_id(self.dut_ports[0])
+        self.tester_port0 = self.tester.get_local_port(self.dut_ports[0])
+        self.tester_iface0 = self.tester.get_interface(self.tester_port0)
+
+        self.used_dut_port = self.dut_ports[0]
+        self.pf_interface = self.dut.ports_info[self.dut_ports[0]]["intf"]
+        port = self.dut.ports_info[0]["port"]
+        port.bind_driver()
+        # get priv-flags default stats
+        self.flag = "vf-vlan-pruning"
+        self.default_stats = self.dut.get_priv_flags_state(self.pf_interface, self.flag)
+
+        self.vf_flag = False
+        self.vf0_mac = "00:11:22:33:44:11"
+
+        self.path = self.dut.apps_name["test-pmd"]
+        self.pkt = Packet()
+        self.pmd_output = PmdOutput(self.dut)
+        self.rxq = 16
+        self.fdirprocess = FdirProcessing(
+            self, self.pmd_output, [self.tester_iface0], rxq=self.rxq
+        )
+
+    def set_up(self):
+        """
+        Run before each test case.
+        """
+        self.pci_list = []
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s %s"
+                % (self.pf_interface, self.flag, self.default_stats),
+                "# ",
+            )
+
+    def setup_pf_vfs_env(self):
+        if self.vf_flag is False:
+            self.dut.generate_sriov_vfs_by_port(
+                self.used_dut_port, 1, driver=self.kdriver
+            )
+            self.sriov_vfs_port = self.dut.ports_info[self.used_dut_port]["vfs_port"]
+            self.vf_flag = True
+
+            self.dut.send_expect(
+                "ip link set %s vf 0 mac %s" % (self.pf_interface, self.vf0_mac),
+                "# ",
+            )
+
+            try:
+                for port in self.sriov_vfs_port:
+                    port.bind_driver(self.drivername)
+                    self.pci_list.append(port.pci)
+
+                self.vf0_prop = {"opt_host": self.sriov_vfs_port[0].pci}
+                self.dut.send_expect("ifconfig %s up" % self.pf_interface, "# ")
+                self.dut.send_expect(
+                    "ip link set dev %s vf 0 spoofchk off" % self.pf_interface, "# "
+                )
+
+            except Exception as e:
+                self.destroy_iavf()
+                raise Exception(e)
+
+    def destroy_iavf(self):
+        if self.vf_flag is True:
+            self.dut.destroy_sriov_vfs_by_port(self.used_dut_port)
+            self.vf_flag = False
+
+    def launch_testpmd(self):
+        param = "--rxq={0} --txq={0}".format(self.rxq)
+        self.pmd_output.start_testpmd(
+            cores="1S/4C/1T",
+            param=param,
+            ports=self.pci_list,
+            socket=self.ports_socket,
+        )
+        self.confing_testpmd()
+
+    def confing_testpmd(self):
+        self.pmd_output.execute_cmd("set fwd mac")
+        self.pmd_output.execute_cmd("set verbose 1")
+        self.pmd_output.execute_cmd("start")
+
+    def check_packets(self, out, port_id, pkt_num=1, check_stats=True):
+        p = "port (\d+)/queue.*"
+        result_list = re.findall(p, out)
+        if check_stats:
+            self.verify(
+                len(result_list) == pkt_num, "received packets mismatch".format(port_id)
+            )
+        for res in result_list:
+            if check_stats:
+                self.verify(
+                    int(res) == port_id,
+                    "port {} did not received the packets".format(port_id),
+                )
+            else:
+                self.verify(
+                    int(res) != port_id,
+                    "port {} should not received a packets".format(port_id),
+                )
+
+    def send_packet_check_vlan_inter(
+        self, pkts, out_vlan, port_id=3, vlan_header=None, iner_vlan=None
+    ):
+        for pkt in pkts:
+            pkt_index = pkts.index(pkt)
+            out, tcpdump_out = self.tcpdump_send_packet_get_output(pkt)
+            self.check_packets(out, port_id)
+            p = "vlan (\d+)"
+            vlan_list = re.findall(p, tcpdump_out)
+            if vlan_header:
+                header = re.findall(vlan_header, tcpdump_out)
+            if pkt_index == 0:
+                if out_vlan == 1:
+                    self.verify(
+                        len(vlan_list) == 1,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                elif out_vlan == 0:
+                    self.verify(
+                        len(vlan_list) == 0,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                else:
+                    self.verify(
+                        int(vlan_list[0]) == out_vlan,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                if iner_vlan:
+                    self.verify(
+                        int(vlan_list[1]) == iner_vlan,
+                        "received packet outer vlan not is %s" % iner_vlan,
+                    )
+            else:
+                if out_vlan == 1:
+                    self.verify(
+                        len(vlan_list) == 3 and int(vlan_list[1]) == out_vlan,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                elif out_vlan == 0:
+                    self.verify(
+                        len(vlan_list) == 2,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                else:
+                    self.verify(
+                        int(vlan_list[1]) == out_vlan,
+                        "received packet outer vlan not is %s" % out_vlan,
+                    )
+                if iner_vlan:
+                    self.verify(
+                        int(vlan_list[2]) == iner_vlan,
+                        "received packet outer vlan not is %s" % iner_vlan,
+                    )
+            if vlan_header == "0x8100":
+                self.verify(
+                    vlan_header in tcpdump_out,
+                    "vlan header not matched, expect: %s." % vlan_header,
+                )
+            elif vlan_header is None:
+                pass
+            else:
+                self.verify(
+                    len(header) == 1,
+                    "vlan header not matched, expect: %s." % vlan_header,
+                )
+
+    def check_vlan_offload(self, vlan_type, stats):
+        p = "VLAN offload.*\n.*?%s (\w+)" % vlan_type
+        out = self.pmd_output.execute_cmd("show port info 0")
+        vlan_stats = re.search(p, out).group(1)
+        self.verify(vlan_stats == stats, "VLAN stats mismatch")
+
+    def tcpdump_send_packet_get_output(self, pkt):
+        self.tester.send_expect("rm -rf getPackageByTcpdump.cap", "# ")
+        self.tester.send_expect(
+            "tcpdump -A -nn -e -vv -w getPackageByTcpdump.cap -i %s 2> /dev/null& "
+            % (self.tester_iface0),
+            "#",
+        )
+        time.sleep(2)
+        out1 = self.fdirprocess.send_pkt_get_out(pkt)
+        out2 = self.pmd_output.execute_cmd("show port stats 0")
+        out = out1 + out2
+        self.tester.send_expect("killall tcpdump", "# ")
+        tcpdump_out = self.tester.send_expect(
+            "tcpdump -A -nn -vv -er getPackageByTcpdump.cap", "# "
+        )
+
+        return (out, tcpdump_out)
+
+    def send_pkt_check_vlan_and_crc(
+        self, pkt, pkt_len=None, vlan_strip=False, crc_strip=False
+    ):
+        out, tcpdump_out = self.tcpdump_send_packet_get_output(pkt)
+        pkt_length = re.search("length=(\d+)", out).group(1)
+        rx_bytes = re.search("RX-bytes:\s+(\d+)", out).group(1)
+        if crc_strip:
+            self.verify(rx_bytes == pkt_length, "CRC strip on failed")
+        else:
+            self.verify(int(rx_bytes) == int(pkt_length) + 4, "CRC strip off failed")
+        if pkt_len:
+            vlan_list = re.findall("vlan\s+\d+", tcpdump_out)
+            if not vlan_strip:
+                self.verify(pkt_length == pkt_len, "vlan strip off failed")
+                self.verify(len(vlan_list) == 4, "Failed pass received vlan packet")
+            elif vlan_strip:
+                self.verify(
+                    int(pkt_length) + 4 == int(pkt_len), "vlan strip off failed"
+                )
+                self.verify(
+                    len(vlan_list) == 3 and vlan_list[0] != vlan_list[-1],
+                    "Failed error received vlan packet",
+                )
+
+    def send_pkt_check_vlan_filter(self, pkt, expected_pkts, expected_vlan, rx_vlan=0):
+        out, tcpdump_out = self.tcpdump_send_packet_get_output(pkt)
+        received_pkt = re.findall("dst=%s" % self.vf0_mac, out)
+        vlan_captured = re.findall("vlan \d+", tcpdump_out)
+        if self.default_stats:
+            if rx_vlan:
+                self.verify(
+                    len(received_pkt) == expected_pkts,
+                    "Failed to get pkt num, expect %s, but got %s"
+                    % (expected_pkts, len(received_pkt)),
+                )
+                self.verify(
+                    len(vlan_captured) == expected_vlan,
+                    "Failed to get pkt vlan num, expect %s, but got %s"
+                    % (expected_vlan, len(vlan_captured)),
+                )
+            else:
+                self.verify(
+                    len(received_pkt) == 0,
+                    "Failed to get pkt num, expect %s, but got %s"
+                    % (0, len(received_pkt)),
+                )
+        else:
+            self.verify(
+                len(received_pkt) == expected_pkts,
+                "Failed to get pkt num, expect %s, but got %s"
+                % (expected_pkts, len(received_pkt)),
+            )
+            self.verify(
+                len(vlan_captured) == expected_vlan,
+                "Failed to get pkt vlan num, expect %s, but got %s"
+                % (expected_vlan, len(vlan_captured)),
+            )
+
+    def test_enable_disable_iavf_vlan_filter(self):
+        """
+        Test case 1: Enable/Disable IAVF VLAN filtering
+        """
+        pkt_list1 = [
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+        ]
+        pkt_list2 = [
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+        ]
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
+                "# ",
+            )
+        self.setup_pf_vfs_env()
+        self.launch_testpmd()
+        self.pmd_output.execute_cmd("vlan set filter on 0")
+        self.check_vlan_offload(vlan_type="filter", stats="on")
+        self.send_pkt_check_vlan_filter(
+            pkt_list1, expected_pkts=len(pkt_list1), expected_vlan=6, rx_vlan=False
+        )
+        self.pmd_output.execute_cmd("rx_vlan add 1 0")
+        self.send_pkt_check_vlan_filter(
+            pkt_list1, expected_pkts=len(pkt_list1), expected_vlan=6, rx_vlan=True
+        )
+
+        self.send_pkt_check_vlan_filter(
+            pkt_list2, expected_pkts=0, expected_vlan=3, rx_vlan=True
+        )
+
+        self.pmd_output.execute_cmd("rx_vlan rm 1 0")
+        self.send_pkt_check_vlan_filter(
+            pkt_list1, expected_pkts=len(pkt_list1), expected_vlan=6, rx_vlan=False
+        )
+
+    def test_enable_disable_iavf_vlan_strip(self):
+        """
+        Test case 2: Enable/Disable IAVF VLAN header stripping
+        """
+        pkt_list = [
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+        ]
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
+                "# ",
+            )
+        self.setup_pf_vfs_env()
+        self.launch_testpmd()
+        self.pmd_output.execute_cmd("vlan set filter on 0")
+        self.pmd_output.execute_cmd("rx_vlan add 1 0")
+        self.check_vlan_offload(vlan_type="filter", stats="on")
+        self.pmd_output.execute_cmd("vlan set strip on 0")
+        self.check_vlan_offload(vlan_type="strip", stats="on")
+        self.send_pkt_check_vlan_filter(
+            pkt_list, expected_pkts=len(pkt_list), expected_vlan=4, rx_vlan=True
+        )
+
+        self.pmd_output.execute_cmd("vlan set strip off 0")
+        self.check_vlan_offload(vlan_type="strip", stats="off")
+        self.send_pkt_check_vlan_filter(
+            pkt_list, expected_pkts=len(pkt_list), expected_vlan=6, rx_vlan=True
+        )
+
+    def test_enable_disable_iavf_vlan_insert(self):
+        """
+        Test case 3: Enable/Disable IAVF VLAN header insertion
+        """
+        out_vlan = 1
+        pkt_list = [
+            'Ether(dst="%s",type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=11,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac,
+        ]
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s off" % (self.pf_interface, self.flag),
+                "# ",
+            )
+        self.setup_pf_vfs_env()
+        self.launch_testpmd()
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("tx_vlan set 0 1")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_packet_check_vlan_inter(pkt_list, out_vlan, port_id=0)
+
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("tx_vlan reset 0")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_packet_check_vlan_inter(pkt_list, out_vlan=0, port_id=0)
+
+    def test_enable_disable_iavf_CRC_strip(self):
+        """
+        Test case 4: Enable/disable AVF CRC stripping
+        """
+        param = "--rxq=16 --txq=16 --disable-crc-strip"
+        pkt = (
+            'Ether(dst="%s",type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac
+        )
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
+                "# ",
+            )
+        self.setup_pf_vfs_env()
+        self.pmd_output.start_testpmd(
+            cores="1S/4C/1T", param=param, ports=self.pci_list, socket=self.ports_socket
+        )
+        self.pmd_output.execute_cmd("set fwd mac")
+        self.pmd_output.execute_cmd("set verbose 1")
+        self.pmd_output.execute_cmd("start")
+        self.send_pkt_check_vlan_and_crc(pkt)
+
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc off")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_pkt_check_vlan_and_crc(pkt, crc_strip=True)
+
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc on")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_pkt_check_vlan_and_crc(pkt)
+
+        self.pmd_output.execute_cmd("quit", "#")
+        self.launch_testpmd()
+        self.send_pkt_check_vlan_and_crc(pkt, crc_strip=True)
+
+    def test_CRC_strip_iavf_vlan_strip_coexists(self):
+        """
+        Test case 5: AVF CRC strip and Vlan strip co-exists
+        """
+        pkt = (
+            'Ether(dst="%s",type=0x8100)/Dot1Q(vlan=1,type=0x8100)/Dot1Q(vlan=2,type=0x0800)/IP(src="196.222.232.221")/("X"*480)'
+            % self.vf0_mac
+        )
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s on" % (self.pf_interface, self.flag),
+                "# ",
+            )
+        self.setup_pf_vfs_env()
+        self.launch_testpmd()
+        self.check_vlan_offload(vlan_type="strip", stats="off")
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("vlan set strip off 0")
+        self.check_vlan_offload(vlan_type="strip", stats="off")
+        self.pmd_output.execute_cmd("vlan set filter on 0")
+        self.pmd_output.execute_cmd("rx_vlan add 1 0")
+        self.pmd_output.execute_cmd("start")
+
+        out, tcpdump_out = self.tcpdump_send_packet_get_output(pkt)
+        pkt_len = re.search("length=(\d+)", out).group(1)
+        vlan_list = re.findall("vlan\s+\d+", tcpdump_out)
+        self.verify(len(vlan_list) == 4, "vlan strip off failed")
+        rx_bytes = re.search("RX-bytes:\s+(\d+)", out).group(1)
+        tx_bytes = re.search("TX-bytes:\s+(\d+)", out).group(1)
+        self.verify(rx_bytes == tx_bytes == pkt_len, "CRC strip on failed")
+
+        self.pmd_output.execute_cmd("vlan set strip on 0")
+        self.check_vlan_offload(vlan_type="strip", stats="on")
+        self.send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len, vlan_strip=True)
+
+        self.pmd_output.execute_cmd("vlan set strip off 0")
+        self.check_vlan_offload(vlan_type="strip", stats="off")
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc on")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len)
+
+        out = self.pmd_output.execute_cmd("vlan set strip on 0")
+        p = "iavf_config_vlan_strip_v2(): fail to execute command VIRTCHNL_OP_ENABLE_VLAN_STRIPPING_V2"
+        self.verify(p in out, "set vlan strip on successfully")
+        self.send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len)
+
+        self.pmd_output.execute_cmd("vlan set strip off 0")
+        self.check_vlan_offload(vlan_type="strip", stats="off")
+        self.pmd_output.execute_cmd("stop")
+        self.pmd_output.execute_cmd("port stop 0")
+        self.pmd_output.execute_cmd("port config 0 rx_offload keep_crc off")
+        self.pmd_output.execute_cmd("port start 0")
+        self.pmd_output.execute_cmd("start")
+        self.send_pkt_check_vlan_and_crc(pkt=pkt, pkt_len=pkt_len, crc_strip=True)
+
+    def tear_down(self):
+        self.pmd_output.quit()
+        self.dut.kill_all()
+        self.destroy_iavf()
+
+    def tear_down_all(self):
+        if self.default_stats:
+            self.dut.send_expect(
+                "ethtool --set-priv-flags %s %s %s"
+                % (self.pf_interface, self.flag, self.default_stats),
+                "# ",
+            )
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-13  8:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 13:54 [dts] [PATCH V1 1/4] test_plans/ice_dcf_dual_vlan: split test suite Song Jiale
2022-09-07 13:54 ` [dts] [PATCH V1 2/4] test_plans/ice_iavf_dual_vlan: " Song Jiale
2022-09-07 13:54 ` [dts] [PATCH V1 3/4] tests/ice_dcf_dual_vlan: " Song Jiale
2022-09-07 13:54 ` [dts] [PATCH V1 4/4] tests/ice_iavf_dual_vlan: " Song Jiale
2022-09-07 17:06 [dts] [PATCH V1 1/4] test_plans/ice_dcf_dual_vlan: " Song Jiale
2022-09-07 17:06 ` [dts] [PATCH V1 4/4] tests/ice_iavf_dual_vlan: " Song Jiale
2022-09-13  8:33   ` Fu, Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).