[V2] ice_dcf_data_path:modify check point to adapt dpdk changed

Message ID 20230705163623.1060424-1-zhiminx.huang@intel.com (mailing list archive)
State New
Headers
Series [V2] ice_dcf_data_path:modify check point to adapt dpdk changed |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-doc-test success Testing OK
ci/Intel-dts-suite-test warning SKIPPED

Commit Message

Huang, ZhiminX July 5, 2023, 4:36 p.m. UTC
  According to dpdk commit
38341238ba1e02c7292b037f91006ea20f8200f9(net/ice: add default RSS for
DCF),all default rss for dcf have been changed to ipv4/ipv6.
so we modify test script and test plan to adapt this changed.

And in some customer issue,it was found that starting testpmd with dcf
and vf port cause rss not work,this dpdk commmit also fixed this
issue,so we add a vf port into test case.

Signed-off-by: Zhimin Huang <zhiminx.huang@intel.com>
---
v2:
add an additional vf port to start testpmd

 test_plans/ice_dcf_data_path_test_plan.rst | 43 +++++++++++---
 tests/TestSuite_ice_dcf_data_path.py       | 65 ++++++++++++++++++----
 2 files changed, 87 insertions(+), 21 deletions(-)
  

Patch

diff --git a/test_plans/ice_dcf_data_path_test_plan.rst b/test_plans/ice_dcf_data_path_test_plan.rst
index 71c9793b..a724dc35 100644
--- a/test_plans/ice_dcf_data_path_test_plan.rst
+++ b/test_plans/ice_dcf_data_path_test_plan.rst
@@ -26,10 +26,11 @@  Set a VF as trust ::
     ip link set enp24s0f0 vf 0 trust on
     ip link set enp27s0f0 vf 0 mac D2:6B:4C:EB:1C:26
 
-Launch dpdk on the VF, request DCF mode ::
+Launch dpdk on the VF, request DCF mode and add an additional vf port to check that not affect DCF fwd::
 
     ./usertools/dpdk-devbind.py -b vfio-pci 18:01.0
-    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 6-10 -n 4 -a 18:01.0,cap=dcf --file-prefix=vf -- -i --rxq=4 --txq=4
+    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 6-10 -n 4 -a 18:01.0,cap=dcf -a 18:01.1 --file-prefix=vf -- -i
+    --rxq=4 --txq=4
 
 
 Test Case: Launch DCF and do macfwd
@@ -101,7 +102,7 @@  Send a series packets to check if DCF RSS is correct for tunnelling packet (inne
 
 
 Expected:
-   p1 hash value is not equal to p2 or p3. p1 hash value is equal to p4 and p5.
+   p1 hash value is equal to p2 or p3. p1 hash value is not equal to p4 and p5.
    check the packets are distributed to queues by rss.
 
 Send a series packets to check if DCF RSS is correct for tunnelling packet (inner IPv6) ::
@@ -113,9 +114,20 @@  Send a series packets to check if DCF RSS is correct for tunnelling packet (inne
     sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="11:22:33:44:55:77")/IPv6(src="::33", dst="::44")/GRE()/IPv6(src="::22", dst="::11")/Raw('x'*64), iface=intf)
 
 Expected:
-   p1 hash value is not equal to p2 or p3. p1 hash value is equal to p4 and p5.
-   p1/p2/p3 should be devided into different queues.
+   p1 hash value is equal to p2 or p3. p1 hash value is not equal to p4 and p5.
+   p1/p4/p5 should be devided into different queues.
 
+Send a series packets to check if DCF RSS is correct for tunnelling packet (outer IPv6) ::
+
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / Raw("x" * 64), iface=intf)
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.3") / Raw("x" * 64), iface=intf)
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.3", dst="192.168.1.2") / Raw("x" * 64), iface=intf)
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="11:22:33:44:55:77") / IPv6(src="::22",dst="::12") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / Raw("x" * 64), iface=intf)
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="11:22:33:44:55:77") / IP(src="1.1.1.2",dst="2.2.2.1") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / Raw("x" * 64), iface=intf)
+
+Expected:
+   p1 hash value is equal to p2 or p3. p1 hash value is not equal to p4 and p5.
+   p1/p4/p5 should be devided into different queues.
 
 Test Case: Check default rss for L4
 ===================================
