diff mbox series

[V3,03/10] tests/checksum_offload: update dts code for dpdk csum change

Message ID 20220830024740.26250-3-weiyuanx.li@intel.com (mailing list archive)
State Accepted
Headers show
Series [V3,01/10] tests/vf_offload: update dts code for dpdk csum change | expand

Commit Message

Weiyuan Li Aug. 30, 2022, 2:47 a.m. UTC
According to dpdk commit 9b4ea7ae77fa(app/testpmd: revert MAC update in checksum forwarding) modify
the script adapt to this chagne.

1. Modify VF case to enable promisc.
2. Modify PF case to send packet dst mac is random.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---
Tested-by: Jiale Song < songx.jiale@intel.com>

v2:
-Modify dst mac address

 tests/TestSuite_checksum_offload.py | 35 +++++++++++++----------------
 1 file changed, 16 insertions(+), 19 deletions(-)

Comments

Peng, Yuan Aug. 30, 2022, 3:06 a.m. UTC | #1
Acked-by Peng, Yuan <yuan.peng@intel.com>

-----Original Message-----
From: Weiyuan Li <weiyuanx.li@intel.com> 
Sent: Tuesday, August 30, 2022 10:48 AM
To: dts@dpdk.org
Cc: Li, WeiyuanX <weiyuanx.li@intel.com>; Jiale, SongX <songx.jiale@intel.com>
Subject: [dts][PATCH V3 03/10] tests/checksum_offload: update dts code for dpdk csum change

According to dpdk commit 9b4ea7ae77fa(app/testpmd: revert MAC update in checksum forwarding) modify the script adapt to this chagne.

1. Modify VF case to enable promisc.
2. Modify PF case to send packet dst mac is random.

Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---
Tested-by: Jiale Song < songx.jiale@intel.com>

v2:
-Modify dst mac address
diff mbox series

Patch

diff --git a/tests/TestSuite_checksum_offload.py b/tests/TestSuite_checksum_offload.py
index 3554f5eb..1ccc884c 100644
--- a/tests/TestSuite_checksum_offload.py
+++ b/tests/TestSuite_checksum_offload.py
@@ -204,11 +204,10 @@  class TestChecksumOffload(TestCase):
             self.tester.get_local_port(self.dut_ports[0])
         )
 
-        sniff_src = self.dut.get_mac_address(self.dut_ports[0])
+        sniff_src = "52:00:00:00:00:00"
         result = dict()
 
         chksum = self.get_chksum_values(packets_expected)
-
         inst = self.tester.tcpdump_sniff_packets(
             intf=rx_interface,
             count=len(packets_sent) * 4,
@@ -424,8 +423,9 @@  class TestChecksumOffload(TestCase):
     ):
         if os.path.isfile(capture_file_path):
             os.remove(capture_file_path)
+        src_mac = "52:00:00:00:00:00"
         self.tester.send_expect(
-            f"tcpdump -i '{iface}' ether src {dut_mac} -s 0 -w {capture_file_path} &",
+            f"tcpdump -i '{iface}' ether src {src_mac} -s 0 -w {capture_file_path} -Q in &",
             "# ",
         )
 
@@ -502,7 +502,8 @@  class TestChecksumOffload(TestCase):
         Verify that the same number of packet are correctly received on the
         traffic generator side.
         """
-        mac = self.dut.get_mac_address(self.dut_ports[0])
+        # mac = self.dut.get_mac_address(self.dut_ports[0])
+        mac = "52:00:00:00:00:01"
 
         pktsChkErr = {
             "IP/UDP": 'Ether(dst="%s", src="52:00:00:00:00:00")/Dot1Q(vlan=1)/IP(chksum=0x0)/UDP(chksum=0xf)/("X"*46)'
@@ -546,7 +547,7 @@  class TestChecksumOffload(TestCase):
         transmit packet.Enable Checksum offload.
         Verify the checksum valid-flags.
         """
