diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f26be655..fc1322253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## v22.01: (Upcoming Release) +### bdev + +The parameter `retry_count` of the RPC `bdev_nvme_set_options` was deprecated and will be +removed in SPDK 22.01, and the parameter `transport_retry_count` is added and used instead. + ## v21.10 Structure `spdk_nvmf_target_opts` has been extended with new member `discovery_filter` which allows to specify diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index 59d61788f..e33821f60 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -2777,7 +2777,7 @@ action_on_timeout | Optional | string | Action to take on command timeout_us | Optional | number | Timeout for each command, in microseconds. If 0, don't track timeouts timeout_admin_us | Optional | number | Timeout for each admin command, in microseconds. If 0, treat same as io timeouts ('timeout_us') keep_alive_timeout_ms | Optional | number | Keep alive timeout period in milliseconds, default is 10s -retry_count | Optional | number | The number of attempts per I/O before an I/O fails +retry_count | Optional | number | The number of attempts per I/O before an I/O fails. (Deprecated. Please use transport_retry_count instead.) arbitration_burst | Optional | number | The value is expressed as a power of two, a value of 111b indicates no limit low_priority_weight | Optional | number | The maximum number of commands that the controller may launch at one time from a low priority queue medium_priority_weight | Optional | number | The maximum number of commands that the controller may launch at one time from a medium priority queue @@ -2786,6 +2786,7 @@ nvme_adminq_poll_period_us | Optional | number | How often the admin queue nvme_ioq_poll_period_us | Optional | number | How often I/O queues are polled for completions, in microseconds. Default: 0 (as fast as possible). io_queue_requests | Optional | number | The number of requests allocated for each NVMe I/O queue. Default: 512. 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. #### Example @@ -2795,7 +2796,7 @@ Example request: request: { "params": { - "retry_count": 5, + "transport_retry_count": 5, "arbitration_burst": 3, "low_priority_weight": 8, "medium_priority_weight":8, diff --git a/module/bdev/nvme/bdev_nvme.c b/module/bdev/nvme/bdev_nvme.c index 61a1fa0a1..fcfb0a232 100644 --- a/module/bdev/nvme/bdev_nvme.c +++ b/module/bdev/nvme/bdev_nvme.c @@ -131,7 +131,7 @@ static struct spdk_bdev_nvme_opts g_opts = { .timeout_us = 0, .timeout_admin_us = 0, .keep_alive_timeout_ms = SPDK_BDEV_NVME_DEFAULT_KEEP_ALIVE_TIMEOUT_IN_MS, - .retry_count = 4, + .transport_retry_count = 4, .arbitration_burst = 0, .low_priority_weight = 0, .medium_priority_weight = 0, @@ -3531,7 +3531,7 @@ bdev_nvme_create(struct spdk_nvme_transport_id *trid, spdk_nvme_ctrlr_get_default_ctrlr_opts(&ctx->opts, sizeof(ctx->opts)); } - ctx->opts.transport_retry_count = g_opts.retry_count; + ctx->opts.transport_retry_count = g_opts.transport_retry_count; ctx->opts.keep_alive_timeout_ms = g_opts.keep_alive_timeout_ms; ctx->opts.disable_read_ana_log_page = true; @@ -4653,7 +4653,7 @@ bdev_nvme_opts_config_json(struct spdk_json_write_ctx *w) spdk_json_write_named_uint64(w, "timeout_us", g_opts.timeout_us); spdk_json_write_named_uint64(w, "timeout_admin_us", g_opts.timeout_admin_us); spdk_json_write_named_uint32(w, "keep_alive_timeout_ms", g_opts.keep_alive_timeout_ms); - spdk_json_write_named_uint32(w, "retry_count", g_opts.retry_count); + spdk_json_write_named_uint32(w, "transport_retry_count", g_opts.transport_retry_count); spdk_json_write_named_uint32(w, "arbitration_burst", g_opts.arbitration_burst); spdk_json_write_named_uint32(w, "low_priority_weight", g_opts.low_priority_weight); spdk_json_write_named_uint32(w, "medium_priority_weight", g_opts.medium_priority_weight); diff --git a/module/bdev/nvme/bdev_nvme.h b/module/bdev/nvme/bdev_nvme.h index 40a363a28..312daaaf6 100644 --- a/module/bdev/nvme/bdev_nvme.h +++ b/module/bdev/nvme/bdev_nvme.h @@ -213,7 +213,8 @@ struct spdk_bdev_nvme_opts { uint64_t timeout_us; uint64_t timeout_admin_us; uint32_t keep_alive_timeout_ms; - uint32_t retry_count; + /* The number of attempts per I/O in the transport layer before an I/O fails. */ + uint32_t transport_retry_count; uint32_t arbitration_burst; uint32_t low_priority_weight; uint32_t medium_priority_weight; diff --git a/module/bdev/nvme/bdev_nvme_rpc.c b/module/bdev/nvme/bdev_nvme_rpc.c index 1d8ad776f..1573a22ac 100644 --- a/module/bdev/nvme/bdev_nvme_rpc.c +++ b/module/bdev/nvme/bdev_nvme_rpc.c @@ -79,7 +79,7 @@ static const struct spdk_json_object_decoder rpc_bdev_nvme_options_decoders[] = {"timeout_us", offsetof(struct spdk_bdev_nvme_opts, timeout_us), spdk_json_decode_uint64, true}, {"timeout_admin_us", offsetof(struct spdk_bdev_nvme_opts, timeout_admin_us), spdk_json_decode_uint64, true}, {"keep_alive_timeout_ms", offsetof(struct spdk_bdev_nvme_opts, keep_alive_timeout_ms), spdk_json_decode_uint32, true}, - {"retry_count", offsetof(struct spdk_bdev_nvme_opts, retry_count), spdk_json_decode_uint32, true}, + {"retry_count", offsetof(struct spdk_bdev_nvme_opts, transport_retry_count), spdk_json_decode_uint32, true}, {"arbitration_burst", offsetof(struct spdk_bdev_nvme_opts, arbitration_burst), spdk_json_decode_uint32, true}, {"low_priority_weight", offsetof(struct spdk_bdev_nvme_opts, low_priority_weight), spdk_json_decode_uint32, true}, {"medium_priority_weight", offsetof(struct spdk_bdev_nvme_opts, medium_priority_weight), spdk_json_decode_uint32, true}, @@ -88,6 +88,7 @@ static const struct spdk_json_object_decoder rpc_bdev_nvme_options_decoders[] = {"nvme_ioq_poll_period_us", offsetof(struct spdk_bdev_nvme_opts, nvme_ioq_poll_period_us), spdk_json_decode_uint64, true}, {"io_queue_requests", offsetof(struct spdk_bdev_nvme_opts, io_queue_requests), spdk_json_decode_uint32, true}, {"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}, }; static void diff --git a/scripts/rpc.py b/scripts/rpc.py index 5c707e9b7..ef5746cff 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -466,7 +466,8 @@ if __name__ == "__main__": nvme_adminq_poll_period_us=args.nvme_adminq_poll_period_us, nvme_ioq_poll_period_us=args.nvme_ioq_poll_period_us, io_queue_requests=args.io_queue_requests, - delay_cmd_submit=args.delay_cmd_submit) + delay_cmd_submit=args.delay_cmd_submit, + transport_retry_count=args.transport_retry_count) 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.') @@ -479,7 +480,7 @@ if __name__ == "__main__": p.add_argument('-k', '--keep-alive-timeout-ms', help="Keep alive timeout period in millisecond. If 0, disable keep-alive.", type=int) p.add_argument('-n', '--retry-count', - help='the number of attempts per I/O when an I/O fails', type=int) + help='the number of attempts per I/O when an I/O fails. (deprecated, please use --transport-retry-count.)', type=int) p.add_argument('--arbitration-burst', help='the value is expressed as a power of two', type=int) p.add_argument('--low-priority-weight', @@ -497,6 +498,8 @@ if __name__ == "__main__": p.add_argument('-d', '--disable-delay-cmd-submit', help='Disable delaying NVMe command submission, i.e. no batching of multiple commands', action='store_false', dest='delay_cmd_submit', default=True) + p.add_argument('-c', '--transport-retry-count', + help='the number of attempts per I/O in the transport layer when an I/O fails.', type=int) p.set_defaults(func=bdev_nvme_set_options) def bdev_nvme_set_hotplug(args): diff --git a/scripts/rpc/bdev.py b/scripts/rpc/bdev.py index a2b1992c2..cd438b335 100644 --- a/scripts/rpc/bdev.py +++ b/scripts/rpc/bdev.py @@ -429,7 +429,7 @@ 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): + delay_cmd_submit=None, transport_retry_count=None): """Set options for the bdev nvme. This is startup command. Args: @@ -437,7 +437,7 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo timeout_us: Timeout for each command, in microseconds. If 0, don't track timeouts (optional) timeout_admin_us: Timeout for each admin command, in microseconds. If 0, treat same as io timeouts (optional) keep_alive_timeout_ms: Keep alive timeout period in millisecond, default is 10s (optional) - retry_count: The number of attempts per I/O when an I/O fails (optional) + retry_count: The number of attempts per I/O when an I/O fails (deprecated) (optional) arbitration_burst: The value is expressed as a power of two (optional) low_prioity_weight: The number of commands that may be executed from the low priority queue at one time (optional) medium_prioity_weight: The number of commands that may be executed from the medium priority queue at one time (optional) @@ -446,6 +446,7 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo nvme_ioq_poll_period_us: How often to poll I/O queues for completions in microseconds (optional) io_queue_requests: The number of requests allocated for each NVMe I/O queue. Default: 512 (optional) 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) """ params = {} @@ -462,6 +463,7 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo params['keep_alive_timeout_ms'] = keep_alive_timeout_ms if retry_count is not None: + print("WARNING: retry_count is deprecated, please use transport_retry_count.") params['retry_count'] = retry_count if arbitration_burst is not None: @@ -488,6 +490,9 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, timeo if delay_cmd_submit is not None: params['delay_cmd_submit'] = delay_cmd_submit + if transport_retry_count is not None: + params['transport_retry_count'] = transport_retry_count + return client.call('bdev_nvme_set_options', params)