@@ -141,7 +153,7 @@  Send a series packets to check if DCF RSS is correct for IPv4 ::
     sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:22:33:44:55:77")/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=1234, dport=5678)/Raw('x'*64), iface=intf)
 
 Expected:
-   p1 hash value is not equal to p2 or p3 or p4 or p5, and should be equal to p6.
+   p1 hash value is not equal to p2 or p3, and should be equal to p4 or p5 or p6.
    check the packets are distributed to queues by rss.
 
 Send a series packets to check if DCF RSS is correct for IPv6 ::
@@ -154,7 +166,7 @@  Send a series packets to check if DCF RSS is correct for IPv6 ::
     sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="11:22:33:44:55:77")/IPv6(src="::22", dst="::11")/TCP(sport=1234, dport=5678)/Raw('x'*64), iface=intf)
 
 Expected:
-   p1 hash value is not equal to p2 or p3 or p4 or p5, and should be equal to p6.
+   p1 hash value is not equal to p2 or p3, and should be equal to p4 or p5 or p6.
    check the packets are distributed to queues by rss.
 
 Send a series packets to check if DCF RSS is correct for tunnelling packet (inner IPv4) ::
@@ -168,7 +180,7 @@  Send a series packets to check if DCF RSS is correct for tunnelling packet (inne
     sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:22:33:44:55:77")/IPv6(src="::11", dst="::22")/GRE()/IP(src="192.168.1.1", dst="192.168.1.2")/TCP(sport=1234, dport=5678)/Raw('x'*64), iface=intf)
 
 Expected:
-   p1 hash value is not equal to p2 or p3 or p4 or p5, and should be equal to p6 and p7.
+   p1 hash value is equal to p2 or p3 or p4 or p5, and should be not equal to p6 and p7.
    check the packets are distributed to queues by rss.
 
 Send a series packets to check if DCF RSS is correct for tunnelling packet (inner IPv6) ::
@@ -182,9 +194,22 @@  Send a series packets to check if DCF RSS is correct for tunnelling packet (inne
     sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:22:33:44:55:77")/IPv6(src="::33", dst="::44")/GRE()/IPv6(src="::22", dst="::11")/UDP(sport=1234, dport=5678)/Raw('x'*64), iface=intf)
 
 Expected:
-   p1 hash value is not equal to p2 or p3 or p4 or p5, and should be equal to p6 and p7.
+   p1 hash value is equal to p2 or p3 or p4 or p5, and should be not equal to p6 and p7.
    check the packets are distributed to queues by rss.
 
+Send a series packets to check if DCF RSS is correct for tunnelling packet (outer IPv6) ::
+
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / UDP(sport=1234, dport=5678)/Raw('x'*64), iface=intf)
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.3") / UDP(sport=1234, dport=5678)/Raw('x'*64), iface=intf)
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.3", dst="192.168.1.2") / UDP(sport=1234, dport=5678)/Raw('x'*64), iface=intf)
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / UDP(sport=1235, dport=5678)/Raw('x'*64), iface=intf)
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / UDP(sport=1234, dport=5679)/Raw('x'*64), iface=intf)
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:22:33:44:55:77") / IPv6(src="::22",dst="::12") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / UDP(sport=1234, dport=5678)/Raw('x'*64), iface=intf)
+    sendp(Ether(dst="D2:6B:4C:EB:1C:26", src="00:22:33:44:55:77") / IP(src="1.1.1.2",dst="2.2.2.1") / GRE() / IPv6(src="::22", dst="::11") / UDP(sport=1234, dport=5678)/Raw('x'*64), iface=intf)
+
+Expected:
+   p1 hash value is equal to p2 or p3 or p4 or p5, and should be not equal to p6 and p7.
+   check the packets are distributed to queues by rss.
 
 Test Case: Create rule with to original VF action
 =================================================
