Commit 6ecf0442 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

bdev/nvme: add option to control accel sequence support



There are still some limitiations to the way IOs with an accel sequence
are handled: mainly, they'll never be retried by bdev_nvme, because it
cannot re-execute an accel sequence (and it doesn't even know whether
that sequence was executed or not).

We plan to address this issue in the future, but, in the interim, a new
option, allow_accel_sequence, was added to allow users to control
whether NVMe bdevs report support for accel sequences (of course the
underlying controller must also support them).

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I560419c605b1f6e2f825a33411e06d120c4d5629
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20014


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 3d2c44ba
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3869,6 +3869,7 @@ transport_tos | Optional | number | IPv4 Type of Service value
nvme_error_stat            | Optional | boolean     | Enable collecting NVMe error counts.
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`.

#### Example

+6 −0
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ static struct spdk_bdev_nvme_opts g_opts = {
	.transport_tos = 0,
	.nvme_error_stat = false,
	.io_path_stat = false,
	.allow_accel_sequence = false,
};

#define NVME_HOTPLUG_POLL_PERIOD_MAX			10000000ULL
@@ -3811,6 +3812,10 @@ bdev_nvme_accel_sequence_supported(void *ctx, enum spdk_bdev_io_type type)
	struct nvme_bdev *nbdev = ctx;
	struct spdk_nvme_ctrlr *ctrlr;

	if (!g_opts.allow_accel_sequence) {
		return false;
	}

	switch (type) {
	case SPDK_BDEV_IO_TYPE_WRITE:
	case SPDK_BDEV_IO_TYPE_READ:
@@ -7870,6 +7875,7 @@ bdev_nvme_opts_config_json(struct spdk_json_write_ctx *w)
	spdk_json_write_named_bool(w, "generate_uuids", g_opts.generate_uuids);
	spdk_json_write_named_uint8(w, "transport_tos", g_opts.transport_tos);
	spdk_json_write_named_bool(w, "io_path_stat", g_opts.io_path_stat);
	spdk_json_write_named_bool(w, "allow_accel_sequence", g_opts.allow_accel_sequence);
	spdk_json_write_object_end(w);

	spdk_json_write_object_end(w);
+1 −0
Original line number Diff line number Diff line
@@ -296,6 +296,7 @@ struct spdk_bdev_nvme_opts {
	bool nvme_error_stat;
	uint32_t rdma_srq_size;
	bool io_path_stat;
	bool allow_accel_sequence;
};

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
@@ -70,6 +70,7 @@ static const struct spdk_json_object_decoder rpc_bdev_nvme_options_decoders[] =
	{"nvme_error_stat", offsetof(struct spdk_bdev_nvme_opts, nvme_error_stat), spdk_json_decode_bool, true},
	{"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},
};

static void
+7 −2
Original line number Diff line number Diff line
@@ -563,7 +563,8 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo
                          delay_cmd_submit=None, transport_retry_count=None, bdev_retry_count=None,
                          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):
                          transport_tos=None, nvme_error_stat=None, rdma_srq_size=None, io_path_stat=None,
                          allow_accel_sequence=None):
    """Set options for the bdev nvme. This is startup command.

    Args:
@@ -608,7 +609,8 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo
        nvme_error_stat: Enable collecting NVMe error counts. (optional)
        rdma_srq_size: Set the size of a shared rdma receive queue. Default: 0 (disabled) (optional)
        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)
    """
    params = {}

@@ -688,6 +690,9 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo
    if io_path_stat is not None:
        params['io_path_stat'] = io_path_stat

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

    return client.call('bdev_nvme_set_options', params)


Loading