test suite reviews and discussions
 help / color / mirror / Atom feed
From: Weiyuan Li <weiyuanx.li@intel.com>
To: dts@dpdk.org, yuan.peng@intel.com
Cc: Weiyuan Li <weiyuanx.li@intel.com>
Subject: [dts][PATCH V1 03/12] tests/checksum_offload: update dts code for dpdk csum change
Date: Mon, 18 Jul 2022 10:54:38 +0800	[thread overview]
Message-ID: <20220718025447.13287-3-weiyuanx.li@intel.com> (raw)
In-Reply-To: <20220718025447.13287-1-weiyuanx.li@intel.com>

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>
---
 tests/TestSuite_checksum_offload.py | 31 ++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/tests/TestSuite_checksum_offload.py b/tests/TestSuite_checksum_offload.py
index 3554f5eb..ffc48b96 100644
--- a/tests/TestSuite_checksum_offload.py
+++ b/tests/TestSuite_checksum_offload.py
@@ -76,6 +76,7 @@ class TestChecksumOffload(TestCase):
             self.output_path = os.sep.join([cur_path, self.logger.log_path])
         # log debug used
         self.count = 0
+        self.src_mac = "52:00:00:00:00:00"
 
     def set_up(self):
         """
@@ -204,15 +205,14 @@ 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,
-            filters=[{"layer": "ether", "config": {"src": sniff_src}}],
+            filters=[{"layer": "ether", "config": {"src": self.src_mac}}],
         )
 
         self.pkt = packet.Packet()
@@ -369,6 +369,7 @@ class TestChecksumOffload(TestCase):
         return self.tester.send_expect(cmd, ">>>", timeout=timeout)
 
     def get_packets(self, dut_mac, tester_mac):
+        tester_mac = "52:00:00:00:00:00"
         eth = Ether(dst=dut_mac, src=tester_mac)
         packets = []
         checksum_options = (
@@ -424,8 +425,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 +504,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 = "23:00:00:00:00:00"
 
         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 +549,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 = "23:00:00:00:00:00"
 
         pkts_ref = {
             "IP/UDP": 'Ether(dst="%s", src="52:00:00:00:00:00")/IP()/UDP()/("X"*46)'
@@ -611,7 +614,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 = "23:00:00:00:00:00"
 
         pkts = {
             "IP/UDP": 'Ether(dst="%s", src="52:00:00:00:00:00")/IP(chksum=0x0)/UDP(chksum=0xf)/("X"*46)'
@@ -660,7 +663,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 = "23:00:00:00:00:00"
         sndIP = "10.0.0.1"
         sndIPv6 = "::1"
         sndPkts = {
@@ -818,7 +821,8 @@ class TestChecksumOffload(TestCase):
         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 = "23:00:00:00:00:00"
+        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}'")
 
@@ -850,6 +854,8 @@ class TestChecksumOffload(TestCase):
         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 = "23:00:00:00:00:00"
+        tester_mac = "52:00:00:00:00:00"
         eth = Ether(dst=dut_mac, src=tester_mac)
 
         checksum_options = (
@@ -905,7 +911,8 @@ class TestChecksumOffload(TestCase):
         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 = "23:00:00:00:00:00"
+        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}'")
@@ -1005,7 +1012,8 @@ class TestChecksumOffload(TestCase):
         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 = "23:00:00:00:00:00"
+        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 +1030,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"
         )
-- 
2.27.0


  parent reply	other threads:[~2022-07-18  2:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18  2:54 [dts][PATCH V1 01/12] tests/kernelpf_iavf: " Weiyuan Li
2022-07-18  2:54 ` [dts][PATCH V1 02/12] tests/vf_offload: " Weiyuan Li
2022-07-18  2:54 ` Weiyuan Li [this message]
2022-07-18  2:54 ` [dts][PATCH V1 04/12] tests/ice_advanced_iavf_rss: " Weiyuan Li
2022-07-18  2:54 ` [dts][PATCH V1 05/12] tests/ice_advanced_rss: " Weiyuan Li
2022-07-18  2:54 ` [dts][PATCH V1 06/12] tests/ice_iavf_fdir: " Weiyuan Li
2022-07-18  2:54 ` [dts][PATCH V1 07/12] tests/tx_preparation: " Weiyuan Li
2022-07-18  2:54 ` [dts][PATCH V1 08/12] test_plans/kernelpf_iavf: " Weiyuan Li
2022-07-18  2:54 ` [dts][PATCH V1 09/12] test_plans/vf_offload: " Weiyuan Li
2022-07-18  2:54 ` [dts][PATCH V1 10/12] test_plans/ice_advanced_iavf_rss: " Weiyuan Li
2022-07-18  2:54 ` [dts][PATCH V1 11/12] test_plans/ice_advanced_rss: " Weiyuan Li
2022-07-18  2:54 ` [dts][PATCH V1 12/12] test_plans/ice_iavf_fdir: " Weiyuan Li
2022-08-10  5:42   ` Jiale, SongX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220718025447.13287-3-weiyuanx.li@intel.com \
    --to=weiyuanx.li@intel.com \
    --cc=dts@dpdk.org \
    --cc=yuan.peng@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).