Commit 2ccaf2ac authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

bdev/nvme: Add transport_ack_timeout to bdev_nvme_set_options RPC



It may take a long time to detect network transport error
when e.g. port is removed on remote target. This timeout
depends on 2 parameters - retry_count and ack_timeout.
bdev_nvme_set_options supports configuration of retry_count
but transport_ack_timeout is missed. Note: this parameter
is used by RDMA transport only.

Signed-off-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Change-Id: I7c3090dc8e4078f64d444e2392a9e0a6ecdc31c0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11175


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatar <tanl12@chinatelecom.cn>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent cc797456
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2907,6 +2907,7 @@ io_queue_requests | Optional | number | The number of requests all
delay_cmd_submit           | Optional | boolean     | Enable delaying NVMe command submission to allow batching of multiple commands. Default: `true`.
transport_retry_count      | Optional | number      | The number of attempts per I/O in the transport layer before an I/O fails.
bdev_retry_count           | Optional | number      | The number of attempts per I/O in the bdev layer before an I/O fails. -1 means infinite retries.
transport_ack_timeout      | Optional | number      | Time to wait ack until packet retransmission. RDMA specific. Range 0-31 where 0 is driver-specific default value.

#### Example

+3 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ static struct spdk_bdev_nvme_opts g_opts = {
	.io_queue_requests = 0,
	.delay_cmd_submit = SPDK_BDEV_NVME_DEFAULT_DELAY_CMD_SUBMIT,
	.bdev_retry_count = 3,
	.transport_ack_timeout = 0,
};

#define NVME_HOTPLUG_POLL_PERIOD_MAX			10000000ULL
@@ -3980,6 +3981,7 @@ bdev_nvme_create(struct spdk_nvme_transport_id *trid,
	}

	ctx->opts.transport_retry_count = g_opts.transport_retry_count;
	ctx->opts.transport_ack_timeout = g_opts.transport_ack_timeout;
	ctx->opts.keep_alive_timeout_ms = g_opts.keep_alive_timeout_ms;
	ctx->opts.disable_read_ana_log_page = true;

@@ -5592,6 +5594,7 @@ bdev_nvme_opts_config_json(struct spdk_json_write_ctx *w)
	spdk_json_write_named_uint32(w, "io_queue_requests", g_opts.io_queue_requests);
	spdk_json_write_named_bool(w, "delay_cmd_submit", g_opts.delay_cmd_submit);
	spdk_json_write_named_int32(w, "bdev_retry_count", g_opts.bdev_retry_count);
	spdk_json_write_named_uint8(w, "transport_ack_timeout", g_opts.transport_ack_timeout);
	spdk_json_write_object_end(w);

	spdk_json_write_object_end(w);
+1 −0
Original line number Diff line number Diff line
@@ -253,6 +253,7 @@ struct spdk_bdev_nvme_opts {
	bool delay_cmd_submit;
	/* The number of attempts per I/O in the bdev layer before an I/O fails. */
	int32_t bdev_retry_count;
	uint8_t transport_ack_timeout;
};

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
@@ -91,6 +91,7 @@ static const struct spdk_json_object_decoder rpc_bdev_nvme_options_decoders[] =
	{"delay_cmd_submit", offsetof(struct spdk_bdev_nvme_opts, delay_cmd_submit), spdk_json_decode_bool, true},
	{"transport_retry_count", offsetof(struct spdk_bdev_nvme_opts, transport_retry_count), spdk_json_decode_uint32, true},
	{"bdev_retry_count", offsetof(struct spdk_bdev_nvme_opts, bdev_retry_count), spdk_json_decode_int32, true},
	{"transport_ack_timeout", offsetof(struct spdk_bdev_nvme_opts, transport_ack_timeout), spdk_json_decode_uint8, true},
};

static void
+5 −1
Original line number Diff line number Diff line
@@ -479,7 +479,8 @@ if __name__ == "__main__":
                                       io_queue_requests=args.io_queue_requests,
                                       delay_cmd_submit=args.delay_cmd_submit,
                                       transport_retry_count=args.transport_retry_count,
                                       bdev_retry_count=args.bdev_retry_count)
                                       bdev_retry_count=args.bdev_retry_count,
                                       transport_ack_timeout=args.transport_ack_timeout)

    p = subparsers.add_parser('bdev_nvme_set_options', aliases=['set_bdev_nvme_options'],
                              help='Set options for the bdev nvme type. This is startup command.')
@@ -514,6 +515,9 @@ if __name__ == "__main__":
                   help='the number of attempts per I/O in the transport layer when an I/O fails.', type=int)
    p.add_argument('-r', '--bdev-retry-count',
                   help='the number of attempts per I/O in the bdev layer when an I/O fails. -1 means infinite retries.', type=int)
    p.add_argument('-e', '--transport-ack-timeout',
                   help="""Time to wait ack until packet retransmission. RDMA specific.
                   Range 0-31 where 0 is driver-specific default value.""", type=int)

    p.set_defaults(func=bdev_nvme_set_options)

Loading