From patchwork Fri Dec 30 10:06:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, DukaiX" X-Patchwork-Id: 121480 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 77439A0032; Fri, 30 Dec 2022 11:11:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 52F8340DD8; Fri, 30 Dec 2022 11:11:13 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 6E4B14067B for ; Fri, 30 Dec 2022 11:11:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672395072; x=1703931072; h=from:to:cc:subject:date:message-id; bh=Bnm+HIWqzd5aNuDIlzp6YENyQvTsbg8FuZzUpis6pu8=; b=KO/faxxS5Jvstr1iOoXW5IO7H6JGvZJL0SNoyo0ivLKh3usI5OPtisZi 9mXg+W6P4ZxwJPGaz5wjoDaFqq5LHVIYaSRAgj5fML2u2cN/V7NvKcWKh f4XrKEMrQEt2ZET/y6kK47CifCiuL8bWWAlYYbR6OwvhacyBo+jE9ENQb XoTVLscMjIBFoLmgPiUa7e8x9JBHXj4XHHw+eqaKwtEoMQH+lL8kKjON+ TFVP8DXibhTLz6pmSySNcIP1ssrr7jezlEzGDf2XZ4xbIXsFqilzqV1+a 0IerTLekJTBxaOlYHEZg8ZCpU4POwGgQD3bHDMMW5C8edcmC4sgSjw+rD w==; X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="319904417" X-IronPort-AV: E=Sophos;i="5.96,287,1665471600"; d="scan'208";a="319904417" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2022 02:11:06 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10575"; a="603872700" X-IronPort-AV: E=Sophos;i="5.96,287,1665471600"; d="scan'208";a="603872700" Received: from unknown (HELO localhost.localdomain) ([10.239.252.15]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2022 02:11:04 -0800 From: Dukai Yuan To: dts@dpdk.org Cc: Dukai Yuan Subject: [dts][PATCH V1] tests/dpdk_gso_lib: optimize code to get NIC driver name Date: Fri, 30 Dec 2022 18:06:21 +0800 Message-Id: <20221230100621.13807-1-dukaix.yuan@intel.com> X-Mailer: git-send-email 2.17.1 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 The NIC driver name obtained by the original code is inaccurate. So optimize code to get NIC driver name. Signed-off-by: Dukai Yuan --- tests/TestSuite_dpdk_gso_lib.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/tests/TestSuite_dpdk_gso_lib.py b/tests/TestSuite_dpdk_gso_lib.py index c989bfc8..0d00e37c 100644 --- a/tests/TestSuite_dpdk_gso_lib.py +++ b/tests/TestSuite_dpdk_gso_lib.py @@ -21,19 +21,6 @@ from framework.virt_common import VM class TestDPDKGsoLib(TestCase): def set_up_all(self): - # This suite will not use the port config in ports.cfg - # it will use the port config in vhost_gro.cfg - # And it need two interface reconnet in DUT - - # unbind the port which config in ports.cfg - self.dut_ports = self.dut.get_ports() - self.def_driver = self.dut.ports_info[self.dut_ports[0]][ - "port" - ].get_nic_driver() - for i in self.dut_ports: - port = self.dut.ports_info[i]["port"] - port.bind_driver() - # get and bind the port in conf file self.pci = peer.get_pci_info() self.pci_drv = peer.get_pci_driver_info() @@ -48,7 +35,7 @@ class TestDPDKGsoLib(TestCase): ) bind_script_path = self.dut.get_dpdk_bind_script() self.dut.send_expect( - "%s --bind=%s %s" % (bind_script_path, self.def_driver, self.pci), "# " + "%s --bind=%s %s" % (bind_script_path, self.drivername, self.pci), "# " ) self.path = self.dut.apps_name["test-pmd"] self.testpmd_name = self.path.split("/")[-1] @@ -491,9 +478,6 @@ class TestDPDKGsoLib(TestCase): """ Run after each test suite. """ - for i in self.dut_ports: - port = self.dut.ports_info[i]["port"] - port.bind_driver(self.def_driver) self.dut.send_expect("ip netns del ns1", "#", 30) self.dut.send_expect("./usertools/dpdk-devbind.py -u %s" % (self.pci), "# ", 30) self.dut.send_expect(