From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E8AD0A0551; Fri, 26 Aug 2022 04:43:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E3B0E40143; Fri, 26 Aug 2022 04:43:14 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id AB8FE400D6 for ; Fri, 26 Aug 2022 04:43:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661481792; x=1693017792; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1TsFJERQDU94Ol8JAVZJKDEmZDv/ZKMhrVhsAfTSAd4=; b=SBblJbQOSX0Tkrfn3QRf07arp2k6ABAfP15/iZR2BYwnYcLRu6a9arh4 wQBj7g7/J5tc/g3+j3mT2k81dwi75X/VBc3ClYYZCVfA1eJFor6MxQhAn 8dFLH8CSTC7FU9QVbXsEDg0oqSr0zmODYu7ULRvr29vq++ZkP/e5T5PPQ 3A5e10CJGzcmHo0ffZPr4feaMh+1UVHT778P/wvDCZiwzjbupxwDxds9P 4naMc4t3+45n+UDHaBwi9S+nEQ9XUNlF+jwcuAsOCzHc0jRiuqEmgLBkF 6mdbWXTELxwO9cpj3CB4EwOmaAU38PGX/KAto+HC3izBudukveLl6NV2q g==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="295187346" X-IronPort-AV: E=Sophos;i="5.93,264,1654585200"; d="scan'208";a="295187346" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 19:43:11 -0700 X-IronPort-AV: E=Sophos;i="5.93,264,1654585200"; d="scan'208";a="671275191" Received: from unknown (HELO localhost.localdomain) ([10.239.252.248]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Aug 2022 19:43:09 -0700 From: Weiyuan Li To: dts@dpdk.org Cc: Weiyuan Li , Jiale Song Subject: [dts][PATCH V2 03/10] tests/checksum_offload: update dts code for dpdk csum change Date: Fri, 26 Aug 2022 10:43:01 +0800 Message-Id: <20220826024308.17447-3-weiyuanx.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220826024308.17447-1-weiyuanx.li@intel.com> References: <20220826024308.17447-1-weiyuanx.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org 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 --- 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(-) 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" ) -- 2.25.1