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

scripts/nvmf_perf: add sock_impl option

parent 3552b7e7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -152,6 +152,9 @@ Optional, common:
    of both ("[0-1,10,20-22]")
  exclude_cpulist: reverse the effect of cpulist mode. Allow IRQ processing
    only on CPU cores which are not provided in cpulist parameter.
- sock_impl - str. Specifies the socket implementation to be used. This could be 'posix' for
  the POSIX socket interfaces, or 'uring' for the Linux io_uring interface.
  Default: posix

Optional, Kernel Target only:

+18 −5
Original line number Diff line number Diff line
@@ -1140,7 +1140,8 @@ class SPDKTarget(Target):
            ConfigField(name='dsa_settings', default=False),
            ConfigField(name='iobuf_small_pool_count', default=32767),
            ConfigField(name='iobuf_large_pool_count', default=16383),
            ConfigField(name='num_cqe', default=4096)
            ConfigField(name='num_cqe', default=4096),
            ConfigField(name='sock_impl', default='posix')
        ]

        self.read_config(config_fields, target_config)
@@ -1318,7 +1319,7 @@ class SPDKTarget(Target):
            time.sleep(1)
        self.client = rpc_client.JSONRPCClient("/var/tmp/spdk.sock")

        rpc.sock.sock_set_default_impl(self.client, impl_name="posix")
        rpc.sock.sock_set_default_impl(self.client, impl_name=self.sock_impl)
        rpc.iobuf.iobuf_set_options(self.client,
                                    small_pool_count=self.iobuf_small_pool_count,
                                    large_pool_count=self.iobuf_large_pool_count,
@@ -1326,13 +1327,13 @@ class SPDKTarget(Target):
                                    large_bufsize=None)

        if self.enable_zcopy:
            rpc.sock.sock_impl_set_options(self.client, impl_name="posix",
            rpc.sock.sock_impl_set_options(self.client, impl_name=self.sock_impl,
                                           enable_zerocopy_send_server=True)
            self.log.info("Target socket options:")
            rpc_client.print_dict(rpc.sock.sock_impl_get_options(self.client, impl_name="posix"))
            rpc_client.print_dict(rpc.sock.sock_impl_get_options(self.client, impl_name=self.sock_impl))

        if self.enable_adq:
            rpc.sock.sock_impl_set_options(self.client, impl_name="posix", enable_placement_id=1)
            rpc.sock.sock_impl_set_options(self.client, impl_name=self.sock_impl, enable_placement_id=1)
            rpc.bdev.bdev_nvme_set_options(self.client, timeout_us=0, action_on_timeout=None,
                                           nvme_adminq_poll_period_us=100000, retry_count=4)

@@ -1504,6 +1505,7 @@ class SPDKInitiator(Initiator):
        self.enable_data_digest = initiator_config.get('enable_data_digest', False)
        self.small_pool_count = initiator_config.get('small_pool_count', 32768)
        self.large_pool_count = initiator_config.get('large_pool_count', 16384)
        self.sock_impl = initiator_config.get('sock_impl', 'posix')

        if "num_cores" in initiator_config:
            self.num_cores = initiator_config["num_cores"]
@@ -1560,6 +1562,17 @@ class SPDKInitiator(Initiator):
                            }
                        }
                    ]
                },
                {
                    "subsystem": "sock",
                    "config": [
                        {
                            "method": "sock_set_default_impl",
                            "params": {
                                "impl_name": self.sock_impl
                            }
                        }
                    ]
                }
            ]
        }