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 88FFCA00C2; Mon, 30 May 2022 07:45:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 830CB40A89; Mon, 30 May 2022 07:45:34 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id A571F40A82 for ; Mon, 30 May 2022 07:45:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653889532; x=1685425532; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Tpo7btW/i4LHUTODD/q1ls+CVG/Q2IF+GMlFxm8csh4=; b=niKFpXuSO/ovZh7RPLKvQLbXeINk4LDjCOdqYNBvnQh54rdwHaErlxk9 a2CNNaVOqE8Fvv7Jvv4wkOIe1MXG+xF8b8JvIOvqR4ZcPUHM7NrX7fcwf W0kwWKCRe8gj3Jar+2nf/9Ob8XFRvIwcnxwobDWR7YVtO9hNYQl9KouA+ l9oNAoaAYTs/ri0+ySo8e6/paYcPFDvOWE46GQgchkCayqgz1F8LqiO22 nl6T4ZpGvdkJYXfUXnfwqoF4FvpQSP9e0/IobgCItV6Gy6bKoYs+eSBpW bHeA6HHm4bWhWkQteYM5Uzc+08EjlGjFkc/4rXuOC7GARuUbNpwsDg158 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10362"; a="273713773" X-IronPort-AV: E=Sophos;i="5.91,262,1647327600"; d="scan'208";a="273713773" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2022 22:45:30 -0700 X-IronPort-AV: E=Sophos;i="5.91,262,1647327600"; d="scan'208";a="605009348" Received: from unknown (HELO daily-regression-131.intel.com) ([10.239.251.131]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2022 22:45:29 -0700 From: Jiale Song To: dts@dpdk.org Cc: Jiale Song Subject: [dts] [PATCH V3] tests/userspace_ethtool: add method wait port link up and add checklist Date: Mon, 30 May 2022 13:45:26 +0800 Message-Id: <20220530054526.292164-1-songx.jiale@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=y 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 fix 4 issue: 1.check and wait for the port status of the tester and dut to be up and delete some unnecessary delays. 2.700 Series not support port disconnect by tools of linux, add 'I40E_10G-10G_BASE_T_X722' and 'I40E_10G-10G_BASE_T_BC'. 3.ensure that the dpdk app has exited and rebind the driver. 4.the bug of 'IGC-I225_LM' is not fixed, add to checklist. Signed-off-by: Jiale Song --- conf/test_case_checklist.json | 7 +++--- tests/TestSuite_userspace_ethtool.py | 34 ++++++++++++++++++---------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/conf/test_case_checklist.json b/conf/test_case_checklist.json index 053841ce..c106abfe 100644 --- a/conf/test_case_checklist.json +++ b/conf/test_case_checklist.json @@ -2131,13 +2131,14 @@ "I40E_10G-SFP_X722", "I40E_10G-10G_BASE_T_X722", "IAVF_10G-X722_VF", - "I40E_10G-10G_BASE_T_BC" + "I40E_10G-10G_BASE_T_BC", + "IGC-I225_LM" ], "Target": [ "ALL" ], - "Bug ID": "", - "Comments": "Know dpdk issue, DPDK-2513" + "Bug ID": "DPDK-2513, DPDK-30123", + "Comments": "i40e and igc not suport this case" } ], "multicast_mode": [ diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py index adbba999..9f0bd8a8 100644 --- a/tests/TestSuite_userspace_ethtool.py +++ b/tests/TestSuite_userspace_ethtool.py @@ -28,7 +28,7 @@ class TestUserspaceEthtool(TestCase): """ self.ports = self.dut.get_ports() self.verify(len(self.ports) >= 2, "No ports found for " + self.nic) - + self.other_700_nic = ["I40E_10G-10G_BASE_T_X722", "I40E_10G-10G_BASE_T_BC"] # build sample app out = self.dut.build_dpdk_apps("examples/ethtool") self.verify("Error" not in out, "compilation error 1") @@ -263,18 +263,25 @@ class TestUserspaceEthtool(TestCase): portinfo["net_dev"].bind_driver(portinfo["ori_driver"]) self.dut.send_expect(self.cmd, "EthApp>", 60) + for port in self.ports: + tester_port = self.tester.get_local_port(port) + intf = self.tester.get_interface(tester_port) + self.tester.is_interface_up(intf) # ethtool doesn't support port disconnect by tools of linux # only detect physical link disconnect status verify_pass = True verify_msg = "" - if not (self.is_eth_series_nic(700) or self.is_eth_series_nic(800)): + if not ( + self.is_eth_series_nic(700) + or self.other_700_nic + or self.is_eth_series_nic(800) + ): # check link status dump function for port in self.ports: tester_port = self.tester.get_local_port(port) intf = self.tester.get_interface(tester_port) self.tester.send_expect("ip link set dev %s down" % intf, "# ") - # wait for link stable - time.sleep(5) + self.tester.is_interface_down(intf) out = self.dut.send_expect("link", "EthApp>", 60) link_pattern = r"Port (\d+): (.*)" @@ -299,8 +306,7 @@ class TestUserspaceEthtool(TestCase): tester_port = self.tester.get_local_port(port) intf = self.tester.get_interface(tester_port) self.tester.send_expect("ip link set dev %s up" % intf, "# ") - # wait for link stable - time.sleep(5) + self.tester.is_interface_up(intf) # check port stats function pkt = Packet(pkt_type="UDP") @@ -447,12 +453,13 @@ class TestUserspaceEthtool(TestCase): ) pkt = Packet(pkt_type="UDP") tester_port = self.tester.get_local_port(port) + intf = self.tester.get_interface(tester_port) + self.tester.is_interface_up(intf) self.verify( self.ethapp_check_link_status(index, "Up") == True, "Fail to Open port{}".format(index), ) - - intf = self.tester.get_interface(tester_port) + time.sleep(1) pkt.send_pkt(self.tester, tx_port=intf, count=4) rx_pkts, tx_pkts = self.strip_portstats(index) self.verify( @@ -532,6 +539,7 @@ class TestUserspaceEthtool(TestCase): pkt = Packet(pkt_type="UDP") tester_port = self.tester.get_local_port(port) intf = self.tester.get_interface(tester_port) + self.tester.is_interface_up(intf) pkt.send_pkt(self.tester, tx_port=intf, count=4) rx_pkts, tx_pkts = self.strip_portstats(index) self.verify(rx_pkts == ori_rx_pkts, "Failed to stop port") @@ -575,7 +583,6 @@ class TestUserspaceEthtool(TestCase): # IntelĀ® Ethernet 800 Series should stop port before set mtu if self.nic in ["ICE_25G-E810C_SFP", "ICE_100G-E810C_QSFP"]: self.dut.send_expect("stop %s" % index, "EthApp>") - # The mtu threshold is 2022,When it is greater than 2022, the open/stop port is required. if mtu > mtu_threshold: if self.nic in [ @@ -592,7 +599,11 @@ class TestUserspaceEthtool(TestCase): if self.nic in ["ICE_25G-E810C_SFP", "ICE_100G-E810C_QSFP"]: self.dut.send_expect("open %s" % index, "EthApp>") - time.sleep(5) + self.tester.is_interface_up(intf) + self.verify( + self.ethapp_check_link_status(index, "Up") == True, + "Fail to Open port{}".format(index), + ) ori_rx_pkts, _ = self.strip_portstats(index) pkt_size = mtu + HEADER_SIZE["eth"] + offset pkt = Packet(pkt_type="UDP", pkt_len=pkt_size) @@ -677,9 +688,8 @@ class TestUserspaceEthtool(TestCase): """ Run after each test case. """ - self.dut.bind_interfaces_linux(self.drivername) self.dut.kill_all() - pass + self.dut.bind_interfaces_linux(self.drivername) def tear_down_all(self): """ -- 2.17.1