Commit 4790c4ef authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

bdev/nvme: Add an option for the max RDMA CQ size



Signed-off-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I38a3961b7f9f290626f700858215f61833af2aae
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/18851


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
Community-CI: Mellanox Build Bot
parent d1357fd8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3920,6 +3920,7 @@ nvme_error_stat | Optional | boolean | Enable collecting NVMe err
rdma_srq_size              | Optional | number      | Set the size of a shared rdma receive queue. Default: 0 (disabled).
io_path_stat               | Optional | boolean     | Enable collecting I/O stat of each nvme bdev io path. Default: `false`.
allow_accel_sequence       | Optional | boolean     | Allow NVMe bdevs to advertise support for accel sequences if the controller also supports them.  Default: `false`.
rdma_max_cq_size           | Optional | number      | Set the maximum size of a rdma completion queue. Default: 0 (unlimited)

#### Example

+8 −2
Original line number Diff line number Diff line
@@ -5541,11 +5541,17 @@ bdev_nvme_set_opts(const struct spdk_bdev_nvme_opts *opts)
		}
	}

	if (opts->rdma_srq_size != 0) {
	if (opts->rdma_srq_size != 0 ||
	    opts->rdma_max_cq_size != 0) {
		struct spdk_nvme_transport_opts drv_opts;

		spdk_nvme_transport_get_opts(&drv_opts, sizeof(drv_opts));
		if (opts->rdma_srq_size != 0) {
			drv_opts.rdma_srq_size = opts->rdma_srq_size;
		}
		if (opts->rdma_max_cq_size != 0) {
			drv_opts.rdma_max_cq_size = opts->rdma_max_cq_size;
		}

		ret = spdk_nvme_transport_set_opts(&drv_opts, sizeof(drv_opts));
		if (ret) {
+1 −0
Original line number Diff line number Diff line
@@ -297,6 +297,7 @@ struct spdk_bdev_nvme_opts {
	uint32_t rdma_srq_size;
	bool io_path_stat;
	bool allow_accel_sequence;
	uint32_t rdma_max_cq_size;
};

struct spdk_nvme_qpair *bdev_nvme_get_io_qpair(struct spdk_io_channel *ctrlr_io_ch);
+1 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ static const struct spdk_json_object_decoder rpc_bdev_nvme_options_decoders[] =
	{"rdma_srq_size", offsetof(struct spdk_bdev_nvme_opts, rdma_srq_size), spdk_json_decode_uint32, true},
	{"io_path_stat", offsetof(struct spdk_bdev_nvme_opts, io_path_stat), spdk_json_decode_bool, true},
	{"allow_accel_sequence", offsetof(struct spdk_bdev_nvme_opts, allow_accel_sequence), spdk_json_decode_bool, true},
	{"rdma_max_cq_size", offsetof(struct spdk_bdev_nvme_opts, rdma_max_cq_size), spdk_json_decode_uint32, true},
};

static void
+6 −1
Original line number Diff line number Diff line
@@ -573,7 +573,7 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo
                          transport_ack_timeout=None, ctrlr_loss_timeout_sec=None, reconnect_delay_sec=None,
                          fast_io_fail_timeout_sec=None, disable_auto_failback=None, generate_uuids=None,
                          transport_tos=None, nvme_error_stat=None, rdma_srq_size=None, io_path_stat=None,
                          allow_accel_sequence=None):
                          allow_accel_sequence=None, rdma_max_cq_size=None):
    """Set options for the bdev nvme. This is startup command.

    Args:
@@ -620,6 +620,8 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo
        io_path_stat: Enable collection I/O path stat of each io path. (optional)
        allow_accel_sequence: Allow NVMe bdevs to advertise support for accel sequences if the
        controller also supports them. (optional)
        rdma_max_cq_size: The maximum size of a rdma completion queue. Default: 0 (unlimited) (optional)

    """
    params = {}

@@ -702,6 +704,9 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo
    if allow_accel_sequence is not None:
        params['allow_accel_sequence'] = allow_accel_sequence

    if rdma_max_cq_size is not None:
        params['rdma_max_cq_size'] = rdma_max_cq_size

    return client.call('bdev_nvme_set_options', params)


Loading