diff --git a/tests/TestSuite_ice_dcf_data_path.py b/tests/TestSuite_ice_dcf_data_path.py
index 64ee0aa6..0a237dc4 100644
--- a/tests/TestSuite_ice_dcf_data_path.py
+++ b/tests/TestSuite_ice_dcf_data_path.py
@@ -24,13 +24,15 @@  class TestICEDCFDataPath(TestCase):
         # Generate 1 trust VF on 1 PF, and request 1 DCF on the trust VF
         self.dut.generate_sriov_vfs_by_port(self.used_dut_port, 4, self.kdriver)
         self.sriov_vfs_port_0 = self.dut.ports_info[self.dut_ports[0]]["vfs_port"]
-        self.used_vf_pci = self.sriov_vfs_port_0[0].pci
+        self.used_vf0_pci = self.sriov_vfs_port_0[0].pci
+        self.used_vf1_pci = self.sriov_vfs_port_0[1].pci
         # config vf trust on and vf mac value
         self.dut.send_expect("ip link set %s vf 0 trust on" % self.dut_intf0, "#")
         self.dut.send_expect(
             "ip link set {} vf 0 mac {}".format(self.dut_intf0, self.vf_mac), "#"
         )
-        self.sriov_vfs_port_0[0].bind_driver(self.vf_driver)
+        for port in self.sriov_vfs_port_0:
+            port.bind_driver(self.vf_driver)
         self.pmd_output = PmdOutput(self.dut)
         self.pkt = Packet()
 
@@ -39,8 +41,8 @@  class TestICEDCFDataPath(TestCase):
             cores="1S/4C/1T",
             param="--txq=4 --rxq=4",
             prefix="vf",
-            ports=[self.used_vf_pci],
-            port_options={self.used_vf_pci: "cap=dcf"},
+            ports=[self.used_vf0_pci, self.used_vf1_pci],
+            port_options={self.used_vf0_pci: "cap=dcf"},
         )
 
     def send_packets(self, packets, tx_port, count=1):
@@ -125,6 +127,18 @@  class TestICEDCFDataPath(TestCase):
             'Ether(dst="%s", src="11:22:33:44:55:77") / IPv6(src="::33", dst="::44") / GRE() / IPv6(src="::22", dst="::11") / Raw("x" * 64)'
             % self.vf_mac,
         ]
+        pkt_list5 = [
+            'Ether(dst="%s", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / Raw("x" * 64)'
+            % self.vf_mac,
+            'Ether(dst="%s", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.3") / Raw("x" * 64)'
+            % self.vf_mac,
+            'Ether(dst="%s", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.3", dst="192.168.1.2") / Raw("x" * 64)'
+            % self.vf_mac,
+            'Ether(dst="%s", src="11:22:33:44:55:77") / IPv6(src="::22",dst="::12") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / Raw("x" * 64)'
+            % self.vf_mac,
+            'Ether(dst="%s", src="11:22:33:44:55:77") / IP(src="1.1.1.2",dst="2.2.2.1") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / Raw("x" * 64)'
+            % self.vf_mac,
+        ]
 
         self.pmd_output.execute_cmd("set fwd rxonly")
         self.pmd_output.execute_cmd("set verbose 1")
@@ -141,14 +155,19 @@  class TestICEDCFDataPath(TestCase):
         )
         out3 = self.send_pkts_getouput(pkt_list3, self.tester_intf0)
         self.verify(
-            out3[0] == out3[3] == out3[4] and out3[0] != out3[1] != out3[2],
+            out3[0] != out3[3] != out3[4] and out3[0] == out3[1] == out3[2],
             "inner ipv4 rss hash value test failed",
         )
         out4 = self.send_pkts_getouput(pkt_list4, self.tester_intf0)
         self.verify(
-            out4[0] == out4[3] == out4[4] and out4[0] != out4[1] != out4[2],
+            out4[0] != out4[3] != out4[4] and out4[0] == out4[1] == out4[2],
             "inner ipv6 rss hash value test failed",
         )
