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: Alexey 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: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: <tanl12@chinatelecom.cn>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Alexey Marchuk 2022-01-20 15:22:06 +03:00 committed by Tomasz Zawadzki
parent cc797456f4
commit 2ccaf2acfa
6 changed files with 18 additions and 2 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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)

View File

@ -442,7 +442,8 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo
keep_alive_timeout_ms=None, retry_count=None, arbitration_burst=None,
low_priority_weight=None, medium_priority_weight=None, high_priority_weight=None,
nvme_adminq_poll_period_us=None, nvme_ioq_poll_period_us=None, io_queue_requests=None,
delay_cmd_submit=None, transport_retry_count=None, bdev_retry_count=None):
delay_cmd_submit=None, transport_retry_count=None, bdev_retry_count=None,
transport_ack_timeout=None):
"""Set options for the bdev nvme. This is startup command.
Args:
@ -461,6 +462,8 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo
delay_cmd_submit: Enable delayed NVMe command submission to allow batching of multiple commands (optional)
transport_retry_count: The number of attempts per I/O in the transport layer when an I/O fails (optional)
bdev_retry_count: The number of attempts per I/O in the bdev layer when an I/O fails. -1 means infinite retries. (optional)
transport_ack_timeout: Time to wait ack until packet retransmission. RDMA specific.
Range 0-31 where 0 is driver-specific default value (optional)
"""
params = {}
@ -510,6 +513,9 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo
if bdev_retry_count is not None:
params['bdev_retry_count'] = bdev_retry_count
if transport_ack_timeout is not None:
params['transport_ack_timeout'] = transport_ack_timeout
return client.call('bdev_nvme_set_options', params)