From 5d64529925b286a9f188bebc5e37efe4b0b4a85e Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Thu, 14 Jun 2018 15:45:47 +0900 Subject: [PATCH] doc/jsonrpc: Add start_subsystem_init and set_nvmf_target_config/options Change-Id: Idf25cd3113f232f0bd05768d679092cfe945b9b2 Signed-off-by: Shuhei Matsumoto Reviewed-on: https://review.gerrithub.io/415131 Reviewed-by: Pawel Wodkowski Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris Tested-by: SPDK Automated Test System --- doc/jsonrpc.md | 113 ++++++++++++++++++++++++++++++++++++++++++++++++- scripts/rpc.py | 6 +-- 2 files changed, 115 insertions(+), 4 deletions(-) diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index 144a0983f7..b365beee1a 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -77,13 +77,46 @@ Example response: } ~~~ +## start_subsystem_init {#rpc_start_subsystem_init} + +Start initialization of SPDK subsystems when it is deferred by starting SPDK application with option -w. +During its deferral some RPCs can be used to set global parameters for SPDK subsystems. +This RPC can be called only once. + +### Parameters + +This method has no parameters. + +### Response + +Completion status of SPDK subsystem initialization is returned as a boolean. + +### Example + +Example request: +~~~ +{ + "jsonrpc": "2.0", + "id": 1, + "method": "start_subsystem_init" +} +~~~ + +Example response: +~~~ +{ + "jsonrpc": "2.0", + "id": 1, + "result": true +} +~~~ # Block Device Abstraction Layer {#jsonrpc_components_bdev} ## set_bdev_options {#rpc_set_bdev_options} Set global parameters for the block device (bdev) subsystem. This RPC may only be called -before subsystems have been initialized. +before SPDK subsystems have been initialized. ### Parameters @@ -690,3 +723,81 @@ Example response: "result": true } ~~~ + +## set_nvmf_target_options {#rpc_set_nvmf_target_options} + +Set global parameters for the NVMe-oF target. This RPC may only be called before SPDK subsystems +have been initialized. + +### Parameters + +Name | Optional | Type | Description +----------------------- | -------- | ----------- | ----------- +max_queue_depth | Optional | number | Maximum number of outstanding I/Os per queue +max_qpairs_per_ctrlr | Optional | number | Maximum number of SQ and CQ per controller +in_capsule_data_size | Optional | number | Maximum number of in-capsule data size +max_io_size | Optional | number | Maximum I/O size (bytes) +max_subsystems | Optional | number | Maximum number of NVMe-oF subsystems +io_unit_size | Optional | number | I/O unit size (bytes) + +### Example + +Example request: +~~~ +{ + "jsonrpc": "2.0", + "id": 1, + "method": "set_nvmf_target_options", + "params": { + "in_capsule_data_size": 4096, + "io_unit_size": 131072, + "max_qpairs_per_ctrlr": 64, + "max_queue_depth": 128, + "max_io_size": 131072, + "max_subsystems": 1024 + } +} +~~~ + +Example response: +~~~ +{ + "jsonrpc": "2.0", + "id": 1, + "result": true +} +~~~ + +## set_nvmf_target_config {#rpc_set_nvmf_target_config} + +Set global configuration of NVMe-oF target. This RPC may only be called before SPDK subsystems +have been initialized. + +### Parameters + +Name | Optional | Type | Description +----------------------- | -------- | ----------- | ----------- +acceptor_poll_rate | Optional | number | Polling interval of the acceptor for incoming connections (microseconds) + +### Example + +Example request: +~~~ +{ + "jsonrpc": "2.0", + "id": 1, + "method": "set_nvmf_target_config", + "params": { + "acceptor_poll_rate": 10000 + } +} +~~~ + +Example response: +~~~ +{ + "jsonrpc": "2.0", + "id": 1, + "result": true +} +~~~ diff --git a/scripts/rpc.py b/scripts/rpc.py index daeef0e55e..c8ca23f6a3 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1009,9 +1009,9 @@ if __name__ == "__main__": p.add_argument('-q', '--max-queue-depth', help='Max number of outstanding I/O per queue', type=int) p.add_argument('-p', '--max-qpairs-per-ctrlr', help='Max number of SQ and CQ per controller', type=int) p.add_argument('-c', '--in-capsule-data-size', help='Max number of in-capsule data size', type=int) - p.add_argument('-i', '--max-io-size', help='Max I/O size', type=int) + p.add_argument('-i', '--max-io-size', help='Max I/O size (bytes)', type=int) p.add_argument('-x', '--max-subsystems', help='Max number of NVMf subsystems', type=int) - p.add_argument('-u', '--io-unit-size', help='I/O unit size', type=int) + p.add_argument('-u', '--io-unit-size', help='I/O unit size (bytes)', type=int) p.set_defaults(func=set_nvmf_target_options) @call_cmd @@ -1020,7 +1020,7 @@ if __name__ == "__main__": acceptor_poll_rate=args.acceptor_poll_rate) p = subparsers.add_parser('set_nvmf_target_config', help='Set NVMf target config') - p.add_argument('-r', '--acceptor-poll-rate', help='How often the acceptor polls for incoming connections', type=int) + p.add_argument('-r', '--acceptor-poll-rate', help='Polling interval of the acceptor for incoming connections (usec)', type=int) p.set_defaults(func=set_nvmf_target_config) @call_cmd