+        out5 = self.send_pkts_getouput(pkt_list5, self.tester_intf0)
+        self.verify(
+            out5[0] != out5[3] != out5[4] and out5[0] == out5[1] == out5[2],
+            "outer ipv6 rss hash value test failed",
+        )
 
     def test_default_rss_l4(self):
         """
@@ -214,32 +233,54 @@  class TestICEDCFDataPath(TestCase):
             'Ether(dst="%s", src="00:22:33:44:55:77") / IPv6(src="::33", dst="::44") / GRE() / IPv6(src="::22", dst="::11") / UDP(sport=1234, dport=5678) / Raw("x" * 64)'
             % self.vf_mac,
         ]
+        pkt_list5 = [
+            'Ether(dst="%s", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / UDP(sport=1234, dport=5678) / Raw("x" * 64)'
+            % self.vf_mac,
+            'Ether(dst="%s", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.3") / UDP(sport=1234, dport=5678) / Raw("x" * 64)'
+            % self.vf_mac,
+            'Ether(dst="%s", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.3", dst="192.168.1.2") / UDP(sport=1234, dport=5678) / Raw("x" * 64)'
+            % self.vf_mac,
+            'Ether(dst="%s", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / UDP(sport=1235, dport=5678) / Raw("x" * 64)'
+            % self.vf_mac,
+            'Ether(dst="%s", src="00:11:22:33:44:55") / IPv6(src="::22",dst="::11") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / UDP(sport=1234, dport=5679) / Raw("x" * 64)'
+            % self.vf_mac,
+            'Ether(dst="%s", src="00:22:33:44:55:77") / IPv6(src="::22",dst="::12") / GRE() / IP(src="192.168.1.1", dst="192.168.1.2") / UDP(sport=1234, dport=5678) / Raw("x" * 64)'
+            % self.vf_mac,
+            'Ether(dst="%s", src="00:22:33:44:55:77") / IP(src="1.1.1.2",dst="2.2.2.1") / GRE() / IPv6(src="::22", dst="::11") / UDP(sport=1234, dport=5678) / Raw("x" * 64)'
+            % self.vf_mac,
+        ]
 
         self.pmd_output.execute_cmd("set fwd rxonly")
         self.pmd_output.execute_cmd("set verbose 1")
         self.pmd_output.execute_cmd("start")
         out1 = self.send_pkts_getouput(pkt_list1, self.tester_intf0)
         self.verify(
-            out1[0] == out1[5] and out1[0] != out1[1] != out1[2] != out1[3] != out1[4],
+            out1[0] == out1[5] == out1[3] == out1[4] and out1[0] != out1[1] != out1[2],
             "ipv4 rss hash value test failed",
         )
         out2 = self.send_pkts_getouput(pkt_list2, self.tester_intf0)
         self.verify(
-            out2[0] == out2[5] and out2[0] != out2[1] != out2[2] != out2[3] != out2[4],
+            out2[0] == out2[5] == out2[3] == out2[4] and out2[0] != out2[1] != out2[2],
             "ipv6 rss hash value test failed",
         )
         out3 = self.send_pkts_getouput(pkt_list3, self.tester_intf0)
         self.verify(
-            out3[0] == out3[6]
-            and out3[0] != out3[1] != out3[2] != out3[3] != out3[4] != out3[5],
+            out3[0] != out3[6] != out3[5]
+            and out3[0] == out3[1] == out3[2] == out3[3] == out3[4],
             "inner ipv4 rss hash value test failed",
         )
         out4 = self.send_pkts_getouput(pkt_list4, self.tester_intf0)
         self.verify(
-            out4[0] == out4[6]
-            and out4[0] != out4[1] != out4[2] != out4[3] != out4[4] != out4[5],
+            out4[0] != out4[6] != out4[5]
+            and out4[0] == out4[1] == out4[2] == out4[3] == out4[4],
             "inner ipv6 rss hash value test failed",
         )
+        out5 = self.send_pkts_getouput(pkt_list5, self.tester_intf0)
+        self.verify(
+            out5[0] != out5[6] != out5[5]
+            and out5[0] == out5[1] == out5[2] == out5[3] == out5[4],
+            "outer ipv6 rss hash value test failed",
+        )
 
     def test_create_rule_with_vf_action(self):
         """