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 E28C0A0093; Fri, 23 Dec 2022 02:04:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE5774282D; Fri, 23 Dec 2022 02:04:52 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id A5DC040685 for ; Fri, 23 Dec 2022 02:04:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671757491; x=1703293491; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hOYfP6lbLkb3a+rncocps8wyD7GbSwA/+xjHTKii3YM=; b=T4DAnFLbjO+VlFtqbqBxYudVSegWpI0QqjwmafvUvAkaPzz88UuTgm31 /299BnnxVOebt4loEEh98TP50FZIRNPWv0sZcmdiMOyiBhGQc0DR4JZn3 b7xg79eGP7t/62tA8aP+wGs2fKkarflPMdew7mv9pTuizbuSiGoxbb1t8 LXNr6gMk9IOSe1ozfBSEy9i2WAhPNWnCPcJ4TQg86HzXaFbQpmba7w+zm 0Li41YJI/MMOMyC/w5UxHi0E3JR6GhRmrOk3guTsAQYIpalhNUaCDJlNC 5z45MrO8qo9KY2GWnSvy4eEAXW0pqFhi+HaNJJ2PinALAG8ZoesNFPGeO w==; X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="321453490" X-IronPort-AV: E=Sophos;i="5.96,267,1665471600"; d="scan'208";a="321453490" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2022 17:04:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10569"; a="759186888" X-IronPort-AV: E=Sophos;i="5.96,267,1665471600"; d="scan'208";a="759186888" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by fmsmga002.fm.intel.com with ESMTP; 22 Dec 2022 17:04:46 -0800 From: Ke Xu To: dts@dpdk.org Cc: lijuan.tu@intel.com, qi.fu@intel.com, yuan.peng@intel.com, ke1.xu@intel.com Subject: [DTS][PATCH V2 3/3] tests/vf_offload: implement packets count, super-long packet and random payload. Date: Fri, 23 Dec 2022 09:02:44 +0800 Message-Id: <20221223010242.282584-4-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221223010242.282584-1-ke1.xu@intel.com> References: <20221223010242.282584-1-ke1.xu@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 Implemented packets count that sends multiple packets of one packet combination. Implemented random payload. Added super-long packet of payload length of 8500. Signed-off-by: Ke Xu --- tests/TestSuite_vf_offload.py | 66 ++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/tests/TestSuite_vf_offload.py b/tests/TestSuite_vf_offload.py index 6765fcc5..f76a9f54 100644 --- a/tests/TestSuite_vf_offload.py +++ b/tests/TestSuite_vf_offload.py @@ -765,7 +765,14 @@ class TestVfOffload(TestCase): self.tester.get_local_port(self.dut_ports[1]) ) - self.loading_sizes = [128, 800, 801, 1700, 2500] + self.size_and_count = [ + (128, 10), + (800, 10), + (801, 10), + (1700, 10), + (2500, 10), + (8500, 1000) + ] self.tester.send_expect( "ethtool -K %s rx off tx off tso off gso off gro off lro off" @@ -839,13 +846,13 @@ class TestVfOffload(TestCase): self.tester.scapy_foreground() time.sleep(5) - for loading_size in self.loading_sizes: + for loading_size, packet_count in self.size_and_count: # IPv4 tcp test out = self.vm0_testpmd.execute_cmd("clear port info all", "testpmd> ", 120) self.tcpdump_start_sniffing([tx_interface, rx_interface]) self.tester.scapy_append( - 'sendp([Ether(dst="%s",src="52:00:00:00:00:00")/IP(src="192.168.1.1",dst="192.168.1.2")/TCP(sport=1021,dport=1021)/("X"*%s)], iface="%s")' - % (mac, loading_size, tx_interface) + 'sendp([Ether(dst="%s",src="52:00:00:00:00:00")/IP(src="192.168.1.1",dst="192.168.1.2")/TCP(sport=1021,dport=1021)/Raw(RandString(size=%s))], iface="%s", count=%s)' + % (mac, loading_size, tx_interface, packet_count) ) out = self.tester.scapy_execute() out = self.vm0_testpmd.execute_cmd("show port stats all") @@ -858,29 +865,29 @@ class TestVfOffload(TestCase): self.logger.info(tx_outlist) if loading_size <= 800: self.verify( - rx_stats == tx_stats and int(tx_outlist[0]) == loading_size, + rx_stats == tx_stats and all([int(tx_outlist[j]) == loading_size for j in range(packet_count)]), "IPV4 RX or TX packet number not correct", ) else: num = loading_size // 800 for i in range(num): self.verify( - int(tx_outlist[i]) == 800, + all([int(tx_outlist[i * packet_count + j]) == 800 for j in range(packet_count)]), "the packet segmentation incorrect, %s" % tx_outlist, ) if loading_size % 800 != 0: self.verify( - int(tx_outlist[num]) == loading_size % 800, + all([int(tx_outlist[num * packet_count + j]) == loading_size % 800 for j in range(packet_count)]), "the packet segmentation incorrect, %s" % tx_outlist, ) - for loading_size in self.loading_sizes: + for loading_size, packet_count in self.size_and_count: # IPv6 tcp test out = self.vm0_testpmd.execute_cmd("clear port info all", "testpmd> ", 120) self.tcpdump_start_sniffing([tx_interface, rx_interface]) self.tester.scapy_append( - 'sendp([Ether(dst="%s", src="52:00:00:00:00:00")/IPv6(src="FE80:0:0:0:200:1FF:FE00:200", dst="3555:5555:6666:6666:7777:7777:8888:8888")/TCP(sport=1021,dport=1021)/("X"*%s)], iface="%s")' - % (mac, loading_size, tx_interface) + 'sendp([Ether(dst="%s", src="52:00:00:00:00:00")/IPv6(src="FE80:0:0:0:200:1FF:FE00:200", dst="3555:5555:6666:6666:7777:7777:8888:8888")/TCP(sport=1021,dport=1021)/Raw(RandString(size=%s))], iface="%s", count=%s)' + % (mac, loading_size, tx_interface, packet_count) ) out = self.tester.scapy_execute() out = self.vm0_testpmd.execute_cmd("show port stats all") @@ -893,19 +900,19 @@ class TestVfOffload(TestCase): self.logger.info(tx_outlist) if loading_size <= 800: self.verify( - rx_stats == tx_stats and int(tx_outlist[0]) == loading_size, + rx_stats == tx_stats and all([int(tx_outlist[j]) == loading_size for j in range(packet_count)]), "IPV6 RX or TX packet number not correct", ) else: num = loading_size // 800 for i in range(num): self.verify( - int(tx_outlist[i]) == 800, + all([int(tx_outlist[i * packet_count + j]) == 800 for j in range(packet_count)]), "the packet segmentation incorrect, %s" % tx_outlist, ) if loading_size % 800 != 0: self.verify( - int(tx_outlist[num]) == loading_size % 800, + all([int(tx_outlist[num * packet_count + j]) == loading_size % 800 for j in range(packet_count)]), "the packet segmentation incorrect, %s" % tx_outlist, ) @@ -924,7 +931,14 @@ class TestVfOffload(TestCase): self.tester.get_local_port(self.vm0_dut_ports[1]) ) - self.loading_sizes = [128, 800, 801, 1700, 2500] + self.size_and_count = [ + (128, 10), + (800, 10), + (801, 10), + (1700, 10), + (2500, 10), + (8500, 1000) + ] self.tester.send_expect( "ethtool -K %s rx off tx off tso off gso off gro off lro off" @@ -981,7 +995,7 @@ class TestVfOffload(TestCase): time.sleep(5) for key_outer in pkts_outer: - for loading_size in self.loading_sizes: + for loading_size, packet_count in self.size_and_count: # IPv4 tcp test out = self.vm0_testpmd.execute_cmd( "clear port info all", "testpmd> ", 120 @@ -995,9 +1009,9 @@ class TestVfOffload(TestCase): ( 'sendp([Ether(dst="%s",src="52:00:00:00:00:00")/' + pkts_outer[key_outer] - + '/IP(src="192.168.1.1",dst="192.168.1.2")/TCP(sport=1021,dport=1021)/("X"*%s)], iface="%s")' + + '/IP(src="192.168.1.1",dst="192.168.1.2")/TCP(sport=1021,dport=1021)/Raw(RandString(size=%s))], iface="%s", count = %s)' ) - % (mac, loading_size, tx_interface) + % (mac, loading_size, tx_interface, packet_count) ) out = self.tester.scapy_execute() out = self.vm0_testpmd.execute_cmd("show port stats all") @@ -1005,26 +1019,27 @@ class TestVfOffload(TestCase): self.tcpdump_stop_sniff() rx_stats, payload_size_list = self.tcpdump_analyse_sniff(rx_interface) tx_stats, _ = self.tcpdump_analyse_sniff(tx_interface) + payload_size_list.sort(reverse=True) self.logger.info(payload_size_list) if loading_size <= 800: self.verify( - rx_stats == tx_stats and payload_size_list[0] == loading_size, + rx_stats == tx_stats and all([payload_size_list == loading_size for j in range(packet_count)]), f"{key_outer} tunnel IPV4 RX or TX packet number not correct", ) else: num = loading_size // 800 for i in range(num): self.verify( - payload_size_list[i] == 800, + all([payload_size_list[i * packet_count + j] == 800 for j in range(packet_count)]), "the packet segmentation incorrect, %s" % payload_size_list, ) if loading_size % 800 != 0: self.verify( - payload_size_list[num] == loading_size % 800, + all([payload_size_list[num * packet_count + j] == loading_size % 800 for j in range(packet_count)]), "the packet segmentation incorrect, %s" % payload_size_list, ) - for loading_size in self.loading_sizes: + for loading_size, packet_count in self.size_and_count: # IPv6 tcp test out = self.vm0_testpmd.execute_cmd( "clear port info all", "testpmd> ", 120 @@ -1040,7 +1055,7 @@ class TestVfOffload(TestCase): + pkts_outer[key_outer] + '/IPv6(src="FE80:0:0:0:200:1FF:FE00:200", dst="3555:5555:6666:6666:7777:7777:8888:8888")/TCP(sport=1021,dport=1021)/("X"*%s)], iface="%s")' ) - % (mac, loading_size, tx_interface) + % (mac, loading_size, tx_interface, packet_count) ) out = self.tester.scapy_execute() out = self.vm0_testpmd.execute_cmd("show port stats all") @@ -1048,22 +1063,23 @@ class TestVfOffload(TestCase): self.tcpdump_stop_sniff() rx_stats, payload_size_list = self.tcpdump_analyse_sniff(rx_interface) tx_stats, _ = self.tcpdump_analyse_sniff(tx_interface) + payload_size_list.sort(reverse=True) self.logger.info(payload_size_list) if loading_size <= 800: self.verify( - rx_stats == tx_stats and payload_size_list[0] == loading_size, + rx_stats == tx_stats and all([payload_size_list[j] == loading_size for j in range(packet_count)]), f"{key_outer} tunnel IPV6 RX or TX packet number not correct", ) else: num = loading_size // 800 for i in range(num): self.verify( - payload_size_list[i] == 800, + all([payload_size_list[i * packet_count + j] == 800 for j in range(packet_count)]), "the packet segmentation incorrect, %s" % payload_size_list, ) if loading_size % 800 != 0: self.verify( - payload_size_list[num] == loading_size % 800, + all([payload_size_list[num * packet_count + j] == loading_size % 800 for j in range(packet_count)]), "the packet segmentation incorrect, %s" % payload_size_list, ) -- 2.25.1