From patchwork Thu Feb 24 14:23:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 108233 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 44A81A04A2; Thu, 24 Feb 2022 07:24:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 395BC41155; Thu, 24 Feb 2022 07:24:19 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id C58424114D for ; Thu, 24 Feb 2022 07:24:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645683857; x=1677219857; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OM1eE7tdoNr9+q0FSMzQS0U8RoJ8/tHn1xXYuqvzV2I=; b=DXScGxne2Ah5ovB9fghTVXjvBMxU5N97q7kE3PG73WitDP7amzcIAqvo urtzd23X3W/DP0sytw+QWu74buLTA4Pkuws0k5kBttNAMVeua8jhzG6Gm 6TmK3orFP5mUP3+yiNVBSr+poLBtP6lAAmyawh6JK2ak3RHTZNH/xj6JS xr91V2uN+TykTYElUA+uwKfi2MJqBflLbQMfs0OUYuTCkQLRQxWj57Cko 0T0i92dgxQ2nYpJ/PhdvhjPUgt934qy8dJRz1IvLXzLhlEcqB7E36Y2oR 9CJaaw6XS2PCL8iikxrMerhpV589CeirNFtXiieCydmSVCUKsQVO5o3xh w==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="232136105" X-IronPort-AV: E=Sophos;i="5.88,393,1635231600"; d="scan'208";a="232136105" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 22:24:17 -0800 X-IronPort-AV: E=Sophos;i="5.88,393,1635231600"; d="scan'208";a="548600972" Received: from unknown (HELO localhost.localdomain) ([10.239.251.226]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 22:24:16 -0800 From: Yu Jiang To: lijuan.tu@intel.com, dts@dpdk.org Cc: Yu Jiang Subject: [dts][PATCH V1 1/2] flow_classify*: wait for interface up Date: Thu, 24 Feb 2022 14:23:48 +0000 Message-Id: <20220224142349.1508842-2-yux.jiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220224142349.1508842-1-yux.jiang@intel.com> References: <20220224142349.1508842-1-yux.jiang@intel.com> MIME-Version: 1.0 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 optimize script: flow_classify/flow_classify_softnic, 1, use new method: is_interface_up to to ensure iface's link status before send_packets 2, wait_link_status_up for all ports after start testpmd Signed-off-by: Yu Jiang --- tests/TestSuite_flow_classify.py | 1 + tests/TestSuite_flow_classify_softnic.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_flow_classify.py b/tests/TestSuite_flow_classify.py index 200d39e0..5b28b884 100644 --- a/tests/TestSuite_flow_classify.py +++ b/tests/TestSuite_flow_classify.py @@ -253,6 +253,7 @@ class TestFlowClassify(TestCase): tx_iface = config.get('tx_intf') cmd = "ifconfig {0} up".format(tx_iface) self.tester.send_expect(cmd, '# ', 30) + self.verify(self.tester.is_interface_up(intf=tx_iface), "Wrong link status, should be up") pkts = config.get('stream') # stream config stream_configs = config.get('stream configs') diff --git a/tests/TestSuite_flow_classify_softnic.py b/tests/TestSuite_flow_classify_softnic.py index 7b6642d0..c5004f16 100644 --- a/tests/TestSuite_flow_classify_softnic.py +++ b/tests/TestSuite_flow_classify_softnic.py @@ -179,12 +179,15 @@ class TestFlowClassifySoftnic(TestCase): Sent pkts that read from the pcap_file. Return the sniff pkts. """ - self.pmdout.wait_link_status_up(self.dut_ports[0]) + self.pmdout.wait_link_status_up('all') tx_port = self.tester.get_local_port(self.dut_ports[from_port%self.port_num]) rx_port = self.tester.get_local_port(self.dut_ports[to_port%self.port_num]) tx_interface = self.tester.get_interface(tx_port) rx_interface = self.tester.get_interface(rx_port) + # check tester's link status before send packet + for iface in [tx_interface, rx_interface]: + self.verify(self.tester.is_interface_up(intf=iface), "Wrong link status, should be up") self.tcpdump_start_sniff(rx_interface, filters) @@ -284,9 +287,9 @@ class TestFlowClassifySoftnic(TestCase): """ Sends continuous packets. """ - self.pmdout.wait_link_status_up(self.dut_ports[0]) + self.pmdout.wait_link_status_up('all') + self.verify(self.tester.is_interface_up(intf=itf), "Wrong link status, should be up") self.tester.scapy_foreground() - time.sleep(2) if src_dst == "src": if ptype == "ipv4": var = src_addr.split(".") From patchwork Thu Feb 24 14:23:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiang X-Patchwork-Id: 108234 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 60F66A0353; Thu, 24 Feb 2022 07:24:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5BC7B4117D; Thu, 24 Feb 2022 07:24:20 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 6B8E94117D for ; Thu, 24 Feb 2022 07:24:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645683859; x=1677219859; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JlSWHq3SXsDvbNXj3Go7VSvVb2A0Nf6tln4/ntfGh70=; b=OYH9gnX6nCGHli81IUplvApqulmTdgKpeqNy/NcS8hNdC7th5Nk2AFgH jqiOfdVHU1zg8FvN8NXyTeTLFLG+31BEEzqgJYKfO2cUF+z+KJ2oM0IqE VaUxxbmjIc1P7SvhrxyXU4MTAwGSqrOv9lfMNtg7beVP+f9Ok09lo1aIn TCPK+AXutXswWEaIq5euwqz+93dRwObrsvj3si2cnrbettAw0RgR7AUMa B3VcQdbpwOo8lXxqx65R8pT7OWSep6zGwm/g0hRFcp40+SKRybJSE1zrc zPWJx6E8/mhIQoFvBaLnGdKMko5gMJyF2qVhkrqKl2fneY3pmaPNV+NQy g==; X-IronPort-AV: E=McAfee;i="6200,9189,10267"; a="232136109" X-IronPort-AV: E=Sophos;i="5.88,393,1635231600"; d="scan'208";a="232136109" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 22:24:19 -0800 X-IronPort-AV: E=Sophos;i="5.88,393,1635231600"; d="scan'208";a="548600978" Received: from unknown (HELO localhost.localdomain) ([10.239.251.226]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 22:24:17 -0800 From: Yu Jiang To: lijuan.tu@intel.com, dts@dpdk.org Cc: Yu Jiang Subject: [dts][PATCH V1 2/2] tests/interrupt_pmd: wait for interface up Date: Thu, 24 Feb 2022 14:23:49 +0000 Message-Id: <20220224142349.1508842-3-yux.jiang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220224142349.1508842-1-yux.jiang@intel.com> References: <20220224142349.1508842-1-yux.jiang@intel.com> MIME-Version: 1.0 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 optimize script: interrupt_pmd, use new method: is_interface_up to to ensure iface's link status before send_packets Signed-off-by: Yu Jiang --- tests/TestSuite_interrupt_pmd.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_interrupt_pmd.py b/tests/TestSuite_interrupt_pmd.py index db8efe44..dd413aca 100644 --- a/tests/TestSuite_interrupt_pmd.py +++ b/tests/TestSuite_interrupt_pmd.py @@ -129,10 +129,11 @@ class TestInterruptPmd(TestCase): Send a packet to port """ for i in range(len(self.dut_ports[:portnum])): + txport = self.tester.get_local_port(self.dut_ports[i]) + mac = self.dut.get_mac_address(self.dut_ports[i]) + txItf = self.tester.get_interface(txport) + self.verify(self.tester.is_interface_up(intf=txItf), "Tester's %s should be up".format(txItf)) for j in range(num): - txport = self.tester.get_local_port(self.dut_ports[i]) - mac = self.dut.get_mac_address(self.dut_ports[i]) - txItf = self.tester.get_interface(txport) self.tester.scapy_append( 'sendp([Ether()/IP(dst="198.0.0.%d")/UDP()/Raw(\'X\'*18)], iface="%s")' % (j, txItf)) self.tester.scapy_execute()