-        mac = self.dut.get_mac_address(self.dut_ports[0])
+        mac = "52:00:00:00:00:01"
 
         pkts_ref = {
             "IP/UDP": 'Ether(dst="%s", src="52:00:00:00:00:00")/IP()/UDP()/("X"*46)'
@@ -611,7 +612,7 @@  class TestChecksumOffload(TestCase):
         Verify that the same number of packet are correctly received on the
         traffic generator side.
         """
-        mac = self.dut.get_mac_address(self.dut_ports[0])
+        mac = "52:00:00:00:00:01"
 
         pkts = {
             "IP/UDP": 'Ether(dst="%s", src="52:00:00:00:00:00")/IP(chksum=0x0)/UDP(chksum=0xf)/("X"*46)'
@@ -660,7 +661,7 @@  class TestChecksumOffload(TestCase):
         Verify that the same number of packet are correctly received on
         the traffic generator side.
         """
-        mac = self.dut.get_mac_address(self.dut_ports[0])
+        mac = "52:00:00:00:00:01"
         sndIP = "10.0.0.1"
         sndIPv6 = "::1"
         sndPkts = {
@@ -816,9 +817,8 @@  class TestChecksumOffload(TestCase):
         verification_errors: List[VerifyFailure] = []
 
         iface = self.tester.get_interface(self.tester.get_local_port(self.dut_ports[0]))
-        dut_mac = self.dut.get_mac_address(self.dut_ports[0])
-        tester_mac = self.tester.get_mac(self.tester.get_local_port(self.dut_ports[0]))
-
+        dut_mac = "52:00:00:00:00:01"
+        tester_mac = "52:00:00:00:00:00"
         self.scapy_exec(f"eth = Ether(dst='{dut_mac}', src='{tester_mac}')")
         self.scapy_exec(f"iface = '{iface}'")
 
@@ -848,8 +848,8 @@  class TestChecksumOffload(TestCase):
         verification_errors: List[VerifyFailure] = []
 
         iface = self.tester.get_interface(self.tester.get_local_port(self.dut_ports[0]))
-        dut_mac = self.dut.get_mac_address(self.dut_ports[0])
-        tester_mac = self.tester.get_mac(self.tester.get_local_port(self.dut_ports[0]))
+        dut_mac = "52:00:00:00:00:01"
+        tester_mac = "52:00:00:00:00:00"
         eth = Ether(dst=dut_mac, src=tester_mac)
 
         checksum_options = (
@@ -903,9 +903,8 @@  class TestChecksumOffload(TestCase):
         verification_errors: List[VerifyFailure] = []
 
         iface = self.tester.get_interface(self.tester.get_local_port(self.dut_ports[0]))
-        dut_mac = self.dut.get_mac_address(self.dut_ports[0])
-        tester_mac = self.tester.get_mac(self.tester.get_local_port(self.dut_ports[0]))
-
+        dut_mac = "52:00:00:00:00:01"
+        tester_mac = "52:00:00:00:00:00"
         self.tester.send_expect("scapy", ">>> ")
         self.scapy_exec(f"eth = Ether(dst='{dut_mac}', src='{tester_mac}')")
         self.scapy_exec(f"iface = '{iface}'")
@@ -1003,9 +1002,8 @@  class TestChecksumOffload(TestCase):
         verification_errors: List[VerifyFailure] = []
 
         iface = self.tester.get_interface(self.tester.get_local_port(self.dut_ports[0]))
-        dut_mac = self.dut.get_mac_address(self.dut_ports[0])
-        tester_mac = self.tester.get_mac(self.tester.get_local_port(self.dut_ports[0]))
-
+        dut_mac = "52:00:00:00:00:01"
+        tester_mac = "52:00:00:00:00:00"
         packets = self.get_packets(dut_mac, tester_mac)
 
         capture_file_name = "test_hardware_checksum_check_l4_tx_capture.pcap"
@@ -1022,7 +1020,6 @@  class TestChecksumOffload(TestCase):
         )
 
         captured_packets = rdpcap("output/tmp/pcap/" + capture_file_name)
-
         self.verify(
             len(packets) == len(captured_packets), "Not all packets were received"
         )