Commit 2c5849c7 authored by Karol Latecki's avatar Karol Latecki Committed by Jim Harris
Browse files

scripts/nvmf_perf: add adq_configure_nic method



Configure NIC settings as per ADQ configuration guide.

Change-Id: I957aada267474c2a1448c89a1b7c81d4dd261ca6
Signed-off-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6263


Reviewed-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarMichal Berger <michalx.berger@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 3c09b2fb
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ class Server:

    def configure_adq(self):
        self.adq_load_modules()
        self.adq_configure_nic()

    def adq_load_modules(self):
        self.log_print("Modprobing ADQ-related Linux modules...")
@@ -91,6 +92,35 @@ class Server:
                self.log_print("ERROR: failed to load module %s" % module)
                self.log_print("%s resulted in error: %s" % (e.cmd, e.output))

    def adq_configure_nic(self):
        self.log_print("Configuring NIC port settings for ADQ testing...")

        # Reload the driver first, to make sure any previous settings are re-set.
        try:
            self.exec_cmd(["sudo", "rmmod", "ice"])
            self.exec_cmd(["sudo", "modprobe", "ice"])
        except CalledProcessError as e:
            self.log_print("ERROR: failed to reload ice module!")
            self.log_print("%s resulted in error: %s" % (e.cmd, e.output))

        nic_names = [self.get_nic_name_by_ip(n) for n in self.nic_ips]
        for nic in nic_names:
            self.log_print(nic)
            try:
                self.exec_cmd(["sudo", "ethtool", "-K", nic,
                               "hw-tc-offload", "on"])  # Enable hardware TC offload
                self.exec_cmd(["sudo", "ethtool", "--set-priv-flags", nic,
                               "channel-inline-flow-director", "on"])  # Enable Intel Flow Director
                self.exec_cmd(["sudo", "ethtool", "--set-priv-flags", nic, "fw-lldp-agent", "off"])  # Disable LLDP
                self.exec_cmd(["sudo", "ethtool", "--set-priv-flags", nic,
                               "channel-pkt-inspect-optimize", "off"])  # Disable channel packet inspection optimization
            except CalledProcessError as e:
                self.log_print("ERROR: failed to configure NIC port using ethtool!")
                self.log_print("%s resulted in error: %s" % (e.cmd, e.output))
                self.log_print("Please update your NIC driver and firmware versions and try again.")
            self.log_print(self.exec_cmd(["sudo", "ethtool", "-k", nic]))
            self.log_print(self.exec_cmd(["sudo", "ethtool", "--show-priv-flags", nic]))


class Target(Server):
    def __init__(self, name, general_config, target_config):