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 46936A034F; Wed, 31 Mar 2021 07:14:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 164EA4069E; Wed, 31 Mar 2021 07:14:55 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id B1FA240141 for ; Wed, 31 Mar 2021 07:14:52 +0200 (CEST) IronPort-SDR: PWPOuIBzUOmcCMyjKRW+w8o9yfSbgs2Lrorisnt1Mm8c9jV4Rx7MOE8LSXRzs5BJUC3NImWxFu 8Ze3FKxjD8IA== X-IronPort-AV: E=McAfee;i="6000,8403,9939"; a="171329832" X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="171329832" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 22:14:48 -0700 IronPort-SDR: aZvZIxk25XSXzpHK9VzcMga5khOfhAJQ2HrtrneOhBgEYuHuBOkDcK7UJcAnx536HZOXZ0l6nN nqT3MSh1/qtw== X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="418491759" Received: from unknown (HELO localhost.localdomain) ([10.240.183.222]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 22:14:47 -0700 From: Ling Wei To: dts@dpdk.org Cc: Ling Wei Date: Wed, 31 Mar 2021 13:13:16 +0800 Message-Id: <20210331051316.602359-1-weix.ling@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [PATCH V1] tests/vhost_cbdma: add bind dut ports to DPDK-compatible driver step 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 Sender: "dts" Add bind dut ports to DPDK-compatible driver method and step in tear_down after test_check_threshold_value_with_cbdma exectue over. Signed-off-by: Ling Wei --- tests/TestSuite_vhost_cbdma.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/TestSuite_vhost_cbdma.py b/tests/TestSuite_vhost_cbdma.py index 260c534e..5699a7db 100644 --- a/tests/TestSuite_vhost_cbdma.py +++ b/tests/TestSuite_vhost_cbdma.py @@ -110,6 +110,22 @@ class TestVirTioVhostCbdma(TestCase): self.dut.send_expect("rm -rf /tmp/s0", "#") self.mode_list = [] + def bind_nic_driver(self, ports, driver=""): + if driver == "igb_uio": + for port in ports: + netdev = self.dut.ports_info[port]['port'] + driver = netdev.get_nic_driver() + if driver != 'igb_uio': + netdev.bind_driver(driver='igb_uio') + else: + for port in ports: + netdev = self.dut.ports_info[port]['port'] + driver_now = netdev.get_nic_driver() + if driver == "": + driver = netdev.default_driver + if driver != driver_now: + netdev.bind_driver(driver=driver) + def get_cbdma_ports_info_and_bind_to_dpdk(self, cbdma_num): """ get all cbdma ports @@ -533,6 +549,8 @@ class TestVirTioVhostCbdma(TestCase): """ self.dut.send_expect("killall -I %s" % self.testpmd_name, '#', 20) self.bind_cbdma_device_to_kernel() + if self.running_case == 'test_check_threshold_value_with_cbdma': + self.bind_nic_driver(self.dut_ports, self.drivername) def tear_down_all(self): """ -- 2.25.1