test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Liu, Yong" <yong.liu@intel.com>
To: Jianbo Liu <jianbo.liu@linaro.org>, "dts@dpdk.org" <dts@dpdk.org>,
	"herbert.guan@arm.com" <herbert.guan@arm.com>
Subject: Re: [dts] [PATCH] framework: add config option for vfio noiommu mode
Date: Wed, 9 Aug 2017 09:07:51 +0000	[thread overview]
Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62E4E23C@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1502260322-23906-1-git-send-email-jianbo.liu@linaro.org>

Hi Jianbo,
I am curious about your environment, what kind of environment you're using and required for NOIMMU mode?

Thanks,
Marvin

> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Jianbo Liu
> Sent: Wednesday, August 09, 2017 2:32 PM
> To: dts@dpdk.org; herbert.guan@arm.com
> Cc: Jianbo Liu <jianbo.liu@linaro.org>
> Subject: [dts] [PATCH] framework: add config option for vfio noiommu mode
> 
> Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
> ---
>  framework/dts.py          |  9 +++++++++
>  framework/project_dpdk.py | 30 +++++++++++++++++++++++++++++-
>  framework/settings.py     |  1 +
>  tools/setup.py            |  2 +-
>  4 files changed, 40 insertions(+), 2 deletions(-)
> 
> diff --git a/framework/dts.py b/framework/dts.py
> index c821fc1..931bf38 100644
> --- a/framework/dts.py
> +++ b/framework/dts.py
> @@ -81,6 +81,14 @@ def dts_parse_param(config, section):
>      parameters = config.get(section, 'parameters').split(':')
>      drivername = config.get(section, 'drivername').split('=')[-1]
> 
> +    driver = drivername.split(':')
> +    if len(driver) == 2:
> +        drivername = driver[0]
> +        drivermode = driver[1]
> +        settings.save_global_setting(settings.HOST_DRIVER_MODE_SETTING,
> drivermode)
> +    else:
> +        drivername = driver[0]
> +
>      settings.save_global_setting(settings.HOST_DRIVER_SETTING, drivername)
> 
>      paramDict = dict()
> @@ -373,6 +381,7 @@ def dts_run_target(duts, tester, targets, test_suites):
>      for dutobj in duts:
>          dutobj.stop_ports()
>          dutobj.restore_interfaces()
> +        dutobj.restore_modules()
> 
> 
>  def dts_run_suite(duts, tester, test_suites, target):
> diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
> index b9a6d4a..402ac8d 100644
> --- a/framework/project_dpdk.py
> +++ b/framework/project_dpdk.py
> @@ -33,7 +33,7 @@ import os
>  import re
> 
>  from settings import NICS, load_global_setting, accepted_nic
> -from settings import DPDK_RXMODE_SETTING, HOST_DRIVER_SETTING
> +from settings import DPDK_RXMODE_SETTING, HOST_DRIVER_SETTING,
> HOST_DRIVER_MODE_SETTING
>  from ssh_connection import SSHConnection
>  from crb import Crb
>  from dut import Dut
> @@ -104,6 +104,11 @@ class DPDKdut(Dut):
>              self.send_expect("modprobe vfio-pci", "#", 70)
>              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)
> +
>          else:
>              self.send_expect("modprobe uio", "#", 70)
>              out = self.send_expect("lsmod | grep igb_uio", "#")
> @@ -130,6 +135,29 @@ class DPDKdut(Dut):
>          out = self.send_expect("kldstat", "#")
>          assert ("nic_uio" in out), "Failed to insmod nic_uio"
> 
> +    def restore_modules(self):
> +        """
> +        Restore DPDK kernel module on DUT.
> +        """
> +        restore_modules = getattr(self, 'restore_modules_%s' %
> self.get_os_type())
> +        restore_modules()
> +
> +    def restore_modules_linux(self):
> +        """
> +        Restore DPDK Linux kernel module on DUT.
> +        """
> +        drivername = load_global_setting(HOST_DRIVER_SETTING)
> +        if drivername == "vfio-pci":
> +            drivermode = load_global_setting(HOST_DRIVER_MODE_SETTING)
> +            if drivermode == "noiommu":
> +                self.send_expect("echo 0 >
> /sys/module/vfio/parameters/enable_unsafe_noiommu_mode", "#", 70)
> +
> +    def restore_modules_freebsd(self):
> +        """
> +        Restore DPDK Freebsd kernel module on DUT.
> +        """
> +        pass
> +
>      def set_rxtx_mode(self):
>          """
>          Set default RX/TX PMD function,
> diff --git a/framework/settings.py b/framework/settings.py
> index d306de2..e5b7746 100644
> --- a/framework/settings.py
> +++ b/framework/settings.py
> @@ -204,6 +204,7 @@ DTS_ENV_PAT = r"DTS_*"
>  PERF_SETTING = "DTS_PERF_ONLY"
>  FUNC_SETTING = "DTS_FUNC_ONLY"
>  HOST_DRIVER_SETTING = "DTS_HOST_DRIVER"
> +HOST_DRIVER_MODE_SETTING = "DTS_HOST_DRIVER_MODE"
>  HOST_NIC_SETTING = "DTS_HOST_NIC"
>  DEBUG_SETTING = "DTS_DEBUG_ENABLE"
>  DEBUG_CASE_SETTING = "DTS_DEBUGCASE_ENABLE"
> diff --git a/tools/setup.py b/tools/setup.py
> index 9fcd70e..c6c72bc 100755
> --- a/tools/setup.py
> +++ b/tools/setup.py
> @@ -280,7 +280,7 @@ def config_execution():
>      driver_option = {'prompt': 'Choose one of them',
>                       'type': 'choice',
>                       'help': 'Choose one of dpdk support driver',
> -                     'options': ['igb_uio', 'vfio-pci'],
> +                     'options': ['igb_uio', 'vfio-pci', 'vfio-
> pci:noiommu'],
>                       'default': '0'}
>      opt = Option(**driver_option)
>      driver_name = opt.parse_input()
> --
> 1.9.1

  reply	other threads:[~2017-08-09  9:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09  6:32 Jianbo Liu
2017-08-09  9:07 ` Liu, Yong [this message]
2017-08-09  9:43   ` Jianbo Liu
2017-08-10  1:30     ` Liu, Yong
2017-08-10 10:11 ` Liu, Yong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86228AFD5BCD8E4EBFD2B90117B5E81E62E4E23C@SHSMSX103.ccr.corp.intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    --cc=herbert.guan@arm.com \
    --cc=jianbo.liu@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).