From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 05342A0350; Tue, 30 Jun 2020 11:55:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ECDDE1BEDF; Tue, 30 Jun 2020 11:55:02 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B2F9C1BEDF for ; Tue, 30 Jun 2020 11:55:01 +0200 (CEST) IronPort-SDR: sxyn9TL2IwXYf7C08Tjg2n3zUYiHE7NfJDlwF/A6muUGaFJxhJ1g3kVuorZlQS4GK4C7Q5/cCx qG3EcgjsDJ7Q== X-IronPort-AV: E=McAfee;i="6000,8403,9666"; a="147742003" X-IronPort-AV: E=Sophos;i="5.75,297,1589266800"; d="scan'208";a="147742003" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2020 02:55:00 -0700 IronPort-SDR: J6iPsUcSRtkrw8JLNZsjGz+YdCpOlTHpjmcSPOCzqmRAQ7XhPgD44fTM1S/mpnpoIQUHCRGgn+ Cg7Iraghz8gw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,297,1589266800"; d="scan'208";a="355732285" Received: from unknown (HELO xqm-virtio_tester.localdomain) ([10.240.183.52]) by orsmga001.jf.intel.com with ESMTP; 30 Jun 2020 02:54:59 -0700 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Tue, 30 Jun 2020 17:46:35 +0800 Message-Id: <1593510398-51509-3-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1593510398-51509-1-git-send-email-qimaix.xiao@intel.com> References: <1593510398-51509-1-git-send-email-qimaix.xiao@intel.com> Subject: [dts] [PATCH V1 2/5]framework/dut.py: update method of restore_interfaces_linux X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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" Signed-off-by: Xiao Qimai --- framework/dut.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/framework/dut.py b/framework/dut.py index 73f965e..2545621 100644 --- a/framework/dut.py +++ b/framework/dut.py @@ -447,13 +447,30 @@ class Dut(Crb): self.send_expect('echo %s > /sys/bus/pci/drivers/%s/bind' % (pci_bus, driver), '# ') pull_retries = 5 + itf = 'N/A' while pull_retries > 0: itf = port.get_interface_name() - if itf == 'N/A': + if not itf or itf == 'N/A': time.sleep(1) pull_retries -= 1 else: break + else: + # try to bind nic with iavf + if driver == 'i40evf': + driver = 'iavf' + self.send_expect('modprobe %s' % driver, '# ') + self.send_expect('echo %s > /sys/bus/pci/drivers/%s/bind' + % (pci_bus, driver), '# ') + pull_retries = 5 + itf = 'N/A' + while pull_retries > 0: + itf = port.get_interface_name() + if not itf or itf == 'N/A': + time.sleep(1) + pull_retries -= 1 + else: + break if itf == 'N/A': self.logger.warning("Fail to bind the device with the linux driver") else: -- 1.8.3.1