@@ -183,37 +183,45 @@ Prerequisites
0000:18:00.0 'Device 1593' if=enp24s0f0 drv=ice unused=vfio-pci
0000:18:00.1 'Device 1593' if=enp24s0f1 drv=ice unused=vfio-pci
-6. Generate 4 VFs on PF0::
+6. Generate 5 VFs on PF0 and PF1::
echo 4 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs
+ echo 4 > /sys/bus/pci/devices/0000:18:00.1/sriov_numvfs
./usertools/dpdk-devbind.py -s
0000:18:01.0 'Ethernet Adaptive Virtual Function 1889' if=enp24s1 drv=iavf unused=vfio-pci
0000:18:01.1 'Ethernet Adaptive Virtual Function 1889' if=enp24s1f1 drv=iavf unused=vfio-pci
0000:18:01.2 'Ethernet Adaptive Virtual Function 1889' if=enp24s1f2 drv=iavf unused=vfio-pci
0000:18:01.3 'Ethernet Adaptive Virtual Function 1889' if=enp24s1f3 drv=iavf unused=vfio-pci
+ 0000:18:11.0 'Ethernet Adaptive Virtual Function 1889' if=enp24s2 drv=iavf unused=vfio-pci
+ 0000:18:11.1 'Ethernet Adaptive Virtual Function 1889' if=enp24s2f1 drv=iavf unused=vfio-pci
+ 0000:18:11.2 'Ethernet Adaptive Virtual Function 1889' if=enp24s2f2 drv=iavf unused=vfio-pci
+ 0000:18:11.3 'Ethernet Adaptive Virtual Function 1889' if=enp24s2f3 drv=iavf unused=vfio-pci
7. Set VF0 as trust::
ip link set enp24s0f0 vf 0 trust on
+ ip link set enp24s0f1 vf 0 trust on
8. 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
+ ./usertools/dpdk-devbind.py -b vfio-pci 0000:18:11.0 0000:18:11.1 0000:18:11.2 0000:18:11.3
-9. Launch dpdk on VF0 and VF1, and VF0 request DCF mode, representing VF1 and VF2::
+9. Launch dpdk on VF0, VF1 and VF2 of each PF, and VF0 request DCF mode, representing VF1 and VF2::
./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 \
-a 0000:18:01.0,cap=dcf,representor=[1,2] -a 0000:18:01.1 -a 0000:18:01.2 \
+ -a 0000:18:11.0,cap=dcf,representor=[1,2] -a 0000:18:11.1 -a 0000:18:01.2 \
-- -i
- testpmd> set portlist 3,4
+ testpmd> set portlist 3,4,8,9
testpmd> set fwd rxonly
testpmd> set verbose 1
testpmd> start
testpmd> show port info all
- check the VF0 driver is net_ice_dcf.
+ check the VF0 driver of both PF is net_ice_dcf.
10. on tester side, copy the layer python file to /root::
@@ -2915,11 +2923,114 @@ will not hang and provide a friendly output.
Test case: negative cases
=========================
+Note: some of the error messages may be different.
-Subcase 1: can not create rule on vf 1
---------------------------------------
+Subcase 1: can not create to vf rule on a representor
+-----------------------------------------------------
+
+1. create rule on representor 1 which is at port 1::
+
+ testpmd> flow create 1 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 1 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 1
+
+ there is no rule listed.
+
+Subcase 2: can not create to vf rule on a vf
+--------------------------------------------
+
+1. create rule on vf 1 which is at port 3::
+
+ testpmd> flow create 3 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 1 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 3
+
+ there is no rule listed.
-1. create rule on vf 1::
+Subcase 3: can not create to vf rule to a vf
+--------------------------------------------
+
+1. create rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 3 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 4: can not create to vf rule to self dcf
+------------------------------------------------
+
+1. create rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 0 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 5: can not create to vf rule to another dcf
+---------------------------------------------------
+
+1. create rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 5 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 6: can not create to vf rule to a representor of another pf
+-------------------------------------------------------------------
+
+1. create rule on vf 0 of pf 0 which is at port 0, to representor 1 of pf 1 which is at port 6::
+
+ testpmd> flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 6 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 7: can not create vf original rule on a representor
+-----------------------------------------------------------
+
+1. create rule on representor 1 which is at port 1::
testpmd> flow create 1 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end
@@ -2933,8 +3044,76 @@ Subcase 1: can not create rule on vf 1
there is no rule listed.
-Subcase 2: unsupported pattern in os default package
-----------------------------------------------------
+Subcase 8: can not create vf original rule on a vf
+--------------------------------------------------
+
+1. create rule on vf 1 which is at port 3::
+
+ testpmd> flow create 3 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 3
+
+ there is no rule listed.
+
+Subcase 9: can not create vf original rule to a vf
+--------------------------------------------------
+
+1. create rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 3 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 10: can not create vf original rule to a representor
+------------------------------------------------------------
+
+1. create rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 11: can not create vf original rule to another dcf
+----------------------------------------------------------
+
+1. create rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 5 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 12: unsupported pattern in os default package
+-----------------------------------------------------
1. load os default package and launch testpmd as step 3-8 in Prerequisites.
@@ -2957,8 +3136,8 @@ Subcase 2: unsupported pattern in os default package
check the rule not exists in the list.
-Subcase 3: unsupported input set
---------------------------------
+Subcase 13: unsupported input set
+---------------------------------
1. create an nvgre rule with unsupported input set field [inner tos]::
@@ -2974,8 +3153,8 @@ Subcase 3: unsupported input set
check the rule not exists in the list.
-Subcase 4: duplicated rules
----------------------------
+Subcase 14: duplicated rules
+----------------------------
1. create a rule::
@@ -2994,8 +3173,8 @@ Subcase 4: duplicated rules
check only the first rule exists in the list.
-Subcase 5: void action
-----------------------
+Subcase 15: void action
+-----------------------
1. create a rule with void action::
@@ -3011,8 +3190,8 @@ Subcase 5: void action
check the rule not exists in the list.
-Subcase 6: unsupported action
------------------------------
+Subcase 16: unsupported action
+------------------------------
1. create a rule with void action::
@@ -3028,12 +3207,47 @@ Subcase 6: unsupported action
check the rule not exists in the list.
-Subcase 7: void input set value
--------------------------------
+Subcase 17: deprecated action
+-----------------------------
+
+1. create a rule with void action::
+
+ testpmd> flow create 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions vf id 1 / end
+
+ Failed to create flow, report message::
+
+ Invalid action type: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ check the rule not exists in the list.
+
+Subcase 18: invalid port id
+---------------------------
+
+1. create a rule with invalid port id 10::
+
+ testpmd> flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / tcp src is 25 dst is 23 / end actions represented_port ethdev_port_id 20 / end
+
+ Failed to create flow, report message::
+
+ ice_flow_create(): Failed to create flow
+ port_flow_complain(): Caught PMD error type 16 (specific action): cause: 0x7fff2c460900, Invalid ethdev_port_id: Invalid argument
+
+2. check the rule list::
+
+ testpmd> flow list 0
+
+ check the rule not exists in the list.
+
+Subcase 19: void input set value
+--------------------------------
1. create a rule with void input set value::
- testpmd> flow create 0 ingress pattern eth / ipv4 / end actions vf id 1 / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / end actions represented_port ethdev_port_id 1 / end
Failed to create flow, report message::
@@ -3045,8 +3259,8 @@ Subcase 7: void input set value
check the rule not exists in the list.
-Subcase 9: delete a non-existing rule
--------------------------------------
+Subcase 20: delete a non-existing rule
+--------------------------------------
1. check the rule list::
@@ -3066,7 +3280,7 @@ Subcase 9: delete a non-existing rule
check no error reports.
-Subcase 10: add long switch rule
+Subcase 21: add long switch rule
--------------------------------
Description: A recipe has 5 words, one of which is reserved for switch ID,
@@ -3138,6 +3352,12 @@ Subcase 1: can not create to vf rule on a representor
there is no rule listed.
+Subcase 2: can not create to vf rule on a vf
+--------------------------------------------
+
+1. validate rule on representor 1 which is at port 3::
+
+ testpmd> flow validate 3 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 1 / end
get the error message::
@@ -3145,12 +3365,165 @@ Subcase 1: can not create to vf rule on a representor
2. list the rule::
+ testpmd> flow list 3
+
+ there is no rule listed.
+
+Subcase 3: can not create to vf rule to a vf
+--------------------------------------------
+
+1. validate rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow validate 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 3 / end
+
+ get the error message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. list the rule::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 4: can not create to vf rule to self dcf
+------------------------------------------------
+
+1. validate rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow validate 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 0 / end
+
+ get the error message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. list the rule::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 5: can not create to vf rule to another dcf
+---------------------------------------------------
+
+1. validate rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow validate 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 5 / end
+
+ get the error message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. list the rule::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 6: can not create to vf rule to a representor of another pf
+-------------------------------------------------------------------
+
+1. validate rule on vf 0 of pf 0 which is at port 0, to representor 1 of pf 1 which is at port 6::
+
+ testpmd> flow validate 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 6 / end
+
+ get the error message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. list the rule::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 7: can not create vf original rule on a representor
+-----------------------------------------------------------
+
+1. validate rule on representor 1 which is at port 1::
+
+ testpmd> flow validate 1 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
testpmd> flow list 1
there is no rule listed.
-Subcase 2: unsupported patterns in os default
----------------------------------------------
+Subcase 8: can not create vf original rule on a vf
+--------------------------------------------------
+
+1. validate rule on vf 1 which is at port 3::
+
+ testpmd> flow validate 3 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 3
+
+ there is no rule listed.
+
+Subcase 9: can not create vf original rule to a vf
+--------------------------------------------------
+
+1. validate rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow validate 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 3 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 10: can not create vf original rule to a representor
+------------------------------------------------------------
+
+1. validate rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow validate 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 11: can not create vf original rule to another dcf
+----------------------------------------------------------
+
+1. validate rule on vf 0 which is at port 0, to vf 1 which is at port 3::
+
+ testpmd> flow validate 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 5 / end
+
+ Failed to create flow, report message::
+
+ Failed to create parser engine.: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ there is no rule listed.
+
+Subcase 12: unsupported patterns in os default
+----------------------------------------------
1. load os default package and launch testpmd as step 3-8 in Prerequisites.
@@ -3173,8 +3546,8 @@ Subcase 2: unsupported patterns in os default
check the rule not exists in the list.
-Subcase 3: unsupported input set
---------------------------------
+Subcase 13: unsupported input set
+---------------------------------
1. validate an nvgre rule with unsupported input set field [inner tos]::
@@ -3190,8 +3563,8 @@ Subcase 3: unsupported input set
check the rule not exists in the list.
-Subcase 4: void action
-----------------------
+Subcase 14: void action
+-----------------------
1. validate a rule with void action::
@@ -3207,8 +3580,8 @@ Subcase 4: void action
check the rule not exists in the list.
-Subcase 5: unsupported action
------------------------------
+Subcase 15: unsupported action
+------------------------------
1. validate a rule with void action::
@@ -3224,7 +3597,24 @@ Subcase 5: unsupported action
check the rule not exists in the list.
-Subcase 6: void input set value
+Subcase 16: deprecated action
+-----------------------------
+
+1. validate a rule with deprecated action::
+
+ testpmd> flow validate 0 ingress pattern eth / ipv4 src is 192.168.0.20 dst is 192.168.0.21 ttl is 2 tos is 4 / end actions vf id 1 / end
+
+ Failed to create flow, report message::
+
+ Invalid action type: Invalid argument
+
+2. check the flow list::
+
+ testpmd> flow list 0
+
+ check the rule not exists in the list.
+
+Subcase 17: void input set value
-------------------------------
1. validate a rule with void input set value::
@@ -3241,7 +3631,24 @@ Subcase 6: void input set value
check the rule not exists in the list.
-Subcase 8: long switch rule
+Subcase 18: invalid port id
+---------------------------
+
+1. validate a rule with invalid port id 10::
+
+ testpmd> flow validate 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / tcp src is 25 dst is 23 / end actions represented_port ethdev_port_id 10 / end
+
+ get the error message::
+
+ Invalid port id: Invalid argument
+
+3. check the rule list::
+
+ testpmd> flow list 0
+
+ check the rule not exists in the list.
+
+Subcase 19: long switch rule
---------------------------
1. validate a rule with input set length longer than 32 bytes::
@@ -3284,6 +3691,51 @@ Subcase 1: DCF stop/DCF start
4. send matched packets, port 3 can't receive the packets.
+Test case: VF Original action test
+==================================
+
+1. validate a rule::
+
+ testpmd> flow validate 0 ingress pattern eth src is 00:00:00:00:00:01 dst is 00:11:22:33:44:55 type is 0x0800 / end actions port_representor port_id 0 / end
+
+ get the message::
+
+ Flow rule validated
+
+ check the flow list::
+
+ testpmd> flow list 0
+
+ check the rule not exists in the list.
+
+2. create a rule::
+
+ testpmd> flow create 0 ingress pattern eth src is 00:00:00:00:00:01 dst is 00:11:22:33:44:55 type is 0x0800 / end actions port_representor port_id 0 / end
+ testpmd> flow list 0
+
+ check the rule exists in the list.
+
+3. send matched packets::
+
+ sendp([Ether(src="00:00:00:00:00:01",dst="00:11:22:33:44:55")/IP()/Raw("x" *80)],iface="enp27s0f0",count=1)
+
+ check port 0 receive the packet.
+ send mismatched packets::
+
+ sendp([Ether(src="00:00:00:00:00:02",dst="00:11:22:33:44:55")/IP()/Raw("x" *80)],iface="enp27s0f0",count=1)
+ sendp([Ether(src="00:00:00:00:00:01",dst="00:11:22:33:44:54")/IP()/Raw("x" *80)],iface="enp27s0f0",count=1)
+ sendp([Ether(src="00:00:00:00:00:01",dst="00:11:22:33:44:55")/IPv6()/Raw("x" *80)],iface="enp27s0f0",count=1)
+
+ check the packets are not to port 0.
+
+4. verify rules can be destroyed::
+
+ testpmd> flow destroy 0 rule 0
+ testpmd> flow list 0
+
+ check the rule not exists in the list.
+ send matched packets, check the packets are not to port 0.
+
Test case: Drop action test
===========================