Commit fb3b0cb7 authored by Jaroslaw Chachulski's avatar Jaroslaw Chachulski Committed by Tomasz Zawadzki
Browse files

scripts/nvmf_perf: add option to turn on pause frames



This commit adds the `configure_pause_frames` function to add an option
to turn onand off pause frames for each NIC.

Signed-off-by: default avatarJaroslaw Chachulski <jaroslawx.chachulski@intel.com>
Change-Id: I77d4b726cf9fc8380bc14c9289bf89213cf18116
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17691


Reviewed-by: default avatarPawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: default avatarKamil Godzwon <kamilx.godzwon@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 9463523b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -60,7 +60,8 @@ The following sub-chapters describe each configuration section in more detail.
    "password": "password",
    "transport": "transport_type",
    "skip_spdk_install": bool,
    "irdma_roce_enable": bool
    "irdma_roce_enable": bool,
    "pause_frames": bool
}
```

@@ -80,6 +81,9 @@ Optional:
- irdma_roce_enable - loads irdma driver with RoCEv2 network protocol enabled on Target and
  Initiator machines. This option applies only to system with Intel E810 NICs.
  Default: false
- pause_frames - configures pause frames when RoCEv2 network protocol is enabled on Target and
  Initiator machines.
  Default: false

### Target System Configuration

+16 −1
Original line number Diff line number Diff line
@@ -53,7 +53,8 @@ class Server(ABC):
            ConfigField(name='password', required=True),
            ConfigField(name='transport', required=True),
            ConfigField(name='skip_spdk_install', default=False),
            ConfigField(name='irdma_roce_enable', default=False)
            ConfigField(name='irdma_roce_enable', default=False),
            ConfigField(name='pause_frames', default=False)
        ]
        self.read_config(config_fields, general_config)
        self.transport = self.transport.lower()
@@ -149,6 +150,7 @@ class Server(ABC):
        self.configure_tuned()
        self.configure_cpu_governor()
        self.configure_irq_affinity(**self.irq_settings)
        self.configure_pause_frames()

    RDMA_PROTOCOL_IWARP = 0
    RDMA_PROTOCOL_ROCE = 1
@@ -185,6 +187,19 @@ class Server(ABC):
            self.reload_driver("irdma", "roce_ena=0")
            self.log.info("Loaded irdma driver with iWARP enabled")

    def set_pause_frames(self, rx_state, tx_state):
        for nic_ip in self.nic_ips:
            nic_name = self.get_nic_name_by_ip(nic_ip)
            self.exec_cmd(["sudo", "ethtool", "-A", nic_name, "rx", rx_state, "tx", tx_state])

    def configure_pause_frames(self):
        if not self.pause_frames:
            self.log.info("Turning off pause frames")
            self.set_pause_frames("off", "off")
            return
        self.log.info("Configuring pause frames")
        self.set_pause_frames("on", "on")

    def configure_arfs(self):
        rps_flow_cnt = 512
        if not self.enable_arfs: