Message ID | 20220118105354.180850-1-yaqi.tang@intel.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | [V3] test_plans/dcf_lifecycle_test_plan: add test plan for CVL DCF enable device reset API | expand |
Context | Check | Description |
---|---|---|
ci/Intel-dts-suite-test | fail | Apply issues |
Thanks, few comments as below. > -----Original Message----- > From: Yaqi Tang <yaqi.tang@intel.com> > Sent: Tuesday, January 18, 2022 6:54 PM > To: dts@dpdk.org > Cc: Tang, Yaqi <yaqi.tang@intel.com> > Subject: [dts][PATCH V3] test_plans/dcf_lifecycle_test_plan: add test plan for > CVL DCF enable device reset API > > DCF PMD need to support rte_eth_dev_reset.The reason is that when a DCF > instance be killed, all the flow rules still exist in hardware. when DCF gets to > reconnect, It has already lost the flow context, and if the application wants to > create new rules, they may fail because FW reports that the rules already > exist.The current workaround assumes that the user can turn off / turn on VF > trust mode, so kernel PF will reset DCF by removing all old rules.The > rte_eth_dev_reset API provides a more elegant way for the application to reset > DCF through the commmad "port reset all" when reconnecting. > > Signed-off-by: Yaqi Tang <yaqi.tang@intel.com> > Tested-by: Yaqi Tang < yaqi.tang@intel.com> > --- > test_plans/dcf_lifecycle_test_plan.rst | 754 +++++++++++++++++++++++++ > 1 file changed, 754 insertions(+) > > diff --git a/test_plans/dcf_lifecycle_test_plan.rst > b/test_plans/dcf_lifecycle_test_plan.rst > index 4c010e76..a8701338 100644 > --- a/test_plans/dcf_lifecycle_test_plan.rst > +++ b/test_plans/dcf_lifecycle_test_plan.rst > @@ -1071,3 +1071,757 @@ TC34: ACL DCF mode is active, add ACL filters by > way of host based configuration > > # ethtool -N enp24s0f1 flow-type tcp4 src-ip 192.168.10.0 m 0.255.255.255 > dst-port 8000 m 0x00ff action -1 > Added rule with ID 15871 > + > +=============================== > +CVL DCF enable device reset API > +=============================== > + > +Description > +=========== > +The test plan includes ten test cases, such as > +two_testpmd_dcf_reset_port, two_testpmd_dcf_reset_device, > two_testpmd_dcf_reset_port_detach, two_testpmd_dcf_reset_mtu, > two_testpmd_dcf_reset_mac, one_testpmd_dcf_reset_port, > one_testpmd_dcf_reset_device, one_testpmd_dcf_reset_port_detach, > one_testpmd_dcf_reset_mtu, one_testpmd_dcf_reset_mac. > + > +DCF PMD need to support rte_eth_dev_reset.The reason is that when a DCF > +instance be killed, all the flow rules still exist in hardware. when > +DCF gets to reconnect, It has already lost the flow context, and if the > +application wants to create new rules, they may fail because FW reports that > the rules already exist.The current workaround assumes that the user can turn > off / turn on VF trust mode, so kernel PF will reset DCF by removing all old > rules.The rte_eth_dev_reset API provides a more elegant way for the > application to reset DCF through the command "port reset all" when > reconnecting. > + > +Prerequisites > +============= > + > +Hardware > +-------- > +Supportted NICs: columbiaville_25g/columbiaville_100g > + > +Software > +-------- > +dpdk: http://dpdk.org/git/dpdk > +scapy: http://www.secdev.org/projects/scapy/ > + > +General Set Up > +-------------- > +1. Copy specific ice package to /lib/firmware/updates/intel/ice/ddp/ice.pkg, > + then load driver:: > + > + # cp ice_comms-1.3.31.0.pkg /lib/firmware/updates/intel/ice/ddp/ice.pkg > + # rmmod ice > + # insmod ice.ko > + > +2. 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 > + > +3. Get the pci device id and interface of DUT and tester:: > + > + # ./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 > + Above Prerequisites is common, not special for reset cases, suggest putting on top of the test plan if need. > +4. Generate 4 VFs on PF0:: > + > + # echo 4 > /sys/bus/pci/devices/0000:3b:00.0/sriov_numvfs > + > +5. Get VF pci device id of DUT. > + > + # ./usertools/dpdk-devbind.py -s > + > + 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 > + > +6. Set VF0 as trust:: > + > + # ip link set ens785f0 vf 0 trust on > + > +7. Bind the VF ports of DUT to dpdk:: > + > + # ./usertools/dpdk-devbind.py -b vfio-pci 3b:01.0 3b:01.1 > + > +Test case > +========= > + > +Common Steps > +------------ > +The common steps launch two testpmds and kill DCF process, then relaunch > two testpmds. > + > +1. Launch the userland ``testpmd`` application on DUT as follows:: > + > + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 -a > + 0000:3b:01.0,cap=dcf --file-prefix=dcf -- -i Could you follow template format for the whole test plan? > + > +2. Launch another ``testpmd`` application on the VF1 of DUT as follows:: > + > + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x18 -n 4 -a > + 0000:3b:01.1 --file-prefix=vf -- -i > + > +3. Set verbose in VF testpmd:: > + > + testpmd> set verbose 1 > + > +4. Set fwd engine and start in VF testpmd:: > + > + testpmd> set fwd mac > + testpmd> start > + > +5. Validate a switch rule to VF1 in DCF testpmd:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +6. Create a switch rule to VF1 in DCF testpmd and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +7. Send a matched packet in scapy to VF1, check the VF1 of DUT can receive > the packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst='C6:44:32:0A:EC:E1')/IP(src='192.168.0.2', > + dst='192.168.0.3')/("X"*64)],iface="ens260f0",count=1) Could you follow template format for the whole test plan, same as below? > + > +the VF1 of DUT:: > + > + testpmd> port 0/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +8. Check the process ID and kill DCF process:: > + > + # ps -ef |grep testpmd > + # kill -9 ##### > + > +9. Relaunch the userland ``testpmd`` application on DUT as follows:: > + > + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 -a > + 0000:3b:01.0,cap=dcf --file-prefix=dcf -- -i > + > +10. Send a matched packet in scapy to VF1, DCF flow rule is still valid and > check the VF1 of DUT can receive the packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +the VF1 of DUT:: The VF1 of DUT:: > + > + testpmd> port 0/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +Test Case 1: two_testpmd_dcf_reset_port > +--------------------------------------- > +The test case resets DCF by resetting the port, and DCF should clean up all old > rules. > + > +Test Steps > +~~~~~~~~~~ > +1. Reset port in DCF testpmd:: > + > + testpmd> stop > + testpmd> port stop all > + testpmd> port reset all > + testpmd> port start all > + testpmd> start > + > +2. Validate a switch rule to VF1 in DCF testpmd:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +3. Create a switch rule to VF1 in DCF testpmd and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +4. Send a matched packet in scapy to VF1, and check the VF1 of DUT can > receive the packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +the VF1 of DUT:: > + > + testpmd> port 0/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +Test Case 2: two_testpmd_dcf_reset_device > +----------------------------------------- > +The test case resets DCF by resetting the device, and DCF should clean up all > old rules. > + > +Test Steps > +~~~~~~~~~~ > +1. Reset DCF device:: > + > + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset > + > +2. Reset port in DCF testpmd:: > + > + testpmd> stop > + testpmd> port stop all > + testpmd> port reset all > + testpmd> port start all > + testpmd> start > + > +3. Validate a switch rule to VF1 in DCF testpmd:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +4. Create a switch rule to VF1 in DCF testpmd and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT can > receive the packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +the VF1 of DUT:: > + > + testpmd> port 0/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +Test Case 3: two_testpmd_dcf_reset_port_detach > +---------------------------------------------- > +The test case resets DCF by detaching the port, and DCF should clean up all > old rules. > + > +Test Steps > +~~~~~~~~~~ > +1. Reset DCF device:: > + > + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset > + > +2. Detach and reset port in DCF testpmd:: > + > + testpmd> stop > + testpmd> port stop 0 > + testpmd> port detach 0 > + testpmd> port attach 3b:01.0,cap=dcf > + testpmd> port reset 0 > + testpmd> port start 0 > + testpmd> start > + > +3. Validate a switch rule to VF1 in DCF testpmd:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +4. Create a switch rule to VF1 in DCF testpmd and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT can > receive the packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +the VF1 of DUT:: > + > + testpmd> port 0/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - > 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +Test Case 4: two_testpmd_dcf_reset_mtu > +-------------------------------------- > +The test case resets DCF by reseting the mtu, and DCF should clean up all old > rules. > + > +Test Steps > +~~~~~~~~~~ > +1. Modify the value of mtu:: > + > + # ifconfig ens785f0 mtu 3000 > + > +2. Reset port in DCF testpmd:: > + > + testpmd> stop > + testpmd> port stop all > + testpmd> port reset all > + testpmd> port start all > + testpmd> start > + > +3. Validate a switch rule to VF1 in DCF testpmd:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +4. Create a switch rule to VF1 in DCF testpmd and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT can > receive the packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +the VF1 of DUT:: > + > + testpmd> port 0/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +Test Case 5: two_testpmd_dcf_reset_mac > +-------------------------------------- > +The test case resets DCF by reseting mac addr, and DCF should clean up all old > rules. > + > +Test Steps > +~~~~~~~~~~ > +1. Reset VF0 by set mac addr:: > + > + # ip link set ens785f0 vf 0 mac 00:01:02:03:04:05 > + > +2. Reset port in DCF testpmd:: > + > + testpmd> stop > + testpmd> port stop all > + testpmd> port reset all > + testpmd> port start all > + testpmd> start > + > +3. Validate a switch rule to VF1 in DCF testpmd:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +4. Create a switch rule to VF1 in DCF testpmd and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT can > receive the packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +the VF1 of DUT:: > + > + testpmd> port 0/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +Common Steps > +------------ > +The common steps launch one testpmd and kill DCF process, then relaunch > one testpmd. > + > +1. Launch the userland ``testpmd`` application on DUT as follows:: > + > + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 -a > + 3b:01.0,cap=dcf -a 3b:01.1 --file-prefix=dcf -- -i > + > +2. Set verbose:: > + > + testpmd> set verbose 1 > + > +3. Set fwd engine and start:: > + > + testpmd> set fwd mac > + testpmd> start > + > +4. Validate a switch rule to VF1:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +5. Create a switch rule to VF1 and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +6. Send a matched packet in scapy to VF1, check DUT can receive the packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +DUT:: > + > + testpmd> port 1/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +7. Check the process ID and kill DCF process:: > + > + # ps -ef |grep testpmd > + # kill -9 ##### > + > +8. Relaunch the userland ``testpmd`` application on DUT as follows:: > + > + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 -a > + 3b:01.0,cap=dcf -a 3b:01.1 --file-prefix=dcf -- -i > + > +9. Set verbose:: > + > + testpmd> set verbose 1 > + > +10. Set fwd engine and start:: > + > + testpmd> set fwd mac > + testpmd> start > + > +11. Send a matched packet in scapy to VF1, DCF flow rule is cleared and check > DUT can't receive the packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +DUT:: > + > + testpmd> > + > +Test Case 6: one_testpmd_dcf_reset_port > +--------------------------------------- > +The test case resets DCF by resetting the port, and DCF should clean up all old > rules. > + > +Test Steps > +~~~~~~~~~~ > +1. Reset port in testpmd:: > + > + testpmd> stop > + testpmd> port stop all > + testpmd> port reset all > + testpmd> port start all > + testpmd> start > + > +2. Validate a switch rule to VF1:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +3. Create a switch rule to VF1 and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +4. Send a matched packet in scapy to VF1, and check DUT can receive the > packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +DUT:: > + > + testpmd> port 1/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - > 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +Test Case 7: one_testpmd_dcf_reset_device > +----------------------------------------- > +The test case resets DCF by resetting the device, and DCF should clean up all > old rules. > + > +Test Steps > +~~~~~~~~~~ > +1. Reset DCF device:: > + > + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset > + > +2. Reset port in testpmd:: > + > + testpmd> stop > + testpmd> port stop all > + testpmd> port reset all > + testpmd> port start all > + testpmd> start > + > +3. Validate a switch rule to VF1:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +4. Create a switch rule to VF1 and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +5. Send a matched packet in scapy to VF1, and check DUT can receive the > packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +DUT:: > + > + testpmd> port 1/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +Test Case 8: one_testpmd_dcf_reset_port_detach > +---------------------------------------------- > +The test case resets DCF by detaching the port, and DCF should clean up all > old rules. > + > +Test Steps > +~~~~~~~~~~ > +1. Reset DCF device:: > + > + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset > + > +2. Detach and reset port in DCF testpmd:: > + > + testpmd> stop > + testpmd> port stop 0 > + testpmd> port detach 0 > + testpmd> port attach 3b:01.0,cap=dcf > + testpmd> port reset 0 > + testpmd> port start 0 > + testpmd> start > + > +3. Validate a switch rule to VF1:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +4. Create a switch rule to VF1 and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +5. Send a matched packet in scapy to VF1, and check DUT can receive the > packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +DUT:: > + > + testpmd> port 1/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - > 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +Test Case 9: one_testpmd_dcf_reset_mtu > +-------------------------------------- > +The test case resets DCF by resetting the mtu, and DCF should clean up all old > rules. > + > +Test Steps > +~~~~~~~~~~ > +1. Modify the value of mtu:: > + > + # ifconfig ens785f0 mtu 3000 > + > +2. Reset port in DCF testpmd:: > + > + testpmd> stop > + testpmd> port stop all > + testpmd> port reset all > + testpmd> port start all > + testpmd> start > + > +3. Validate a switch rule to VF1:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +4. Create a switch rule to VF1 and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +5. Send a matched packet in scapy to VF1, and check DUT can receive the > packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +DUT:: > + > + testpmd> port 1/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - > 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > + > +Test Case 10: one_testpmd_dcf_reset_mac > +--------------------------------------- > +The test case resets DCF by resetting mac addr, and DCF should clean up all > old rules. > + > +Test Steps > +~~~~~~~~~~ > +1. Reset VF0 by set mac addr:: > + > + # ip link set ens785f0 vf 0 mac 00:01:02:03:04:05 > + > +2. Reset port in DCF testpmd:: > + > + testpmd> stop > + testpmd> port stop all > + testpmd> port reset all > + testpmd> port start all > + testpmd> start > + > +3. Validate a switch rule to VF1:: > + > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > + > + Get the message:: > + > + Flow rule validated > + > +4. Create a switch rule to VF1 and list rules:: > + > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > + > +5. Send a matched packet in scapy to VF1, and check DUT can receive the > packet. > + > +Tester:: > + > + >>> sendp([Ether(src="00:11:22:33:44:55", > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose= > + False) > + > +DUT:: > + > + testpmd> port 1/queue 0: received 1 packets > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - > 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > RTE_MBUF_F_RX_IP_CKSUM_GOOD > RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > -- > 2.25.1
> -----Original Message----- > From: Lin, Xueqin <xueqin.lin@intel.com> > Sent: Tuesday, January 18, 2022 1:18 PM > To: Tang, Yaqi <yaqi.tang@intel.com>; dts@dpdk.org > Cc: Tang, Yaqi <yaqi.tang@intel.com> > Subject: RE: [dts][PATCH V3] test_plans/dcf_lifecycle_test_plan: add test plan > for CVL DCF enable device reset API > > Thanks, few comments as below. > > > -----Original Message----- > > From: Yaqi Tang <yaqi.tang@intel.com> > > Sent: Tuesday, January 18, 2022 6:54 PM > > To: dts@dpdk.org > > Cc: Tang, Yaqi <yaqi.tang@intel.com> > > Subject: [dts][PATCH V3] test_plans/dcf_lifecycle_test_plan: add test > > plan for CVL DCF enable device reset API > > > > DCF PMD need to support rte_eth_dev_reset.The reason is that when a > > DCF instance be killed, all the flow rules still exist in hardware. > > when DCF gets to reconnect, It has already lost the flow context, and > > if the application wants to create new rules, they may fail because FW > > reports that the rules already exist.The current workaround assumes > > that the user can turn off / turn on VF trust mode, so kernel PF will > > reset DCF by removing all old rules.The rte_eth_dev_reset API provides > > a more elegant way for the application to reset DCF through the commmad > "port reset all" when reconnecting. > > > > Signed-off-by: Yaqi Tang <yaqi.tang@intel.com> > > Tested-by: Yaqi Tang < yaqi.tang@intel.com> > > --- > > test_plans/dcf_lifecycle_test_plan.rst | 754 > > +++++++++++++++++++++++++ > > 1 file changed, 754 insertions(+) > > > > diff --git a/test_plans/dcf_lifecycle_test_plan.rst > > b/test_plans/dcf_lifecycle_test_plan.rst > > index 4c010e76..a8701338 100644 > > --- a/test_plans/dcf_lifecycle_test_plan.rst > > +++ b/test_plans/dcf_lifecycle_test_plan.rst > > @@ -1071,3 +1071,757 @@ TC34: ACL DCF mode is active, add ACL filters > > by way of host based configuration > > > > # ethtool -N enp24s0f1 flow-type tcp4 src-ip 192.168.10.0 m > > 0.255.255.255 dst-port 8000 m 0x00ff action -1 > > Added rule with ID 15871 > > + > > +=============================== > > +CVL DCF enable device reset API > > +=============================== > > + > > +Description > > +=========== > > +The test plan includes ten test cases, such as > > +two_testpmd_dcf_reset_port, two_testpmd_dcf_reset_device, > > two_testpmd_dcf_reset_port_detach, two_testpmd_dcf_reset_mtu, > > two_testpmd_dcf_reset_mac, one_testpmd_dcf_reset_port, > > one_testpmd_dcf_reset_device, one_testpmd_dcf_reset_port_detach, > > one_testpmd_dcf_reset_mtu, one_testpmd_dcf_reset_mac. It is not convenient for test cases add in future. Suggest not listing the test case, could describe which features supported. > > + > > +DCF PMD need to support rte_eth_dev_reset.The reason is that when a > > +DCF instance be killed, all the flow rules still exist in hardware. > > +when DCF gets to reconnect, It has already lost the flow context, and > > +if the application wants to create new rules, they may fail because > > +FW reports that > > the rules already exist.The current workaround assumes that the user > > can turn off / turn on VF trust mode, so kernel PF will reset DCF by > > removing all old rules.The rte_eth_dev_reset API provides a more > > elegant way for the application to reset DCF through the command "port > > reset all" when reconnecting. > > + > > +Prerequisites > > +============= > > + > > +Hardware > > +-------- > > +Supportted NICs: columbiaville_25g/columbiaville_100g > > + > > +Software > > +-------- > > +dpdk: http://dpdk.org/git/dpdk > > +scapy: http://www.secdev.org/projects/scapy/ > > + > > +General Set Up > > +-------------- > > +1. Copy specific ice package to /lib/firmware/updates/intel/ice/ddp/ice.pkg, > > + then load driver:: > > + > > + # cp ice_comms-1.3.31.0.pkg /lib/firmware/updates/intel/ice/ddp/ice.pkg > > + # rmmod ice > > + # insmod ice.ko > > + > > +2. 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 > > + > > +3. Get the pci device id and interface of DUT and tester:: > > + > > + # ./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 > > + > > Above Prerequisites is common, not special for reset cases, suggest putting on > top of the test plan if need. > > > +4. Generate 4 VFs on PF0:: > > + > > + # echo 4 > /sys/bus/pci/devices/0000:3b:00.0/sriov_numvfs > > + > > +5. Get VF pci device id of DUT. > > + > > + # ./usertools/dpdk-devbind.py -s > > + > > + 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 > > + > > +6. Set VF0 as trust:: > > + > > + # ip link set ens785f0 vf 0 trust on > > + > > +7. Bind the VF ports of DUT to dpdk:: > > + > > + # ./usertools/dpdk-devbind.py -b vfio-pci 3b:01.0 3b:01.1 > > + > > +Test case > > +========= > > + > > +Common Steps > > +------------ > > +The common steps launch two testpmds and kill DCF process, then > > +relaunch > > two testpmds. > > + > > +1. Launch the userland ``testpmd`` application on DUT as follows:: > > + > > + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 > > + -a 0000:3b:01.0,cap=dcf --file-prefix=dcf -- -i > > Could you follow template format for the whole test plan? > > > + > > +2. Launch another ``testpmd`` application on the VF1 of DUT as follows:: > > + > > + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x18 -n 4 > > + -a > > + 0000:3b:01.1 --file-prefix=vf -- -i > > + > > +3. Set verbose in VF testpmd:: > > + > > + testpmd> set verbose 1 > > + > > +4. Set fwd engine and start in VF testpmd:: > > + > > + testpmd> set fwd mac > > + testpmd> start > > + > > +5. Validate a switch rule to VF1 in DCF testpmd:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +6. Create a switch rule to VF1 in DCF testpmd and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +7. Send a matched packet in scapy to VF1, check the VF1 of DUT can > > +receive > > the packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst='C6:44:32:0A:EC:E1')/IP(src='192.168.0.2', > > + dst='192.168.0.3')/("X"*64)],iface="ens260f0",count=1) > > Could you follow template format for the whole test plan, same as below? > > > + > > +the VF1 of DUT:: > > + > > + testpmd> port 0/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + > > +8. Check the process ID and kill DCF process:: > > + > > + # ps -ef |grep testpmd > > + # kill -9 ##### > > + > > +9. Relaunch the userland ``testpmd`` application on DUT as follows:: > > + > > + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 > > + -a 0000:3b:01.0,cap=dcf --file-prefix=dcf -- -i > > + > > +10. Send a matched packet in scapy to VF1, DCF flow rule is still > > +valid and > > check the VF1 of DUT can receive the packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +the VF1 of DUT:: > > The VF1 of DUT:: > > > + > > + testpmd> port 0/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + > > +Test Case 1: two_testpmd_dcf_reset_port > > +--------------------------------------- > > +The test case resets DCF by resetting the port, and DCF should clean > > +up all old > > rules. > > + > > +Test Steps > > +~~~~~~~~~~ > > +1. Reset port in DCF testpmd:: > > + > > + testpmd> stop > > + testpmd> port stop all > > + testpmd> port reset all > > + testpmd> port start all > > + testpmd> start > > + Add one more step check: clean up all rules, no rule list in the application > > +2. Validate a switch rule to VF1 in DCF testpmd:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +3. Create a switch rule to VF1 in DCF testpmd and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +4. Send a matched packet in scapy to VF1, and check the VF1 of DUT > > +can > > receive the packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +the VF1 of DUT:: > > + > > + testpmd> port 0/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + Add more step: repeat above steps for 2 times > > +Test Case 2: two_testpmd_dcf_reset_device > > +----------------------------------------- > > +The test case resets DCF by resetting the device, and DCF should > > +clean up all > > old rules. > > + > > +Test Steps > > +~~~~~~~~~~ > > +1. Reset DCF device:: > > + > > + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset This test case is testing resetting dcf port by "echo" cmd. Will you also kill the DCF testpmd for this case? if not, kill sample should not common step. > > + > > +2. Reset port in DCF testpmd:: > > + > > + testpmd> stop > > + testpmd> port stop all > > + testpmd> port reset all > > + testpmd> port start all > > + testpmd> start > > + > > +3. Validate a switch rule to VF1 in DCF testpmd:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +4. Create a switch rule to VF1 in DCF testpmd and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT > > +can > > receive the packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +the VF1 of DUT:: > > + > > + testpmd> port 0/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + > > +Test Case 3: two_testpmd_dcf_reset_port_detach > > +---------------------------------------------- > > +The test case resets DCF by detaching the port, and DCF should clean > > +up all > > old rules. > > + > > +Test Steps > > +~~~~~~~~~~ > > +1. Reset DCF device:: > > + > > + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset May not need this step. > > + > > +2. Detach and reset port in DCF testpmd:: > > + > > + testpmd> stop > > + testpmd> port stop 0 > > + testpmd> port detach 0 > > + testpmd> port attach 3b:01.0,cap=dcf > > + testpmd> port reset 0 > > + testpmd> port start 0 > > + testpmd> start > > + > > +3. Validate a switch rule to VF1 in DCF testpmd:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +4. Create a switch rule to VF1 in DCF testpmd and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT > > +can > > receive the packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +the VF1 of DUT:: > > + > > + testpmd> port 0/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - > > 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + > > +Test Case 4: two_testpmd_dcf_reset_mtu > > +-------------------------------------- > > +The test case resets DCF by reseting the mtu, and DCF should clean up > > +all old > > rules. > > + > > +Test Steps > > +~~~~~~~~~~ > > +1. Modify the value of mtu:: > > + > > + # ifconfig ens785f0 mtu 3000 > > + > > +2. Reset port in DCF testpmd:: > > + > > + testpmd> stop > > + testpmd> port stop all > > + testpmd> port reset all > > + testpmd> port start all > > + testpmd> start > > + > > +3. Validate a switch rule to VF1 in DCF testpmd:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +4. Create a switch rule to VF1 in DCF testpmd and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT > > +can > > receive the packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +the VF1 of DUT:: > > + > > + testpmd> port 0/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + > > +Test Case 5: two_testpmd_dcf_reset_mac > > +-------------------------------------- > > +The test case resets DCF by reseting mac addr, and DCF should clean > > +up all old > > rules. > > + > > +Test Steps > > +~~~~~~~~~~ > > +1. Reset VF0 by set mac addr:: > > + > > + # ip link set ens785f0 vf 0 mac 00:01:02:03:04:05 > > + > > +2. Reset port in DCF testpmd:: > > + > > + testpmd> stop > > + testpmd> port stop all > > + testpmd> port reset all > > + testpmd> port start all > > + testpmd> start > > + > > +3. Validate a switch rule to VF1 in DCF testpmd:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +4. Create a switch rule to VF1 in DCF testpmd and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT > > +can > > receive the packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +the VF1 of DUT:: > > + > > + testpmd> port 0/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + > > +Common Steps > > +------------ > > +The common steps launch one testpmd and kill DCF process, then > > +relaunch > > one testpmd. > > + > > +1. Launch the userland ``testpmd`` application on DUT as follows:: > > + > > + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 -a > > + 3b:01.0,cap=dcf -a 3b:01.1 --file-prefix=dcf -- -i > > + > > +2. Set verbose:: > > + > > + testpmd> set verbose 1 > > + > > +3. Set fwd engine and start:: > > + > > + testpmd> set fwd mac > > + testpmd> start > > + > > +4. Validate a switch rule to VF1:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +5. Create a switch rule to VF1 and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +6. Send a matched packet in scapy to VF1, check DUT can receive the packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +DUT:: > > + > > + testpmd> port 1/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + > > +7. Check the process ID and kill DCF process:: > > + > > + # ps -ef |grep testpmd > > + # kill -9 ##### > > + > > +8. Relaunch the userland ``testpmd`` application on DUT as follows:: > > + > > + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 -a > > + 3b:01.0,cap=dcf -a 3b:01.1 --file-prefix=dcf -- -i > > + > > +9. Set verbose:: > > + > > + testpmd> set verbose 1 > > + > > +10. Set fwd engine and start:: > > + > > + testpmd> set fwd mac > > + testpmd> start > > + > > +11. Send a matched packet in scapy to VF1, DCF flow rule is cleared > > +and check > > DUT can't receive the packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +DUT:: > > + > > + testpmd> > > + > > +Test Case 6: one_testpmd_dcf_reset_port > > +--------------------------------------- > > +The test case resets DCF by resetting the port, and DCF should clean > > +up all old > > rules. > > + > > +Test Steps > > +~~~~~~~~~~ > > +1. Reset port in testpmd:: > > + > > + testpmd> stop > > + testpmd> port stop all > > + testpmd> port reset all > > + testpmd> port start all > > + testpmd> start If without this reset port step, if success to create step 3 rule? > > + > > +2. Validate a switch rule to VF1:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +3. Create a switch rule to VF1 and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +4. Send a matched packet in scapy to VF1, and check DUT can receive > > +the > > packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +DUT:: > > + > > + testpmd> port 1/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - > > 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + > > +Test Case 7: one_testpmd_dcf_reset_device > > +----------------------------------------- > > +The test case resets DCF by resetting the device, and DCF should > > +clean up all > > old rules. > > + > > +Test Steps > > +~~~~~~~~~~ > > +1. Reset DCF device:: > > + > > + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset > > + > > +2. Reset port in testpmd:: > > + > > + testpmd> stop > > + testpmd> port stop all > > + testpmd> port reset all > > + testpmd> port start all > > + testpmd> start > > + > > +3. Validate a switch rule to VF1:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +4. Create a switch rule to VF1 and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +5. Send a matched packet in scapy to VF1, and check DUT can receive > > +the > > packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +DUT:: > > + > > + testpmd> port 1/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > + RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + > > +Test Case 8: one_testpmd_dcf_reset_port_detach > > +---------------------------------------------- > > +The test case resets DCF by detaching the port, and DCF should clean > > +up all > > old rules. > > + > > +Test Steps > > +~~~~~~~~~~ > > +1. Reset DCF device:: > > + > > + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset > > + > > +2. Detach and reset port in DCF testpmd:: > > + > > + testpmd> stop > > + testpmd> port stop 0 > > + testpmd> port detach 0 > > + testpmd> port attach 3b:01.0,cap=dcf > > + testpmd> port reset 0 > > + testpmd> port start 0 > > + testpmd> start > > + > > +3. Validate a switch rule to VF1:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +4. Create a switch rule to VF1 and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +5. Send a matched packet in scapy to VF1, and check DUT can receive > > +the > > packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +DUT:: > > + > > + testpmd> port 1/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - > > 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + > > +Test Case 9: one_testpmd_dcf_reset_mtu > > +-------------------------------------- > > +The test case resets DCF by resetting the mtu, and DCF should clean > > +up all old > > rules. > > + > > +Test Steps > > +~~~~~~~~~~ > > +1. Modify the value of mtu:: > > + > > + # ifconfig ens785f0 mtu 3000 > > + > > +2. Reset port in DCF testpmd:: > > + > > + testpmd> stop > > + testpmd> port stop all > > + testpmd> port reset all > > + testpmd> port start all > > + testpmd> start > > + > > +3. Validate a switch rule to VF1:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +4. Create a switch rule to VF1 and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +5. Send a matched packet in scapy to VF1, and check DUT can receive > > +the > > packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +DUT:: > > + > > + testpmd> port 1/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - > > 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > + > > +Test Case 10: one_testpmd_dcf_reset_mac > > +--------------------------------------- > > +The test case resets DCF by resetting mac addr, and DCF should clean > > +up all > > old rules. > > + > > +Test Steps > > +~~~~~~~~~~ > > +1. Reset VF0 by set mac addr:: > > + > > + # ip link set ens785f0 vf 0 mac 00:01:02:03:04:05 > > + > > +2. Reset port in DCF testpmd:: > > + > > + testpmd> stop > > + testpmd> port stop all > > + testpmd> port reset all > > + testpmd> port start all > > + testpmd> start > > + > > +3. Validate a switch rule to VF1:: > > + > > + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 > > + src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end > > + > > + Get the message:: > > + > > + Flow rule validated > > + > > +4. Create a switch rule to VF1 and list rules:: > > + > > + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src > > + is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF > > + > > +5. Send a matched packet in scapy to VF1, and check DUT can receive > > +the > > packet. > > + > > +Tester:: > > + > > + >>> sendp([Ether(src="00:11:22:33:44:55", > > + dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", > > + dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbos > > + e= > > + False) > > + > > +DUT:: > > + > > + testpmd> port 1/queue 0: received 1 packets > > + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - > > + length=98 - > > 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD > > RTE_MBUF_F_RX_IP_CKSUM_GOOD > > RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN > > -- > > 2.25.1
diff --git a/test_plans/dcf_lifecycle_test_plan.rst b/test_plans/dcf_lifecycle_test_plan.rst index 4c010e76..a8701338 100644 --- a/test_plans/dcf_lifecycle_test_plan.rst +++ b/test_plans/dcf_lifecycle_test_plan.rst @@ -1071,3 +1071,757 @@ TC34: ACL DCF mode is active, add ACL filters by way of host based configuration # ethtool -N enp24s0f1 flow-type tcp4 src-ip 192.168.10.0 m 0.255.255.255 dst-port 8000 m 0x00ff action -1 Added rule with ID 15871 + +=============================== +CVL DCF enable device reset API +=============================== + +Description +=========== +The test plan includes ten test cases, such as two_testpmd_dcf_reset_port, two_testpmd_dcf_reset_device, two_testpmd_dcf_reset_port_detach, two_testpmd_dcf_reset_mtu, +two_testpmd_dcf_reset_mac, one_testpmd_dcf_reset_port, one_testpmd_dcf_reset_device, one_testpmd_dcf_reset_port_detach, one_testpmd_dcf_reset_mtu, one_testpmd_dcf_reset_mac. + +DCF PMD need to support rte_eth_dev_reset.The reason is that when a DCF instance be killed, all the flow rules still exist in hardware. when DCF gets to reconnect, +It has already lost the flow context, and if the application wants to create new rules, they may fail because FW reports that the rules already exist.The current +workaround assumes that the user can turn off / turn on VF trust mode, so kernel PF will reset DCF by removing all old rules.The rte_eth_dev_reset API provides +a more elegant way for the application to reset DCF through the command "port reset all" when reconnecting. + +Prerequisites +============= + +Hardware +-------- +Supportted NICs: columbiaville_25g/columbiaville_100g + +Software +-------- +dpdk: http://dpdk.org/git/dpdk +scapy: http://www.secdev.org/projects/scapy/ + +General Set Up +-------------- +1. Copy specific ice package to /lib/firmware/updates/intel/ice/ddp/ice.pkg, + then load driver:: + + # cp ice_comms-1.3.31.0.pkg /lib/firmware/updates/intel/ice/ddp/ice.pkg + # rmmod ice + # insmod ice.ko + +2. 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 + +3. Get the pci device id and interface of DUT and tester:: + + # ./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 4 VFs on PF0:: + + # echo 4 > /sys/bus/pci/devices/0000:3b:00.0/sriov_numvfs + +5. Get VF pci device id of DUT. + + # ./usertools/dpdk-devbind.py -s + + 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 + +6. Set VF0 as trust:: + + # ip link set ens785f0 vf 0 trust on + +7. Bind the VF ports of DUT to dpdk:: + + # ./usertools/dpdk-devbind.py -b vfio-pci 3b:01.0 3b:01.1 + +Test case +========= + +Common Steps +------------ +The common steps launch two testpmds and kill DCF process, then relaunch two testpmds. + +1. Launch the userland ``testpmd`` application on DUT as follows:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 -a 0000:3b:01.0,cap=dcf --file-prefix=dcf -- -i + +2. Launch another ``testpmd`` application on the VF1 of DUT as follows:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x18 -n 4 -a 0000:3b:01.1 --file-prefix=vf -- -i + +3. Set verbose in VF testpmd:: + + testpmd> set verbose 1 + +4. Set fwd engine and start in VF testpmd:: + + testpmd> set fwd mac + testpmd> start + +5. Validate a switch rule to VF1 in DCF testpmd:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +6. Create a switch rule to VF1 in DCF testpmd and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +7. Send a matched packet in scapy to VF1, check the VF1 of DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst='C6:44:32:0A:EC:E1')/IP(src='192.168.0.2', dst='192.168.0.3')/("X"*64)],iface="ens260f0",count=1) + +the VF1 of DUT:: + + testpmd> port 0/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +8. Check the process ID and kill DCF process:: + + # ps -ef |grep testpmd + # kill -9 ##### + +9. Relaunch the userland ``testpmd`` application on DUT as follows:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 -a 0000:3b:01.0,cap=dcf --file-prefix=dcf -- -i + +10. Send a matched packet in scapy to VF1, DCF flow rule is still valid and check the VF1 of DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +the VF1 of DUT:: + + testpmd> port 0/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +Test Case 1: two_testpmd_dcf_reset_port +--------------------------------------- +The test case resets DCF by resetting the port, and DCF should clean up all old rules. + +Test Steps +~~~~~~~~~~ +1. Reset port in DCF testpmd:: + + testpmd> stop + testpmd> port stop all + testpmd> port reset all + testpmd> port start all + testpmd> start + +2. Validate a switch rule to VF1 in DCF testpmd:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +3. Create a switch rule to VF1 in DCF testpmd and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +4. Send a matched packet in scapy to VF1, and check the VF1 of DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +the VF1 of DUT:: + + testpmd> port 0/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +Test Case 2: two_testpmd_dcf_reset_device +----------------------------------------- +The test case resets DCF by resetting the device, and DCF should clean up all old rules. + +Test Steps +~~~~~~~~~~ +1. Reset DCF device:: + + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset + +2. Reset port in DCF testpmd:: + + testpmd> stop + testpmd> port stop all + testpmd> port reset all + testpmd> port start all + testpmd> start + +3. Validate a switch rule to VF1 in DCF testpmd:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +4. Create a switch rule to VF1 in DCF testpmd and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +the VF1 of DUT:: + + testpmd> port 0/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +Test Case 3: two_testpmd_dcf_reset_port_detach +---------------------------------------------- +The test case resets DCF by detaching the port, and DCF should clean up all old rules. + +Test Steps +~~~~~~~~~~ +1. Reset DCF device:: + + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset + +2. Detach and reset port in DCF testpmd:: + + testpmd> stop + testpmd> port stop 0 + testpmd> port detach 0 + testpmd> port attach 3b:01.0,cap=dcf + testpmd> port reset 0 + testpmd> port start 0 + testpmd> start + +3. Validate a switch rule to VF1 in DCF testpmd:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +4. Create a switch rule to VF1 in DCF testpmd and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +the VF1 of DUT:: + + testpmd> port 0/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +Test Case 4: two_testpmd_dcf_reset_mtu +-------------------------------------- +The test case resets DCF by reseting the mtu, and DCF should clean up all old rules. + +Test Steps +~~~~~~~~~~ +1. Modify the value of mtu:: + + # ifconfig ens785f0 mtu 3000 + +2. Reset port in DCF testpmd:: + + testpmd> stop + testpmd> port stop all + testpmd> port reset all + testpmd> port start all + testpmd> start + +3. Validate a switch rule to VF1 in DCF testpmd:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +4. Create a switch rule to VF1 in DCF testpmd and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +the VF1 of DUT:: + + testpmd> port 0/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +Test Case 5: two_testpmd_dcf_reset_mac +-------------------------------------- +The test case resets DCF by reseting mac addr, and DCF should clean up all old rules. + +Test Steps +~~~~~~~~~~ +1. Reset VF0 by set mac addr:: + + # ip link set ens785f0 vf 0 mac 00:01:02:03:04:05 + +2. Reset port in DCF testpmd:: + + testpmd> stop + testpmd> port stop all + testpmd> port reset all + testpmd> port start all + testpmd> start + +3. Validate a switch rule to VF1 in DCF testpmd:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +4. Create a switch rule to VF1 in DCF testpmd and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +5. Send a matched packet in scapy to VF1, and check the VF1 of DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +the VF1 of DUT:: + + testpmd> port 0/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +Common Steps +------------ +The common steps launch one testpmd and kill DCF process, then relaunch one testpmd. + +1. Launch the userland ``testpmd`` application on DUT as follows:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 -a 3b:01.0,cap=dcf -a 3b:01.1 --file-prefix=dcf -- -i + +2. Set verbose:: + + testpmd> set verbose 1 + +3. Set fwd engine and start:: + + testpmd> set fwd mac + testpmd> start + +4. Validate a switch rule to VF1:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +5. Create a switch rule to VF1 and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +6. Send a matched packet in scapy to VF1, check DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +DUT:: + + testpmd> port 1/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +7. Check the process ID and kill DCF process:: + + # ps -ef |grep testpmd + # kill -9 ##### + +8. Relaunch the userland ``testpmd`` application on DUT as follows:: + + # ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -v -c 0x6 -n 4 -a 3b:01.0,cap=dcf -a 3b:01.1 --file-prefix=dcf -- -i + +9. Set verbose:: + + testpmd> set verbose 1 + +10. Set fwd engine and start:: + + testpmd> set fwd mac + testpmd> start + +11. Send a matched packet in scapy to VF1, DCF flow rule is cleared and check DUT can't receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +DUT:: + + testpmd> + +Test Case 6: one_testpmd_dcf_reset_port +--------------------------------------- +The test case resets DCF by resetting the port, and DCF should clean up all old rules. + +Test Steps +~~~~~~~~~~ +1. Reset port in testpmd:: + + testpmd> stop + testpmd> port stop all + testpmd> port reset all + testpmd> port start all + testpmd> start + +2. Validate a switch rule to VF1:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +3. Create a switch rule to VF1 and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +4. Send a matched packet in scapy to VF1, and check DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +DUT:: + + testpmd> port 1/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +Test Case 7: one_testpmd_dcf_reset_device +----------------------------------------- +The test case resets DCF by resetting the device, and DCF should clean up all old rules. + +Test Steps +~~~~~~~~~~ +1. Reset DCF device:: + + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset + +2. Reset port in testpmd:: + + testpmd> stop + testpmd> port stop all + testpmd> port reset all + testpmd> port start all + testpmd> start + +3. Validate a switch rule to VF1:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +4. Create a switch rule to VF1 and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +5. Send a matched packet in scapy to VF1, and check DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +DUT:: + + testpmd> port 1/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +Test Case 8: one_testpmd_dcf_reset_port_detach +---------------------------------------------- +The test case resets DCF by detaching the port, and DCF should clean up all old rules. + +Test Steps +~~~~~~~~~~ +1. Reset DCF device:: + + # echo 1 > /sys/bus/pci/devices/0000:3b:01.0/reset + +2. Detach and reset port in DCF testpmd:: + + testpmd> stop + testpmd> port stop 0 + testpmd> port detach 0 + testpmd> port attach 3b:01.0,cap=dcf + testpmd> port reset 0 + testpmd> port start 0 + testpmd> start + +3. Validate a switch rule to VF1:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +4. Create a switch rule to VF1 and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +5. Send a matched packet in scapy to VF1, and check DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +DUT:: + + testpmd> port 1/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +Test Case 9: one_testpmd_dcf_reset_mtu +-------------------------------------- +The test case resets DCF by resetting the mtu, and DCF should clean up all old rules. + +Test Steps +~~~~~~~~~~ +1. Modify the value of mtu:: + + # ifconfig ens785f0 mtu 3000 + +2. Reset port in DCF testpmd:: + + testpmd> stop + testpmd> port stop all + testpmd> port reset all + testpmd> port start all + testpmd> start + +3. Validate a switch rule to VF1:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +4. Create a switch rule to VF1 and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +5. Send a matched packet in scapy to VF1, and check DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +DUT:: + + testpmd> port 1/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN + +Test Case 10: one_testpmd_dcf_reset_mac +--------------------------------------- +The test case resets DCF by resetting mac addr, and DCF should clean up all old rules. + +Test Steps +~~~~~~~~~~ +1. Reset VF0 by set mac addr:: + + # ip link set ens785f0 vf 0 mac 00:01:02:03:04:05 + +2. Reset port in DCF testpmd:: + + testpmd> stop + testpmd> port stop all + testpmd> port reset all + testpmd> port start all + testpmd> start + +3. Validate a switch rule to VF1:: + + testpmd> flow validate 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / end actions vf id 1 / end + + Get the message:: + + Flow rule validated + +4. Create a switch rule to VF1 and list rules:: + + testpmd> flow create 0 priority 0 ingress pattern eth / ipv4 src is 192.168.0.2 dst is 192.168.0.3 / 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 IPV4 => VF + +5. Send a matched packet in scapy to VF1, and check DUT can receive the packet. + +Tester:: + + >>> sendp([Ether(src="00:11:22:33:44:55", dst="C6:44:32:0A:EC:E1")/IP(src="192.168.0.2", dst="192.168.0.3")/("X"*64)],iface="ens260f0",count=1,inter=0,verbose=False) + +DUT:: + + testpmd> port 1/queue 0: received 1 packets + src=00:11:22:33:44:55 - dst=C6:44:32:0A:EC:E1 - type=0x0800 - length=98 - 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: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN -- 2.25.1