Skip to content

Commit

Permalink
ENRT/BasePvPRecipe.py: make driverctl override optional
Browse files Browse the repository at this point in the history
Some NICs as Mellanox ones don't require overriding to vfio-pci.

This patch adds new parameter driverctl_override to bypass this command call.

Signed-off-by: Jan Tluka <[email protected]>
  • Loading branch information
jtluka authored and olichtne committed Oct 16, 2023
1 parent 373f0dd commit b0dc2d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
13 changes: 9 additions & 4 deletions lnst/Recipes/ENRT/BasePvPRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from enum import Enum

from lnst.Common.LnstError import LnstError
from lnst.Common.Parameters import Param, IntParam, StrParam
from lnst.Common.Parameters import Param, IntParam, StrParam, BoolParam
from lnst.RecipeCommon.Ping.Recipe import PingTestAndEvaluate

from lnst.RecipeCommon.Perf.Recipe import Recipe as PerfRecipe
Expand Down Expand Up @@ -53,6 +53,7 @@ class BasePvPRecipe(PingTestAndEvaluate, PerfRecipe):
"""

driver = StrParam(mandatory=True)
driverctl_override = BoolParam(default=True)

trex_dir = StrParam(mandatory=True)

Expand Down Expand Up @@ -99,9 +100,10 @@ def base_dpdk_configuration(self, dpdk_host_cfg):
host.run("echo -n {} /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages"
.format(self.params.nr_hugepages))

host.run("modprobe vfio-pci")
for nic in dpdk_host_cfg.nics:
host.run("driverctl set-override {} vfio-pci".format(nic.bus_info))
if self.params.driverctl_override:
host.run("modprobe vfio-pci")
for nic in dpdk_host_cfg.nics:
host.run("driverctl set-override {} vfio-pci".format(nic.bus_info))

def base_dpdk_deconfiguration(self, dpdk_host_cfg, service_list=[]):
""" Undo Base DPDK configuration in a host
Expand All @@ -111,6 +113,9 @@ def base_dpdk_deconfiguration(self, dpdk_host_cfg, service_list=[]):
from being able to unset-override the host's interfaces.
They will get restarted.
"""
if not self.params.driverctl_override:
return

host = dpdk_host_cfg.host
# TODO service should be a host method
host.run("service irqbalance start")
Expand Down
7 changes: 4 additions & 3 deletions lnst/Recipes/ENRT/OvS_DPDK_PvP.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@ def test_wide_deconfiguration(self, config):
log_exc_traceback()

try:
for nic in config.generator.nics:
config.generator.host.run(
"driverctl unset-override {}".format(nic.bus_info))
if self.params.driverctl_override:
for nic in config.generator.nics:
config.generator.host.run(
"driverctl unset-override {}".format(nic.bus_info))

config.generator.host.run("service irqbalance start")
except:
Expand Down

0 comments on commit b0dc2d6

Please sign in to comment.