From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CD1BD5F24 for ; Wed, 7 Mar 2018 10:16:25 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2018 01:16:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,435,1515484800"; d="scan'208";a="180602499" Received: from dpdk-test32.sh.intel.com ([10.67.119.122]) by orsmga004.jf.intel.com with ESMTP; 07 Mar 2018 01:16:23 -0800 From: Marvin Liu To: dts@dpdk.org Cc: Marvin Liu Date: Thu, 8 Mar 2018 01:06:06 +0800 Message-Id: <1520442368-77344-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH v1 1/3] framework/project_dpdk: add new arguments in setup_modules function 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: , X-List-Received-Date: Wed, 07 Mar 2018 09:16:27 -0000 Add driver name and driver mode arguments in setup_modules function. For DUT, these two agruments should be stripped from execution file. Signed-off-by: Marvin Liu diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py index 40c862a..f87fd13 100644 --- a/framework/project_dpdk.py +++ b/framework/project_dpdk.py @@ -79,21 +79,23 @@ class DPDKdut(Dut): self.build_install_dpdk(target) self.setup_memory() - self.setup_modules(target) + + drivername = load_global_setting(HOST_DRIVER_SETTING) + drivermode = load_global_setting(HOST_DRIVER_MODE_SETTING) + self.setup_modules(target, drivername, drivermode) if bind_dev and self.get_os_type() == 'linux': self.bind_interfaces_linux(drivername) self.extra_nic_setup() - def setup_modules(self, target): + def setup_modules(self, target, drivername, drivermode): """ Install DPDK required kernel module on DUT. """ setup_modules = getattr(self, 'setup_modules_%s' % self.get_os_type()) - setup_modules(target) + setup_modules(target, drivername, drivermode) - def setup_modules_linux(self, target): - drivername = load_global_setting(HOST_DRIVER_SETTING) + def setup_modules_linux(self, target, drivername, drivermode): if drivername == "vfio-pci": self.send_expect("rmmod vfio_pci", "#", 70) self.send_expect("rmmod vfio_iommu_type1", "#", 70) @@ -103,7 +105,6 @@ class DPDKdut(Dut): out = self.send_expect("lsmod | grep vfio_iommu_type1", "#") assert ("vfio_iommu_type1" in out), "Failed to setup vfio-pci" - drivermode = load_global_setting(HOST_DRIVER_MODE_SETTING) if drivermode == "noiommu": self.send_expect("echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode", "#", 70) @@ -113,7 +114,7 @@ class DPDKdut(Dut): out = self.send_expect("lsmod | grep uio_pci_generic", "#") assert ("uio_pci_generic" in out), "Failed to setup uio_pci_generic" - else: + elif drivername == "igb_uio": self.send_expect("modprobe uio", "#", 70) out = self.send_expect("lsmod | grep igb_uio", "#") if "igb_uio" in out: @@ -123,7 +124,7 @@ class DPDKdut(Dut): out = self.send_expect("lsmod | grep igb_uio", "#") assert ("igb_uio" in out), "Failed to insmod igb_uio" - def setup_modules_freebsd(self, target): + def setup_modules_freebsd(self, target, drivername, drivermode): """ Install DPDK required Freebsd kernel module on DUT. """ -- 1.9.3