nvme/rpc: Make 'delay_cmd_submit' configurable via RPC
Optional parameter 'delay_cmd_submit' has been added to 'bdev_nvme_set_options' RPC method. Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com> Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com> Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com> Change-Id: Ia09c57bbac8078ee6ab1e8f0bd279ffeb9e08cb8 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462584 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
This commit is contained in:
parent
38520df476
commit
542be8790b
@ -30,6 +30,10 @@ has been added. The public API is available at `include/spdk/pipe.h`.
|
||||
`delayed_pcie_doorbell` parameter in `spdk_nvme_io_qpair_opts` was renamed to `delay_cmd_submit`
|
||||
to allow reuse in other transports.
|
||||
|
||||
### rpc
|
||||
|
||||
Added optional 'delay_cmd_submit' parameter to 'bdev_nvme_set_options' RPC method.
|
||||
|
||||
## v19.10:
|
||||
|
||||
### rpc
|
||||
|
@ -1416,6 +1416,7 @@ high_priority_weight | Optional | number | The maximum number of comm
|
||||
nvme_adminq_poll_period_us | Optional | number | How often the admin queue is polled for asynchronous events in microseconds
|
||||
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`.
|
||||
|
||||
### Example
|
||||
|
||||
@ -1434,6 +1435,7 @@ request:
|
||||
"timeout_us": 10000000,
|
||||
"action_on_timeout": "reset",
|
||||
"io_queue_requests" : 2048,
|
||||
"delay_cmd_submit": true
|
||||
},
|
||||
"jsonrpc": "2.0",
|
||||
"method": "bdev_nvme_set_options",
|
||||
|
@ -2287,6 +2287,7 @@ bdev_nvme_config_json(struct spdk_json_write_ctx *w)
|
||||
spdk_json_write_named_uint64(w, "nvme_adminq_poll_period_us", g_opts.nvme_adminq_poll_period_us);
|
||||
spdk_json_write_named_uint64(w, "nvme_ioq_poll_period_us", g_opts.nvme_ioq_poll_period_us);
|
||||
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_object_end(w);
|
||||
|
||||
spdk_json_write_object_end(w);
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*-
|
||||
* BSD LICENSE
|
||||
*
|
||||
* Copyright (c) Intel Corporation.
|
||||
* All rights reserved.
|
||||
* Copyright (c) Intel Corporation. All rights reserved.
|
||||
* Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@ -82,6 +82,7 @@ static const struct spdk_json_object_decoder rpc_bdev_nvme_options_decoders[] =
|
||||
{"nvme_adminq_poll_period_us", offsetof(struct spdk_bdev_nvme_opts, nvme_adminq_poll_period_us), spdk_json_decode_uint64, true},
|
||||
{"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},
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -357,7 +357,8 @@ if __name__ == "__main__":
|
||||
high_priority_weight=args.high_priority_weight,
|
||||
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)
|
||||
io_queue_requests=args.io_queue_requests,
|
||||
delay_cmd_submit=args.delay_cmd_submit)
|
||||
|
||||
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.')
|
||||
@ -381,6 +382,9 @@ if __name__ == "__main__":
|
||||
help='How often to poll I/O queues for completions', type=int)
|
||||
p.add_argument('-s', '--io-queue-requests',
|
||||
help='The number of requests allocated for each NVMe I/O queue. Default: 512', type=int)
|
||||
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.set_defaults(func=bdev_nvme_set_options)
|
||||
|
||||
def bdev_nvme_set_hotplug(args):
|
||||
|
@ -355,7 +355,8 @@ def bdev_uring_delete(client, name):
|
||||
def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=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):
|
||||
nvme_adminq_poll_period_us=None, nvme_ioq_poll_period_us=None, io_queue_requests=None,
|
||||
delay_cmd_submit=None):
|
||||
"""Set options for the bdev nvme. This is startup command.
|
||||
|
||||
Args:
|
||||
@ -369,6 +370,7 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, retry
|
||||
nvme_adminq_poll_period_us: How often the admin queue is polled for asynchronous events in microseconds (optional)
|
||||
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)
|
||||
"""
|
||||
params = {}
|
||||
|
||||
@ -402,6 +404,9 @@ def bdev_nvme_set_options(client, action_on_timeout=None, timeout_us=None, retry
|
||||
if io_queue_requests:
|
||||
params['io_queue_requests'] = io_queue_requests
|
||||
|
||||
if delay_cmd_submit is not None:
|
||||
params['delay_cmd_submit'] = delay_cmd_submit
|
||||
|
||||
return client.call('bdev_nvme_set_options', params)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user