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 27980A0350; Tue, 30 Jun 2020 11:55:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1E6301BF70; Tue, 30 Jun 2020 11:55:04 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5C7D61BEC0 for ; Tue, 30 Jun 2020 11:55:02 +0200 (CEST) IronPort-SDR: vvvMnJTIk0pLt56oHWCDiPe1W34m/G/2ooUn4QqiKsGPJFWHJWKcjZ7dbqDz7MtoL/lS4IM511 27EzUfowetMw== X-IronPort-AV: E=McAfee;i="6000,8403,9666"; a="147742005" X-IronPort-AV: E=Sophos;i="5.75,297,1589266800"; d="scan'208";a="147742005" 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:02 -0700 IronPort-SDR: Zi8BufFV7lqmLPDYt2LPR7xd738sYGepd7F6nFxfSBVDxp+9XmEobddHiXD1Ntguuer92GmuGa siI2B3Bblq1g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,297,1589266800"; d="scan'208";a="355732300" Received: from unknown (HELO xqm-virtio_tester.localdomain) ([10.240.183.52]) by orsmga001.jf.intel.com with ESMTP; 30 Jun 2020 02:55:01 -0700 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Tue, 30 Jun 2020 17:46:36 +0800 Message-Id: <1593510398-51509-4-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 3/5]framework/project_dpdk: update method setup_modules_linux for vfio-pci in vm 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/project_dpdk.py | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index e8b5d0f..b8cb2bd 100644 --- a/framework/project_dpdk.py +++ b/framework/project_dpdk.py @@ -101,25 +101,15 @@ class DPDKdut(Dut): def setup_modules_linux(self, target, drivername, drivermode): if drivername == "vfio-pci": - if 'VirtDut' in str(self.__class__): - self.send_expect("modprobe -r vfio_iommu_type1", "#") - self.send_expect("modprobe -r vfio", "#") - self.send_expect("modprobe vfio enable_unsafe_noiommu_mode=1", "#") - self.send_expect("modprobe vfio-pci", "#") - else: - self.send_expect("rmmod vfio_pci", "#", 70) - self.send_expect("rmmod vfio_iommu_type1", "#", 70) - self.send_expect("rmmod vfio", "#", 70) - self.send_expect("modprobe vfio", "#", 70) - self.send_expect("modprobe vfio-pci", "#", 70) - out = self.send_expect("lsmod | grep vfio_iommu_type1", "#") - if not out: - out = self.send_expect("ls /sys/module |grep vfio_pci", "#") - assert ("vfio_pci" in out), "Failed to insmod vfio_pci" - - + self.send_expect("rmmod vfio_pci", "#") + self.send_expect("rmmod vfio_iommu_type1", "#") + self.send_expect("rmmod vfio", "#") + self.send_expect("modprobe vfio", "#") + self.send_expect("modprobe vfio-pci", "#") if drivermode == "noiommu": - self.send_expect("echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode", "#", 70) + self.send_expect("echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode", "#") + out = self.send_expect("ls /sys/module|grep vfio_pci", "#") + assert ("vfio_pci" in out), "load vfio_pci failed" elif drivername == "uio_pci_generic": self.send_expect("modprobe uio", "#", 70) -- 1.8.3.1