xref: /spdk/doc/jsonrpc.md (revision e2916ec13731949a1e4ffefc148ac43bd7f1f11e)
1# JSON-RPC {#jsonrpc}
2
3## Overview {#jsonrpc_overview}
4
5SPDK implements a [JSON-RPC 2.0](http://www.jsonrpc.org/specification) server
6to allow external management tools to dynamically configure SPDK components.
7
8## Parameters
9
10Most of the commands can take parameters. If present, parameter is validated against its domain. If this check fail
11whole command will fail with response error message [Invalid params](@ref jsonrpc_error_message).
12
13### Required parameters
14
15These parameters are mandatory. If any required parameter is missing RPC command will fail with proper error response.
16
17### Optional parameters
18
19Those parameters might be omitted. If an optional parameter is present it must be valid otherwise command will fail
20proper error response.
21
22## Error response message {#jsonrpc_error_message}
23
24Each error response will contain proper message. As much as possible the message should indicate what went wrong during
25command processing.
26
27There is ongoing effort to customize this messages but some RPC methods just return "Invalid parameters" as message body
28for any kind of error.
29
30Code   | Description
31------ | -----------
32-1     | Invalid state - given method exists but it is not callable in [current runtime state](@ref rpc_framework_start_init)
33-32600 | Invalid request - not compliant with JSON-RPC 2.0 Specification
34-32601 | Method not found
35-32602 | @ref jsonrpc_invalid_params
36-32603 | Internal error for e.g.: errors like out of memory
37-32700 | @ref jsonrpc_parser_error
38
39### Parser error {#jsonrpc_parser_error}
40
41Encountered some error during parsing request like:
42
43- the JSON object is malformed
44- parameter is too long
45- request is too long
46
47### Invalid params {#jsonrpc_invalid_params}
48
49This type of error is most common one. It mean that there is an error while processing the request like:
50
51- Parameters decoding in RPC method handler failed because required parameter is missing.
52- Unknown parameter present encountered.
53- Parameter type doesn't match expected type e.g.: given number when expected a string.
54- Parameter domain check failed.
55- Request is valid but some other error occurred during processing request. If possible message explains the error reason nature.
56
57## rpc.py {#rpc_py}
58
59SPDK provides a set of Python scripts which can invoke the JSON-RPC methods described in this document.  'rpc.py' in the scripts
60directory is the main script that users will invoke to execute a JSON-RPC method. The scripts/rpc directory contains modules
61that 'rpc.py' imports for definitions of each SPDK library's or module's methods.
62
63Example:
64
65~~~bash
66scripts/rpc.py bdev_nvme_attach_controller -b nvme0 -a 00:02.0 -t pcie
67~~~
68
69A brief description of each of the RPC methods and optional 'rpc.py' arguments can be viewed with:
70
71~~~bash
72scripts/rpc.py --help
73~~~
74
75A detailed description of each RPC method and its parameters is also available.  For example:
76
77~~~bash
78scripts/rpc.py bdev_nvme_attach_controller --help
79~~~
80
81### Generate JSON-RPC methods for current configuration {#jsonrpc_generate}
82
83An initial configuration can be specified for an SPDK application via the '-c' command line parameter.
84The configuration file is a JSON file containing all of the JSON-RPC method invocations necessary
85for the desired configuration. Writing these files by hand is extremely tedious however, so 'rpc.py'
86provides a mechanism to generate a JSON-RPC file based on the current configuration.
87
88~~~bash
89scripts/rpc.py save_config > config.json
90~~~
91
92'config.json' can then be passed to a new SPDK application using the '-c' command line parameter
93to reproduce the same configuration.
94
95### JSON-RPC batching
96
97'rpc.py' also supports batching of multiple JSON-RPC methods with one invocation.  So instead of
98calling 'rpc.py' once for each JSON-RPC method, such as:
99
100~~~bash
101scripts/rpc.py bdev_malloc_create -b malloc0 64 512
102scripts/rpc.py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a
103scripts/rpc.py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 malloc0
104scripts/rpc.py nvmf_create_transport -t tcp
105scripts/rpc.py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t tcp -a 127.0.0.1 -s 4420
106~~~
107
108you can put the following into a text file:
109
110~~~bash
111bdev_malloc_create -b malloc0 64 512
112nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a
113nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 malloc0
114nvmf_create_transport -t tcp
115nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t tcp -a 127.0.0.1 -s 4420
116~~~
117
118and then just do:
119
120~~~bash
121scripts/rpc.py < rpc.txt
122~~~
123
124### Adding external RPC methods
125
126SPDK includes both in-tree modules as well as the ability to use external modules.  The in-tree modules include some python
127scripts to ease the process of sending RPCs to in-tree modules.  External modules can utilize this same framework to add new RPC
128methods as follows:
129
130If PYTHONPATH doesn't include the location of the external RPC python script, it should be updated:
131
132~~~bash
133export PYTHONPATH=/home/user/plugin_example/
134~~~
135
136In provided location, create python module file (e.g. rpc_plugin.py) with new RPC methods.  The file should contain
137spdk_rpc_plugin_initialize() method that will be called when the plugin is loaded to define new parsers for provided subparsers
138argument that adds new RPC calls (subparsers.add_parser()).  The new parsers should use the client.call() method to call RPC
139functions registered within the external module using the SPDK_RPC_REGISTER() macro.  Example:
140
141~~~python
142from spdk.rpc.client import print_json
143
144
145def example_create(client, num_blocks, block_size, name=None, uuid=None):
146    """Construct an example block device.
147
148    Args:
149        num_blocks: size of block device in blocks
150        block_size: block size of device; must be a power of 2 and at least 512
151        name: name of block device (optional)
152        uuid: UUID of block device (optional)
153
154    Returns:
155        Name of created block device.
156    """
157    params = {'num_blocks': num_blocks, 'block_size': block_size}
158    if name:
159        params['name'] = name
160    if uuid:
161        params['uuid'] = uuid
162    return client.call('bdev_example_create', params)
163
164
165def example_delete(client, name):
166    """Delete example block device.
167
168    Args:
169        bdev_name: name of bdev to delete
170    """
171    params = {'name': name}
172    return client.call('bdev_example_delete', params)
173
174
175def spdk_rpc_plugin_initialize(subparsers):
176    def bdev_example_create(args):
177        num_blocks = (args.total_size * 1024 * 1024) // args.block_size
178        print_json(example_create(args.client,
179                                  num_blocks=int(num_blocks),
180                                  block_size=args.block_size,
181                                  name=args.name,
182                                  uuid=args.uuid))
183
184    p = subparsers.add_parser('bdev_example_create',
185                              help='Create an example bdev')
186    p.add_argument('-b', '--name', help="Name of the bdev")
187    p.add_argument('-u', '--uuid', help="UUID of the bdev")
188    p.add_argument(
189        'total_size', help='Size of bdev in MB (float > 0)', type=float)
190    p.add_argument('block_size', help='Block size for this bdev', type=int)
191    p.set_defaults(func=bdev_example_create)
192
193    def bdev_example_delete(args):
194        example_delete(args.client,
195                      name=args.name)
196
197    p = subparsers.add_parser('bdev_example_delete',
198                              help='Delete an example disk')
199    p.add_argument('name', help='example bdev name')
200    p.set_defaults(func=bdev_example_delete)
201~~~
202
203Finally, call the rpc.py script with '--plugin' parameter to provide above python module name:
204
205~~~bash
206./scripts/rpc.py --plugin rpc_plugin bdev_example_create 10 4096
207~~~
208
209### Converting from legacy configuration {#jsonrpc_convert}
210
211Starting with SPDK 20.10, legacy configuration file support has been removed.
212Users with extensive configuration files already running in SPDK application,
213can [generate JSON-RPC for current configuration](@ref jsonrpc_generate).
214
215If binary for deploying the application is unavailable, the legacy configuration
216file can be converted to JSON-RPC using python tool:
217
218~~~bash
219./scripts/config_converter.py < config.ini > config.json
220~~~
221
222## App Framework {#jsonrpc_components_app}
223
224### spdk_kill_instance {#rpc_spdk_kill_instance}
225
226Send a signal to the application.
227
228#### Parameters
229
230Name                    | Optional | Type        | Description
231----------------------- | -------- | ----------- | -----------
232sig_name                | Required | string      | Signal to send (SIGINT, SIGTERM, SIGQUIT, SIGHUP, or SIGKILL)
233
234#### Example
235
236Example request:
237
238~~~json
239{
240  "jsonrpc": "2.0",
241  "id": 1,
242  "method": "spdk_kill_instance",
243  "params": {
244    "sig_name": "SIGINT"
245  }
246}
247~~~
248
249Example response:
250
251~~~json
252{
253  "jsonrpc": "2.0",
254  "id": 1,
255  "result": true
256}
257~~~
258
259### framework_monitor_context_switch {#rpc_framework_monitor_context_switch}
260
261Query, enable, or disable the context switch monitoring functionality.
262
263#### Parameters
264
265Name                    | Optional | Type        | Description
266----------------------- | -------- | ----------- | -----------
267enabled                 | Optional | boolean     | Enable (`true`) or disable (`false`) monitoring (omit this parameter to query the current state)
268
269#### Response
270
271Name                    | Type        | Description
272----------------------- | ----------- | -----------
273enabled                 | boolean     | The current state of context switch monitoring
274
275#### Example
276
277Example request:
278
279~~~json
280{
281  "jsonrpc": "2.0",
282  "id": 1,
283  "method": "framework_monitor_context_switch",
284  "params": {
285    "enabled": false
286  }
287}
288~~~
289
290Example response:
291
292~~~json
293{
294  "jsonrpc": "2.0",
295  "id": 1,
296  "result": {
297    "enabled": false
298  }
299}
300~~~
301
302### framework_start_init {#rpc_framework_start_init}
303
304Start initialization of SPDK subsystems when it is deferred by starting SPDK application with option -w.
305During its deferral some RPCs can be used to set global parameters for SPDK subsystems.
306This RPC can be called only once.
307
308#### Parameters
309
310This method has no parameters.
311
312#### Response
313
314Completion status of SPDK subsystem initialization is returned as a boolean.
315
316#### Example
317
318Example request:
319
320~~~json
321{
322  "jsonrpc": "2.0",
323  "id": 1,
324  "method": "framework_start_init"
325}
326~~~
327
328Example response:
329
330~~~json
331{
332  "jsonrpc": "2.0",
333  "id": 1,
334  "result": true
335}
336~~~
337
338### framework_wait_init {#rpc_framework_wait_init}
339
340Do not return until all subsystems have been initialized and the RPC system state is running.
341If the application is already running, this call will return immediately. This RPC can be called at any time.
342
343#### Parameters
344
345This method has no parameters.
346
347#### Response
348
349Returns True when subsystems have been initialized.
350
351#### Example
352
353Example request:
354
355~~~json
356{
357  "jsonrpc": "2.0",
358  "id": 1,
359  "method": "framework_wait_init"
360}
361~~~
362
363Example response:
364
365~~~json
366{
367  "jsonrpc": "2.0",
368  "id": 1,
369  "result": true
370}
371~~~
372
373### rpc_get_methods {#rpc_rpc_get_methods}
374
375Get an array of supported RPC methods.
376
377#### Parameters
378
379Name                    | Optional | Type        | Description
380----------------------- | -------- | ----------- | -----------
381current                 | Optional | boolean     | Get an array of RPC methods only callable in the current state.
382
383#### Response
384
385The response is an array of supported RPC methods.
386
387#### Example
388
389Example request:
390
391~~~json
392{
393  "jsonrpc": "2.0",
394  "id": 1,
395  "method": "rpc_get_methods"
396}
397~~~
398
399Example response:
400
401~~~json
402{
403  "jsonrpc": "2.0",
404  "id": 1,
405  "result": [
406    "framework_start_init",
407    "rpc_get_methods",
408    "scsi_get_devices",
409    "nbd_get_disks",
410    "nbd_stop_disk",
411    "nbd_start_disk",
412    "log_get_flags",
413    "log_clear_flag",
414    "log_set_flag",
415    "log_get_level",
416    "log_set_level",
417    "log_get_print_level",
418    "log_set_print_level",
419    "iscsi_get_options",
420    "iscsi_target_node_add_lun",
421    "iscsi_get_connections",
422    "iscsi_delete_portal_group",
423    "iscsi_create_portal_group",
424    "iscsi_get_portal_groups",
425    "iscsi_delete_target_node",
426    "iscsi_target_node_remove_pg_ig_maps",
427    "iscsi_target_node_add_pg_ig_maps",
428    "iscsi_create_target_node",
429    "iscsi_get_target_nodes",
430    "iscsi_delete_initiator_group",
431    "iscsi_initiator_group_remove_initiators",
432    "iscsi_initiator_group_add_initiators",
433    "iscsi_create_initiator_group",
434    "iscsi_get_initiator_groups",
435    "iscsi_set_options",
436    "bdev_set_options",
437    "bdev_set_qos_limit",
438    "bdev_get_bdevs",
439    "bdev_get_iostat",
440    "framework_get_config",
441    "framework_get_subsystems",
442    "framework_monitor_context_switch",
443    "spdk_kill_instance",
444    "accel_set_options",
445    "accel_set_driver",
446    "accel_crypto_key_create",
447    "accel_crypto_key_destroy",
448    "accel_crypto_keys_get",
449    "accel_assign_opc",
450    "accel_get_module_info",
451    "accel_get_opc_assignments",
452    "accel_error_inject_error",
453    "ioat_scan_accel_module",
454    "dsa_scan_accel_module",
455    "dpdk_cryptodev_scan_accel_module",
456    "dpdk_cryptodev_set_driver",
457    "dpdk_cryptodev_get_driver",
458    "mlx5_scan_accel_module",
459    "bdev_virtio_attach_controller",
460    "bdev_virtio_scsi_get_devices",
461    "bdev_virtio_detach_controller",
462    "bdev_virtio_blk_set_hotplug",
463    "bdev_aio_delete",
464    "bdev_aio_create",
465    "bdev_split_delete",
466    "bdev_split_create",
467    "bdev_error_inject_error",
468    "bdev_error_delete",
469    "bdev_error_create",
470    "bdev_passthru_create",
471    "bdev_passthru_delete"
472    "bdev_nvme_apply_firmware",
473    "bdev_nvme_get_transport_statistics",
474    "bdev_nvme_get_controller_health_info",
475    "bdev_nvme_detach_controller",
476    "bdev_nvme_attach_controller",
477    "bdev_null_create",
478    "bdev_malloc_delete",
479    "bdev_malloc_create",
480    "bdev_ftl_delete",
481    "bdev_ftl_unload",
482    "bdev_ftl_create",
483    "bdev_ftl_load",
484    "bdev_ftl_unmap",
485    "bdev_ftl_get_stats",
486    "bdev_ftl_get_properties",
487    "bdev_ftl_set_property",
488    "bdev_lvol_get_lvstores",
489    "bdev_lvol_delete",
490    "bdev_lvol_resize",
491    "bdev_lvol_set_read_only",
492    "bdev_lvol_decouple_parent",
493    "bdev_lvol_inflate",
494    "bdev_lvol_rename",
495    "bdev_lvol_clone",
496    "bdev_lvol_snapshot",
497    "bdev_lvol_create",
498    "bdev_lvol_delete_lvstore",
499    "bdev_lvol_rename_lvstore",
500    "bdev_lvol_create_lvstore",
501    "bdev_daos_delete",
502    "bdev_daos_create",
503    "bdev_daos_resize"
504  ]
505}
506~~~
507
508### framework_get_subsystems {#rpc_framework_get_subsystems}
509
510Get an array of name and dependency relationship of SPDK subsystems in initialization order.
511
512#### Parameters
513
514None
515
516#### Response
517
518The response is an array of name and dependency relationship of SPDK subsystems in initialization order.
519
520#### Example
521
522Example request:
523
524~~~json
525{
526  "jsonrpc": "2.0",
527  "id": 1,
528  "method": "framework_get_subsystems"
529}
530~~~
531
532Example response:
533
534~~~json
535{
536  "jsonrpc": "2.0",
537  "id": 1,
538  "result": [
539    {
540      "subsystem": "accel",
541      "depends_on": []
542    },
543    {
544      "subsystem": "interface",
545      "depends_on": []
546    },
547    {
548      "subsystem": "net_framework",
549      "depends_on": [
550        "interface"
551      ]
552    },
553    {
554      "subsystem": "bdev",
555      "depends_on": [
556        "accel"
557      ]
558    },
559    {
560      "subsystem": "nbd",
561      "depends_on": [
562        "bdev"
563      ]
564    },
565    {
566      "subsystem": "nvmf",
567      "depends_on": [
568        "bdev"
569      ]
570    },
571    {
572      "subsystem": "scsi",
573      "depends_on": [
574        "bdev"
575      ]
576    },
577    {
578      "subsystem": "vhost",
579      "depends_on": [
580        "scsi"
581      ]
582    },
583    {
584      "subsystem": "iscsi",
585      "depends_on": [
586        "scsi"
587      ]
588    }
589  ]
590}
591~~~
592
593### framework_get_config {#rpc_framework_get_config}
594
595Get current configuration of the specified SPDK framework
596
597#### Parameters
598
599Name                    | Optional | Type        | Description
600----------------------- | -------- | ----------- | -----------
601name                    | Required | string      | SPDK subsystem name
602
603#### Response
604
605The response is current configuration of the specified SPDK subsystem.
606Null is returned if it is not retrievable by the framework_get_config method and empty array is returned if it is empty.
607
608#### Example
609
610Example request:
611
612~~~json
613{
614  "jsonrpc": "2.0",
615  "id": 1,
616  "method": "framework_get_config",
617  "params": {
618    "name": "bdev"
619  }
620}
621~~~
622
623Example response:
624
625~~~json
626{
627  "jsonrpc": "2.0",
628  "id": 1,
629  "result": [
630    {
631      "params": {
632        "base_bdev": "Malloc2",
633        "split_size_mb": 0,
634        "split_count": 2
635      },
636      "method": "bdev_split_create"
637    },
638    {
639      "params": {
640        "trtype": "PCIe",
641        "name": "Nvme1",
642        "traddr": "0000:01:00.0"
643      },
644      "method": "bdev_nvme_attach_controller"
645    },
646    {
647      "params": {
648        "trtype": "PCIe",
649        "name": "Nvme2",
650        "traddr": "0000:03:00.0"
651      },
652      "method": "bdev_nvme_attach_controller"
653    },
654    {
655      "params": {
656        "block_size": 512,
657        "num_blocks": 131072,
658        "name": "Malloc0",
659        "uuid": "913fc008-79a7-447f-b2c4-c73543638c31"
660      },
661      "method": "bdev_malloc_create"
662    },
663    {
664      "params": {
665        "block_size": 512,
666        "num_blocks": 131072,
667        "name": "Malloc1",
668        "uuid": "dd5b8f6e-b67a-4506-b606-7fff5a859920"
669      },
670      "method": "bdev_malloc_create"
671    }
672  ]
673}
674~~~
675
676### framework_get_reactors {#rpc_framework_get_reactors}
677
678Retrieve an array of all reactors.
679
680#### Parameters
681
682This method has no parameters.
683
684#### Response
685
686The response is an array of all reactors.
687
688#### Example
689
690Example request:
691
692~~~json
693{
694  "jsonrpc": "2.0",
695  "method": "framework_get_reactors",
696  "id": 1
697}
698~~~
699
700Example response:
701
702~~~json
703{
704  "jsonrpc": "2.0",
705  "id": 1,
706  "result": {
707    "tick_rate": 2400000000,
708    "reactors": [
709      {
710        "lcore": 0,
711        "busy": 41289723495,
712        "idle": 3624832946,
713        "lw_threads": [
714          {
715            "name": "app_thread",
716            "id", 1,
717            "cpumask": "1",
718            "elapsed": 44910853363
719          }
720        ]
721      }
722    ]
723  }
724}
725~~~
726
727### framework_set_scheduler {#rpc_framework_set_scheduler}
728
729Select thread scheduler that will be activated.
730This feature is considered as experimental.
731
732#### Parameters
733
734Name                    | Optional | Type        | Description
735----------------------- | -------- | ----------- | -----------
736name                    | Required | string      | Name of a scheduler
737period                  | Optional | number      | Scheduler period
738load_limit              | Optional | number      | Thread load limit in % (dynamic only)
739core_limit              | Optional | number      | Load limit on the core to be considered full (dynamic only)
740core_busy               | Optional | number      | Indicates at what load on core scheduler should move threads to a different core (dynamic only)
741
742#### Response
743
744Completion status of the operation is returned as a boolean.
745
746#### Example
747
748Example request:
749
750~~~json
751{
752  "jsonrpc": "2.0",
753  "method": "framework_set_scheduler",
754  "id": 1,
755  "params": {
756    "name": "static",
757    "period": "1000000"
758  }
759}
760~~~
761
762Example response:
763
764~~~json
765{
766  "jsonrpc": "2.0",
767  "id": 1,
768  "result": true
769}
770~~~
771
772### framework_get_scheduler {#rpc_framework_get_scheduler}
773
774Retrieve currently set scheduler name and period, along with current governor name.
775
776#### Parameters
777
778This method has no parameters.
779
780#### Response
781
782Name                    | Description
783------------------------| -----------
784scheduler_name          | Current scheduler name
785scheduler_period        | Currently set scheduler period in microseconds
786governor_name           | Governor name
787
788#### Example
789
790Example request:
791
792~~~json
793{
794  "jsonrpc": "2.0",
795  "method": "framework_set_scheduler",
796  "id": 1,
797}
798~~~
799
800Example response:
801
802~~~json
803{
804  "jsonrpc": "2.0",
805  "id": 1,
806  "result": {
807    "scheduler_name": "static",
808    "scheduler_period": 2800000000,
809    "governor_name": "default"
810  }
811}
812~~~
813
814### framework_enable_cpumask_locks
815
816Enable CPU core lock files to block multiple SPDK applications from running on the same cpumask.
817The CPU core locks are enabled by default, unless user specified `--disable-cpumask-locks` command
818line option when launching SPDK.
819
820This RPC may be called after locks have already been enabled, with no effect and no error response.
821
822#### Parameters
823
824This method has no parameters.
825
826#### Response
827
828true on success
829
830#### Example
831
832Example request:
833
834~~~json
835{
836  "jsonrpc": "2.0",
837  "id": 1,
838  "method": "framework_enable_cpumask_locks"
839}
840~~~
841
842Example response:
843
844~~~json
845{
846  "jsonrpc": "2.0",
847  "id": 1,
848  "result": true
849}
850~~~
851
852### framework_disable_cpumask_locks
853
854Disable CPU core lock files. The locks can also be disabled during startup, when
855user specifies `--disable-cpumask-locks` command line option during SPDK launch.
856
857This RPC may be called after locks have already been disabled, with no effect and no error
858response.
859
860#### Parameters
861
862This method has no parameters.
863
864#### Response
865
866true on success
867
868#### Example
869
870Example request:
871
872~~~json
873{
874  "jsonrpc": "2.0",
875  "id": 1,
876  "method": "framework_disable_cpumask_locks"
877}
878~~~
879
880Example response:
881
882~~~json
883{
884  "jsonrpc": "2.0",
885  "id": 1,
886  "result": true
887}
888~~~
889
890### thread_get_stats {#rpc_thread_get_stats}
891
892Retrieve current statistics of all the threads.
893
894#### Parameters
895
896This method has no parameters.
897
898#### Response
899
900The response is an array of objects containing threads statistics.
901
902#### Example
903
904Example request:
905
906~~~json
907{
908  "jsonrpc": "2.0",
909  "method": "thread_get_stats",
910  "id": 1
911}
912~~~
913
914Example response:
915
916~~~json
917{
918  "jsonrpc": "2.0",
919  "id": 1,
920  "result": {
921    "tick_rate": 2400000000,
922    "threads": [
923      {
924        "name": "app_thread",
925        "id": 1,
926	"cpumask": "1",
927        "busy": 139223208,
928        "idle": 8641080608,
929        "in_interrupt": false,
930        "active_pollers_count": 1,
931        "timed_pollers_count": 2,
932        "paused_pollers_count": 0
933      }
934    ]
935  }
936}
937~~~
938
939### thread_set_cpumask {#rpc_thread_set_cpumask}
940
941Set the cpumask of the thread to the specified value. The thread may be migrated
942to one of the specified CPUs.
943
944#### Parameters
945
946Name                    | Optional | Type        | Description
947----------------------- | -------- | ----------- | -----------
948id                      | Required | string      | Thread ID
949cpumask                 | Required | string      | Cpumask for this thread
950
951#### Response
952
953Completion status of the operation is returned as a boolean.
954
955#### Example
956
957Example request:
958
959~~~json
960{
961  "jsonrpc": "2.0",
962  "method": "thread_set_cpumask",
963  "id": 1,
964  "params": {
965    "id": "1",
966    "cpumask": "1"
967  }
968}
969~~~
970
971Example response:
972
973~~~json
974{
975  "jsonrpc": "2.0",
976  "id": 1,
977  "result": true
978}
979~~~
980
981### trace_enable_tpoint_group {#rpc_trace_enable_tpoint_group}
982
983Enable trace on a specific tpoint group. For example "bdev" for bdev trace group,
984"all" for all trace groups.
985
986#### Parameters
987
988Name                    | Optional | Type        | Description
989----------------------- | -------- | ----------- | -----------
990name                    | Required | string      | bdev, nvmf_rdma, nvmf_tcp, blobfs, scsi, iscsi_conn, ftl, all
991
992#### Example
993
994Example request:
995
996~~~json
997{
998  "jsonrpc": "2.0",
999  "method": "trace_enable_tpoint_group",
1000  "id": 1,
1001  "params": {
1002    "name": "bdev"
1003  }
1004}
1005~~~
1006
1007Example response:
1008
1009~~~json
1010{
1011  "jsonrpc": "2.0",
1012  "id": 1,
1013  "result": true
1014}
1015~~~
1016
1017### trace_disable_tpoint_group {#rpc_trace_disable_tpoint_group}
1018
1019Disable trace on a specific tpoint group. For example "bdev" for bdev trace group,
1020"all" for all trace groups.
1021
1022#### Parameters
1023
1024Name                    | Optional | Type        | Description
1025----------------------- | -------- | ----------- | -----------
1026name                    | Required | string      | bdev, nvmf_rdma, nvmf_tcp, blobfs, all
1027
1028#### Example
1029
1030Example request:
1031
1032~~~json
1033{
1034  "jsonrpc": "2.0",
1035  "method": "trace_disable_tpoint_group",
1036  "id": 1,
1037  "params": {
1038    "name": "bdev"
1039  }
1040}
1041~~~
1042
1043Example response:
1044
1045~~~json
1046{
1047  "jsonrpc": "2.0",
1048  "id": 1,
1049  "result": true
1050}
1051~~~
1052
1053### trace_set_tpoint_mask {#rpc_trace_set_tpoint_mask}
1054
1055Enable tracepoint mask on a specific tpoint group. For example "bdev" for bdev trace group,
1056and 0x1 to enable the first tracepoint inside the group (BDEV_IO_START). This command will not
1057disable already active tracepoints or those not specified in the mask. For a full description
1058of all available trace groups, see
1059[tracepoint documentation](https://spdk.io/doc/nvmf_tgt_tracepoints.html).
1060
1061#### Parameters
1062
1063Name                    | Optional | Type        | Description
1064----------------------- | -------- | ----------- | -----------
1065name                    | Required | string      | bdev, nvmf_rdma, nvmf_tcp, blobfs, scsi, iscsi_conn, ftl
1066tpoint_mask             | Required | number      | mask to enable tracepoints inside a group
1067
1068#### Example
1069
1070Example request:
1071
1072~~~json
1073{
1074  "jsonrpc": "2.0",
1075  "method": "trace_set_tpoint_mask",
1076  "id": 1,
1077  "params": {
1078    "name": "bdev",
1079    "tpoint_mask": 0x1
1080  }
1081}
1082~~~
1083
1084Example response:
1085
1086~~~json
1087{
1088  "jsonrpc": "2.0",
1089  "id": 1,
1090  "result": true
1091}
1092~~~
1093
1094### trace_clear_tpoint_mask {#rpc_trace_clear_tpoint_mask}
1095
1096Disable tracepoint mask on a specific tpoint group. For example "bdev" for bdev trace group,
1097and 0x1 to disable the first tracepoint inside the group (BDEV_IO_START). For a full description
1098of all available trace groups, see
1099[tracepoint documentation](https://spdk.io/doc/nvmf_tgt_tracepoints.html).
1100
1101#### Parameters
1102
1103Name                    | Optional | Type        | Description
1104----------------------- | -------- | ----------- | -----------
1105name                    | Required | string      | bdev, nvmf_rdma, nvmf_tcp, blobfs, scsi, iscsi_conn, ftl
1106tpoint_mask             | Required | number      | mask to diesable tracepoints inside a group
1107
1108#### Example
1109
1110Example request:
1111
1112~~~json
1113{
1114  "jsonrpc": "2.0",
1115  "method": "trace_clear_tpoint_mask",
1116  "id": 1,
1117  "params": {
1118    "name": "bdev",
1119    "tpoint_mask": 0x1
1120  }
1121}
1122~~~
1123
1124Example response:
1125
1126~~~json
1127{
1128  "jsonrpc": "2.0",
1129  "id": 1,
1130  "result": true
1131}
1132~~~
1133
1134### trace_get_tpoint_group_mask {#rpc_trace_get_tpoint_group_mask}
1135
1136Display mask info for every group.
1137
1138#### Parameters
1139
1140No parameters required
1141
1142#### Example
1143
1144Example request:
1145
1146~~~json
1147{
1148  "jsonrpc": "2.0",
1149  "method": "trace_get_tpoint_group_mask",
1150  "id": 1
1151}
1152~~~
1153
1154Example response:
1155
1156~~~json
1157{
1158  "jsonrpc": "2.0",
1159  "id": 1,
1160  "result": {
1161    "tpoint_group_mask": "0x0",
1162  "iscsi_conn": {
1163    "enabled": false,
1164    "mask": "0x2"
1165  },
1166  "scsi": {
1167    "enabled": false,
1168    "mask": "0x4"
1169  },
1170  "bdev": {
1171    "enabled": false,
1172    "mask": "0x8"
1173  },
1174  "nvmf_tcp": {
1175    "enabled": false,
1176    "mask": "0x20"
1177  },
1178  "ftl": {
1179    "enabled": false,
1180    "mask": "0x40"
1181  },
1182  "blobfs": {
1183    "enabled": false,
1184    "mask": "0x80"
1185    }
1186  }
1187}
1188~~~
1189
1190### trace_get_info {#rpc_trace_get_info}
1191
1192Get name of shared memory file, list of the available trace point groups
1193and mask of the available trace points for each group
1194
1195#### Parameters
1196
1197No parameters required
1198
1199#### Example
1200
1201Example request:
1202
1203~~~json
1204{
1205  "jsonrpc": "2.0",
1206  "method": "trace_get_info",
1207  "id": 1
1208}
1209~~~
1210
1211Example response:
1212
1213~~~json
1214{
1215  "jsonrpc": "2.0",
1216  "id": 1,
1217  "result": {
1218    "tpoint_shm_path": "/dev/shm/spdk_tgt_trace.pid3071944",
1219    "tpoint_group_mask": "0x8",
1220    "iscsi_conn": {
1221      "mask": "0x2",
1222      "tpoint_mask": "0x0"
1223    },
1224    "scsi": {
1225      "mask": "0x4",
1226      "tpoint_mask": "0x0"
1227    },
1228    "bdev": {
1229      "mask": "0x8",
1230      "tpoint_mask": "0xffffffffffffffff"
1231    },
1232    "nvmf_tcp": {
1233      "mask": "0x20",
1234      "tpoint_mask": "0x0"
1235    },
1236    "blobfs": {
1237      "mask": "0x80",
1238      "tpoint_mask": "0x0"
1239    },
1240    "thread": {
1241      "mask": "0x400",
1242      "tpoint_mask": "0x0"
1243    },
1244    "nvme_pcie": {
1245      "mask": "0x800",
1246      "tpoint_mask": "0x0"
1247    },
1248    "nvme_tcp": {
1249      "mask": "0x2000",
1250      "tpoint_mask": "0x0"
1251    },
1252    "bdev_nvme": {
1253      "mask": "0x4000",
1254      "tpoint_mask": "0x0"
1255    }
1256  }
1257}
1258~~~
1259
1260### log_set_print_level {#rpc_log_set_print_level}
1261
1262Set the current level at which output will additionally be
1263sent to the current console.
1264
1265#### Parameters
1266
1267Name                    | Optional | Type        | Description
1268----------------------- | -------- | ----------- | -----------
1269level                   | Required | string      | ERROR, WARNING, NOTICE, INFO, DEBUG
1270
1271#### Example
1272
1273Example request:
1274
1275~~~json
1276{
1277  "jsonrpc": "2.0",
1278  "method": "log_set_print_level",
1279  "id": 1,
1280  "params": {
1281    "level": "ERROR"
1282  }
1283}
1284~~~
1285
1286Example response:
1287
1288~~~json
1289{
1290  "jsonrpc": "2.0",
1291  "id": 1,
1292  "result": true
1293}
1294~~~
1295
1296### log_get_print_level {#rpc_log_get_print_level}
1297
1298Get the current level at which output will additionally be
1299sent to the current console.
1300
1301#### Example
1302
1303Example request:
1304
1305~~~json
1306{
1307  "jsonrpc": "2.0",
1308  "method": "log_get_print_level",
1309  "id": 1,
1310}
1311~~~
1312
1313Example response:
1314
1315~~~json
1316{
1317  "jsonrpc": "2.0",
1318  "id": 1,
1319  "result": "NOTICE"
1320}
1321~~~
1322
1323### log_set_level {#rpc_log_set_level}
1324
1325Set the current logging level output by the `log` module.
1326
1327#### Parameters
1328
1329Name                    | Optional | Type        | Description
1330----------------------- | -------- | ----------- | -----------
1331level                   | Required | string      | ERROR, WARNING, NOTICE, INFO, DEBUG
1332
1333#### Example
1334
1335Example request:
1336
1337~~~json
1338{
1339  "jsonrpc": "2.0",
1340  "method": "log_set_level",
1341  "id": 1,
1342  "params": {
1343    "level": "ERROR"
1344  }
1345}
1346~~~
1347
1348Example response:
1349
1350~~~json
1351{
1352  "jsonrpc": "2.0",
1353  "id": 1,
1354  "result": true
1355}
1356~~~
1357
1358### log_get_level {#rpc_log_get_level}
1359
1360Get the current logging level output by the `log` module.
1361
1362#### Example
1363
1364Example request:
1365
1366~~~json
1367{
1368  "jsonrpc": "2.0",
1369  "method": "log_get_level",
1370  "id": 1,
1371}
1372~~~
1373
1374Example response:
1375
1376~~~json
1377{
1378  "jsonrpc": "2.0",
1379  "id": 1,
1380  "result": "NOTICE"
1381}
1382~~~
1383
1384### log_set_flag {#rpc_log_set_flag}
1385
1386Enable logging for specific portions of the application. The list of possible
1387log flags can be obtained using the `log_get_flags` RPC and may be different
1388for each application.
1389
1390#### Parameters
1391
1392Name                    | Optional | Type        | Description
1393----------------------- | -------- | ----------- | -----------
1394flag                    | Required | string      | A log flag, or 'all'
1395
1396#### Example
1397
1398Example request:
1399
1400~~~json
1401{
1402  "jsonrpc": "2.0",
1403  "method": "log_set_flag",
1404  "id": 1,
1405  "params": {
1406    "flag": "all"
1407  }
1408}
1409~~~
1410
1411Example response:
1412
1413~~~json
1414{
1415  "jsonrpc": "2.0",
1416  "id": 1,
1417  "result": true
1418}
1419~~~
1420
1421### log_clear_flag {#rpc_log_clear_flag}
1422
1423Disable logging for specific portions of the application. The list of possible
1424log flags can be obtained using the `log_get_flags` RPC and may be different
1425for each application.
1426
1427#### Parameters
1428
1429Name                    | Optional | Type        | Description
1430----------------------- | -------- | ----------- | -----------
1431flag                    | Required | string      | A log flag, or 'all'
1432
1433#### Example
1434
1435Example request:
1436
1437~~~json
1438{
1439  "jsonrpc": "2.0",
1440  "method": "log_clear_flag",
1441  "id": 1,
1442  "params": {
1443    "flag": "all"
1444  }
1445}
1446~~~
1447
1448Example response:
1449
1450~~~json
1451{
1452  "jsonrpc": "2.0",
1453  "id": 1,
1454  "result": true
1455}
1456~~~
1457
1458### log_get_flags {#rpc_log_get_flags}
1459
1460Get the list of valid flags for this application and whether
1461they are currently enabled.
1462
1463#### Example
1464
1465Example request:
1466
1467~~~json
1468{
1469  "jsonrpc": "2.0",
1470  "method": "log_get_flags",
1471  "id": 1,
1472}
1473~~~
1474
1475Example response:
1476
1477~~~json
1478{
1479  "jsonrpc": "2.0",
1480  "id": 1,
1481  "result": {
1482    "nvmf": true,
1483    "nvme": true,
1484    "aio": false,
1485    "bdev" false
1486  }
1487}
1488~~~
1489
1490### log_enable_timestamps {#rpc_log_enable_timestamps}
1491
1492Enable or disable timestamps.
1493
1494#### Parameters
1495
1496Name                    | Optional | Type        | Description
1497----------------------- | -------- | ----------- | -----------
1498enabled                 | Required | boolean     | on or off
1499
1500#### Example
1501
1502Example request:
1503
1504~~~json
1505{
1506  "jsonrpc": "2.0",
1507  "method": "log_enable_timestamps",
1508  "id": 1,
1509  "params": {
1510    "enabled": true
1511  }
1512}
1513~~~
1514
1515Example response:
1516
1517~~~json
1518{
1519  "jsonrpc": "2.0",
1520  "id": 1,
1521  "result": true
1522}
1523~~~
1524
1525### thread_get_pollers {#rpc_thread_get_pollers}
1526
1527Retrieve current pollers of all the threads.
1528
1529#### Parameters
1530
1531This method has no parameters.
1532
1533### Response
1534
1535The response is an array of objects containing pollers of all the threads.
1536
1537#### Example
1538
1539Example request:
1540
1541~~~json
1542{
1543  "jsonrpc": "2.0",
1544  "method": "thread_get_pollers",
1545  "id": 1
1546}
1547~~~
1548
1549Example response:
1550
1551~~~json
1552{
1553  "jsonrpc": "2.0",
1554  "id": 1,
1555  "result": {
1556    "tick_rate": 2500000000,
1557    "threads": [
1558      {
1559        "name": "app_thread",
1560        "id": 1,
1561        "active_pollers": [],
1562        "timed_pollers": [
1563          {
1564            "name": "spdk_rpc_subsystem_poll",
1565            "id": 1,
1566            "state": "waiting",
1567            "run_count": 12345,
1568            "busy_count": 10000,
1569            "period_ticks": 10000000
1570          }
1571        ],
1572        "paused_pollers": []
1573      }
1574    ]
1575  }
1576}
1577~~~
1578
1579### thread_get_io_channels {#rpc_thread_get_io_channels}
1580
1581Retrieve current IO channels of all the threads.
1582
1583#### Parameters
1584
1585This method has no parameters.
1586
1587#### Response
1588
1589The response is an array of objects containing IO channels of all the threads.
1590
1591#### Example
1592
1593Example request:
1594
1595~~~json
1596{
1597  "jsonrpc": "2.0",
1598  "method": "thread_get_io_channels",
1599  "id": 1
1600}
1601~~~
1602
1603Example response:
1604
1605~~~json
1606{
1607  "jsonrpc": "2.0",
1608  "id": 1,
1609  "result": {
1610    "tick_rate": 2500000000,
1611    "threads": [
1612      {
1613        "name": "app_thread",
1614        "io_channels": [
1615          {
1616            "name": "nvmf_tgt",
1617            "ref": 1
1618          }
1619        ]
1620      }
1621    ]
1622  }
1623}
1624~~~
1625
1626### env_dpdk_get_mem_stats {#rpc_env_dpdk_get_mem_stats}
1627
1628Write the dpdk memory stats to a file.
1629
1630#### Parameters
1631
1632This method has no parameters.
1633
1634#### Response
1635
1636The response is a pathname to a text file containing the memory stats.
1637
1638#### Example
1639
1640Example request:
1641
1642~~~json
1643{
1644  "jsonrpc": "2.0",
1645  "method": "env_dpdk_get_mem_stats",
1646  "id": 1
1647}
1648~~~
1649
1650Example response:
1651
1652~~~json
1653{
1654  "jsonrpc": "2.0",
1655  "id": 1,
1656  "result": {
1657    "filename": "/tmp/spdk_mem_dump.txt"
1658  }
1659}
1660~~~
1661
1662## Acceleration Framework Layer {#jsonrpc_components_accel_fw}
1663
1664### accel_get_module_info {#accel_get_module_info}
1665
1666Get a list of valid module names and their supported operations.
1667
1668#### Parameters
1669
1670None
1671
1672#### Example
1673
1674Example request:
1675
1676~~~json
1677{
1678  "jsonrpc": "2.0",
1679  "method": "accel_get_module_info",
1680  "id": 1
1681}
1682~~~
1683
1684Example response:
1685
1686~~~json
1687[
1688  {
1689    "module": "software",
1690    "supported ops": [
1691      "copy",
1692      "fill",
1693      "dualcast",
1694      "compare",
1695      "crc32c",
1696      "copy_crc32c",
1697      "compress",
1698      "decompress"
1699    ]
1700  },
1701  {
1702    "module": "dsa",
1703    "supported ops": [
1704      "copy",
1705      "fill",
1706      "dualcast",
1707      "compare",
1708      "crc32c",
1709      "copy_crc32c"
1710    ]
1711  }
1712]
1713~~~
1714
1715### accel_get_opc_assignments {#rpc_accel_get_opc_assignments}
1716
1717Get a list of opcode names and their assigned accel_fw modules.
1718
1719#### Parameters
1720
1721None
1722
1723#### Example
1724
1725Example request:
1726
1727~~~json
1728{
1729  "jsonrpc": "2.0",
1730  "method": "accel_get_opc_assignments",
1731  "id": 1
1732}
1733~~~
1734
1735Example response:
1736
1737~~~json
1738{
1739  "jsonrpc": "2.0",
1740  "id": 1,
1741  "result": [
1742    {
1743      "copy": "software",
1744      "fill": "software",
1745      "dualcast": "software",
1746      "compare": "software",
1747      "crc32c": "software",
1748      "copy_crc32c": "software",
1749      "compress": "software",
1750      "decompress": "software"
1751    }
1752  ]
1753}
1754~~~
1755
1756### accel_assign_opc {#rpc_accel_assign_opc}
1757
1758Manually assign an operation to a module.
1759
1760#### Parameters
1761
1762Name                    | Optional | Type        | Description
1763----------------------- | -------- | ----------- | -----------------
1764opname                  | Required | string      | name of operation
1765module                  | Required | string      | name of module
1766
1767#### Example
1768
1769Example request:
1770
1771~~~json
1772{
1773  "jsonrpc": "2.0",
1774  "method": "accel_assign_opc",
1775  "id": 1,
1776  "params": {
1777    "opname": "copy",
1778    "module": "software"
1779  }
1780}
1781~~~
1782
1783Example response:
1784
1785~~~json
1786{
1787  "jsonrpc": "2.0",
1788  "id": 1,
1789  "result": true
1790}
1791~~~
1792
1793### accel_crypto_key_create {#rpc_accel_crypto_key_create}
1794
1795Create a crypto key which will be used in accel framework
1796
1797#### Parameters
1798
1799Name       | Optional | Type        | Description
1800-----------|----------| ----------- | -----------------
1801cipher     | Required | string      | crypto cipher to use
1802key        | Required | string      | Key in **hex** form
1803key2       | Optional | string      | Optional 2nd part of the key or a tweak in **hex** form
1804tweak_mode | Optional | string      | Tweak mode to use: SIMPLE_LBA, JOIN_NEG_LBA_WITH_LBA, INCR_512_FULL_LBA, INCR_512_UPPER_LBA. Default is SIMPLE_LBA
1805name       | Required | string      | The key name
1806
1807#### Example
1808
1809Example request:
1810
1811~~~json
1812{
1813  "jsonrpc": "2.0",
1814  "method": "accel_crypto_key_create",
1815  "id": 1,
1816  "params": {
1817    "cipher": "AES_XTS",
1818    "key": "00112233445566778899001122334455",
1819    "key2": "00112233445566778899001122334455",
1820    "tweak_mode": "SIMPLE_LBA",
1821    "name": "super_key"
1822  }
1823}
1824~~~
1825
1826Example response:
1827
1828~~~json
1829{
1830  "jsonrpc": "2.0",
1831  "id": 1,
1832  "result": true
1833}
1834~~~
1835
1836### accel_crypto_key_destroy {#rpc_accel_crypto_key_destroy}
1837
1838Destroy a crypto key. The user is responsible for ensuring that the deleted key is not used by acceleration modules.
1839
1840#### Parameters
1841
1842Name       | Optional | Type        | Description
1843-----------|----------| ----------- | -----------------
1844name       | Required | string      | The key name
1845
1846#### Example
1847
1848Example request:
1849
1850~~~json
1851{
1852  "jsonrpc": "2.0",
1853  "method": "accel_crypto_key_destroy",
1854  "id": 1,
1855  "params": {
1856    "name": "super_key"
1857  }
1858}
1859~~~
1860
1861Example response:
1862
1863~~~json
1864{
1865  "jsonrpc": "2.0",
1866  "id": 1,
1867  "result": true
1868}
1869~~~
1870
1871### accel_crypto_keys_get {#rpc_accel_crypto_keys_get}
1872
1873Get information about existing crypto keys
1874
1875#### Parameters
1876
1877Name                    | Optional | Type        | Description
1878----------------------- |----------| ----------- | -----------------
1879key_name                | Optional | string      | If specified, return info about a specific key
1880
1881#### Example
1882
1883Example request:
1884
1885~~~json
1886{
1887  "jsonrpc": "2.0",
1888  "method": "accel_crypto_keys_get",
1889  "id": 1
1890}
1891~~~
1892
1893Example response:
1894
1895~~~json
1896{
1897  "jsonrpc": "2.0",
1898  "id": 1,
1899  "result": [
1900    {
1901      "name": "test_dek",
1902      "cipher": "AES_XTS",
1903      "key": "00112233445566778899001122334455",
1904      "key2": "11223344556677889900112233445500",
1905      "tweak_mode": "SIMPLE_LBA"
1906    },
1907    {
1908      "name": "test_dek2",
1909      "cipher": "AES_XTS",
1910      "key": "11223344556677889900112233445500",
1911      "key2": "22334455667788990011223344550011",
1912      "tweak_mode": "SIMPLE_LBA"
1913    }
1914  ]
1915}
1916~~~
1917
1918### accel_set_driver {#rpc_accel_set_driver}
1919
1920Select platform driver to execute operation chains.  Until a driver is selected, all operations are
1921executed through accel modules.
1922
1923#### Parameters
1924
1925Name                    | Optional | Type        | Description
1926----------------------- |----------| ----------- | -----------------
1927name                    | Required | string      | Name of the platform driver
1928
1929#### Example
1930
1931Example request:
1932
1933~~~json
1934{
1935  "jsonrpc": "2.0",
1936  "method": "accel_set_driver",
1937  "id": 1
1938  "params": {
1939    "name": "xeon"
1940  }
1941}
1942~~~
1943
1944Example response:
1945
1946~~~json
1947{
1948  "jsonrpc": "2.0",
1949  "id": 1,
1950  "result": true
1951}
1952~~~
1953
1954### accel_set_options {#rpc_accel_set_options}
1955
1956Set accel framework's options.
1957
1958#### Parameters
1959
1960Name                    | Optional | Type        | Description
1961----------------------- |----------| ----------- | -----------------
1962small_cache_size        | Optional | number      | Size of the small iobuf cache
1963large_cache_size        | Optional | number      | Size of the large iobuf cache
1964task_count              | Optional | number      | Maximum number of tasks per IO channel
1965sequence_count          | Optional | number      | Maximum number of sequences per IO channel
1966buf_count               | Optional | number      | Maximum number of accel buffers per IO channel
1967
1968#### Example
1969
1970Example request:
1971
1972~~~json
1973{
1974  "jsonrpc": "2.0",
1975  "method": "accel_set_options",
1976  "id": 1,
1977  "params": {
1978    "small_cache_size": 128,
1979    "large_cache_size": 32
1980  }
1981}
1982~~~
1983
1984Example response:
1985
1986~~~json
1987{
1988  "jsonrpc": "2.0",
1989  "id": 1,
1990  "result": true
1991}
1992~~~
1993
1994### accel_get_stats {#rpc_accel_get_stats}
1995
1996Retrieve accel framework's statistics.  Statistics for opcodes that have never been executed (i.e.
1997all their stats are at 0) aren't included in the `operations` array.
1998
1999#### Parameters
2000
2001None.
2002
2003#### Example
2004
2005Example request:
2006
2007~~~json
2008{
2009  "jsonrpc": "2.0",
2010  "method": "accel_get_stats",
2011  "id": 1
2012}
2013~~~
2014
2015Example response:
2016
2017~~~json
2018{
2019  "jsonrpc": "2.0",
2020  "id": 1,
2021  "result": {
2022    "sequence_executed": 256,
2023    "sequence_failed": 0,
2024    "operations": [
2025      {
2026        "opcode": "copy",
2027        "executed": 256,
2028        "failed": 0
2029      },
2030      {
2031        "opcode": "encrypt",
2032        "executed": 128,
2033        "failed": 0
2034      },
2035      {
2036        "opcode": "decrypt",
2037        "executed": 128,
2038        "failed": 0
2039      }
2040    ]
2041  }
2042}
2043~~~
2044
2045### accel_error_inject_error {#rpc_accel_error_inject_error}
2046
2047Inject an error to execution of a given operation.  Note, that in order for the errors to be
2048actually injected, the error module must be assigned to that operation via `accel_assign_opc`.
2049
2050#### Parameters
2051
2052Name                    | Optional | Type        | Description
2053----------------------- |----------| ----------- | -----------------
2054opcode                  | Required | string      | Operation to inject errors.
2055type                    | Required | string      | Type of errors to inject ("corrupt": corrupt the data, "failure": fail the operation, "disable": disable error injection).
2056count                   | Optional | number      | Numbers of errors to inject on each IO channel (`UINT64_MAX` by default).
2057interval                | Optional | number      | Interval between injections.
2058errcode                 | Optional | number      | Error code to inject (only relevant for type=failure).
2059
2060#### Example
2061
2062Example request:
2063
2064~~~json
2065{
2066  "method": "accel_error_inject_error",
2067  "params": {
2068    "opcode": "crc32c",
2069    "type": "corrupt",
2070    "count": 10000,
2071    "interval": 8
2072  }
2073}
2074~~~
2075
2076Example response:
2077
2078~~~json
2079{
2080  "jsonrpc": "2.0",
2081  "id": 1,
2082  "result": true
2083}
2084~~~
2085
2086### compressdev_scan_accel_module {#rpc_compressdev_scan_accel_module}
2087
2088Set config and enable compressdev accel module offload.
2089Select the DPDK polled mode driver (pmd) for the accel compress module,
20900 = auto-select, 1= QAT only, 2 = mlx5_pci only.
2091
2092#### Parameters
2093
2094Name                    | Optional | Type        | Description
2095----------------------- | -------- | ----------- | -----------
2096pmd                     | Required | int         | pmd selection
2097
2098#### Example
2099
2100Example request:
2101
2102~~~json
2103{
2104  "params": {
2105    "pmd": 1
2106  },
2107  "jsonrpc": "2.0",
2108  "method": "compressdev_scan_accel_module",
2109  "id": 1
2110}
2111~~~
2112
2113Example response:
2114
2115~~~json
2116{
2117  "jsonrpc": "2.0",
2118  "id": 1,
2119  "result": true
2120}
2121~~~
2122
2123### dsa_scan_accel_module {#rpc_dsa_scan_accel_module}
2124
2125Set config and enable dsa accel module offload.
2126This feature is considered as experimental.
2127
2128#### Parameters
2129
2130Name                    | Optional | Type        | Description
2131----------------------- | -------- | ----------- | -----------
2132config_kernel_mode      | Optional | Boolean     | If set, will use kernel idxd driver.
2133
2134#### Example
2135
2136Example request:
2137
2138~~~json
2139{
2140  "params": {
2141    "config_kernel_mode": false
2142  },
2143  "jsonrpc": "2.0",
2144  "method": "dsa_scan_accel_module",
2145  "id": 1
2146}
2147~~~
2148
2149Example response:
2150
2151~~~json
2152{
2153  "jsonrpc": "2.0",
2154  "id": 1,
2155  "result": true
2156}
2157~~~
2158
2159### iaa_scan_accel_module {#rpc_iaa_scan_accel_module}
2160
2161Enable IAA accel module offload.
2162This feature is considered as experimental.
2163
2164#### Parameters
2165
2166None
2167
2168#### Example
2169
2170Example request:
2171
2172~~~json
2173{
2174  "jsonrpc": "2.0",
2175  "method": "iaa_scan_accel_module",
2176  "id": 1
2177}
2178~~~
2179
2180Example response:
2181
2182~~~json
2183{
2184  "jsonrpc": "2.0",
2185  "id": 1,
2186  "result": true
2187}
2188~~~
2189
2190### ioat_scan_accel_module {#rpc_ioat_scan_accel_module}
2191
2192Enable ioat accel module offload.
2193
2194#### Parameters
2195
2196None
2197
2198#### Example
2199
2200Example request:
2201
2202~~~json
2203{
2204  "jsonrpc": "2.0",
2205  "method": "ioat_scan_accel_module",
2206  "id": 1
2207}
2208~~~
2209
2210Example response:
2211
2212~~~json
2213{
2214  "jsonrpc": "2.0",
2215  "id": 1,
2216  "result": true
2217}
2218~~~
2219
2220### dpdk_cryptodev_scan_accel_module {#rpc_dpdk_cryptodev_scan_accel_module}
2221
2222Enable dpdk_cryptodev accel offload
2223
2224#### Parameters
2225
2226None
2227
2228#### Example
2229
2230Example request:
2231
2232~~~json
2233{
2234  "jsonrpc": "2.0",
2235  "method": "dpdk_cryptodev_scan_accel_module",
2236  "id": 1
2237}
2238~~~
2239
2240Example response:
2241
2242~~~json
2243{
2244  "jsonrpc": "2.0",
2245  "id": 1,
2246  "result": true
2247}
2248~~~
2249
2250### dpdk_cryptodev_set_driver {#rpc_dpdk_cryptodev_set_driver}
2251
2252Set the DPDK cryptodev driver
2253
2254#### Parameters
2255
2256Name                    | Optional | Type   | Description
2257----------------------- |----------|--------| -----------
2258crypto_pmd              | Required | string | The driver, can be one of crypto_aesni_mb, crypto_qat or mlx5_pci
2259
2260#### Example
2261
2262Example request:
2263
2264~~~json
2265{
2266  "jsonrpc": "2.0",
2267  "method": "dpdk_cryptodev_set_driver",
2268  "id": 1,
2269  "params": {
2270    "crypto_pmd": "crypto_aesni_mb"
2271  }
2272}
2273~~~
2274
2275Example response:
2276
2277~~~json
2278{
2279  "jsonrpc": "2.0",
2280  "id": 1,
2281  "result": true
2282}
2283~~~
2284
2285### dpdk_cryptodev_get_driver {#rpc_dpdk_cryptodev_get_driver}
2286
2287Get the DPDK cryptodev driver
2288
2289#### Parameters
2290
2291None
2292
2293#### Example
2294
2295Example request:
2296
2297~~~json
2298{
2299  "jsonrpc": "2.0",
2300  "method": "dpdk_cryptodev_get_driver",
2301  "id": 1
2302}
2303~~~
2304
2305Example response:
2306
2307~~~json
2308{
2309  "jsonrpc": "2.0",
2310  "id": 1,
2311  "result": "crypto_aesni_mb"
2312}
2313~~~
2314
2315### mlx5_scan_accel_module {#rpc_mlx5_scan_accel_module}
2316
2317Enable mlx5 accel offload
2318
2319#### Parameters
2320
2321Name                    | Optional | Type   | Description
2322----------------------- | -------- |--------| -----------
2323qp_size                 | Optional | number | qpair size
2324num_requests            | Optional | number | Size of the shared requests pool
2325
2326#### Example
2327
2328Example request:
2329
2330~~~json
2331{
2332  "jsonrpc": "2.0",
2333  "method": "mlx5_scan_accel_module",
2334  "id": 1,
2335  "params": {
2336    "qp_size": 256,
2337    "num_requests": 2047
2338  }
2339}
2340~~~
2341
2342Example response:
2343
2344~~~json
2345{
2346  "jsonrpc": "2.0",
2347  "id": 1,
2348  "result": true
2349}
2350~~~
2351
2352## Block Device Abstraction Layer {#jsonrpc_components_bdev}
2353
2354### bdev_set_options {#rpc_bdev_set_options}
2355
2356Set global parameters for the block device (bdev) subsystem.  This RPC may only be called
2357before SPDK subsystems have been initialized.
2358
2359#### Parameters
2360
2361Name                    | Optional | Type        | Description
2362----------------------- | -------- | ----------- | -----------
2363bdev_io_pool_size       | Optional | number      | Number of spdk_bdev_io structures in shared buffer pool
2364bdev_io_cache_size      | Optional | number      | Maximum number of spdk_bdev_io structures cached per thread
2365bdev_auto_examine       | Optional | boolean     | If set to false, the bdev layer will not examine every disks automatically
2366iobuf_small_cache_size  | Optional | number      | Size of the small iobuf per thread cache
2367iobuf_large_cache_size  | Optional | number      | Size of the large iobuf per thread cache
2368
2369#### Example
2370
2371Example request:
2372
2373~~~json
2374{
2375  "jsonrpc": "2.0",
2376  "id": 1,
2377  "method": "bdev_set_options",
2378  "params": {
2379    "bdev_io_pool_size": 65536,
2380    "bdev_io_cache_size": 256
2381  }
2382}
2383~~~
2384
2385Example response:
2386
2387~~~json
2388{
2389  "jsonrpc": "2.0",
2390  "id": 1,
2391  "result": true
2392}
2393~~~
2394
2395### bdev_get_bdevs {#rpc_bdev_get_bdevs}
2396
2397Get information about block devices (bdevs).
2398
2399#### Parameters
2400
2401The user may specify no parameters in order to list all block devices, or a block device may be
2402specified by name.  If a timeout is specified, the method will block until a bdev with a specified
2403name appears or the timeout expires.  By default, the timeout is zero, meaning the method returns
2404immediately whether the bdev exists or not.
2405
2406Name                    | Optional | Type        | Description
2407----------------------- | -------- | ----------- | -----------
2408name                    | Optional | string      | Block device name
2409timeout                 | Optional | number      | Time (ms) to wait for a bdev with specified name to appear
2410
2411#### Response
2412
2413The response is an array of objects containing information about the requested block devices.
2414
2415#### Example
2416
2417Example request:
2418
2419~~~json
2420{
2421  "jsonrpc": "2.0",
2422  "id": 1,
2423  "method": "bdev_get_bdevs",
2424  "params": {
2425    "name": "Malloc0"
2426  }
2427}
2428~~~
2429
2430Example response:
2431
2432~~~json
2433{
2434  "jsonrpc": "2.0",
2435  "id": 1,
2436  "result": [
2437    {
2438      "name": "Malloc0",
2439      "product_name": "Malloc disk",
2440      "block_size": 512,
2441      "num_blocks": 20480,
2442      "claimed": false,
2443      "zoned": false,
2444      "supported_io_types": {
2445        "read": true,
2446        "write": true,
2447        "unmap": true,
2448        "write_zeroes": true,
2449        "flush": true,
2450        "reset": true,
2451        "nvme_admin": false,
2452        "nvme_io": false
2453      },
2454      "driver_specific": {}
2455    }
2456  ]
2457}
2458~~~
2459
2460### bdev_examine {#rpc_bdev_examine}
2461
2462Request that the bdev layer examines the given bdev for metadata and creates
2463new bdevs if metadata is found. This is only necessary if `auto_examine` has
2464been set to false using `bdev_set_options`. By default, `auto_examine` is true
2465and bdev examination is automatic.
2466
2467#### Parameters
2468
2469Name                    | Optional | Type        | Description
2470----------------------- | -------- | ----------- | -----------
2471name                    | Required | string      | Block device name
2472
2473#### Response
2474
2475The response is an array of objects containing I/O statistics of the requested block devices.
2476
2477#### Example
2478
2479Example request:
2480
2481~~~json
2482{
2483  "jsonrpc": "2.0",
2484  "id": 1,
2485  "method": "bdev_examine",
2486  "params": {
2487    "name": "Nvme0n1"
2488  }
2489}
2490~~~
2491
2492Example response:
2493
2494~~~json
2495{
2496  "jsonrpc": "2.0",
2497  "id": 1,
2498  "result": true
2499}
2500~~~
2501
2502### bdev_wait_for_examine {#rpc_bdev_wait_for_examine}
2503
2504Report when all bdevs have been examined by every bdev module.
2505
2506#### Parameters
2507
2508None
2509
2510#### Response
2511
2512The response is sent when all bdev modules had a chance to examine every bdev.
2513
2514#### Example
2515
2516Example request:
2517
2518~~~json
2519{
2520  "jsonrpc": "2.0",
2521  "method": "bdev_wait_for_examine",
2522  "id": 1
2523}
2524~~~
2525
2526Example response:
2527
2528~~~json
2529{
2530  "jsonrpc": "2.0",
2531  "id": 1,
2532  "result": true
2533}
2534~~~
2535
2536### bdev_get_iostat {#rpc_bdev_get_iostat}
2537
2538Get I/O statistics of block devices (bdevs).
2539
2540#### Parameters
2541
2542The user may specify no parameters in order to list all block devices, or a block device may be
2543specified by name.
2544
2545Name                    | Optional | Type        | Description
2546----------------------- | -------- | ----------- | -----------
2547name                    | Optional | string      | Block device name
2548per_channel             | Optional | bool        | Display per channel data for specified block device.
2549
2550#### Response
2551
2552The response is an array of objects containing I/O statistics of the requested block devices.
2553
2554#### Example
2555
2556Example request:
2557
2558~~~json
2559{
2560  "jsonrpc": "2.0",
2561  "id": 1,
2562  "method": "bdev_get_iostat",
2563  "params": {
2564    "name": "Nvme0n1",
2565    "per_channel": false
2566  }
2567}
2568~~~
2569
2570Example response:
2571
2572~~~json
2573{
2574  "jsonrpc": "2.0",
2575  "id": 1,
2576  "result": {
2577    "tick_rate": 2200000000,
2578    "bdevs" : [
2579      {
2580        "name": "Nvme0n1",
2581        "bytes_read": 36864,
2582        "num_read_ops": 2,
2583        "bytes_written": 0,
2584        "num_write_ops": 0,
2585        "bytes_unmapped": 0,
2586        "num_unmap_ops": 0,
2587        "read_latency_ticks": 178904,
2588        "write_latency_ticks": 0,
2589        "unmap_latency_ticks": 0,
2590        "queue_depth_polling_period": 2,
2591        "queue_depth": 0,
2592        "io_time": 0,
2593        "weighted_io_time": 0
2594      }
2595    ]
2596  }
2597}
2598~~~
2599
2600### bdev_reset_iostat {#rpc_bdev_reset_iostat}
2601
2602Reset I/O statistics of block devices (bdevs). Note that if one consumer resets I/O statistics,
2603it affects all other consumers.
2604
2605#### Parameters
2606
2607The user may specify no parameters in order to reset I/O statistics for all block devices, or
2608a block device may be specified by name.
2609
2610Name                    | Optional | Type        | Description
2611----------------------- | -------- | ----------- | -----------
2612name                    | Optional | string      | Block device name
2613mode                    | Optional | string      | Mode to reset I/O statistics: all, maxmin (default: all)
2614
2615#### Example
2616
2617Example request:
2618
2619~~~json
2620{
2621  "jsonrpc": "2.0",
2622  "id": 1,
2623  "method": "bdev_reset_iostat",
2624  "params": {
2625    "name": "Nvme0n1"
2626  }
2627}
2628~~~
2629
2630Example response:
2631
2632~~~json
2633{
2634  "jsonrpc": "2.0",
2635  "id": 1,
2636  "result": true
2637}
2638~~~
2639
2640### bdev_enable_histogram {#rpc_bdev_enable_histogram}
2641
2642Control whether collecting data for histogram is enabled for specified bdev.
2643
2644#### Parameters
2645
2646Name                    | Optional | Type        | Description
2647----------------------- | -------- | ----------- | -----------
2648name                    | Required | string      | Block device name
2649enable                  | Required | boolean     | Enable or disable histogram on specified device
2650
2651#### Example
2652
2653Example request:
2654
2655~~~json
2656{
2657  "jsonrpc": "2.0",
2658  "id": 1,
2659  "method": "bdev_enable_histogram",
2660  "params": {
2661    "name": "Nvme0n1"
2662    "enable": true
2663  }
2664}
2665~~~
2666
2667Example response:
2668
2669~~~json
2670{
2671  "jsonrpc": "2.0",
2672  "id": 1,
2673  "result": true
2674}
2675~~~
2676
2677### bdev_get_histogram {#rpc_bdev_get_histogram}
2678
2679Get latency histogram for specified bdev.
2680
2681#### Parameters
2682
2683Name                    | Optional | Type        | Description
2684----------------------- | -------- | ----------- | -----------
2685name                    | Required | string      | Block device name
2686
2687#### Result
2688
2689Name                    | Description
2690------------------------| -----------
2691histogram               | Base64 encoded histogram
2692bucket_shift            | Granularity of the histogram buckets
2693tsc_rate                | Ticks per second
2694
2695#### Example
2696
2697Example request:
2698
2699~~~json
2700{
2701  "jsonrpc": "2.0",
2702  "id": 1,
2703  "method": "bdev_get_histogram",
2704  "params": {
2705    "name": "Nvme0n1"
2706  }
2707}
2708~~~
2709
2710Example response:
2711Note that histogram field is trimmed, actual encoded histogram length is ~80kb.
2712
2713~~~json
2714{
2715  "jsonrpc": "2.0",
2716  "id": 1,
2717  "result": {
2718    "histogram": "AAAAAAAAAAAAAA...AAAAAAAAA==",
2719    "tsc_rate": 2300000000,
2720    "bucket_shift": 7
2721  }
2722}
2723~~~
2724
2725### bdev_set_qos_limit {#rpc_bdev_set_qos_limit}
2726
2727Set the quality of service rate limit on a bdev.
2728
2729#### Parameters
2730
2731Name                    | Optional | Type        | Description
2732----------------------- | -------- | ----------- | -----------
2733name                    | Required | string      | Block device name
2734rw_ios_per_sec          | Optional | number      | Number of R/W I/Os per second to allow. 0 means unlimited.
2735rw_mbytes_per_sec       | Optional | number      | Number of R/W megabytes per second to allow. 0 means unlimited.
2736r_mbytes_per_sec        | Optional | number      | Number of Read megabytes per second to allow. 0 means unlimited.
2737w_mbytes_per_sec        | Optional | number      | Number of Write megabytes per second to allow. 0 means unlimited.
2738
2739#### Example
2740
2741Example request:
2742
2743~~~json
2744{
2745  "jsonrpc": "2.0",
2746  "id": 1,
2747  "method": "bdev_set_qos_limit",
2748  "params": {
2749    "name": "Malloc0"
2750    "rw_ios_per_sec": 20000
2751    "rw_mbytes_per_sec": 100
2752    "r_mbytes_per_sec": 50
2753    "w_mbytes_per_sec": 50
2754  }
2755}
2756~~~
2757
2758Example response:
2759
2760~~~json
2761{
2762  "jsonrpc": "2.0",
2763  "id": 1,
2764  "result": true
2765}
2766~~~
2767
2768### bdev_set_qd_sampling_period {#rpc_bdev_set_qd_sampling_period}
2769
2770Enable queue depth tracking on a specified bdev.
2771
2772#### Parameters
2773
2774Name                    | Optional | Type        | Description
2775----------------------- | -------- | ----------- | -----------
2776name                    | Required | string      | Block device name
2777period                  | Required | int         | period (in microseconds).If set to 0, polling will be disabled.
2778
2779#### Example
2780
2781Example request:
2782
2783~~~json
2784{
2785  "jsonrpc": "2.0",
2786  "method": "bdev_set_qd_sampling_period",
2787  "id": 1,
2788  "params": {
2789    "name": "Malloc0",
2790    "period": 20
2791  }
2792}
2793~~~
2794
2795Example response:
2796
2797~~~json
2798{
2799  "jsonrpc": "2.0",
2800  "id": 1,
2801  "result": true
2802}
2803~~~
2804
2805### bdev_compress_create {#rpc_bdev_compress_create}
2806
2807Create a new compress bdev on a given base bdev.
2808
2809#### Parameters
2810
2811Name                    | Optional | Type        | Description
2812----------------------- | -------- | ----------- | -----------
2813base_bdev_name          | Required | string      | Name of the base bdev
2814pm_path                 | Required | string      | Path to persistent memory
2815lb_size                 | Optional | int         | Compressed vol logical block size (512 or 4096)
2816
2817#### Result
2818
2819Name of newly created bdev.
2820
2821#### Example
2822
2823Example request:
2824
2825~~~json
2826{
2827  "params": {
2828    "base_bdev_name": "Nvme0n1",
2829    "pm_path": "/pm_files",
2830    "lb_size": 4096
2831  },
2832  "jsonrpc": "2.0",
2833  "method": "bdev_compress_create",
2834  "id": 1
2835}
2836~~~
2837
2838### bdev_compress_delete {#rpc_bdev_compress_delete}
2839
2840Delete a compressed bdev.
2841
2842#### Parameters
2843
2844Name                    | Optional | Type        | Description
2845----------------------- | -------- | ----------- | -----------
2846name                    | Required | string      | Name of the compress bdev
2847
2848#### Example
2849
2850Example request:
2851
2852~~~json
2853{
2854  "params": {
2855    "name": "COMP_Nvme0n1"
2856  },
2857  "jsonrpc": "2.0",
2858  "method": "bdev_compress_delete",
2859  "id": 1
2860}
2861~~~
2862
2863Example response:
2864
2865~~~json
2866{
2867  "jsonrpc": "2.0",
2868  "id": 1,
2869  "result": true
2870}
2871~~~
2872
2873### bdev_compress_get_orphans {#rpc_bdev_compress_get_orphans}
2874
2875Get a list of compressed volumes that are missing their pmem metadata.
2876
2877#### Parameters
2878
2879Name                    | Optional | Type        | Description
2880----------------------- | -------- | ----------- | -----------
2881name                    | Required | string      | Name of the compress bdev
2882
2883#### Example
2884
2885Example request:
2886
2887~~~json
2888{
2889  "params": {
2890    "name": "COMP_Nvme0n1"
2891  },
2892  "jsonrpc": "2.0",
2893  "method": "bdev_compress_get_orphans",
2894  "id": 1
2895}
2896~~~
2897
2898Example response:
2899
2900~~~json
2901{
2902  "jsonrpc": "2.0",
2903  "id": 1,
2904  "name": "COMP_Nvme0n1"
2905}
2906~~~
2907
2908### bdev_crypto_create {#rpc_bdev_crypto_create}
2909
2910Create a new crypto bdev on a given base bdev.
2911
2912#### Parameters
2913
2914Name                    | Optional | Type        | Description
2915----------------------- |----------| ----------- | -----------
2916base_bdev_name          | Required | string      | Name of the base bdev
2917name                    | Required | string      | Name of the crypto vbdev to create
2918crypto_pmd              | Optional | string      | Name of the crypto device driver. Obsolete, see accel_crypto_key_create
2919key                     | Optional | string      | Key in hex form. Obsolete, see accel_crypto_key_create
2920cipher                  | Optional | string      | Cipher to use, AES_CBC or AES_XTS (QAT and MLX5). Obsolete, see accel_crypto_key_create
2921key2                    | Optional | string      | 2nd key in hex form only required for cipher AET_XTS. Obsolete, see accel_crypto_key_create
2922key_name                | Optional | string      | Name of the key created with accel_crypto_key_create
2923module                  | Optional | string      | Name of the accel module which is used to create a key (if no key_name specified)
2924
2925Both key and key2 must be passed in the hexlified form. For example, 256bit AES key may look like this:
2926afd9477abf50254219ccb75965fbe39f23ebead5676e292582a0a67f66b88215
2927
2928#### Result
2929
2930Name of newly created bdev.
2931
2932#### Example
2933
2934Example request:
2935
2936~~~json
2937{
2938  "params": {
2939    "base_bdev_name": "Nvme0n1",
2940    "name": "my_crypto_bdev",
2941    "crypto_pmd": "crypto_aesni_mb",
2942    "key": "12345678901234561234567890123456",
2943    "cipher": "AES_CBC"
2944  },
2945  "jsonrpc": "2.0",
2946  "method": "bdev_crypto_create",
2947  "id": 1
2948}
2949~~~
2950
2951Example response:
2952
2953~~~json
2954{
2955
2956  "jsonrpc": "2.0",
2957  "id": 1,
2958  "result": "my_crypto_bdev"
2959}
2960~~~
2961
2962### bdev_crypto_delete {#rpc_bdev_crypto_delete}
2963
2964Delete a crypto bdev.
2965
2966#### Parameters
2967
2968Name                    | Optional | Type        | Description
2969----------------------- | -------- | ----------- | -----------
2970name                    | Required | string      | Name of the crypto bdev
2971
2972#### Example
2973
2974Example request:
2975
2976~~~json
2977{
2978  "params": {
2979    "name": "my_crypto_bdev"
2980  },
2981  "jsonrpc": "2.0",
2982  "method": "bdev_crypto_delete",
2983  "id": 1
2984}
2985~~~
2986
2987Example response:
2988
2989~~~json
2990{
2991  "jsonrpc": "2.0",
2992  "id": 1,
2993  "result": true
2994}
2995~~~
2996
2997### bdev_ocf_create {#rpc_bdev_ocf_create}
2998
2999Construct new OCF bdev.
3000Command accepts cache mode that is going to be used.
3001You can find more details about supported cache modes in the [OCF documentation](https://open-cas.github.io/cache_configuration.html#cache-mode)
3002
3003#### Parameters
3004
3005Name                    | Optional | Type        | Description
3006----------------------- | -------- | ----------- | -----------
3007name                    | Required | string      | Bdev name to use
3008mode                    | Required | string      | OCF cache mode: wb, wt, pt, wa, wi, wo
3009cache_line_size         | Optional | int         | OCF cache line size in KiB: 4, 8, 16, 32, 64
3010cache_bdev_name         | Required | string      | Name of underlying cache bdev
3011core_bdev_name          | Required | string      | Name of underlying core bdev
3012
3013#### Result
3014
3015Name of newly created bdev.
3016
3017#### Example
3018
3019Example request:
3020
3021~~~json
3022{
3023  "params": {
3024    "name": "ocf0",
3025    "mode": "wt",
3026    "cache_line_size": 64,
3027    "cache_bdev_name": "Nvme0n1",
3028    "core_bdev_name": "aio0"
3029  },
3030  "jsonrpc": "2.0",
3031  "method": "bdev_ocf_create",
3032  "id": 1
3033}
3034~~~
3035
3036Example response:
3037
3038~~~json
3039{
3040  "jsonrpc": "2.0",
3041  "id": 1,
3042  "result": "ocf0"
3043}
3044~~~
3045
3046### bdev_ocf_delete {#rpc_bdev_ocf_delete}
3047
3048Delete the OCF bdev
3049
3050#### Parameters
3051
3052Name                    | Optional | Type        | Description
3053----------------------- | -------- | ----------- | -----------
3054name                    | Required | string      | Bdev name
3055
3056#### Example
3057
3058Example request:
3059
3060~~~json
3061{
3062  "params": {
3063    "name": "ocf0"
3064  },
3065  "jsonrpc": "2.0",
3066  "method": "bdev_ocf_delete",
3067  "id": 1
3068}
3069~~~
3070
3071Example response:
3072
3073~~~json
3074{
3075  "jsonrpc": "2.0",
3076  "id": 1,
3077  "result": true
3078}
3079~~~
3080
3081### bdev_ocf_get_stats {#rpc_bdev_ocf_get_stats}
3082
3083Get statistics of chosen OCF block device.
3084
3085#### Parameters
3086
3087Name                    | Optional | Type        | Description
3088----------------------- | -------- | ----------- | -----------
3089name                    | Required | string      | Block device name
3090
3091#### Response
3092
3093Statistics as json object.
3094
3095#### Example
3096
3097Example request:
3098
3099~~~json
3100{
3101  "params": {
3102    "name": "ocf0"
3103  },
3104  "jsonrpc": "2.0",
3105  "method": "bdev_ocf_get_stats",
3106  "id": 1
3107}
3108~~~
3109
3110Example response:
3111
3112~~~json
3113{
3114  "jsonrpc": "2.0",
3115  "id": 1,
3116  "result": [
3117  "usage": {
3118    "clean": {
3119      "count": 76033,
3120      "units": "4KiB blocks",
3121      "percentage": "100.0"
3122    },
3123    "free": {
3124      "count": 767,
3125      "units": "4KiB blocks",
3126      "percentage": "0.9"
3127    },
3128    "occupancy": {
3129      "count": 76033,
3130      "units": "4KiB blocks",
3131      "percentage": "99.0"
3132    },
3133    "dirty": {
3134      "count": 0,
3135      "units": "4KiB blocks",
3136      "percentage": "0.0"
3137    }
3138  },
3139  "requests": {
3140    "rd_total": {
3141      "count": 2,
3142      "units": "Requests",
3143      "percentage": "0.0"
3144    },
3145    "wr_full_misses": {
3146      "count": 76280,
3147      "units": "Requests",
3148      "percentage": "35.6"
3149    },
3150    "rd_full_misses": {
3151      "count": 1,
3152      "units": "Requests",
3153      "percentage": "0.0"
3154    },
3155    "rd_partial_misses": {
3156      "count": 0,
3157      "units": "Requests",
3158      "percentage": "0.0"
3159    },
3160    "wr_total": {
3161      "count": 212416,
3162      "units": "Requests",
3163      "percentage": "99.2"
3164    },
3165    "wr_pt": {
3166      "count": 1535,
3167      "units": "Requests",
3168      "percentage": "0.7"
3169    },
3170    "wr_partial_misses": {
3171      "count": 0,
3172      "units": "Requests",
3173      "percentage": "0.0"
3174    },
3175    "serviced": {
3176      "count": 212418,
3177      "units": "Requests",
3178      "percentage": "99.2"
3179    },
3180    "rd_pt": {
3181      "count": 0,
3182      "units": "Requests",
3183      "percentage": "0.0"
3184    },
3185    "total": {
3186      "count": 213953,
3187      "units": "Requests",
3188      "percentage": "100.0"
3189    },
3190    "rd_hits": {
3191      "count": 1,
3192      "units": "Requests",
3193      "percentage": "0.0"
3194    },
3195    "wr_hits": {
3196      "count": 136136,
3197      "units": "Requests",
3198      "percentage": "63.6"
3199    }
3200  },
3201  "errors": {
3202    "total": {
3203      "count": 0,
3204      "units": "Requests",
3205      "percentage": "0.0"
3206    },
3207    "cache_obj_total": {
3208      "count": 0,
3209      "units": "Requests",
3210      "percentage": "0.0"
3211    },
3212    "core_obj_total": {
3213      "count": 0,
3214      "units": "Requests",
3215      "percentage": "0.0"
3216    },
3217    "cache_obj_rd": {
3218      "count": 0,
3219      "units": "Requests",
3220      "percentage": "0.0"
3221    },
3222    "core_obj_wr": {
3223      "count": 0,
3224      "units": "Requests",
3225      "percentage": "0.0"
3226    },
3227    "core_obj_rd": {
3228      "count": 0,
3229      "units": "Requests",
3230      "percentage": "0.0"
3231    },
3232    "cache_obj_wr": {
3233      "count": 0,
3234      "units": "Requests",
3235      "percentage": "0.0"
3236    }
3237  },
3238  "blocks": {
3239    "volume_rd": {
3240      "count": 9,
3241      "units": "4KiB blocks",
3242      "percentage": "0.0"
3243    },
3244    "volume_wr": {
3245      "count": 213951,
3246      "units": "4KiB blocks",
3247      "percentage": "99.9"
3248    },
3249    "cache_obj_total": {
3250      "count": 212425,
3251      "units": "4KiB blocks",
3252      "percentage": "100.0"
3253    },
3254    "core_obj_total": {
3255      "count": 213959,
3256      "units": "4KiB blocks",
3257      "percentage": "100.0"
3258    },
3259    "cache_obj_rd": {
3260      "count": 1,
3261      "units": "4KiB blocks",
3262      "percentage": "0.0"
3263    },
3264    "core_obj_wr": {
3265      "count": 213951,
3266      "units": "4KiB blocks",
3267      "percentage": "99.9"
3268    },
3269    "volume_total": {
3270      "count": 213960,
3271      "units": "4KiB blocks",
3272      "percentage": "100.0"
3273    },
3274    "core_obj_rd": {
3275      "count": 8,
3276      "units": "4KiB blocks",
3277      "percentage": "0.0"
3278    },
3279    "cache_obj_wr": {
3280      "count": 212424,
3281      "units": "4KiB blocks",
3282      "percentage": "99.9"
3283    }
3284  ]
3285}
3286~~~
3287
3288### bdev_ocf_reset_stats {#rpc_bdev_ocf_reset_stats}
3289
3290Reset statistics of chosen OCF block device.
3291
3292#### Parameters
3293
3294Name                    | Optional | Type        | Description
3295----------------------- | -------- | ----------- | -----------
3296name                    | Required | string      | Block device name
3297
3298#### Response
3299
3300Completion status of reset statistics operation returned as a boolean.
3301
3302#### Example
3303
3304Example request:
3305
3306~~~json
3307{
3308  "params": {
3309    "name": "ocf0"
3310  },
3311  "jsonrpc": "2.0",
3312  "method": "bdev_ocf_reset_stats",
3313  "id": 1
3314}
3315~~~
3316
3317Example response:
3318
3319~~~json
3320{
3321  "jsonrpc": "2.0",
3322  "id": 1,
3323  "result": true
3324}
3325~~~
3326
3327### bdev_ocf_get_bdevs {#rpc_bdev_ocf_get_bdevs}
3328
3329Get list of OCF devices including unregistered ones.
3330
3331#### Parameters
3332
3333Name                    | Optional | Type        | Description
3334----------------------- | -------- | ----------- | -----------
3335name                    | Optional | string      | Name of OCF vbdev or name of cache device or name of core device
3336
3337#### Response
3338
3339Array of OCF devices with their current status, along with core and cache bdevs.
3340
3341#### Example
3342
3343Example request:
3344
3345~~~json
3346{
3347  "jsonrpc": "2.0",
3348  "method": "bdev_ocf_get_bdevs",
3349  "id": 1
3350}
3351~~~
3352
3353Example response:
3354
3355~~~json
3356{
3357  "jsonrpc": "2.0",
3358  "id": 1,
3359  "result": [
3360    {
3361      "name": "PartCache",
3362      "started": false,
3363      "cache": {
3364        "name": "Malloc0",
3365        "attached": true
3366      },
3367      "core": {
3368        "name": "Malloc1",
3369        "attached": false
3370      }
3371    }
3372  ]
3373}
3374~~~
3375
3376### bdev_ocf_set_cache_mode {#rpc_bdev_ocf_set_cache_mode}
3377
3378Set new cache mode on OCF bdev.
3379
3380#### Parameters
3381
3382Name                    | Optional | Type        | Description
3383----------------------- | -------- | ----------- | -----------
3384name                    | Required | string      | Bdev name
3385mode                    | Required | string      | OCF cache mode: wb, wt, pt, wa, wi, wo
3386
3387#### Response
3388
3389New cache mode name.
3390
3391#### Example
3392
3393Example request:
3394
3395~~~json
3396{
3397  "params": {
3398    "name": "ocf0",
3399    "mode": "pt",
3400  },
3401  "jsonrpc": "2.0",
3402  "method": "bdev_ocf_set_cache_mode",
3403  "id": 1
3404}
3405~~~
3406
3407Example response:
3408
3409~~~json
3410{
3411  "jsonrpc": "2.0",
3412  "id": 1,
3413  "result": "pt"
3414}
3415~~~
3416
3417### bdev_ocf_set_seqcutoff {#rpc_bdev_ocf_set_seqcutoff}
3418
3419Set sequential cutoff parameters on all cores for the given OCF cache device.
3420A brief description of this functionality can be found in [OpenCAS documentation](https://open-cas.github.io/guide_tool_details.html#seq-cutoff).
3421
3422#### Parameters
3423
3424Name                    | Optional | Type        | Description
3425----------------------- | -------- | ----------- | -----------
3426name                    | Required | string      | Bdev name
3427policy                  | Required | string      | Sequential cutoff policy: always, full, never
3428threshold               | Optional | int         | Activation threshold in KiB
3429promotion_count         | Optional | int         | Promotion request count
3430
3431#### Example
3432
3433Example request:
3434
3435~~~json
3436{
3437  "params": {
3438    "name": "ocf0",
3439    "policy": "full",
3440    "threshold": 4,
3441    "promotion_count": 2
3442  },
3443  "jsonrpc": "2.0",
3444  "method": "bdev_ocf_set_seqcutoff",
3445  "id": 1
3446}
3447~~~
3448
3449Example response:
3450
3451~~~json
3452{
3453  "jsonrpc": "2.0",
3454  "id": 1,
3455  "result": true
3456}
3457~~~
3458
3459### bdev_ocf_flush_start {#rpc_bdev_ocf_flush_start}
3460
3461Start flushing OCF cache device.
3462
3463Automatic flushes of dirty data are managed by OCF cleaning policy settings.
3464In addition to that, all dirty data is flushed to core device when there is
3465an attempt to stop caching.
3466On the other hand, this RPC call gives a possibility to flush dirty data manually
3467when there is a need for it, e.g. to speed up the shutdown process when data
3468hasn't been flushed for a long time.
3469This RPC returns immediately, and flush is then being performed in the
3470background. To see the status of flushing operation use bdev_ocf_flush_status.
3471
3472#### Parameters
3473
3474Name                    | Optional | Type        | Description
3475----------------------- | -------- | ----------- | -----------
3476name                    | Required | string      | Bdev name
3477
3478#### Example
3479
3480Example request:
3481
3482~~~json
3483{
3484  "params": {
3485    "name": "ocf0"
3486  },
3487  "jsonrpc": "2.0",
3488  "method": "bdev_ocf_flush_start",
3489  "id": 1
3490}
3491~~~
3492
3493Example response:
3494
3495~~~json
3496{
3497  "jsonrpc": "2.0",
3498  "id": 1,
3499  "result": true
3500}
3501~~~
3502
3503### bdev_ocf_flush_status {#rpc_bdev_ocf_flush_status}
3504
3505Get flush status of OCF cache device.
3506
3507Automatic flushes of dirty data are managed by OCF cleaning policy settings.
3508In addition to that, all dirty data is flushed to core device when there is
3509an attempt to stop caching.
3510On the other hand, there is a possibility to flush dirty data manually
3511when there is a need for it, e.g. to speed up the shutdown process when data
3512hasn't been flushed for a long time.
3513This RPC reports if such manual flush is still in progress and if the operation
3514was successful. To start manual flush use bdev_ocf_flush_start.
3515
3516#### Parameters
3517
3518Name                    | Optional | Type        | Description
3519----------------------- | -------- | ----------- | -----------
3520name                    | Required | string      | Bdev name
3521
3522#### Response
3523
3524Status of OCF cache device flush.
3525
3526#### Example
3527
3528Example request:
3529
3530~~~json
3531{
3532  "params": {
3533    "name": "ocf0"
3534  },
3535  "jsonrpc": "2.0",
3536  "method": "bdev_ocf_flush_status",
3537  "id": 1
3538}
3539~~~
3540
3541Example response:
3542
3543~~~json
3544{
3545  "jsonrpc": "2.0",
3546  "id": 1,
3547  "result": {
3548    "in_progress": false,
3549    "status": 0
3550  }
3551}
3552~~~
3553
3554### bdev_malloc_create {#rpc_bdev_malloc_create}
3555
3556Construct @ref bdev_config_malloc
3557
3558The `dif_type` parameter can have 0, 1, 2, or 3, and controls the check of the guard tag and the reference tag.
3559If the `dif_type` is 1, 2, or 3, the malloc bdev compares the guard tag to the CRC-16 computed over the block data.
3560If the `dif_type` is 1 or 2, the malloc bdev compares the reference tag to the computed reference tag.
3561The computed reference tag for the first block of the I/O is the `init_ref_tag` of the DIF context, and
3562the computed reference tag is incremented for each subsequent block.
3563If the `dif_type` is 3, the malloc bdev does not check the reference tag.
3564The application tag is not checked by the malloc bdev because the current block device API does not expose
3565it to the upper layer yet.
3566
3567#### Parameters
3568
3569Name                    | Optional | Type        | Description
3570----------------------- | -------- | ----------- | -----------
3571name                    | Optional | string      | Bdev name to use
3572block_size              | Required | number      | Data block size in bytes -must be multiple of 512
3573num_blocks              | Required | number      | Number of blocks
3574uuid                    | Optional | string      | UUID of new bdev
3575optimal_io_boundary     | Optional | number      | Split on optimal IO boundary, in number of blocks, default 0
3576md_size                 | Optional | number      | Metadata size for this bdev (0, 8, 16, 32, 64, or 128). Default is 0.
3577md_interleave           | Optional | boolean     | Metadata location, interleaved if true, and separated if false. Default is false.
3578dif_type                | Optional | number      | Protection information type. Parameter --md-size needs to be set along --dif-type. Default=0 - no protection.
3579dif_is_head_of_md       | Optional | boolean     | Protection information is in the first 8 bytes of metadata. Default=false.
3580
3581#### Result
3582
3583Name of newly created bdev.
3584
3585#### Example
3586
3587Example request:
3588
3589~~~json
3590{
3591  "params": {
3592    "block_size": 4096,
3593    "num_blocks": 16384,
3594    "name": "Malloc0",
3595    "uuid": "2b6601ba-eada-44fb-9a83-a20eb9eb9e90",
3596    "optimal_io_boundary": 16
3597  },
3598  "jsonrpc": "2.0",
3599  "method": "bdev_malloc_create",
3600  "id": 1
3601}
3602~~~
3603
3604Example response:
3605
3606~~~json
3607{
3608  "jsonrpc": "2.0",
3609  "id": 1,
3610  "result": "Malloc0"
3611}
3612~~~
3613
3614### bdev_malloc_delete {#rpc_bdev_malloc_delete}
3615
3616Delete @ref bdev_config_malloc
3617
3618#### Parameters
3619
3620Name                    | Optional | Type        | Description
3621----------------------- | -------- | ----------- | -----------
3622name                    | Required | string      | Bdev name
3623
3624#### Example
3625
3626Example request:
3627
3628~~~json
3629{
3630  "params": {
3631    "name": "Malloc0"
3632  },
3633  "jsonrpc": "2.0",
3634  "method": "bdev_malloc_delete",
3635  "id": 1
3636}
3637~~~
3638
3639Example response:
3640
3641~~~json
3642{
3643  "jsonrpc": "2.0",
3644  "id": 1,
3645  "result": true
3646}
3647~~~
3648
3649### bdev_null_create {#rpc_bdev_null_create}
3650
3651Construct @ref bdev_config_null
3652
3653#### Parameters
3654
3655Name                    | Optional | Type        | Description
3656----------------------- | -------- | ----------- | -----------
3657name                    | Optional | string      | Bdev name to use
3658block_size              | Required | number      | Block size in bytes
3659num_blocks              | Required | number      | Number of blocks
3660uuid                    | Optional | string      | UUID of new bdev
3661md_size                 | Optional | number      | Metadata size for this bdev. Default=0.
3662dif_type                | Optional | number      | Protection information type. Parameter --md-size needs to be set along --dif-type. Default=0 - no protection.
3663dif_is_head_of_md       | Optional | boolean     | Protection information is in the first 8 bytes of metadata. Default=false.
3664
3665#### Result
3666
3667Name of newly created bdev.
3668
3669#### Example
3670
3671Example request:
3672
3673~~~json
3674{
3675  "params": {
3676    "block_size": 4104,
3677    "num_blocks": 16384,
3678    "name": "Null0",
3679    "uuid": "2b6601ba-eada-44fb-9a83-a20eb9eb9e90",
3680    "md_size": 8,
3681    "dif_type": 1,
3682    "dif_is_head_of_md": true
3683  },
3684  "jsonrpc": "2.0",
3685  "method": "bdev_null_create",
3686  "id": 1
3687}
3688~~~
3689
3690Example response:
3691
3692~~~json
3693{
3694  "jsonrpc": "2.0",
3695  "id": 1,
3696  "result": "Null0"
3697}
3698~~~
3699
3700### bdev_null_delete {#rpc_bdev_null_delete}
3701
3702Delete @ref bdev_config_null.
3703
3704#### Parameters
3705
3706Name                    | Optional | Type        | Description
3707----------------------- | -------- | ----------- | -----------
3708name                    | Required | string      | Bdev name
3709
3710#### Example
3711
3712Example request:
3713
3714~~~json
3715{
3716  "params": {
3717    "name": "Null0"
3718  },
3719  "jsonrpc": "2.0",
3720  "method": "bdev_null_delete",
3721  "id": 1
3722}
3723~~~
3724
3725Example response:
3726
3727~~~json
3728{
3729  "jsonrpc": "2.0",
3730  "id": 1,
3731  "result": true
3732}
3733~~~
3734
3735### bdev_null_resize {#rpc_bdev_null_resize}
3736
3737Resize @ref bdev_config_null.
3738
3739#### Parameters
3740
3741Name                    | Optional | Type        | Description
3742----------------------- | -------- | ----------- | -----------
3743name                    | Required | string      | Bdev name
3744new_size                | Required | number      | Bdev new capacity in MiB
3745
3746#### Example
3747
3748Example request:
3749
3750~~~json
3751{
3752  "params": {
3753    "name": "Null0",
3754    "new_size": 4096
3755  },
3756  "jsonrpc": "2.0",
3757  "method": "bdev_null_resize",
3758  "id": 1
3759}
3760~~~
3761
3762Example response:
3763
3764~~~json
3765{
3766  "jsonrpc": "2.0",
3767  "id": 1,
3768  "result": true
3769}
3770~~~
3771
3772### bdev_aio_create {#rpc_bdev_aio_create}
3773
3774Construct @ref bdev_config_aio.
3775
3776#### Parameters
3777
3778Name                    | Optional | Type        | Description
3779----------------------- | -------- | ----------- | -----------
3780name                    | Required | string      | Bdev name to use
3781filename                | Required | number      | Path to device or file
3782block_size              | Optional | number      | Block size in bytes
3783
3784#### Result
3785
3786Name of newly created bdev.
3787
3788#### Example
3789
3790Example request:
3791
3792~~~json
3793{
3794  "params": {
3795    "block_size": 4096,
3796    "name": "Aio0",
3797    "filename": "/tmp/aio_bdev_file"
3798  },
3799  "jsonrpc": "2.0",
3800  "method": "bdev_aio_create",
3801  "id": 1
3802}
3803~~~
3804
3805Example response:
3806
3807~~~json
3808{
3809  "jsonrpc": "2.0",
3810  "id": 1,
3811  "result": "Aio0"
3812}
3813~~~
3814
3815### bdev_aio_rescan {#rpc_bdev_aio_rescan}
3816
3817Rescan the size of @ref bdev_config_aio.
3818
3819#### Parameters
3820
3821Name                    | Optional | Type        | Description
3822----------------------- | -------- | ----------- | -----------
3823name                    | Required | string      | Bdev name
3824
3825#### Example
3826
3827Example request:
3828
3829~~~json
3830{
3831  "params": {
3832    "name": "Aio0"
3833  },
3834  "jsonrpc": "2.0",
3835  "method": "bdev_aio_rescan",
3836  "id": 1
3837}
3838~~~
3839
3840Example response:
3841
3842~~~json
3843{
3844  "jsonrpc": "2.0",
3845  "id": 1,
3846  "result": true
3847}
3848~~~
3849
3850### bdev_aio_delete {#rpc_bdev_aio_delete}
3851
3852Delete @ref bdev_config_aio.
3853
3854#### Parameters
3855
3856Name                    | Optional | Type        | Description
3857----------------------- | -------- | ----------- | -----------
3858name                    | Required | string      | Bdev name
3859
3860#### Example
3861
3862Example request:
3863
3864~~~json
3865{
3866  "params": {
3867    "name": "Aio0"
3868  },
3869  "jsonrpc": "2.0",
3870  "method": "bdev_aio_delete",
3871  "id": 1
3872}
3873~~~
3874
3875Example response:
3876
3877~~~json
3878{
3879  "jsonrpc": "2.0",
3880  "id": 1,
3881  "result": true
3882}
3883~~~
3884
3885### bdev_nvme_set_options {#rpc_bdev_nvme_set_options}
3886
3887Set global parameters for all bdev NVMe. This RPC may only be called before SPDK subsystems have been initialized
3888or any bdev NVMe has been created.
3889
3890Parameters, ctrlr_loss_timeout_sec, reconnect_delay_sec, and fast_io_fail_timeout_sec, are for I/O error resiliency.
3891They can be overridden if they are given by the RPC bdev_nvme_attach_controller.
3892
3893#### Parameters
3894
3895Name                       | Optional | Type        | Description
3896-------------------------- | -------- | ----------- | -----------
3897action_on_timeout          | Optional | string      | Action to take on command time out: none, reset or abort
3898timeout_us                 | Optional | number      | Timeout for each command, in microseconds. If 0, don't track timeouts
3899timeout_admin_us           | Optional | number      | Timeout for each admin command, in microseconds. If 0, treat same as io timeouts ('timeout_us')
3900keep_alive_timeout_ms      | Optional | number      | Keep alive timeout period in milliseconds, default is 10s
3901retry_count                | Optional | number      | The number of attempts per I/O before an I/O fails. (Deprecated. Please use transport_retry_count instead.)
3902arbitration_burst          | Optional | number      | The value is expressed as a power of two, a value of 111b indicates no limit
3903low_priority_weight        | Optional | number      | The maximum number of commands that the controller may launch at one time from a low priority queue
3904medium_priority_weight     | Optional | number      | The maximum number of commands that the controller may launch at one time from a medium priority queue
3905high_priority_weight       | Optional | number      | The maximum number of commands that the controller may launch at one time from a high priority queue
3906nvme_adminq_poll_period_us | Optional | number      | How often the admin queue is polled for asynchronous events in microseconds
3907nvme_ioq_poll_period_us    | Optional | number      | How often I/O queues are polled for completions, in microseconds. Default: 0 (as fast as possible).
3908io_queue_requests          | Optional | number      | The number of requests allocated for each NVMe I/O queue. Default: 512.
3909delay_cmd_submit           | Optional | boolean     | Enable delaying NVMe command submission to allow batching of multiple commands. Default: `true`.
3910transport_retry_count      | Optional | number      | The number of attempts per I/O in the transport layer before an I/O fails.
3911bdev_retry_count           | Optional | number      | The number of attempts per I/O in the bdev layer before an I/O fails. -1 means infinite retries.
3912transport_ack_timeout      | Optional | number      | Time to wait ack until retransmission for RDMA or connection close for TCP. Range 0-31 where 0 means use default.
3913ctrlr_loss_timeout_sec     | Optional | number      | Time to wait until ctrlr is reconnected before deleting ctrlr.  -1 means infinite reconnects. 0 means no reconnect.
3914reconnect_delay_sec        | Optional | number      | Time to delay a reconnect trial. 0 means no reconnect.
3915fast_io_fail_timeout_sec   | Optional | number      | Time to wait until ctrlr is reconnected before failing I/O to ctrlr. 0 means no such timeout.
3916disable_auto_failback      | Optional | boolean     | Disable automatic failback. The RPC bdev_nvme_set_preferred_path can be used to do manual failback.
3917generate_uuids             | Optional | boolean     | Enable generation of UUIDs for NVMe bdevs that do not provide this value themselves.
3918transport_tos              | Optional | number      | IPv4 Type of Service value. Only applicable for RDMA transport. Default: 0 (no TOS is applied).
3919nvme_error_stat            | Optional | boolean     | Enable collecting NVMe error counts.
3920rdma_srq_size              | Optional | number      | Set the size of a shared rdma receive queue. Default: 0 (disabled).
3921io_path_stat               | Optional | boolean     | Enable collecting I/O stat of each nvme bdev io path. Default: `false`.
3922allow_accel_sequence       | Optional | boolean     | Allow NVMe bdevs to advertise support for accel sequences if the controller also supports them.  Default: `false`.
3923rdma_max_cq_size           | Optional | number      | Set the maximum size of a rdma completion queue. Default: 0 (unlimited)
3924rdma_cm_event_timeout_ms   | Optional | number      | Time to wait for RDMA CM events. Default: 0 (0 means using default value of driver).
3925dhchap_digests             | Optional | list        | List of allowed DH-HMAC-CHAP digests.
3926dhchap_dhgroups            | Optional | list        | List of allowed DH-HMAC-CHAP DH groups.
3927
3928#### Example
3929
3930Example request:
3931
3932~~~json
3933request:
3934{
3935  "params": {
3936    "transport_retry_count": 5,
3937    "arbitration_burst": 3,
3938    "low_priority_weight": 8,
3939    "medium_priority_weight":8,
3940    "high_priority_weight": 8,
3941    "nvme_adminq_poll_period_us": 2000,
3942    "timeout_us": 10000000,
3943    "timeout_admin_us": 20000000,
3944    "keep_alive_timeout_ms": 600000,
3945    "action_on_timeout": "reset",
3946    "io_queue_requests" : 2048,
3947    "delay_cmd_submit": true
3948    "dhchap_digests": [
3949      "sha384",
3950      "sha512"
3951    ],
3952    "dhchap_dhgroups": [
3953      "ffdhe6144",
3954      "ffdhe8192"
3955    ]
3956  },
3957  "jsonrpc": "2.0",
3958  "method": "bdev_nvme_set_options",
3959  "id": 1
3960}
3961~~~
3962
3963Example response:
3964
3965~~~json
3966{
3967  "jsonrpc": "2.0",
3968  "id": 1,
3969  "result": true
3970}
3971~~~
3972
3973### bdev_nvme_set_hotplug {#rpc_bdev_nvme_set_hotplug}
3974
3975Change settings of the NVMe hotplug feature. If enabled, PCIe NVMe bdevs will be automatically discovered on insertion
3976and deleted on removal.
3977
3978#### Parameters
3979
3980Name                    | Optional | Type        | Description
3981----------------------- | -------- | ----------- | -----------
3982enable                  | Required | string      | True to enable, false to disable
3983period_us               | Optional | number      | How often to poll for hot-insert and hot-remove events. Values: 0 - reset/use default or 1 to 10000000.
3984
3985#### Example
3986
3987Example request:
3988
3989~~~json
3990request:
3991{
3992  "params": {
3993    "enable": true,
3994    "period_us": 2000
3995  },
3996  "jsonrpc": "2.0",
3997  "method": "bdev_nvme_set_hotplug",
3998  "id": 1
3999}
4000~~~
4001
4002Example response:
4003
4004~~~json
4005{
4006  "jsonrpc": "2.0",
4007  "id": 1,
4008  "result": true
4009}
4010~~~
4011
4012### bdev_nvme_attach_controller {#rpc_bdev_nvme_attach_controller}
4013
4014Construct @ref bdev_config_nvme. This RPC can also be used to add additional paths to an existing controller to enable
4015multipathing. This is done by specifying the `name` parameter as an existing controller. When adding an additional
4016path, the hostnqn, hostsvcid, hostaddr, prchk_reftag, and prchk_guard_arguments must not be specified and are assumed
4017to have the same value as the existing path.
4018
4019The parameters, `ctrlr_loss_timeout_sec`, `reconnect_delay_sec`, and `fast_io_fail_timeout_sec`, are mutually dependent.
4020If `reconnect_delay_sec` is non-zero, `ctrlr_loss_timeout_sec` has to be -1 or not less than `reconnect_delay_sec`.
4021If `reconnect_delay_sec` is zero, `ctrlr_loss_timeout_sec` has to be zero.
4022If `fast_io_fail_timeout_sec` is not zero, it has to be not less than `reconnect_delay_sec` and less than `ctrlr_loss_timeout_sec` if `ctrlr_loss_timeout_sec` is not -1.
4023
4024#### Result
4025
4026Array of names of newly created bdevs.
4027
4028#### Parameters
4029
4030Name                       | Optional | Type        | Description
4031-------------------------- | -------- | ----------- | -----------
4032name                       | Required | string      | Name of the NVMe controller, prefix for each bdev name
4033trtype                     | Required | string      | NVMe-oF target trtype: rdma or pcie
4034traddr                     | Required | string      | NVMe-oF target address: ip or BDF
4035adrfam                     | Optional | string      | NVMe-oF target adrfam: ipv4, ipv6, ib, fc, intra_host
4036trsvcid                    | Optional | string      | NVMe-oF target trsvcid: port number
4037subnqn                     | Optional | string      | NVMe-oF target subnqn
4038hostnqn                    | Optional | string      | NVMe-oF target hostnqn
4039hostaddr                   | Optional | string      | NVMe-oF host address: ip address
4040hostsvcid                  | Optional | string      | NVMe-oF host trsvcid: port number
4041prchk_reftag               | Optional | bool        | Enable checking of PI reference tag for I/O processing
4042prchk_guard                | Optional | bool        | Enable checking of PI guard for I/O processing
4043hdgst                      | Optional | bool        | Enable TCP header digest
4044ddgst                      | Optional | bool        | Enable TCP data digest
4045fabrics_connect_timeout_us | Optional | bool        | Timeout for fabrics connect (in microseconds)
4046multipath                  | Optional | string      | Multipathing behavior: disable, failover, multipath. Default is failover.
4047num_io_queues              | Optional | number      | The number of IO queues to request during initialization. Range: (0, UINT16_MAX + 1], Default is 1024.
4048ctrlr_loss_timeout_sec     | Optional | number      | Time to wait until ctrlr is reconnected before deleting ctrlr.  -1 means infinite reconnects. 0 means no reconnect.
4049reconnect_delay_sec        | Optional | number      | Time to delay a reconnect trial. 0 means no reconnect.
4050fast_io_fail_timeout_sec   | Optional | number      | Time to wait until ctrlr is reconnected before failing I/O to ctrlr. 0 means no such timeout.
4051psk                        | Optional | string      | Name of the pre-shared key to be used for TLS (Enables SSL socket implementation for TCP)
4052max_bdevs                  | Optional | number      | The size of the name array for newly created bdevs. Default is 128.
4053dhchap_key                 | Optional | string      | DH-HMAC-CHAP key name.
4054
4055#### Example
4056
4057Example request:
4058
4059~~~json
4060{
4061  "params": {
4062    "trtype": "pcie",
4063    "name": "Nvme0",
4064    "traddr": "0000:0a:00.0"
4065  },
4066  "jsonrpc": "2.0",
4067  "method": "bdev_nvme_attach_controller",
4068  "id": 1
4069}
4070~~~
4071
4072Example response:
4073
4074~~~json
4075{
4076  "jsonrpc": "2.0",
4077  "id": 1,
4078  "result": [
4079    "Nvme0n1"
4080  ]
4081}
4082~~~
4083
4084### bdev_nvme_get_controllers {#rpc_bdev_nvme_get_controllers}
4085
4086Get information about NVMe controllers.
4087
4088#### Parameters
4089
4090The user may specify no parameters in order to list all NVMe controllers, or one NVMe controller may be
4091specified by name.
4092
4093Name                    | Optional | Type        | Description
4094----------------------- | -------- | ----------- | -----------
4095name                    | Optional | string      | NVMe controller name
4096
4097#### Response
4098
4099The response is an array of objects containing information about the requested NVMe controllers.
4100
4101#### Example
4102
4103Example request:
4104
4105~~~json
4106{
4107  "jsonrpc": "2.0",
4108  "id": 1,
4109  "method": "bdev_nvme_get_controllers",
4110  "params": {
4111    "name": "Nvme0"
4112  }
4113}
4114~~~
4115
4116Example response:
4117
4118~~~json
4119{
4120  "jsonrpc": "2.0",
4121  "id": 1,
4122  "result": [
4123    {
4124      "name": "Nvme0",
4125      "trid": {
4126        "trtype": "PCIe",
4127        "traddr": "0000:05:00.0"
4128      },
4129      "cntlid": 0
4130    }
4131  ]
4132}
4133~~~
4134
4135### bdev_nvme_detach_controller {#rpc_bdev_nvme_detach_controller}
4136
4137Detach NVMe controller and delete any associated bdevs. Optionally,
4138If all of the transport ID options are specified, only remove that
4139transport path from the specified controller. If that is the only
4140available path for the controller, this will also result in the
4141controller being detached and the associated bdevs being deleted.
4142
4143returns true if the controller and bdevs were successfully destroyed
4144or the address was properly removed, false otherwise.
4145
4146#### Parameters
4147
4148Name                    | Optional | Type        | Description
4149----------------------- | -------- | ----------- | -----------
4150name                    | Required | string      | Controller name
4151trtype                  | Optional | string      | NVMe-oF target trtype: rdma or tcp
4152traddr                  | Optional | string      | NVMe-oF target address: ip or BDF
4153adrfam                  | Optional | string      | NVMe-oF target adrfam: ipv4, ipv6, ib, fc, intra_host
4154trsvcid                 | Optional | string      | NVMe-oF target trsvcid: port number
4155subnqn                  | Optional | string      | NVMe-oF target subnqn
4156hostaddr                | Optional | string      | NVMe-oF host address: ip
4157hostsvcid               | Optional | string      | NVMe-oF host svcid: port number
4158
4159#### Example
4160
4161Example requests:
4162
4163~~~json
4164{
4165  "params": {
4166    "name": "Nvme0"
4167  },
4168  "jsonrpc": "2.0",
4169  "method": "bdev_nvme_detach_controller",
4170  "id": 1
4171}
4172~~~
4173
4174Example response:
4175
4176~~~json
4177{
4178  "jsonrpc": "2.0",
4179  "id": 1,
4180  "result": true
4181}
4182~~~
4183
4184### bdev_nvme_reset_controller {#rpc_bdev_nvme_reset_controller}
4185
4186For non NVMe multipath, reset an NVMe controller whose name is given by the `name` parameter.
4187
4188For NVMe multipath, an NVMe bdev controller is created and it aggregates multiple NVMe controllers.
4189The `name` parameter is an NVMe bdev controller name and the `cntlid` parameter is used to identify
4190an NVMe controller in the NVMe bdev controller. Reset only one NVMe-oF controller if the `cntlid`
4191parameter is specified, or all NVMe-oF controllers in an NVMe bdev controller if it is omitted.
4192
4193Returns true if the controller reset was successful, false otherwise.
4194
4195#### Parameters
4196
4197Name                    | Optional | Type        | Description
4198----------------------- | -------- | ----------- | -----------
4199name                    | Required | string      | NVMe controller name (or NVMe bdev controller name for multipath)
4200cntlid                  | Optional | number      | NVMe controller ID (used as NVMe controller name for multipath)
4201
4202#### Example
4203
4204Example request:
4205
4206~~~json
4207{
4208  "jsonrpc": "2.0",
4209  "id": 1,
4210  "method": "bdev_nvme_reset_controller",
4211  "params": {
4212    "name": "Nvme0"
4213  }
4214}
4215~~~
4216
4217Example response:
4218
4219~~~json
4220{
4221  "jsonrpc": "2.0",
4222  "id": 1,
4223  "result": true
4224}
4225~~~
4226
4227### bdev_nvme_enable_controller {#rpc_bdev_nvme_enable_controller}
4228
4229For non NVMe multipath, enable an NVMe controller whose name is given by the `name` parameter.
4230
4231For NVMe multipath, an NVMe bdev controller is created and it aggregates multiple NVMe controllers.
4232The `name` parameter is an NVMe bdev controller name and the `cntlid` parameter is used to identify
4233an NVMe controller in the NVMe bdev controller. Enable only one NVMe-oF controller if the `cntlid`
4234parameter is specified, or all NVMe-oF controllers in an NVMe bdev controller if it is omitted.
4235
4236Returns true if the controller enablement was successful or a controller was already enabled, false otherwise.
4237
4238#### Parameters
4239
4240Name                    | Optional | Type        | Description
4241----------------------- | -------- | ----------- | -----------
4242name                    | Required | string      | NVMe controller name (or NVMe bdev controller name for multipath)
4243cntlid                  | Optional | number      | NVMe controller ID (used as NVMe controller name for multipath)
4244
4245#### Example
4246
4247Example request:
4248
4249~~~json
4250{
4251  "jsonrpc": "2.0",
4252  "id": 1,
4253  "method": "bdev_nvme_enable_controller",
4254  "params": {
4255    "name": "Nvme0"
4256  }
4257}
4258~~~
4259
4260Example response:
4261
4262~~~json
4263{
4264  "jsonrpc": "2.0",
4265  "id": 1,
4266  "result": true
4267}
4268~~~
4269
4270### bdev_nvme_disable_controller {#rpc_bdev_nvme_disable_controller}
4271
4272For non NVMe multipath, disable an NVMe controller whose name is given by the `name` parameter.
4273
4274For NVMe multipath, an NVMe bdev controller is created and it aggregates multiple NVMe controllers.
4275The `name` parameter is an NVMe bdev controller name and the `cntlid` parameter is used to identify
4276an NVMe controller in the NVMe bdev controller. Disable only one NVMe-oF controller if the `cntlid`
4277parameter is specified, or all NVMe-oF controllers in an NVMe bdev controller if it is omitted.
4278
4279Returns true if the controller disablement was successful or a controller was already disabled, false otherwise.
4280
4281#### Parameters
4282
4283Name                    | Optional | Type        | Description
4284----------------------- | -------- | ----------- | -----------
4285name                    | Required | string      | NVMe controller name (or NVMe bdev controller name for multipath)
4286cntlid                  | Optional | number      | NVMe controller ID (used as NVMe controller name for multipath)
4287
4288#### Example
4289
4290Example request:
4291
4292~~~json
4293{
4294  "jsonrpc": "2.0",
4295  "id": 1,
4296  "method": "bdev_nvme_disable_controller",
4297  "params": {
4298    "name": "Nvme0"
4299  }
4300}
4301~~~
4302
4303Example response:
4304
4305~~~json
4306{
4307  "jsonrpc": "2.0",
4308  "id": 1,
4309  "result": true
4310}
4311~~~
4312
4313### bdev_nvme_start_discovery {#rpc_bdev_nvme_start_discovery}
4314
4315Start a discovery service for the discovery subsystem of the specified transport ID.
4316
4317The discovery service will read the discovery log page for the specified
4318discovery subsystem, and automatically attach to any subsystems found in the
4319log page. When determining a controller name to use when attaching, it will use
4320the 'name' parameter as a prefix, followed by a unique integer for that discovery
4321service. If the discovery service identifies a subsystem that has been previously
4322attached but is listed with a different path, it will use the same controller name
4323as the previous entry, and connect as a multipath.
4324
4325When the discovery service sees that a subsystem entry has been removed
4326from the log page, it will automatically detach from that controller as well.
4327
4328The 'name' is also used to later stop the discovery service.
4329
4330#### Parameters
4331
4332Name                       | Optional | Type        | Description
4333-------------------------- | -------- | ----------- | -----------
4334name                       | Required | string      | Prefix for NVMe controllers
4335trtype                     | Required | string      | NVMe-oF target trtype: rdma or tcp
4336traddr                     | Required | string      | NVMe-oF target address: ip
4337adrfam                     | Optional | string      | NVMe-oF target adrfam: ipv4, ipv6
4338trsvcid                    | Optional | string      | NVMe-oF target trsvcid: port number
4339hostnqn                    | Optional | string      | NVMe-oF target hostnqn
4340wait_for_attach            | Optional | bool        | Wait to complete until all discovered NVM subsystems are attached
4341attach_timeout_ms          | Optional | number      | Time to wait until the discovery and all discovered NVM subsystems are attached
4342ctrlr_loss_timeout_sec     | Optional | number      | Time to wait until ctrlr is reconnected before deleting ctrlr.  -1 means infinite reconnects. 0 means no reconnect.
4343reconnect_delay_sec        | Optional | number      | Time to delay a reconnect trial. 0 means no reconnect.
4344fast_io_fail_timeout_sec   | Optional | number      | Time to wait until ctrlr is reconnected before failing I/O to ctrlr. 0 means no such timeout.
4345
4346#### Example
4347
4348Example request:
4349
4350~~~json
4351{
4352  "jsonrpc": "2.0",
4353  "method": "bdev_nvme_start_discovery",
4354  "id": 1,
4355  "params": {
4356    "name": "nvme_auto",
4357    "trtype": "tcp",
4358    "traddr": "127.0.0.1",
4359    "hostnqn": "nqn.2021-12.io.spdk:host1",
4360    "adrfam": "ipv4",
4361    "trsvcid": "4420"
4362  }
4363}
4364~~~
4365
4366Example response:
4367
4368~~~json
4369{
4370  "jsonrpc": "2.0",
4371  "id": 1,
4372  "result": true
4373}
4374~~~
4375
4376### bdev_nvme_stop_discovery {#rpc_bdev_nvme_stop_discovery}
4377
4378Stop a discovery service. This includes detaching any controllers that were
4379discovered via the service that is being stopped.
4380
4381#### Parameters
4382
4383Name                       | Optional | Type        | Description
4384-------------------------- | -------- | ----------- | -----------
4385name                       | Required | string      | Name of service to stop
4386
4387#### Example
4388
4389Example request:
4390
4391~~~json
4392{
4393  "jsonrpc": "2.0",
4394  "method": "bdev_nvme_stop_discovery",
4395  "id": 1,
4396  "params": {
4397    "name": "nvme_auto"
4398  }
4399}
4400~~~
4401
4402Example response:
4403
4404~~~json
4405{
4406  "jsonrpc": "2.0",
4407  "id": 1,
4408  "result": true
4409}
4410~~~
4411
4412### bdev_nvme_get_discovery_info {#rpc_bdev_nvme_get_discovery_info}
4413
4414Get information about the discovery service.
4415
4416#### Example
4417
4418Example request:
4419~~~json
4420{
4421  "jsonrpc": "2.0",
4422  "method": "bdev_nvme_get_discovery_info",
4423  "id": 1
4424}
4425~~~
4426
4427Example response:
4428
4429~~~json
4430{
4431  "jsonrpc": "2.0",
4432  "id": 1,
4433  "result": [
4434    {
4435      "name": "nvme-disc",
4436      "trid": {
4437        "trtype": "TCP",
4438        "adrfam": "IPv4",
4439        "traddr": "127.0.0.1",
4440        "trsvcid": "8009",
4441        "subnqn": "nqn.2014-08.org.nvmexpress.discovery"
4442      },
4443      "referrals": []
4444    }
4445  ]
4446}
4447~~~
4448
4449### bdev_nvme_get_io_paths {#rpc_bdev_nvme_get_io_paths}
4450
4451Display all or the specified NVMe bdev's active I/O paths.
4452
4453#### Parameters
4454
4455Name                    | Optional | Type        | Description
4456----------------------- | -------- | ----------- | -----------
4457name                    | Optional | string      | Name of the NVMe bdev
4458
4459#### Example
4460
4461Example request:
4462
4463~~~json
4464{
4465  "jsonrpc": "2.0",
4466  "method": "bdev_nvme_get_io_paths",
4467  "id": 1,
4468  "params": {
4469    "name": "Nvme0n1"
4470  }
4471}
4472~~~
4473
4474Example response:
4475
4476~~~json
4477{
4478  "jsonrpc": "2.0",
4479  "id": 1,
4480  "result": {
4481    "poll_groups": [
4482      {
4483        "thread": "app_thread",
4484        "io_paths": [
4485          {
4486            "bdev_name": "Nvme0n1",
4487            "cntlid": 0,
4488            "current": true,
4489            "connected": true,
4490            "accessible": true,
4491            "transport": {
4492              "trtype": "RDMA",
4493              "traddr": "1.2.3.4",
4494              "trsvcid": "4420",
4495              "adrfam": "IPv4"
4496            }
4497          }
4498        ]
4499      }
4500    ]
4501  }
4502}
4503~~~
4504
4505### bdev_nvme_set_preferred_path {#rpc_bdev_nvme_set_preferred_path}
4506
4507Set the preferred I/O path for an NVMe bdev in multipath mode.
4508
4509NOTE: This RPC does not support NVMe bdevs in failover mode.
4510
4511#### Parameters
4512
4513Name                    | Optional | Type        | Description
4514----------------------- | -------- | ----------- | -----------
4515name                    | Required | string      | Name of the NVMe bdev
4516cntlid                  | Required | number      | NVMe-oF controller ID
4517
4518#### Example
4519
4520Example request:
4521
4522~~~json
4523{
4524  "jsonrpc": "2.0",
4525  "method": "bdev_nvme_set_preferred_path",
4526  "id": 1,
4527  "params": {
4528    "name": "Nvme0n1",
4529    "cntlid": 0
4530  }
4531}
4532~~~
4533
4534Example response:
4535
4536~~~json
4537{
4538  "jsonrpc": "2.0",
4539  "id": 1,
4540  "result": true
4541}
4542~~~
4543
4544### bdev_nvme_set_multipath_policy {#rpc_bdev_nvme_set_multipath_policy}
4545
4546Set multipath policy of the NVMe bdev in multipath mode or set multipath
4547selector for active-active multipath policy.
4548
4549#### Parameters
4550
4551Name                    | Optional | Type        | Description
4552----------------------- | -------- | ----------- | -----------
4553name                    | Required | string      | Name of the NVMe bdev
4554policy                  | Required | string      | Multipath policy: active_active or active_passive
4555selector                | Optional | string      | Multipath selector: round_robin or queue_depth, used in active-active mode. Default is round_robin
4556rr_min_io               | Optional | number      | Number of I/Os routed to current io path before switching to another for round-robin selector. The min value is 1.
4557
4558#### Example
4559
4560Example request:
4561
4562~~~json
4563{
4564  "jsonrpc": "2.0",
4565  "method": "bdev_nvme_set_multipath_policy",
4566  "id": 1,
4567  "params": {
4568    "name": "Nvme0n1",
4569    "policy": "active_passive"
4570  }
4571}
4572~~~
4573
4574Example response:
4575
4576~~~json
4577{
4578  "jsonrpc": "2.0",
4579  "id": 1,
4580  "result": true
4581}
4582~~~
4583
4584### bdev_nvme_get_path_iostat {#rpc_bdev_nvme_get_path_iostat}
4585
4586Get I/O statistics for IO paths of the block device. Call RPC bdev_nvme_set_options to set enable_io_path_stat
4587true before using this RPC.
4588
4589#### Parameters
4590
4591Name                    | Optional | Type        | Description
4592----------------------- | -------- | ----------- | -----------
4593name                    | Required | string      | Name of the NVMe bdev
4594
4595#### Example
4596
4597Example request:
4598
4599~~~json
4600{
4601  "jsonrpc": "2.0",
4602  "method": "bdev_nvme_get_path_iostat",
4603  "id": 1,
4604  "params": {
4605    "name": "NVMe0n1"
4606  }
4607}
4608~~~
4609
4610Example response:
4611
4612~~~json
4613{
4614  "jsonrpc": "2.0",
4615  "id": 1,
4616  "result": {
4617    "name": "NVMe0n1",
4618    "stats": [
4619      {
4620        "trid": {
4621          "trtype": "TCP",
4622          "adrfam": "IPv4",
4623          "traddr": "10.169.204.201",
4624          "trsvcid": "4420",
4625          "subnqn": "nqn.2016-06.io.spdk:cnode1"
4626        },
4627        "stat": {
4628          "bytes_read": 676691968,
4629          "num_read_ops": 165201,
4630          "bytes_written": 0,
4631          "num_write_ops": 0,
4632          "bytes_unmapped": 0,
4633          "num_unmap_ops": 0,
4634          "max_read_latency_ticks": 521487,
4635          "min_read_latency_ticks": 0,
4636          "write_latency_ticks": 0,
4637          "max_write_latency_ticks": 0,
4638          "min_write_latency_ticks": 0,
4639          "unmap_latency_ticks": 0,
4640          "max_unmap_latency_ticks": 0,
4641          "min_unmap_latency_ticks": 0,
4642          "copy_latency_ticks": 0,
4643          "max_copy_latency_ticks": 0,
4644          "min_copy_latency_ticks": 0
4645        }
4646      },
4647      {
4648        "trid": {
4649          "trtype": "TCP",
4650          "adrfam": "IPv4",
4651          "traddr": "8.8.8.6",
4652          "trsvcid": "4420",
4653          "subnqn": "nqn.2016-06.io.spdk:cnode1"
4654        },
4655        "stat": {
4656          "bytes_read": 677138432,
4657          "num_read_ops": 165317,
4658          "bytes_written": 0,
4659          "num_write_ops": 0,
4660          "bytes_unmapped": 0,
4661          "num_unmap_ops": 0,
4662          "max_read_latency_ticks": 108525,
4663          "min_read_latency_ticks": 0,
4664          "write_latency_ticks": 0,
4665          "max_write_latency_ticks": 0,
4666          "min_write_latency_ticks": 0,
4667          "unmap_latency_ticks": 0,
4668          "max_unmap_latency_ticks": 0,
4669          "min_unmap_latency_ticks": 0,
4670          "copy_latency_ticks": 0,
4671          "max_copy_latency_ticks": 0,
4672          "min_copy_latency_ticks": 0
4673        }
4674      }
4675    ]
4676  }
4677}
4678~~~
4679
4680### bdev_nvme_cuse_register {#rpc_bdev_nvme_cuse_register}
4681
4682Register CUSE device on NVMe controller.
4683
4684#### Parameters
4685
4686Name                    | Optional | Type        | Description
4687----------------------- | -------- | ----------- | -----------
4688name                    | Required | string      | Name of the NVMe controller
4689
4690#### Example
4691
4692Example request:
4693
4694~~~json
4695{
4696  "jsonrpc": "2.0",
4697  "method": "bdev_nvme_cuse_register",
4698  "id": 1,
4699  "params": {
4700    "name": "Nvme0"
4701  }
4702}
4703~~~
4704
4705Example response:
4706
4707~~~json
4708{
4709  "jsonrpc": "2.0",
4710  "id": 1,
4711  "result": true
4712}
4713~~~
4714
4715### bdev_nvme_cuse_unregister {#rpc_bdev_nvme_cuse_unregister}
4716
4717Unregister CUSE device on NVMe controller.
4718
4719#### Parameters
4720
4721Name                    | Optional | Type        | Description
4722----------------------- | -------- | ----------- | -----------
4723name                    | Required | string      | Name of the NVMe controller
4724
4725#### Example
4726
4727Example request:
4728
4729~~~json
4730{
4731  "params": {
4732    "name": "Nvme0"
4733  },
4734  "jsonrpc": "2.0",
4735  "method": "bdev_nvme_cuse_unregister",
4736  "id": 1
4737}
4738~~~
4739
4740Example response:
4741
4742~~~json
4743{
4744  "jsonrpc": "2.0",
4745  "id": 1,
4746  "result": true
4747}
4748~~~
4749
4750### bdev_zone_block_create {#rpc_bdev_zone_block_create}
4751
4752Creates a virtual zone device on top of existing non-zoned bdev.
4753
4754#### Parameters
4755
4756Name                    | Optional | Type        | Description
4757----------------------- | -------- | ----------- | -----------
4758name                    | Required | string      | Name of the Zone device
4759base_bdev               | Required | string      | Name of the Base bdev
4760zone_capacity           | Required | number      | Zone capacity in blocks
4761optimal_open_zones      | Required | number      | Number of zones required to reach optimal write speed
4762
4763#### Example
4764
4765Example request:
4766
4767~~~json
4768{
4769  "jsonrpc": "2.0",
4770  "method": "bdev_zone_block_create",
4771  "id": 1,
4772  "params": {
4773    "name": "zone1",
4774    "base_bdev": "NVMe0n1",
4775    "zone_capacity": 4096,
4776    "optimal_open_zones": 32
4777  }
4778}
4779~~~
4780
4781Example response:
4782
4783~~~json
4784{
4785  "jsonrpc": "2.0",
4786  "id": 1,
4787  "result": "zone1"
4788}
4789~~~
4790
4791### bdev_zone_block_delete {#rpc_bdev_zone_block_delete}
4792
4793Deletes a virtual zone device.
4794
4795#### Parameters
4796
4797Name                    | Optional | Type        | Description
4798----------------------- | -------- | ----------- | -----------
4799name                    | Required | string      | Name of the Zone device
4800
4801#### Example
4802
4803Example request:
4804
4805~~~json
4806{
4807  "jsonrpc": "2.0",
4808  "method": "bdev_zone_block_delete",
4809  "id": 1,
4810  "params": {
4811    "name": "zone1"
4812  }
4813}
4814~~~
4815
4816Example response:
4817
4818~~~json
4819{
4820  "jsonrpc": "2.0",
4821  "id": 1,
4822  "result": true
4823}
4824~~~
4825
4826### bdev_nvme_apply_firmware {#rpc_bdev_nvme_apply_firmware}
4827
4828Download and commit firmware to NVMe device.
4829
4830#### Parameters
4831
4832Name                    | Optional | Type        | Description
4833----------------------- | -------- | ----------- | -----------
4834filename                | Required | string      | filename of the firmware to download
4835bdev_name               | Required | string      | Name of the NVMe block device
4836
4837#### Example
4838
4839Example request:
4840
4841~~~json
4842{
4843  "jsonrpc": "2.0",
4844  "method": "bdev_nvme_apply_firmware",
4845  "id": 1,
4846  "params": {
4847    "filename": "firmware_file",
4848    "bdev_name": "NVMe0n1"
4849  }
4850}
4851~~~
4852
4853### bdev_nvme_get_transport_statistics {#rpc_bdev_nvme_get_transport_statistics}
4854
4855Get bdev_nvme poll group transport statistics.
4856
4857#### Parameters
4858
4859This RPC method accepts no parameters
4860
4861#### Response
4862
4863The response is an array of objects containing information about transport statistics per NVME poll group.
4864
4865#### Example
4866
4867Example request:
4868
4869~~~json
4870{
4871  "jsonrpc": "2.0",
4872  "id": 1,
4873  "method": "bdev_nvme_get_transport_statistics",
4874}
4875~~~
4876
4877Example response:
4878
4879~~~json
4880{
4881  "jsonrpc": "2.0",
4882  "id": 1,
4883	"result": {
4884	  "poll_groups": [
4885		{
4886		  "thread": "nvmf_tgt_poll_group_0",
4887		  "transports": [
4888			{
4889			  "trname": "RDMA",
4890			  "devices": [
4891				{
4892				  "dev_name": "mlx5_1",
4893				  "polls": 137492169,
4894				  "idle_polls": 137492169,
4895				  "completions": 0,
4896				  "queued_requests": 0,
4897				  "total_send_wrs": 0,
4898				  "send_sq_doorbell_updates": 0,
4899				  "total_recv_wrs": 0,
4900				  "recv_sq_doorbell_updates": 0
4901				},
4902				{
4903				  "dev_name": "mlx5_0",
4904				  "polls": 137985185,
4905				  "idle_polls": 137492169,
4906				  "completions": 1474593,
4907				  "queued_requests": 0,
4908				  "total_send_wrs": 1474593,
4909				  "send_sq_doorbell_updates": 426147,
4910				  "total_recv_wrs": 1474721,
4911				  "recv_sq_doorbell_updates": 348445
4912				}
4913			  ]
4914			},
4915			{
4916			  "trname": "PCIE",
4917			  "polls": 435419831,
4918			  "idle_polls": 434901004,
4919			  "completions": 1485543,
4920			  "cq_doorbell_updates": 518827,
4921			  "queued_requests": 0,
4922			  "submitted_requests": 1485543,
4923			  "sq_doorbell_updates": 516081
4924			}
4925		  ]
4926		},
4927		{
4928		  "thread": "nvmf_tgt_poll_group_1",
4929		  "transports": [
4930			{
4931			  "trname": "RDMA",
4932			  "devices": [
4933				{
4934				  "dev_name": "mlx5_1",
4935				  "polls": 140245630,
4936				  "idle_polls": 140245630,
4937				  "completions": 0,
4938				  "queued_requests": 0,
4939				  "total_send_wrs": 0,
4940				  "send_sq_doorbell_updates": 0,
4941				  "total_recv_wrs": 0,
4942				  "recv_sq_doorbell_updates": 0
4943				},
4944				{
4945				  "dev_name": "mlx5_0",
4946				  "polls": 140751844,
4947				  "idle_polls": 140245630,
4948				  "completions": 1489298,
4949				  "queued_requests": 0,
4950				  "total_send_wrs": 1489298,
4951				  "send_sq_doorbell_updates": 433510,
4952				  "total_recv_wrs": 1489426,
4953				  "recv_sq_doorbell_updates": 357956
4954				}
4955			  ]
4956			},
4957			{
4958			  "trname": "PCIE",
4959			  "polls": 429044294,
4960			  "idle_polls": 428525658,
4961			  "completions": 1478730,
4962			  "cq_doorbell_updates": 518636,
4963			  "queued_requests": 0,
4964			  "submitted_requests": 1478730,
4965			  "sq_doorbell_updates": 511658
4966			}
4967		  ]
4968		}
4969	  ]
4970	}
4971}
4972~~~
4973
4974### bdev_nvme_get_controller_health_info {#rpc_bdev_nvme_get_controller_health_info}
4975
4976Display health log of the required NVMe bdev device.
4977
4978#### Parameters
4979
4980Name                    | Optional | Type        | Description
4981----------------------- | -------- | ----------- | -----------
4982name                    | Required | string      | Name of the NVMe bdev controller
4983
4984#### Response
4985
4986The response is the object containing information about health log of the NVMe controller.
4987
4988#### Example
4989
4990Example request:
4991
4992~~~json
4993{
4994  "jsonrpc": "2.0",
4995  "method": "bdev_nvme_get_controller_health_info",
4996  "id": 1,
4997  "params": {
4998    "name": "Nvme0"
4999  }
5000}
5001~~~
5002
5003Example response:
5004
5005~~~json
5006{
5007  "model_number": "INTEL SSDPE2KX020T8",
5008  "serial_number": "BTLJ72430ARH2P0BGN",
5009  "firmware_revision": "VDV10110",
5010  "traddr": "0000:08:00.0",
5011  "temperature_celsius": 32,
5012  "available_spare_percentage": 99,
5013  "available_spare_threshold_percentage": 10,
5014  "percentage_used": 2,
5015  "data_units_read": 1013408619,
5016  "data_units_written": 346792685,
5017  "host_read_commands": 30457773282,
5018  "host_write_commands": 18949677715,
5019  "controller_busy_time": 4979,
5020  "power_cycles": 49,
5021  "power_on_hours": 31118,
5022  "unsafe_shutdowns": 18,
5023  "media_errors": 17,
5024  "num_err_log_entries": 19,
5025  "warning_temperature_time_minutes": 0,
5026  "critical_composite_temperature_time_minutes": 0
5027}
5028~~~
5029
5030### bdev_rbd_register_cluster {#rpc_bdev_rbd_register_cluster}
5031
5032This method is available only if SPDK was build with Ceph RBD support.
5033
5034#### Parameters
5035
5036Name                    | Optional | Type        | Description
5037----------------------- | -------- | ----------- | -----------
5038name                    | Required | string      | Registered Rados cluster object name
5039user_id                 | Optional | string      | Ceph ID (i.e. admin, not client.admin)
5040config_param            | Optional | string map  | Explicit librados configuration
5041config_file             | Optional | string      | File path of libraodos configuration file
5042key_file                | Optional | string      | File path of libraodos key file
5043
5044This RPC registers a Rados Cluster object handle which is only known
5045to rbd module, it uses user_id + config_param or user_id + config_file +
5046key_file or user_id + config_param + config_file + key_file to identify
5047a Rados cluster object.
5048
5049When accessing the Ceph cluster as some user other than "admin" (the
5050default), the "user_id" has to be set.
5051
5052The configuration items and secret key can be specified by setting config_param,
5053config_file and key_file, all of them, or none of them. If only config_param is
5054passed, all key/value pairs are passed to rados_conf_set to configure cluster access.
5055In practice, "mon_host" (= list of monitor address+port) and "key" (= the secret key
5056stored in Ceph keyrings) are enough. If config_file and key_file are specified, they must
5057exist with all relevant settings for accessing the Ceph cluster. If config_param, config_file
5058and key_file are specified, get the key/value pairs from config_file first and set to
5059rados_conf_set function, then set pairs in config_param and keyring in key_file. If nothing
5060is specified, it will get configuration file and key file from the default location
5061/etc/ceph/ceph.conf and /etc/ceph/ceph.client.user_id.keyring.
5062
5063#### Result
5064
5065Name of newly created Rados cluster object.
5066
5067#### Example
5068
5069Example request:
5070
5071~~
5072{
5073  "params": {
5074    "name": "rbd_cluster",
5075    "user_id": cinder,
5076    "config_file": "/root/ceph_conf/ceph.conf",
5077    "key_file": "/root/ceph_conf/ceph.client.cinder.keyring"
5078  },
5079  "jsonrpc": "2.0",
5080  "method": "bdev_rbd_register_cluster",
5081  "id": 1
5082}
5083~~
5084
5085Example response:
5086
5087~~
5088response:
5089{
5090  "jsonrpc": "2.0",
5091  "id": 1,
5092  "result": "rbd_cluster"
5093}
5094~~
5095
5096### bdev_rbd_unregister_cluster {#rpc_bdev_rbd_unregister_cluster}
5097
5098This method is available only if SPDK was build with Ceph RBD support.
5099If there is still rbd bdev using this cluster, the unregisteration operation
5100will fail.
5101
5102#### Result
5103
5104`true` if Rados cluster object with provided name was deleted or `false` otherwise.
5105
5106#### Parameters
5107
5108Name                    | Optional | Type        | Description
5109----------------------- | -------- | ----------- | -------------------------
5110name                    | Required | string      | Rados cluster object name
5111
5112#### Example
5113
5114Example request:
5115
5116~~
5117{
5118  "params": {
5119    "name": "rbd_cluster"
5120  },
5121  "jsonrpc": "2.0",
5122  "method": "bdev_rbd_unregister_cluster",
5123  "id": 1
5124}
5125~~
5126
5127Example response:
5128
5129~~
5130{
5131  "jsonrpc": "2.0",
5132  "id": 1,
5133  "result": true
5134}
5135~~
5136
5137### bdev_rbd_get_clusters_info {#rpc_bdev_rbd_get_clusters_info}
5138
5139This method is available only if SPDK was build with Ceph RBD support.
5140
5141#### Result
5142
5143Returns the cluster info of the Rados Cluster name if provided. Otherwise, it
5144returns the cluster info of every registered Raods Cluster name.
5145
5146#### Parameters
5147
5148Name                    | Optional | Type        | Description
5149----------------------- | -------- | ----------- | -------------------------
5150name                    | Optional | string      | Rados cluster object name
5151
5152#### Example
5153
5154Example request:
5155
5156~~
5157{
5158  "params": {
5159    "name": "rbd_cluster"
5160  },
5161  "jsonrpc": "2.0",
5162  "method": "bdev_rbd_get_clusters_info",
5163  "id": 1
5164}
5165~~
5166
5167Example response:
5168
5169~~
5170{
5171  "jsonrpc": "2.0",
5172  "cluster_name": "rbd_cluster"
5173}
5174~~
5175
5176### bdev_rbd_create {#rpc_bdev_rbd_create}
5177
5178Create @ref bdev_config_rbd bdev
5179
5180This method is available only if SPDK was build with Ceph RBD support.
5181
5182#### Parameters
5183
5184Name                    | Optional | Type        | Description
5185----------------------- | -------- | ----------- | -----------
5186name                    | Optional | string      | Bdev name
5187user_id                 | Optional | string      | Ceph ID (i.e. admin, not client.admin)
5188pool_name               | Required | string      | Pool name
5189rbd_name                | Required | string      | Image name
5190block_size              | Required | number      | Block size
5191config                  | Optional | string map  | Explicit librados configuration
5192cluster_name            | Optional | string      | Rados cluster object name created in this module.
5193uuid                    | Optional | string      | UUID of new bdev
5194
5195If no config is specified, Ceph configuration files must exist with
5196all relevant settings for accessing the pool. If a config map is
5197passed, the configuration files are ignored and instead all key/value
5198pairs are passed to rados_conf_set to configure cluster access. In
5199practice, "mon_host" (= list of monitor address+port) and "key" (= the
5200secret key stored in Ceph keyrings) are enough.
5201
5202When accessing the image as some user other than "admin" (the
5203default), the "user_id" has to be set.
5204
5205If provided with cluster_name option, it will use the Rados cluster object
5206referenced by the name (created by bdev_rbd_register_cluster RPC) and ignores
5207"user_id + config" combination to create its own Rados cluster. In this scenario,
5208all the bdevs will share the same cluster with one connection of Ceph in librbd module.
5209Performance tuning on the I/O workload could be done by estimating how many io_contxt
5210threads and messager threads in Ceph side and how many cores would be reasonable to provide
5211for SPDK to get up to your projections.
5212
5213#### Result
5214
5215Name of newly created bdev.
5216
5217#### Example
5218
5219Example request with `key` from `/etc/ceph/ceph.client.admin.keyring`:
5220
5221~~~json
5222{
5223  "params": {
5224    "pool_name": "rbd",
5225    "rbd_name": "foo",
5226    "config": {
5227      "mon_host": "192.168.7.1:6789,192.168.7.2:6789",
5228      "key": "AQDwf8db7zR1GRAA5k7NKXjS5S5V4mntwUDnGQ==",
5229    }
5230    "block_size": 4096,
5231    "uuid": "76210ea4-7920-40a0-a07b-8992a7443c76"
5232  },
5233  "jsonrpc": "2.0",
5234  "method": "bdev_rbd_create",
5235  "id": 1
5236}
5237~~~
5238
5239Example response:
5240
5241~~~json
5242response:
5243{
5244  "jsonrpc": "2.0",
5245  "id": 1,
5246  "result": "Ceph0"
5247}
5248~~~
5249
5250Example request with `cluster_name`:
5251
5252~~
5253{
5254  "params": {
5255    "pool_name": "rbd",
5256    "rbd_name": "foo",
5257    "block_size": 4096,
5258    "cluster_name": "rbd_cluster"
5259  },
5260  "jsonrpc": "2.0",
5261  "method": "bdev_rbd_create",
5262  "id": 1
5263}
5264~~
5265
5266Example response:
5267
5268~~
5269response:
5270{
5271  "jsonrpc": "2.0",
5272  "id": 1,
5273  "result": "Ceph0"
5274}
5275~~
5276
5277### bdev_rbd_delete {#rpc_bdev_rbd_delete}
5278
5279Delete @ref bdev_config_rbd bdev
5280
5281This method is available only if SPDK was build with Ceph RBD support.
5282
5283#### Result
5284
5285`true` if bdev with provided name was deleted or `false` otherwise.
5286
5287#### Parameters
5288
5289Name                    | Optional | Type        | Description
5290----------------------- | -------- | ----------- | -----------
5291name                    | Required | string      | Bdev name
5292
5293#### Example
5294
5295Example request:
5296
5297~~~json
5298{
5299  "params": {
5300    "name": "Rbd0"
5301  },
5302  "jsonrpc": "2.0",
5303  "method": "bdev_rbd_delete",
5304  "id": 1
5305}
5306~~~
5307
5308Example response:
5309
5310~~~json
5311{
5312  "jsonrpc": "2.0",
5313  "id": 1,
5314  "result": true
5315}
5316~~~
5317
5318### bdev_rbd_resize {#rpc_bdev_rbd_resize}
5319
5320Resize @ref bdev_config_rbd bdev
5321
5322This method is available only if SPDK was build with Ceph RBD support.
5323
5324#### Result
5325
5326`true` if bdev with provided name was resized or `false` otherwise.
5327
5328#### Parameters
5329
5330Name                    | Optional | Type        | Description
5331----------------------- | -------- | ----------- | -----------
5332name                    | Required | string      | Bdev name
5333new_size                | Required | int         | New bdev size for resize operation in MiB
5334
5335#### Example
5336
5337Example request:
5338
5339~~~json
5340{
5341  "params": {
5342    "name": "Rbd0"
5343    "new_size": "4096"
5344  },
5345  "jsonrpc": "2.0",
5346  "method": "bdev_rbd_resize",
5347  "id": 1
5348}
5349~~~
5350
5351Example response:
5352
5353~~~json
5354{
5355  "jsonrpc": "2.0",
5356  "id": 1,
5357  "result": true
5358}
5359~~~
5360
5361### bdev_delay_create {#rpc_bdev_delay_create}
5362
5363Create delay bdev. This bdev type redirects all IO to it's base bdev and inserts a delay on the completion
5364path to create an artificial drive latency. All latency values supplied to this bdev should be in microseconds.
5365
5366#### Parameters
5367
5368Name                    | Optional | Type        | Description
5369----------------------- | -------- | ----------- | -----------
5370name                    | Required | string      | Bdev name
5371base_bdev_name          | Required | string      | Base bdev name
5372avg_read_latency        | Required | number      | average read latency (us)
5373p99_read_latency        | Required | number      | p99 read latency (us)
5374avg_write_latency       | Required | number      | average write latency (us)
5375p99_write_latency       | Required | number      | p99 write latency (us)
5376
5377#### Result
5378
5379Name of newly created bdev.
5380
5381#### Example
5382
5383Example request:
5384
5385~~~json
5386{
5387  "params": {
5388    "base_bdev_name": "Null0",
5389    "name": "Delay0",
5390    "avg_read_latency": "15",
5391    "p99_read_latency": "50",
5392    "avg_write_latency": "40",
5393    "p99_write_latency": "110",
5394  },
5395  "jsonrpc": "2.0",
5396  "method": "bdev_delay_create",
5397  "id": 1
5398}
5399~~~
5400
5401Example response:
5402
5403~~~json
5404{
5405  "jsonrpc": "2.0",
5406  "id": 1,
5407  "result": "Delay0"
5408}
5409~~~
5410
5411### bdev_delay_delete {#rpc_bdev_delay_delete}
5412
5413Delete delay bdev.
5414
5415#### Parameters
5416
5417Name                    | Optional | Type        | Description
5418----------------------- | -------- | ----------- | -----------
5419name                    | Required | string      | Bdev name
5420
5421#### Example
5422
5423Example request:
5424
5425~~~json
5426{
5427  "params": {
5428    "name": "Delay0"
5429  },
5430  "jsonrpc": "2.0",
5431  "method": "bdev_delay_delete",
5432  "id": 1
5433}
5434
5435~~~
5436
5437Example response:
5438
5439~~~json
5440{
5441  "jsonrpc": "2.0",
5442  "id": 1,
5443  "result": true
5444}
5445~~~
5446
5447### bdev_delay_update_latency {#rpc_bdev_delay_update_latency}
5448
5449Update a target latency value associated with a given delay bdev. Any currently
5450outstanding I/O will be completed with the old latency.
5451
5452#### Parameters
5453
5454Name                    | Optional | Type        | Description
5455----------------------- | -------- | ----------- | -----------
5456delay_bdev_name         | Required | string      | Name of the delay bdev
5457latency_type            | Required | string      | One of: avg_read, avg_write, p99_read, p99_write
5458latency_us              | Required | number      | The new latency value in microseconds
5459
5460#### Result
5461
5462Name of newly created bdev.
5463
5464#### Example
5465
5466Example request:
5467
5468~~~json
5469{
5470  "params": {
5471    "delay_bdev_name": "Delay0",
5472    "latency_type": "avg_read",
5473    "latency_us": "100",
5474  },
5475  "jsonrpc": "2.0",
5476  "method": "bdev_delay_update_latency",
5477  "id": 1
5478}
5479~~~
5480
5481Example response:
5482
5483~~~json
5484{
5485  "result": "true"
5486}
5487~~~
5488
5489### bdev_error_create {#rpc_bdev_error_create}
5490
5491Construct error bdev.
5492
5493#### Parameters
5494
5495Name                    | Optional | Type        | Description
5496----------------------- | -------- | ----------- | -----------
5497base_name               | Required | string      | Base bdev name
5498uuid                    | Optional | string      | UUID for this bdev
5499
5500#### Example
5501
5502Example request:
5503
5504~~~json
5505{
5506  "params": {
5507    "base_name": "Malloc0"
5508  },
5509  "jsonrpc": "2.0",
5510  "method": "bdev_error_create",
5511  "id": 1
5512}
5513~~~
5514
5515Example response:
5516
5517~~~json
5518{
5519  "jsonrpc": "2.0",
5520  "id": 1,
5521  "result": true
5522}
5523~~~
5524
5525### bdev_error_delete {#rpc_bdev_error_delete}
5526
5527Delete error bdev
5528
5529#### Result
5530
5531`true` if bdev with provided name was deleted or `false` otherwise.
5532
5533#### Parameters
5534
5535Name                    | Optional | Type        | Description
5536----------------------- | -------- | ----------- | -----------
5537name                    | Required | string      | Error bdev name
5538
5539#### Example
5540
5541Example request:
5542
5543~~~json
5544{
5545  "params": {
5546    "name": "EE_Malloc0"
5547  },
5548  "jsonrpc": "2.0",
5549  "method": "bdev_error_delete",
5550  "id": 1
5551}
5552~~~
5553
5554Example response:
5555
5556~~~json
5557{
5558  "jsonrpc": "2.0",
5559  "id": 1,
5560  "result": true
5561}
5562~~~
5563
5564### bdev_error_inject_error {#rpc_bdev_error_inject_error}
5565
5566Inject an error via an error bdev. Create an error bdev on base bdev first. Default 'num'
5567value is 1 and if 'num' is set to zero, the specified injection is disabled.
5568
5569#### Parameters
5570
5571Name                    | Optional | Type        | Description
5572----------------------- | -------- | ----------- | -----------
5573name                    | Required | string      | Name of the error injection bdev
5574io_type                 | Required | string      | io type 'clear' 'read' 'write' 'unmap' 'flush' 'all'
5575error_type              | Required | string      | error type 'failure' 'pending' 'corrupt_data' 'nomem'
5576num                     | Optional | int         | the number of commands you want to fail.(default:1)
5577queue_depth             | Optional | int         | the queue depth at which to trigger the error
5578corrupt_offset          | Optional | int         | the offset in bytes to xor with corrupt_value
5579corrupt_value           | Optional | int         | the value for xor (1-255, 0 is invalid)
5580
5581#### Example
5582
5583Example request:
5584
5585~~~json
5586{
5587  "jsonrpc": "2.0",
5588  "method": "bdev_error_inject_error",
5589  "id": 1,
5590  "params": {
5591    "name": "EE_Malloc0",
5592    "io_type": "write",
5593    "error_type": "pending",
5594    "num": 1
5595  }
5596}
5597~~~
5598
5599Example response:
5600
5601~~~json
5602{
5603  "jsonrpc": "2.0",
5604  "id": 1,
5605  "result": true
5606}
5607~~~
5608
5609### bdev_iscsi_set_options {#rpc_bdev_iscsi_set_options}
5610
5611This RPC can be called at any time, but the new value will only take effect for new iSCSI bdevs.
5612
5613#### Parameters
5614
5615Name                       | Optional | Type        | Description
5616-------------------------- | -------- | ----------- | -----------
5617timeout_sec                | Optional | number      | Timeout for command, in seconds, if 0, don't track timeout
5618
5619#### Example
5620
5621Example request:
5622
5623~~~json
5624request:
5625{
5626  "params": {
5627    "timeout_sec": 30
5628  },
5629  "jsonrpc": "2.0",
5630  "method": "bdev_iscsi_set_options",
5631  "id": 1
5632}
5633~~~
5634
5635Example response:
5636
5637~~~json
5638{
5639  "jsonrpc": "2.0",
5640  "id": 1,
5641  "result": true
5642}
5643~~~
5644
5645### bdev_iscsi_create {#rpc_bdev_iscsi_create}
5646
5647Connect to iSCSI target and create bdev backed by this connection.
5648
5649This method is available only if SPDK was build with iSCSI initiator support.
5650
5651#### Parameters
5652
5653Name                    | Optional | Type        | Description
5654----------------------- | -------- | ----------- | -----------
5655name                    | Required | string      | Bdev name
5656initiator_iqn           | Required | string      | IQN name used during connection
5657url                     | Required | string      | iSCSI resource URI
5658
5659#### Result
5660
5661Name of newly created bdev.
5662
5663#### Example
5664
5665Example request:
5666
5667~~~json
5668{
5669  "params": {
5670    "url": "iscsi://127.0.0.1/iqn.2016-06.io.spdk:disk1/0",
5671    "initiator_iqn": "iqn.2016-06.io.spdk:init",
5672    "name": "iSCSI0"
5673  },
5674  "jsonrpc": "2.0",
5675  "method": "bdev_iscsi_create",
5676  "id": 1
5677}
5678~~~
5679
5680Example response:
5681
5682~~~json
5683{
5684  "jsonrpc": "2.0",
5685  "id": 1,
5686  "result": "iSCSI0"
5687}
5688~~~
5689
5690### bdev_iscsi_delete {#rpc_bdev_iscsi_delete}
5691
5692Delete iSCSI bdev and terminate connection to target.
5693
5694This method is available only if SPDK was built with iSCSI initiator support.
5695
5696#### Parameters
5697
5698Name                    | Optional | Type        | Description
5699----------------------- | -------- | ----------- | -----------
5700name                    | Required | string      | Bdev name
5701
5702#### Example
5703
5704Example request:
5705
5706~~~json
5707{
5708  "params": {
5709    "name": "iSCSI0"
5710  },
5711  "jsonrpc": "2.0",
5712  "method": "bdev_iscsi_delete",
5713  "id": 1
5714}
5715~~~
5716
5717Example response:
5718
5719~~~json
5720{
5721  "jsonrpc": "2.0",
5722  "id": 1,
5723  "result": true
5724}
5725~~~
5726
5727### bdev_ftl_create {#rpc_bdev_ftl_create}
5728
5729Create FTL bdev.
5730
5731This RPC is subject to change.
5732
5733#### Parameters
5734
5735Name                    | Optional | Type        | Description
5736----------------------- | -------- | ----------- | -----------
5737name                    | Required | string      | Bdev name
5738base_bdev               | Required | string      | Name of the base device
5739cache                   | Required | string      | Name of the cache device
5740uuid                    | Optional | string      | UUID of restored bdev (not applicable when creating new instance)
5741core_mask               | Optional | string      | CPU core(s) possible for placement of the ftl core thread, application main thread by default
5742overprovisioning        | Optional | int         | Percentage of base device used for relocation, 20% by default
5743fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data on target application shutdown and rely on shared memory during next load
5744
5745#### Result
5746
5747Name of newly created bdev.
5748
5749#### Example
5750
5751Example request:
5752
5753~~~json
5754{
5755  "params": {
5756    "name": "ftl0",
5757    "base_bdev": "nvme0n1",
5758    "cache": "nvme1n1",
5759    "uuid": "4a7481ce-786f-41a0-9b86-8f7465c8f4d3",
5760    "core_mask": "[0]",
5761    "overprovisioning": 10
5762  },
5763  "jsonrpc": "2.0",
5764  "method": "bdev_ftl_create",
5765  "id": 1
5766}
5767~~~
5768
5769Example response:
5770
5771~~~json
5772{
5773  "jsonrpc": "2.0",
5774  "id": 1,
5775  "result": {
5776      "name" : "ftl0"
5777      "uuid" : "4a7481ce-786f-41a0-9b86-8f7465c8f4d3"
5778  }
5779}
5780~~~
5781
5782### bdev_ftl_load {#rpc_bdev_ftl_load}
5783
5784Loads FTL bdev.
5785
5786This RPC is subject to change.
5787
5788#### Parameters
5789
5790Name                    | Optional | Type        | Description
5791----------------------- | -------- | ----------- | -----------
5792name                    | Required | string      | Bdev name
5793base_bdev               | Required | string      | Name of the base device
5794cache                   | Required | string      | Name of the cache device
5795uuid                    | Required | string      | UUID of restored bdev
5796core_mask               | Optional | string      | CPU core(s) possible for placement of the ftl core thread, application main thread by default
5797overprovisioning        | Optional | int         | Percentage of base device used for relocation, 20% by default
5798fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data on target application shutdown and rely on shared memory during next load
5799
5800#### Result
5801
5802Name of loaded bdev.
5803
5804#### Example
5805
5806Example request:
5807
5808~~~json
5809{
5810  "params": {
5811    "name": "ftl0",
5812    "base_bdev": "nvme0n1",
5813    "cache": "nvme1n1",
5814    "uuid": "4a7481ce-786f-41a0-9b86-8f7465c8f4d3",
5815    "core_mask": "[0]",
5816    "overprovisioning": 10
5817  },
5818  "jsonrpc": "2.0",
5819  "method": "bdev_ftl_load",
5820  "id": 1
5821}
5822~~~
5823
5824Example response:
5825
5826~~~json
5827{
5828  "jsonrpc": "2.0",
5829  "id": 1,
5830  "result": {
5831      "name" : "ftl0"
5832      "uuid" : "4a7481ce-786f-41a0-9b86-8f7465c8f4d3"
5833  }
5834}
5835~~~
5836
5837### bdev_ftl_delete {#rpc_bdev_ftl_delete}
5838
5839Delete FTL bdev.
5840
5841This RPC is subject to change.
5842
5843#### Parameters
5844
5845Name                    | Optional | Type        | Description
5846----------------------- | -------- | ----------- | -----------
5847name                    | Required | string      | Bdev name
5848fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data during deletion and rely on shared memory during next load
5849
5850#### Example
5851
5852Example request:
5853
5854~~~json
5855{
5856  "params": {
5857    "name": "ftl0"
5858  },
5859  "jsonrpc": "2.0",
5860  "method": "bdev_ftl_delete",
5861  "id": 1
5862}
5863~~~
5864
5865Example response:
5866
5867~~~json
5868{
5869  "jsonrpc": "2.0",
5870  "id": 1,
5871  "result": true
5872}
5873~~~
5874
5875### bdev_ftl_unload {#rpc_bdev_ftl_unload}
5876
5877Unloads FTL bdev.
5878
5879This RPC is subject to change.
5880
5881#### Parameters
5882
5883Name                    | Optional | Type        | Description
5884----------------------- | -------- | ----------- | -----------
5885name                    | Required | string      | Bdev name
5886fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data during deletion and rely on shared memory during next load
5887
5888#### Example
5889
5890Example request:
5891
5892~~~json
5893{
5894  "params": {
5895    "name": "ftl0"
5896  },
5897  "jsonrpc": "2.0",
5898  "method": "bdev_ftl_unload",
5899  "id": 1
5900}
5901~~~
5902
5903Example response:
5904
5905~~~json
5906{
5907  "jsonrpc": "2.0",
5908  "id": 1,
5909  "result": true
5910}
5911~~~
5912
5913### bdev_ftl_unmap {#rpc_bdev_ftl_unmap}
5914
5915Unmap range of LBAs.
5916
5917This RPC is subject to change.
5918
5919#### Parameters
5920
5921Name                    | Optional | Type        | Description
5922----------------------- | -------- | ----------- | -----------
5923name                    | Required | string      | Bdev name
5924lba                     | Required | number      | start lba, aligned to 1024
5925num_blocks              | Required | number      | number of blocks, aligned to 1024
5926
5927#### Example
5928
5929Example request:
5930
5931~~~json
5932{
5933  "params": {
5934    "name": "ftl0"
5935    "lba": "0"
5936    "num_blocks": "1024"
5937  },
5938  "jsonrpc": "2.0",
5939  "method": "bdev_ftl_unmap",
5940  "id": 1
5941}
5942~~~
5943
5944Example response:
5945
5946~~~json
5947{
5948  "jsonrpc": "2.0",
5949  "id": 1,
5950  "result": true
5951}
5952~~~
5953
5954### bdev_ftl_get_stats {#rpc_bdev_ftl_get_stats}
5955
5956Get IO statistics for FTL bdev
5957
5958This RPC is subject to change.
5959
5960#### Parameters
5961
5962Name                    | Optional | Type        | Description
5963----------------------- | -------- | ----------- | -----------
5964name                    | Required | string      | Bdev name
5965
5966#### Response
5967
5968The response is an object containing IO statistics for an FTL instance, split into multiple subobjects:
5969
5970- `user` - contains information about number of IOs, and errors for any incoming requests,
5971- `cmp` - information about IO for the compaction process,
5972- `gc` - information about IO for the garbage collection process,
5973- `md_base` - internal metadata requests to the base FTL device,
5974- `md_nv_cache` - internal metadata requests to the cache device,
5975- `l2p` - requests done on the L2P cache region.
5976
5977Each subobject contains the following information:
5978
5979- `ios` - describes the total number of IOs requested,
5980- `blocks` - the total number of requested blocks,
5981- `errors` - describes the number of detected errors for a given operation, with the following distinctions:
5982  - `media` - media errors,
5983  - `crc` - mismatch in calculated CRC versus saved checksum in the metadata,
5984  - `other` - any other errors.
5985
5986#### Example
5987
5988Example request:
5989
5990~~~json
5991{
5992  "params": {
5993    "name": "ftl0"
5994  },
5995  "jsonrpc": "2.0",
5996  "method": "bdev_ftl_get_stats",
5997  "id": 1
5998}
5999~~~
6000
6001Example response:
6002
6003~~~json
6004{
6005  "jsonrpc": "2.0",
6006  "id": 1,
6007  "result": {
6008      "name": "ftl0",
6009      "user": {
6010        "read": {
6011          "ios": 0,
6012          "blocks": 0,
6013          "errors": {
6014            "media": 0,
6015            "crc": 0,
6016            "other": 0
6017          }
6018        },
6019        "write": {
6020          "ios": 318707,
6021          "blocks": 318707,
6022          "errors": {
6023            "media": 0,
6024            "other": 0
6025          }
6026        }
6027      },
6028      "cmp": {
6029        "read": {
6030          "ios": 0,
6031          "blocks": 0,
6032          "errors": {
6033            "media": 0,
6034            "crc": 0,
6035            "other": 0
6036          }
6037        },
6038        "write": {
6039          "ios": 0,
6040          "blocks": 0,
6041          "errors": {
6042            "media": 0,
6043            "other": 0
6044          }
6045        }
6046      },
6047      "gc": {
6048        "read": {
6049          "ios": 0,
6050          "blocks": 0,
6051          "errors": {
6052            "media": 0,
6053            "crc": 0,
6054            "other": 0
6055          }
6056        },
6057        "write": {
6058          "ios": 0,
6059          "blocks": 0,
6060          "errors": {
6061            "media": 0,
6062            "other": 0
6063          }
6064        }
6065      },
6066      "md_base": {
6067        "read": {
6068          "ios": 0,
6069          "blocks": 0,
6070          "errors": {
6071            "media": 0,
6072            "crc": 0,
6073            "other": 0
6074          }
6075        },
6076        "write": {
6077          "ios": 1,
6078          "blocks": 32,
6079          "errors": {
6080            "media": 0,
6081            "other": 0
6082          }
6083        }
6084      },
6085      "md_nv_cache": {
6086        "read": {
6087          "ios": 0,
6088          "blocks": 0,
6089          "errors": {
6090            "media": 0,
6091            "crc": 0,
6092            "other": 0
6093          }
6094        },
6095        "write": {
6096          "ios": 1064,
6097          "blocks": 1073896,
6098          "errors": {
6099            "media": 0,
6100            "other": 0
6101          }
6102        }
6103      },
6104      "l2p": {
6105        "read": {
6106          "ios": 240659,
6107          "blocks": 240659,
6108          "errors": {
6109            "media": 0,
6110            "crc": 0,
6111            "other": 0
6112          }
6113        },
6114        "write": {
6115          "ios": 235745,
6116          "blocks": 235745,
6117          "errors": {
6118            "media": 0,
6119            "other": 0
6120          }
6121        }
6122      }
6123    }
6124}
6125~~~
6126
6127### bdev_ftl_get_properties {#rpc_bdev_ftl_get_properties}
6128
6129Get FTL properties
6130
6131#### Parameters
6132
6133Name                    | Optional | Type        | Description
6134----------------------- | -------- | ----------- | -----------
6135name                    | Required | string      | Bdev name
6136
6137#### Response
6138
6139The response contains FTL bdev properties. Some of them can be modified, other
6140reported as read only.
6141
6142#### Example
6143
6144Example request:
6145
6146~~~json
6147{
6148  "params": {
6149    "name": "ftl0"
6150  },
6151  "jsonrpc": "2.0",
6152  "method": "bdev_ftl_get_properties",
6153  "id": 1
6154}
6155~~~
6156
6157Example response:
6158
6159~~~json
6160{
6161  "jsonrpc": "2.0",
6162  "id": 1,
6163  "result": {
6164    "name": "ftl0",
6165    "properties": [
6166      {
6167        "name": "property1",
6168        "value": "Property Value 1",
6169        "unit": "MiB/s",
6170        "desc": "This is an example of read-only property",
6171        "read-only": true
6172      },
6173      {
6174        "name": "property2",
6175        "value": 17,
6176        "unit": "s",
6177        "desc": "This is an example of FTL modifiable property",
6178        "read-only": false
6179      }
6180    ]
6181  }
6182}
6183~~~
6184
6185### bdev_ftl_set_property {#rpc_bdev_ftl_set_property}
6186
6187Set FTL property. Trying to set a read-only property will result in an error.
6188
6189#### Parameters
6190
6191Name                    | Optional | Type        | Description
6192----------------------- | -------- | ----------- | -----------
6193name                    | Required | string      | Bdev name
6194property                | Required | string      | Name of the property to modify
6195value                   | Required | string      | New value of the property to be set
6196
6197#### Example
6198
6199Example request:
6200
6201~~~json
6202{
6203  "params": {
6204    "name": "ftl0"
6205    "property": "nv_cache.flush"
6206    "value": "true"
6207  },
6208  "jsonrpc": "2.0",
6209  "method": "bdev_ftl_set_property",
6210  "id": 1
6211}
6212~~~
6213
6214Example response:
6215
6216~~~json
6217{
6218  "jsonrpc": "2.0",
6219  "id": 1,
6220  "result": true
6221}
6222~~~
6223
6224### bdev_passthru_create {#rpc_bdev_passthru_create}
6225
6226Create passthru bdev. This bdev type redirects all IO to it's base bdev. It has no other purpose than being an example
6227and a starting point in development of new bdev type.
6228
6229#### Parameters
6230
6231Name                    | Optional | Type        | Description
6232----------------------- | -------- | ----------- | -----------
6233name                    | Required | string      | Bdev name
6234base_bdev_name          | Required | string      | Base bdev name
6235uuid                    | Optional | string      | UUID of new bdev
6236
6237#### Result
6238
6239Name of newly created bdev.
6240
6241#### Example
6242
6243Example request:
6244
6245~~~json
6246{
6247  "params": {
6248    "base_bdev_name": "Malloc0",
6249    "name": "Passsthru0"
6250  },
6251  "jsonrpc": "2.0",
6252  "method": "bdev_passthru_create",
6253  "id": 1
6254}
6255~~~
6256
6257Example response:
6258
6259~~~json
6260{
6261  "jsonrpc": "2.0",
6262  "id": 1,
6263  "result": "Passsthru0"
6264}
6265~~~
6266
6267### bdev_passthru_delete {#rpc_bdev_passthru_delete}
6268
6269Delete passthru bdev.
6270
6271#### Parameters
6272
6273Name                    | Optional | Type        | Description
6274----------------------- | -------- | ----------- | -----------
6275name                    | Required | string      | Bdev name
6276
6277#### Example
6278
6279Example request:
6280
6281~~~json
6282{
6283  "params": {
6284    "name": "Passsthru0"
6285  },
6286  "jsonrpc": "2.0",
6287  "method": "bdev_passthru_delete",
6288  "id": 1
6289}
6290
6291~~~
6292
6293Example response:
6294
6295~~~json
6296{
6297  "jsonrpc": "2.0",
6298  "id": 1,
6299  "result": true
6300}
6301~~~
6302
6303### bdev_xnvme_create {#rpc_bdev_xnvme_create}
6304
6305Create xnvme bdev. This bdev type redirects all IO to its underlying backend.
6306
6307#### Parameters
6308
6309Name                    | Optional | Type        | Description
6310----------------------- | -------- | ----------- | -----------
6311name                    | Required | string      | name of xNVMe bdev to create
6312filename                | Required | string      | path to device or file (ex: /dev/nvme0n1)
6313io_mechanism            | Required | string      | IO mechanism to use (ex: libaio, io_uring, io_uring_cmd, etc.)
6314conserve_cpu            | Optional | boolean     | Whether or not to conserve CPU when polling (default: false)
6315
6316#### Result
6317
6318Name of newly created bdev.
6319
6320#### Example
6321
6322Example request:
6323
6324~~~json
6325{
6326  "jsonrpc": "2.0",
6327  "method": "bdev_xnvme_create",
6328  "id": 1,
6329  "params": {
6330    "name": "bdev_ng0n1",
6331    "filename": "/dev/ng0n1",
6332    "io_mechanism": "io_uring_cmd",
6333    "conserve_cpu": false,
6334  }
6335}
6336~~~
6337
6338Example response:
6339
6340~~~json
6341{
6342  "jsonrpc": "2.0",
6343  "id": 1,
6344  "result": "bdev_ng0n1"
6345}
6346~~~
6347
6348### bdev_xnvme_delete {#rpc_bdev_xnvme_delete}
6349
6350Delete xnvme bdev.
6351
6352#### Parameters
6353
6354Name                    | Optional | Type        | Description
6355----------------------- | -------- | ----------- | -----------
6356name                    | Required | string      | name of xnvme bdev to delete
6357
6358#### Example
6359
6360Example request:
6361
6362~~~json
6363{
6364  "params": {
6365    "name": "bdev_ng0n1"
6366  },
6367  "jsonrpc": "2.0",
6368  "method": "bdev_xnvme_delete",
6369  "id": 1
6370}
6371
6372~~~
6373
6374Example response:
6375
6376~~~json
6377{
6378  "jsonrpc": "2.0",
6379  "id": 1,
6380  "result": true
6381}
6382~~~
6383
6384### bdev_virtio_attach_controller {#rpc_bdev_virtio_attach_controller}
6385
6386Create new initiator @ref bdev_config_virtio_scsi or @ref bdev_config_virtio_blk and expose all found bdevs.
6387
6388#### Parameters
6389
6390Name                    | Optional | Type        | Description
6391----------------------- | -------- | ----------- | -----------
6392name                    | Required | string      | Virtio SCSI base bdev name or Virtio Blk bdev name
6393trtype                  | Required | string      | Virtio target trtype: pci or user
6394traddr                  | Required | string      | target address: BDF or UNIX socket file path
6395dev_type                | Required | string      | Virtio device type: blk or scsi
6396vq_count                | Optional | number      | Number of queues this controller will utilize (default: 1)
6397vq_size                 | Optional | number      | Size of each queue. Must be power of 2. (default: 512)
6398
6399In case of Virtio SCSI the `name` parameter will be base name for new created bdevs. For Virtio Blk `name` will be the
6400name of created bdev.
6401
6402`vq_count` and `vq_size` parameters are valid only if `trtype` is `user`.
6403
6404#### Result
6405
6406Array of names of newly created bdevs.
6407
6408#### Example
6409
6410Example request:
6411
6412~~~json
6413{
6414  "params": {
6415    "name": "VirtioScsi0",
6416    "trtype": "user",
6417    "vq_size": 128,
6418    "dev_type": "scsi",
6419    "traddr": "/tmp/VhostScsi0",
6420    "vq_count": 4
6421  },
6422  "jsonrpc": "2.0",
6423  "method": "bdev_virtio_attach_controller",
6424  "id": 1
6425}
6426~~~
6427
6428Example response:
6429
6430~~~json
6431{
6432  "jsonrpc": "2.0",
6433  "id": 1,
6434  "result": ["VirtioScsi0t2", "VirtioScsi0t4"]
6435}
6436~~~
6437
6438### bdev_virtio_scsi_get_devices {#rpc_bdev_virtio_scsi_get_devices}
6439
6440Show information about all available Virtio SCSI devices.
6441
6442#### Parameters
6443
6444This method has no parameters.
6445
6446#### Result
6447
6448Array of Virtio SCSI information objects.
6449
6450#### Example
6451
6452Example request:
6453
6454~~~json
6455{
6456  "jsonrpc": "2.0",
6457  "method": "bdev_virtio_scsi_get_devices",
6458  "id": 1
6459}
6460~~~
6461
6462Example response:
6463
6464~~~json
6465{
6466  "jsonrpc": "2.0",
6467  "id": 1,
6468  "result": [
6469    {
6470      "name": "VirtioScsi0",
6471      "virtio": {
6472          "vq_size": 128,
6473          "vq_count": 4,
6474          "type": "user",
6475          "socket": "/tmp/VhostScsi0"
6476      }
6477    }
6478  ]
6479}
6480~~~
6481
6482### bdev_virtio_detach_controller {#rpc_bdev_virtio_detach_controller}
6483
6484Remove a Virtio device. This command can be used to remove any type of virtio device.
6485
6486#### Parameters
6487
6488Name                    | Optional | Type        | Description
6489----------------------- | -------- | ----------- | -----------
6490name                    | Required | string      | Virtio name
6491
6492#### Example
6493
6494Example request:
6495
6496~~~json
6497{
6498  "params": {
6499    "name": "VirtioUser0"
6500  },
6501  "jsonrpc": "2.0",
6502  "method": "bdev_virtio_detach_controller",
6503  "id": 1
6504}
6505
6506~~~
6507
6508Example response:
6509
6510~~~json
6511{
6512  "jsonrpc": "2.0",
6513  "id": 1,
6514  "result": true
6515}
6516~~~
6517
6518### bdev_virtio_blk_set_hotplug {#rpc_bdev_virtio_blk_set_hotplug}
6519
6520Enable/Disable the virtio blk hotplug monitor or change the monitor period time
6521
6522#### Parameters
6523
6524Name                    | Optional | Type        | Description
6525----------------------- | -------- | ----------- | -----------
6526enable                  | Required | bool        | Enable or disable the virtio blk hotplug monitor
6527period-us               | Optional | number      | The period time of the monitor
6528
6529When the enable is true then the period-us is optional. If user don't set the period time then use the default
6530value. When the enable is false then the period-us is not required.
6531
6532#### Result
6533
6534True the rpc is successful otherwise false
6535
6536#### Example
6537
6538Example request:
6539
6540~~~json
6541{
6542  "params": {
6543    "enable": "true",
6544    "period-us": "1000000"
6545  },
6546  "jsonrpc": "2.0",
6547  "method": "bdev_virtio_blk_set_hotplug",
6548  "id": 1
6549}
6550~~~
6551
6552Example response:
6553
6554~~~json
6555{
6556  "jsonrpc": "2.0",
6557  "id": 1,
6558  "result": true
6559}
6560~~~
6561
6562## iSCSI Target {#jsonrpc_components_iscsi_tgt}
6563
6564### iscsi_set_options method {#rpc_iscsi_set_options}
6565
6566Set global parameters for iSCSI targets.
6567
6568This RPC may only be called before SPDK subsystems have been initialized. This RPC can be called only once.
6569
6570#### Parameters
6571
6572Name                            | Optional | Type    | Description
6573------------------------------- | -------- | ------- | -----------
6574auth_file                       | Optional | string  | Path to CHAP shared secret file (default: "")
6575node_base                       | Optional | string  | Prefix of the name of iSCSI target node (default: "iqn.2016-06.io.spdk")
6576nop_timeout                     | Optional | number  | Timeout in seconds to nop-in request to the initiator (default: 60)
6577nop_in_interval                 | Optional | number  | Time interval in secs between nop-in requests by the target (default: 30)
6578disable_chap                    | Optional | boolean | CHAP for discovery session should be disabled (default: `false`)
6579require_chap                    | Optional | boolean | CHAP for discovery session should be required (default: `false`)
6580mutual_chap                     | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`)
6581chap_group                      | Optional | number  | CHAP group ID for discovery session (default: 0)
6582max_sessions                    | Optional | number  | Maximum number of sessions in the host (default: 128)
6583max_queue_depth                 | Optional | number  | Maximum number of outstanding I/Os per queue (default: 64)
6584max_connections_per_session     | Optional | number  | Session specific parameter, MaxConnections (default: 2)
6585default_time2wait               | Optional | number  | Session specific parameter, DefaultTime2Wait (default: 2)
6586default_time2retain             | Optional | number  | Session specific parameter, DefaultTime2Retain (default: 20)
6587first_burst_length              | Optional | number  | Session specific parameter, FirstBurstLength (default: 8192)
6588immediate_data                  | Optional | boolean | Session specific parameter, ImmediateData (default: `true`)
6589error_recovery_level            | Optional | number  | Session specific parameter, ErrorRecoveryLevel (default: 0)
6590allow_duplicated_isid           | Optional | boolean | Allow duplicated initiator session ID (default: `false`)
6591max_large_datain_per_connection | Optional | number  | Max number of outstanding split read I/Os per connection (default: 64)
6592max_r2t_per_connection          | Optional | number  | Max number of outstanding R2Ts per connection (default: 4)
6593pdu_pool_size                   | Optional | number  | Number of PDUs in the pool (default: approximately 2 * max_sessions * (max_queue_depth + max_connections_per_session))
6594immediate_data_pool_size        | Optional | number  | Number of immediate data buffers in the pool (default: 128 * max_sessions)
6595data_out_pool_size              | Optional | number  | Number of data out buffers in the pool (default: 16 * max_sessions)
6596
6597To load CHAP shared secret file, its path is required to specify explicitly in the parameter `auth_file`.
6598
6599Parameters `disable_chap` and `require_chap` are mutually exclusive. Parameters `no_discovery_auth`, `req_discovery_auth`,
6600`req_discovery_auth_mutual`, and `discovery_auth_group` are still available instead of `disable_chap`, `require_chap`,
6601`mutual_chap`, and `chap_group`, respectivey but will be removed in future releases.
6602
6603#### Example
6604
6605Example request:
6606
6607~~~json
6608{
6609  "params": {
6610    "allow_duplicated_isid": true,
6611    "default_time2retain": 60,
6612    "first_burst_length": 8192,
6613    "immediate_data": true,
6614    "node_base": "iqn.2016-06.io.spdk",
6615    "max_sessions": 128,
6616    "nop_timeout": 30,
6617    "nop_in_interval": 30,
6618    "auth_file": "/usr/local/etc/spdk/auth.conf",
6619    "disable_chap": true,
6620    "default_time2wait": 2
6621  },
6622  "jsonrpc": "2.0",
6623  "method": "iscsi_set_options",
6624  "id": 1
6625}
6626~~~
6627
6628Example response:
6629
6630~~~json
6631{
6632  "jsonrpc": "2.0",
6633  "id": 1,
6634  "result": true
6635}
6636~~~
6637
6638### iscsi_get_options method {#rpc_iscsi_get_options}
6639
6640Show global parameters of iSCSI targets.
6641
6642#### Parameters
6643
6644This method has no parameters.
6645
6646#### Example
6647
6648Example request:
6649
6650~~~json
6651request:
6652{
6653  "jsonrpc": "2.0",
6654  "method": "iscsi_get_options",
6655  "id": 1
6656}
6657~~~
6658
6659Example response:
6660
6661~~~json
6662{
6663  "jsonrpc": "2.0",
6664  "id": 1,
6665  "result": {
6666    "allow_duplicated_isid": true,
6667    "default_time2retain": 60,
6668    "first_burst_length": 8192,
6669    "immediate_data": true,
6670    "node_base": "iqn.2016-06.io.spdk",
6671    "mutual_chap": false,
6672    "nop_in_interval": 30,
6673    "chap_group": 0,
6674    "max_connections_per_session": 2,
6675    "max_queue_depth": 64,
6676    "nop_timeout": 30,
6677    "max_sessions": 128,
6678    "error_recovery_level": 0,
6679    "auth_file": "/usr/local/etc/spdk/auth.conf",
6680    "disable_chap": true,
6681    "default_time2wait": 2,
6682    "require_chap": false,
6683    "max_large_datain_per_connection": 64,
6684    "max_r2t_per_connection": 4
6685  }
6686}
6687~~~
6688
6689### scsi_get_devices {#rpc_scsi_get_devices}
6690
6691Display SCSI devices
6692
6693#### Parameters
6694
6695This method has no parameters.
6696
6697#### Example
6698
6699Example request:
6700
6701~~~json
6702{
6703  "jsonrpc": "2.0",
6704  "method": "scsi_get_devices",
6705  "id": 1
6706}
6707~~~
6708
6709Example response:
6710
6711~~~json
6712{
6713  "jsonrpc": "2.0",
6714  "id": 1,
6715  "result": [
6716    {
6717      "id": 0,
6718      "device_name": "iqn.2016-06.io.spdk:Target3"
6719    }
6720  ]
6721}
6722~~~
6723
6724### iscsi_set_discovery_auth method {#rpc_iscsi_set_discovery_auth}
6725
6726Set CHAP authentication for sessions dynamically.
6727
6728#### Parameters
6729
6730Name                        | Optional | Type    | Description
6731--------------------------- | -------- | --------| -----------
6732disable_chap                | Optional | boolean | CHAP for discovery session should be disabled (default: `false`)
6733require_chap                | Optional | boolean | CHAP for discovery session should be required (default: `false`)
6734mutual_chap                 | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`)
6735chap_group                  | Optional | number  | CHAP group ID for discovery session (default: 0)
6736
6737Parameters `disable_chap` and `require_chap` are mutually exclusive.
6738
6739#### Example
6740
6741Example request:
6742
6743~~~json
6744request:
6745{
6746  "params": {
6747    "chap_group": 1,
6748    "require_chap": true,
6749    "mutual_chap": true
6750  },
6751  "jsonrpc": "2.0",
6752  "method": "iscsi_set_discovery_auth",
6753  "id": 1
6754}
6755~~~
6756
6757Example response:
6758
6759~~~json
6760{
6761  "jsonrpc": "2.0",
6762  "id": 1,
6763  "result": true
6764}
6765~~~
6766
6767### iscsi_create_auth_group method {#rpc_iscsi_create_auth_group}
6768
6769Create an authentication group for CHAP authentication.
6770
6771#### Parameters
6772
6773Name                        | Optional | Type    | Description
6774--------------------------- | -------- | --------| -----------
6775tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6776secrets                     | Optional | array   | Array of @ref rpc_iscsi_create_auth_group_secret objects
6777
6778#### secret {#rpc_iscsi_create_auth_group_secret}
6779
6780Name                        | Optional | Type    | Description
6781--------------------------- | ---------| --------| -----------
6782user                        | Required | string  | Unidirectional CHAP name
6783secret                      | Required | string  | Unidirectional CHAP secret
6784muser                       | Optional | string  | Bidirectional CHAP name
6785msecret                     | Optional | string  | Bidirectional CHAP secret
6786
6787#### Example
6788
6789Example request:
6790
6791~~~json
6792{
6793  "params": {
6794    "secrets": [
6795      {
6796        "muser": "mu1",
6797        "secret": "s1",
6798        "user": "u1",
6799        "msecret": "ms1"
6800      }
6801    ],
6802    "tag": 2
6803  },
6804  "jsonrpc": "2.0",
6805  "method": "iscsi_create_auth_group",
6806  "id": 1
6807}
6808~~~
6809
6810Example response:
6811
6812~~~json
6813{
6814  "jsonrpc": "2.0",
6815  "id": 1,
6816  "result": true
6817}
6818~~~
6819
6820### iscsi_delete_auth_group method {#rpc_iscsi_delete_auth_group}
6821
6822Delete an existing authentication group for CHAP authentication.
6823
6824#### Parameters
6825
6826Name                        | Optional | Type    | Description
6827--------------------------- | -------- | --------| -----------
6828tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6829
6830#### Example
6831
6832Example request:
6833
6834~~~json
6835{
6836  "params": {
6837    "tag": 2
6838  },
6839  "jsonrpc": "2.0",
6840  "method": "iscsi_delete_auth_group",
6841  "id": 1
6842}
6843~~~
6844
6845Example response:
6846
6847~~~json
6848{
6849  "jsonrpc": "2.0",
6850  "id": 1,
6851  "result": true
6852}
6853~~~
6854
6855### iscsi_get_auth_groups {#rpc_iscsi_get_auth_groups}
6856
6857Show information about all existing authentication group for CHAP authentication.
6858
6859#### Parameters
6860
6861This method has no parameters.
6862
6863#### Result
6864
6865Array of objects describing authentication group.
6866
6867Name                        | Type    | Description
6868--------------------------- | --------| -----------
6869tag                         | number  | Authentication group tag
6870secrets                     | array   | Array of @ref rpc_iscsi_create_auth_group_secret objects
6871
6872#### Example
6873
6874Example request:
6875
6876~~~json
6877{
6878  "jsonrpc": "2.0",
6879  "method": "iscsi_get_auth_groups",
6880  "id": 1
6881}
6882~~~
6883
6884Example response:
6885
6886~~~json
6887{
6888  "jsonrpc": "2.0",
6889  "id": 1,
6890  "result": [
6891    {
6892      "secrets": [
6893        {
6894          "muser": "mu1",
6895          "secret": "s1",
6896          "user": "u1",
6897          "msecret": "ms1"
6898        }
6899      ],
6900      "tag": 1
6901    },
6902    {
6903      "secrets": [
6904        {
6905          "secret": "s2",
6906          "user": "u2"
6907        }
6908      ],
6909      "tag": 2
6910    }
6911  ]
6912}
6913~~~
6914
6915### iscsi_auth_group_add_secret {#rpc_iscsi_auth_group_add_secret}
6916
6917Add a secret to an existing authentication group for CHAP authentication.
6918
6919#### Parameters
6920
6921Name                        | Optional | Type    | Description
6922--------------------------- | -------- | --------| -----------
6923tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6924user                        | Required | string  | Unidirectional CHAP name
6925secret                      | Required | string  | Unidirectional CHAP secret
6926muser                       | Optional | string  | Bidirectional CHAP name
6927msecret                     | Optional | string  | Bidirectional CHAP secret
6928
6929#### Example
6930
6931Example request:
6932
6933~~~json
6934{
6935  "params": {
6936    "muser": "mu3",
6937    "secret": "s3",
6938    "tag": 2,
6939    "user": "u3",
6940    "msecret": "ms3"
6941  },
6942  "jsonrpc": "2.0",
6943  "method": "iscsi_auth_group_add_secret",
6944  "id": 1
6945}
6946~~~json
6947
6948Example response:
6949
6950~~~json
6951{
6952  "jsonrpc": "2.0",
6953  "id": 1,
6954  "result": true
6955}
6956~~~
6957
6958### iscsi_auth_group_remove_secret {#rpc_iscsi_auth_group_remove_secret}
6959
6960Remove a secret from an existing authentication group for CHAP authentication.
6961
6962#### Parameters
6963
6964Name                        | Optional | Type    | Description
6965--------------------------- | -------- | --------| -----------
6966tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6967user                        | Required | string  | Unidirectional CHAP name
6968
6969#### Example
6970
6971Example request:
6972
6973~~~json
6974{
6975  "params": {
6976    "tag": 2,
6977    "user": "u3"
6978  },
6979  "jsonrpc": "2.0",
6980  "method": "iscsi_auth_group_remove_secret",
6981  "id": 1
6982}
6983~~~
6984
6985Example response:
6986
6987~~~json
6988{
6989  "jsonrpc": "2.0",
6990  "id": 1,
6991  "result": true
6992}
6993~~~
6994
6995### iscsi_get_initiator_groups method {#rpc_iscsi_get_initiator_groups}
6996
6997Show information about all available initiator groups.
6998
6999#### Parameters
7000
7001This method has no parameters.
7002
7003#### Result
7004
7005Array of objects describing initiator groups.
7006
7007Name                        | Type    | Description
7008--------------------------- | --------| -----------
7009tag                         | number  | Initiator group tag
7010initiators                  | array   | Array of initiator hostnames or IP addresses
7011netmasks                    | array   | Array of initiator netmasks
7012
7013#### Example
7014
7015Example request:
7016
7017~~~json
7018{
7019  "jsonrpc": "2.0",
7020  "method": "iscsi_get_initiator_groups",
7021  "id": 1
7022}
7023~~~
7024
7025Example response:
7026
7027~~~json
7028{
7029  "jsonrpc": "2.0",
7030  "id": 1,
7031  "result": [
7032    {
7033      "initiators": [
7034        "iqn.2016-06.io.spdk:host1",
7035        "iqn.2016-06.io.spdk:host2"
7036      ],
7037      "tag": 1,
7038      "netmasks": [
7039        "192.168.1.0/24"
7040      ]
7041    }
7042  ]
7043}
7044~~~
7045
7046### iscsi_create_initiator_group method {#rpc_iscsi_create_initiator_group}
7047
7048Add an initiator group.
7049
7050#### Parameters
7051
7052Name                        | Optional | Type    | Description
7053--------------------------- | -------- | --------| -----------
7054tag                         | Required | number  | Initiator group tag (unique, integer > 0)
7055initiators                  | Required | array   | Not empty array of initiator hostnames or IP addresses
7056netmasks                    | Required | array   | Not empty array of initiator netmasks
7057
7058#### Example
7059
7060Example request:
7061
7062~~~json
7063{
7064  "params": {
7065    "initiators": [
7066      "iqn.2016-06.io.spdk:host1",
7067      "iqn.2016-06.io.spdk:host2"
7068    ],
7069    "tag": 1,
7070    "netmasks": [
7071      "192.168.1.0/24"
7072    ]
7073  },
7074  "jsonrpc": "2.0",
7075  "method": "iscsi_create_initiator_group",
7076  "id": 1
7077}
7078~~~
7079
7080Example response:
7081
7082~~~json
7083response:
7084{
7085  "jsonrpc": "2.0",
7086  "id": 1,
7087  "result": true
7088}
7089~~~
7090
7091### iscsi_delete_initiator_group method {#rpc_iscsi_delete_initiator_group}
7092
7093Delete an existing initiator group.
7094
7095#### Parameters
7096
7097Name                        | Optional | Type    | Description
7098--------------------------- | -------- | --------| -----------
7099tag                         | Required | number  | Initiator group tag (unique, integer > 0)
7100
7101#### Example
7102
7103Example request:
7104
7105~~~json
7106{
7107  "params": {
7108    "tag": 1
7109  },
7110  "jsonrpc": "2.0",
7111  "method": "iscsi_delete_initiator_group",
7112  "id": 1
7113}
7114~~~
7115
7116Example response:
7117
7118~~~json
7119{
7120  "jsonrpc": "2.0",
7121  "id": 1,
7122  "result": true
7123}
7124~~~
7125
7126### iscsi_initiator_group_add_initiators method {#rpc_iscsi_initiator_group_add_initiators}
7127
7128Add initiators to an existing initiator group.
7129
7130#### Parameters
7131
7132Name                        | Optional | Type    | Description
7133--------------------------- | -------- | --------| -----------
7134tag                         | Required | number  | Existing initiator group tag.
7135initiators                  | Optional | array   | Array of initiator hostnames or IP addresses
7136netmasks                    | Optional | array   | Array of initiator netmasks
7137
7138#### Example
7139
7140Example request:
7141
7142~~~json
7143request:
7144{
7145  "params": {
7146    "initiators": [
7147      "iqn.2016-06.io.spdk:host3"
7148    ],
7149    "tag": 1,
7150    "netmasks": [
7151      "255.255.255.1"
7152    ]
7153  },
7154  "jsonrpc": "2.0",
7155  "method": "iscsi_initiator_group_add_initiators",
7156  "id": 1
7157}
7158~~~
7159
7160Example response:
7161
7162~~~json
7163response:
7164{
7165  "jsonrpc": "2.0",
7166  "id": 1,
7167  "result": true
7168}
7169~~~
7170
7171### iscsi_initiator_group_remove_initiators method {#rpc_iscsi_initiator_group_remove_initiators}
7172
7173Remove initiators from an initiator group.
7174
7175#### Parameters
7176
7177Name                        | Optional | Type    | Description
7178--------------------------- | -------- | --------| -----------
7179tag                         | Required | number  | Existing initiator group tag.
7180initiators                  | Optional | array   | Array of initiator hostnames or IP addresses
7181netmasks                    | Optional | array   | Array of initiator netmasks
7182
7183#### Example
7184
7185Example request:
7186
7187~~~json
7188request:
7189{
7190  "params": {
7191    "initiators": [
7192      "iqn.2016-06.io.spdk:host3"
7193    ],
7194    "tag": 1,
7195    "netmasks": [
7196      "255.255.255.1"
7197    ]
7198  },
7199  "jsonrpc": "2.0",
7200  "method": "iscsi_initiator_group_remove_initiators",
7201  "id": 1
7202}
7203~~~
7204
7205Example response:
7206
7207~~~json
7208response:
7209{
7210  "jsonrpc": "2.0",
7211  "id": 1,
7212  "result": true
7213}
7214~~~
7215
7216### iscsi_get_target_nodes method {#rpc_iscsi_get_target_nodes}
7217
7218Show information about all available iSCSI target nodes.
7219
7220#### Parameters
7221
7222This method has no parameters.
7223
7224#### Result
7225
7226Array of objects describing target node.
7227
7228Name                        | Type    | Description
7229--------------------------- | --------| -----------
7230name                        | string  | Target node name (ASCII)
7231alias_name                  | string  | Target node alias name (ASCII)
7232pg_ig_maps                  | array   | Array of Portal_Group_Tag:Initiator_Group_Tag mappings
7233luns                        | array   | Array of Bdev names to LUN ID mappings
7234queue_depth                 | number  | Target queue depth
7235disable_chap                | boolean | CHAP authentication should be disabled for this target
7236require_chap                | boolean | CHAP authentication should be required for this target
7237mutual_chap                 | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`)
7238chap_group                  | number  | Authentication group ID for this target node
7239header_digest               | boolean | Header Digest should be required for this target node
7240data_digest                 | boolean | Data Digest should be required for this target node
7241
7242#### Example
7243
7244Example request:
7245
7246~~~json
7247{
7248  "jsonrpc": "2.0",
7249  "method": "iscsi_get_target_nodes",
7250  "id": 1
7251}
7252~~~
7253
7254Example response:
7255
7256~~~json
7257{
7258  "jsonrpc": "2.0",
7259  "id": 1,
7260  "result": [
7261    {
7262      "luns": [
7263        {
7264          "lun_id": 0,
7265          "bdev_name": "Nvme0n1"
7266        }
7267      ],
7268      "mutual_chap": false,
7269      "name": "iqn.2016-06.io.spdk:target1",
7270      "alias_name": "iscsi-target1-alias",
7271      "require_chap": false,
7272      "chap_group": 0,
7273      "pg_ig_maps": [
7274        {
7275          "ig_tag": 1,
7276          "pg_tag": 1
7277        }
7278      ],
7279      "data_digest": false,
7280      "disable_chap": false,
7281      "header_digest": false,
7282      "queue_depth": 64
7283    }
7284  ]
7285}
7286~~~
7287
7288### iscsi_create_target_node method {#rpc_iscsi_create_target_node}
7289
7290Add an iSCSI target node.
7291
7292#### Parameters
7293
7294Name                        | Optional | Type    | Description
7295--------------------------- | -------- | --------| -----------
7296name                        | Required | string  | Target node name (ASCII)
7297alias_name                  | Required | string  | Target node alias name (ASCII)
7298pg_ig_maps                  | Required | array   | Array of (Portal_Group_Tag:Initiator_Group_Tag) mappings
7299luns                        | Required | array   | Array of Bdev names to LUN ID mappings
7300queue_depth                 | Required | number  | Target queue depth
7301disable_chap                | Optional | boolean | CHAP authentication should be disabled for this target
7302require_chap                | Optional | boolean | CHAP authentication should be required for this target
7303mutual_chap                 | Optional | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`)
7304chap_group                  | Optional | number  | Authentication group ID for this target node
7305header_digest               | Optional | boolean | Header Digest should be required for this target node
7306data_digest                 | Optional | boolean | Data Digest should be required for this target node
7307
7308Parameters `disable_chap` and `require_chap` are mutually exclusive.
7309
7310#### Example
7311
7312Example request:
7313
7314~~~json
7315{
7316  "params": {
7317    "luns": [
7318      {
7319        "lun_id": 0,
7320        "bdev_name": "Nvme0n1"
7321      }
7322    ],
7323    "mutual_chap": true,
7324    "name": "target2",
7325    "alias_name": "iscsi-target2-alias",
7326    "pg_ig_maps": [
7327      {
7328        "ig_tag": 1,
7329        "pg_tag": 1
7330      },
7331      {
7332        "ig_tag": 2,
7333        "pg_tag": 2
7334      }
7335    ],
7336    "data_digest": true,
7337    "disable_chap": true,
7338    "header_digest": true,
7339    "queue_depth": 24
7340  },
7341  "jsonrpc": "2.0",
7342  "method": "iscsi_create_target_node",
7343  "id": 1
7344}
7345~~~
7346
7347Example response:
7348
7349~~~json
7350{
7351  "jsonrpc": "2.0",
7352  "id": 1,
7353  "result": true
7354}
7355~~~
7356
7357### iscsi_target_node_set_auth method {#rpc_iscsi_target_node_set_auth}
7358
7359Set CHAP authentication to an existing iSCSI target node.
7360
7361#### Parameters
7362
7363Name                        | Optional | Type    | Description
7364--------------------------- | -------- | --------| -----------
7365name                        | Required | string  | Target node name (ASCII)
7366disable_chap                | Optional | boolean | CHAP authentication should be disabled for this target
7367require_chap                | Optional | boolean | CHAP authentication should be required for this target
7368mutual_chap                 | Optional | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`)
7369chap_group                  | Optional | number  | Authentication group ID for this target node
7370
7371Parameters `disable_chap` and `require_chap` are mutually exclusive.
7372
7373#### Example
7374
7375Example request:
7376
7377~~~json
7378{
7379  "params": {
7380    "chap_group": 1,
7381    "require_chap": true,
7382    "name": "iqn.2016-06.io.spdk:target1",
7383    "mutual_chap": true
7384  },
7385  "jsonrpc": "2.0",
7386  "method": "iscsi_target_node_set_auth",
7387  "id": 1
7388}
7389~~~
7390
7391Example response:
7392
7393~~~json
7394{
7395  "jsonrpc": "2.0",
7396  "id": 1,
7397  "result": true
7398}
7399~~~
7400
7401### iscsi_target_node_add_pg_ig_maps method {#rpc_iscsi_target_node_add_pg_ig_maps}
7402
7403Add initiator group to portal group mappings to an existing iSCSI target node.
7404
7405#### Parameters
7406
7407Name                        | Optional | Type    | Description
7408--------------------------- | -------- | --------| -----------
7409name                        | Required | string  | Target node name (ASCII)
7410pg_ig_maps                  | Required | array   | Not empty array of initiator to portal group mappings objects
7411
7412Portal to Initiator group mappings object:
7413
7414Name                        | Optional | Type    | Description
7415--------------------------- | -------- | --------| -----------
7416ig_tag                      | Required | number  | Existing initiator group tag
7417pg_tag                      | Required | number  | Existing portal group tag
7418
7419#### Example
7420
7421Example request:
7422
7423~~~json
7424{
7425  "params": {
7426    "pg_ig_maps": [
7427      {
7428        "ig_tag": 1,
7429        "pg_tag": 1
7430      },
7431      {
7432        "ig_tag": 2,
7433        "pg_tag": 2
7434      },
7435      {
7436        "ig_tag": 3,
7437        "pg_tag": 3
7438      }
7439    ],
7440    "name": "iqn.2016-06.io.spdk:target3"
7441  },
7442  "jsonrpc": "2.0",
7443  "method": "iscsi_target_node_add_pg_ig_maps",
7444  "id": 1
7445}
7446~~~
7447
7448Example response:
7449
7450~~~json
7451{
7452  "jsonrpc": "2.0",
7453  "id": 1,
7454  "result": true
7455}
7456~~~
7457
7458### iscsi_target_node_remove_pg_ig_maps method {#rpc_iscsi_target_node_remove_pg_ig_maps}
7459
7460Delete initiator group to portal group mappings from an existing iSCSI target node.
7461
7462#### Parameters
7463
7464Name                        | Optional | Type    | Description
7465--------------------------- | -------- | --------| -----------
7466name                        | Required | string  | Target node name (ASCII)
7467pg_ig_maps                  | Required | array   | Not empty array of Portal to Initiator group mappings objects
7468
7469Portal to Initiator group mappings object:
7470
7471Name                        | Optional | Type    | Description
7472--------------------------- | -------- | --------| -----------
7473ig_tag                      | Required | number  | Existing initiator group tag
7474pg_tag                      | Required | number  | Existing portal group tag
7475
7476#### Example
7477
7478Example request:
7479
7480~~~json
7481{
7482  "params": {
7483    "pg_ig_maps": [
7484      {
7485        "ig_tag": 1,
7486        "pg_tag": 1
7487      },
7488      {
7489        "ig_tag": 2,
7490        "pg_tag": 2
7491      },
7492      {
7493        "ig_tag": 3,
7494        "pg_tag": 3
7495      }
7496    ],
7497    "name": "iqn.2016-06.io.spdk:target3"
7498  },
7499  "jsonrpc": "2.0",
7500  "method": "iscsi_target_node_remove_pg_ig_maps",
7501  "id": 1
7502}
7503~~~
7504
7505Example response:
7506
7507~~~json
7508{
7509  "jsonrpc": "2.0",
7510  "id": 1,
7511  "result": true
7512}
7513~~~
7514
7515### iscsi_delete_target_node method {#rpc_iscsi_delete_target_node}
7516
7517Delete an iSCSI target node.
7518
7519#### Parameters
7520
7521Name                        | Optional | Type    | Description
7522--------------------------- | -------- | --------| -----------
7523name                        | Required | string  | Target node name (ASCII)
7524
7525#### Example
7526
7527Example request:
7528
7529~~~json
7530{
7531  "params": {
7532    "name": "iqn.2016-06.io.spdk:target1"
7533  },
7534  "jsonrpc": "2.0",
7535  "method": "iscsi_delete_target_node",
7536  "id": 1
7537}
7538~~~
7539
7540Example response:
7541
7542~~~json
7543{
7544  "jsonrpc": "2.0",
7545  "id": 1,
7546  "result": true
7547}
7548~~~
7549
7550### iscsi_get_portal_groups method {#rpc_iscsi_get_portal_groups}
7551
7552Show information about all available portal groups.
7553
7554#### Parameters
7555
7556This method has no parameters.
7557
7558#### Example
7559
7560Example request:
7561
7562~~~json
7563request:
7564{
7565  "jsonrpc": "2.0",
7566  "method": "iscsi_get_portal_groups",
7567  "id": 1
7568}
7569~~~
7570
7571Example response:
7572
7573~~~json
7574{
7575  "jsonrpc": "2.0",
7576  "id": 1,
7577  "result": [
7578    {
7579      "portals": [
7580        {
7581          "host": "127.0.0.1",
7582          "port": "3260"
7583        }
7584      ],
7585      "tag": 1,
7586      "private": false
7587    }
7588  ]
7589}
7590~~~
7591
7592### iscsi_create_portal_group method {#rpc_iscsi_create_portal_group}
7593
7594Add a portal group.
7595
7596#### Parameters
7597
7598Name                        | Optional | Type    | Description
7599--------------------------- | -------- | --------| -----------
7600tag                         | Required | number  | Portal group tag
7601portals                     | Required | array   | Not empty array of portals
7602private                     | Optional | boolean | When true, portals in this group are not returned by a discovery session. Used for login redirection. (default: `false`)
7603wait                        | Optional | boolean | When true, do not listen on portals until it is started explicitly. (default: `false`)
7604
7605Portal object
7606
7607Name                        | Optional | Type    | Description
7608--------------------------- | -------- | --------| -----------
7609host                        | Required | string  | Hostname or IP address
7610port                        | Required | string  | Port number
7611
7612#### Example
7613
7614Example request:
7615
7616~~~json
7617{
7618  "params": {
7619    "portals": [
7620      {
7621        "host": "127.0.0.1",
7622        "port": "3260"
7623      }
7624    ],
7625    "tag": 1
7626  },
7627  "jsonrpc": "2.0",
7628  "method": "iscsi_create_portal_group",
7629  "id": 1
7630}
7631~~~
7632
7633Example response:
7634
7635~~~json
7636{
7637  "jsonrpc": "2.0",
7638  "id": 1,
7639  "result": true
7640}
7641~~~
7642
7643### iscsi_start_portal_group method {#rpc_iscsi_start_portal_group}
7644
7645Start listening on portals if the portal group is not started yet, or do nothing
7646if the portal group already started. Return a success response for both cases.
7647
7648#### Parameters
7649
7650Name                        | Optional | Type    | Description
7651--------------------------- | -------- | --------| -----------
7652tag                         | Required | number  | Existing portal group tag
7653
7654#### Example
7655
7656Example request:
7657
7658~~~json
7659{
7660  "params": {
7661    "tag": 1
7662  },
7663  "jsonrpc": "2.0",
7664  "method": "iscsi_start_portal_group",
7665  "id": 1
7666}
7667~~~
7668
7669Example response:
7670
7671~~~json
7672{
7673  "jsonrpc": "2.0",
7674  "id": 1,
7675  "result": true
7676}
7677~~~
7678
7679### iscsi_delete_portal_group method {#rpc_iscsi_delete_portal_group}
7680
7681Delete an existing portal group.
7682
7683#### Parameters
7684
7685Name                        | Optional | Type    | Description
7686--------------------------- | -------- | --------| -----------
7687tag                         | Required | number  | Existing portal group tag
7688
7689#### Example
7690
7691Example request:
7692
7693~~~json
7694{
7695  "params": {
7696    "tag": 1
7697  },
7698  "jsonrpc": "2.0",
7699  "method": "iscsi_delete_portal_group",
7700  "id": 1
7701}
7702~~~
7703
7704Example response:
7705
7706~~~json
7707{
7708  "jsonrpc": "2.0",
7709  "id": 1,
7710  "result": true
7711}
7712~~~
7713
7714### iscsi_portal_group_set_auth method {#rpc_iscsi_portal_group_set_auth}
7715
7716Set CHAP authentication for discovery sessions specific for the existing iSCSI portal group.
7717This RPC overwrites the setting by the global parameters for the iSCSI portal group.
7718
7719#### Parameters
7720
7721Name                        | Optional | Type    | Description
7722--------------------------- | -------- | --------| -----------
7723disable_chap                | Optional | boolean | CHAP for discovery session should be disabled (default: `false`)
7724require_chap                | Optional | boolean | CHAP for discovery session should be required (default: `false`)
7725mutual_chap                 | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`)
7726chap_group                  | Optional | number  | CHAP group ID for discovery session (default: 0)
7727
7728Parameters `disable_chap` and `require_chap` are mutually exclusive.
7729
7730#### Example
7731
7732Example request:
7733
7734~~~json
7735request:
7736{
7737  "params": {
7738    "tag": 1,
7739    "chap_group": 1,
7740    "require_chap": true,
7741    "mutual_chap": true
7742  },
7743  "jsonrpc": "2.0",
7744  "method": "iscsi_portal_group_set_auth",
7745  "id": 1
7746}
7747~~~
7748
7749Example response:
7750
7751~~~json
7752{
7753  "jsonrpc": "2.0",
7754  "id": 1,
7755  "result": true
7756}
7757~~~
7758
7759### iscsi_get_connections method {#rpc_iscsi_get_connections}
7760
7761Show information about all active connections.
7762
7763#### Parameters
7764
7765This method has no parameters.
7766
7767#### Results
7768
7769Array of objects describing iSCSI connection.
7770
7771Name                        | Type    | Description
7772--------------------------- | --------| -----------
7773id                          | number  | Index (used for TTT - Target Transfer Tag)
7774cid                         | number  | CID (Connection ID)
7775tsih                        | number  | TSIH (Target Session Identifying Handle)
7776lcore_id                    | number  | Core number on which the iSCSI connection runs
7777initiator_addr              | string  | Initiator address
7778target_addr                 | string  | Target address
7779target_node_name            | string  | Target node name (ASCII) without prefix
7780
7781#### Example
7782
7783Example request:
7784
7785~~~json
7786{
7787  "jsonrpc": "2.0",
7788  "method": "iscsi_get_connections",
7789  "id": 1
7790}
7791~~~
7792
7793Example response:
7794
7795~~~json
7796{
7797  "jsonrpc": "2.0",
7798  "id": 1,
7799  "result": [
7800    {
7801      "tsih": 4,
7802      "cid": 0,
7803      "target_node_name": "target1",
7804      "lcore_id": 0,
7805      "initiator_addr": "10.0.0.2",
7806      "target_addr": "10.0.0.1",
7807      "id": 0
7808    }
7809  ]
7810}
7811~~~
7812
7813### iscsi_get_stats method {#iscsi_get_stats}
7814
7815Show stat information of iSCSI connections.
7816
7817#### Parameters
7818
7819This method has no parameters.
7820
7821#### Results
7822
7823Stat information of iSCSI connections.
7824
7825Name                        | Type    | Description
7826--------------------------- | --------| -----------
7827invalid                     | number  | The number of invalid connections
7828running                     | number  | The number of running connections
7829exiting                     | number  | The number of exiting connections
7830exited                      | number  | The number of exited connections
7831
7832#### Example
7833
7834Example request:
7835
7836~~~json
7837{
7838  "jsonrpc": "2.0",
7839  "method": "iscsi_get_stats",
7840  "id": 1
7841}
7842~~~
7843
7844Example response:
7845
7846~~~json
7847{
7848  "jsonrpc": "2.0",
7849  "id": 1,
7850  "result":
7851    {
7852      "invalid": 0,
7853      "running": 5,
7854      "exiting": 0,
7855      "exited": 0
7856    }
7857
7858}
7859~~~
7860
7861### iscsi_target_node_add_lun method {#rpc_iscsi_target_node_add_lun}
7862
7863Add an LUN to an existing iSCSI target node.
7864
7865#### Parameters
7866
7867Name                        | Optional | Type    | Description
7868--------------------------- | -------- | --------| -----------
7869name                        | Required | string  | Target node name (ASCII)
7870bdev_name                   | Required | string  | bdev name to be added as a LUN
7871lun_id                      | Optional | number  | LUN ID (default: first free ID)
7872
7873#### Example
7874
7875Example request:
7876
7877~~~json
7878{
7879  "params": {
7880    "lun_id": 2,
7881    "name": "iqn.2016-06.io.spdk:target1",
7882    "bdev_name": "Malloc0"
7883  },
7884  "jsonrpc": "2.0",
7885  "method": "iscsi_target_node_add_lun",
7886  "id": 1
7887}
7888~~~
7889
7890Example response:
7891
7892~~~json
7893{
7894  "jsonrpc": "2.0",
7895  "id": 1,
7896  "result": true
7897}
7898~~~
7899
7900### iscsi_target_node_set_redirect method {#rpc_iscsi_target_node_set_redirect}
7901
7902Update redirect portal of the primary portal group for the target node,
7903
7904#### Parameters
7905
7906Name                        | Optional | Type    | Description
7907--------------------------- | -------- | --------| -----------
7908name                        | Required | string  | Target node name (ASCII)
7909pg_tag                      | Required | number  | Existing portal group tag
7910redirect_host               | Optional | string  | Numeric IP address to which the target node is redirected
7911redirect_port               | Optional | string  | Numeric TCP port to which the target node is redirected
7912
7913If both redirect_host and redirect_port are omitted, clear the redirect portal.
7914
7915#### Example
7916
7917Example request:
7918
7919~~~json
7920{
7921  "params": {
7922    "name": "iqn.2016-06.io.spdk:target1",
7923    "pg_tag": 1,
7924    "redirect_host": "10.0.0.3",
7925    "redirect_port": "3260"
7926  },
7927  "jsonrpc": "2.0",
7928  "method": "iscsi_target_node_set_redirect",
7929  "id": 1
7930}
7931~~~
7932
7933Example response:
7934
7935~~~json
7936{
7937  "jsonrpc": "2.0",
7938  "id": 1,
7939  "result": true
7940}
7941~~~
7942
7943### iscsi_target_node_request_logout method {#rpc_iscsi_target_node_request_logout}
7944
7945For the target node, request connections whose portal group tag match to logout,
7946or request all connections to logout if portal group tag is omitted.
7947
7948#### Parameters
7949
7950Name                        | Optional | Type    | Description
7951--------------------------- | -------- | --------| -----------
7952name                        | Required | string  | Target node name (ASCII)
7953pg_tag                      | Optional | number  | Existing portal group tag
7954
7955#### Example
7956
7957Example request:
7958
7959~~~json
7960{
7961  "params": {
7962    "name": "iqn.2016-06.io.spdk:target1",
7963    "pg_tag": 1
7964  },
7965  "jsonrpc": "2.0",
7966  "method": "iscsi_target_node_request_logout",
7967  "id": 1
7968}
7969~~~
7970
7971Example response:
7972
7973~~~json
7974{
7975  "jsonrpc": "2.0",
7976  "id": 1,
7977  "result": true
7978}
7979~~~
7980
7981### iscsi_enable_histogram {#rpc_iscsi_enable_histogram}
7982
7983Control whether collecting data for histogram is enabled for specified iscsi target node.
7984
7985#### Parameters
7986
7987Name                    | Optional | Type        | Description
7988----------------------- | -------- | ----------- | -----------
7989name                    | Required | string      | Iscsi target node name
7990enable                  | Required | boolean     | Enable or disable histogram on specified target node
7991
7992#### Example
7993
7994Example request:
7995
7996~~~json
7997{
7998  "jsonrpc": "2.0",
7999  "id": 1,
8000  "method": "iscsi_enable_histogram",
8001  "params": {
8002    "name": "iqn.2016-06.io.spdk:target1"
8003    "enable": true
8004  }
8005}
8006~~~
8007
8008Example response:
8009
8010~~~json
8011{
8012  "jsonrpc": "2.0",
8013  "id": 1,
8014  "result": true
8015}
8016~~~
8017
8018### iscsi_get_histogram {#rpc_iscsi_get_histogram}
8019
8020Get latency histogram for specified iscsi target node.
8021
8022#### Parameters
8023
8024Name                    | Optional | Type        | Description
8025----------------------- | -------- | ----------- | -----------
8026name                    | Required | string      | Iscsi target node name
8027
8028#### Result
8029
8030Name                    | Description
8031------------------------| -----------
8032histogram               | Base64 encoded histogram
8033bucket_shift            | Granularity of the histogram buckets
8034tsc_rate                | Ticks per second
8035
8036#### Example
8037
8038Example request:
8039
8040~~~json
8041{
8042  "jsonrpc": "2.0",
8043  "id": 1,
8044  "method": "iscsi_get_histogram",
8045  "params": {
8046    "name": "iqn.2016-06.io.spdk:target1"
8047  }
8048}
8049~~~
8050
8051Example response:
8052Note that histogram field is trimmed, actual encoded histogram length is ~80kb.
8053
8054~~~json
8055{
8056  "jsonrpc": "2.0",
8057  "id": 1,
8058  "result": {
8059    "histogram": "AAAAAAAAAAAAAA...AAAAAAAAA==",
8060    "tsc_rate": 2300000000,
8061    "bucket_shift": 7
8062  }
8063}
8064~~~
8065
8066## NVMe-oF Target {#jsonrpc_components_nvmf_tgt}
8067
8068### nvmf_create_transport method {#rpc_nvmf_create_transport}
8069
8070Initialize an NVMe-oF transport with the given options.
8071
8072#### Parameters
8073
8074Name                        | Optional | Type    | Description
8075--------------------------- | -------- | --------| -----------
8076trtype                      | Required | string  | Transport type (ex. RDMA)
8077tgt_name                    | Optional | string  | Parent NVMe-oF target name.
8078max_queue_depth             | Optional | number  | Max number of outstanding I/O per queue
8079max_io_qpairs_per_ctrlr     | Optional | number  | Max number of IO qpairs per controller
8080in_capsule_data_size        | Optional | number  | Max number of in-capsule data size
8081max_io_size                 | Optional | number  | Max I/O size (bytes)
8082io_unit_size                | Optional | number  | I/O unit size (bytes)
8083max_aq_depth                | Optional | number  | Max number of admin cmds per AQ
8084num_shared_buffers          | Optional | number  | The number of pooled data buffers available to the transport
8085buf_cache_size              | Optional | number  | The number of shared buffers to reserve for each poll group
8086num_cqe                     | Optional | number  | The number of CQ entries. Only used when no_srq=true (RDMA only)
8087max_srq_depth               | Optional | number  | The number of elements in a per-thread shared receive queue (RDMA only)
8088no_srq                      | Optional | boolean | Disable shared receive queue even for devices that support it. (RDMA only)
8089c2h_success                 | Optional | boolean | Disable C2H success optimization (TCP only)
8090dif_insert_or_strip         | Optional | boolean | Enable DIF insert for write I/O and DIF strip for read I/O DIF
8091sock_priority               | Optional | number  | The socket priority of the connection owned by this transport (TCP only)
8092acceptor_backlog            | Optional | number  | The number of pending connections allowed in backlog before failing new connection attempts (RDMA only)
8093abort_timeout_sec           | Optional | number  | Abort execution timeout value, in seconds
8094no_wr_batching              | Optional | boolean | Disable work requests batching (RDMA only)
8095control_msg_num             | Optional | number  | The number of control messages per poll group (TCP only)
8096disable_mappable_bar0       | Optional | boolean | disable client mmap() of BAR0 (VFIO-USER only)
8097disable_adaptive_irq        | Optional | boolean | Disable adaptive interrupt feature (VFIO-USER only)
8098disable_shadow_doorbells    | Optional | boolean | disable shadow doorbell support (VFIO-USER only)
8099zcopy                       | Optional | boolean | Use zero-copy operations if the underlying bdev supports them
8100ack_timeout                 | Optional | number  | ACK timeout in milliseconds
8101data_wr_pool_size           | Optional | number  | RDMA data WR pool size (RDMA only)
8102
8103#### Example
8104
8105Example request:
8106
8107~~~json
8108{
8109  "jsonrpc": "2.0",
8110  "method": "nvmf_create_transport",
8111  "id": 1,
8112  "params": {
8113    "trtype": "RDMA",
8114    "max_queue_depth": 32
8115  }
8116}
8117~~~
8118
8119Example response:
8120
8121~~~json
8122{
8123  "jsonrpc": "2.0",
8124  "id": 1,
8125  "result": true
8126}
8127~~~
8128
8129### nvmf_get_subsystems method {#rpc_nvmf_get_subsystems}
8130
8131#### Parameters
8132
8133Name                        | Optional | Type        | Description
8134--------------------------- | -------- | ------------| -----------
8135tgt_name                    | Optional | string      | Parent NVMe-oF target name.
8136
8137#### Example
8138
8139Example request:
8140
8141~~~json
8142{
8143  "jsonrpc": "2.0",
8144  "id": 1,
8145  "method": "nvmf_get_subsystems"
8146}
8147~~~
8148
8149Example response:
8150
8151~~~json
8152{
8153  "jsonrpc": "2.0",
8154  "id": 1,
8155  "result": [
8156    {
8157      "nqn": "nqn.2014-08.org.nvmexpress.discovery",
8158      "subtype": "Discovery"
8159      "listen_addresses": [],
8160      "hosts": [],
8161      "allow_any_host": true
8162    },
8163    {
8164      "nqn": "nqn.2016-06.io.spdk:cnode1",
8165      "subtype": "NVMe",
8166      "listen_addresses": [
8167        {
8168          "trtype": "RDMA",
8169          "adrfam": "IPv4",
8170          "traddr": "192.168.0.123",
8171          "trsvcid": "4420"
8172        }
8173      ],
8174      "hosts": [
8175        {"nqn": "nqn.2016-06.io.spdk:host1"}
8176      ],
8177      "allow_any_host": false,
8178      "serial_number": "abcdef",
8179      "model_number": "ghijklmnop",
8180      "namespaces": [
8181        {"nsid": 1, "name": "Malloc2"},
8182        {"nsid": 2, "name": "Nvme0n1"}
8183      ]
8184    }
8185  ]
8186}
8187~~~
8188
8189### nvmf_create_subsystem method {#rpc_nvmf_create_subsystem}
8190
8191Construct an NVMe over Fabrics target subsystem.
8192
8193#### Parameters
8194
8195Name                       | Optional | Type        | Description
8196-------------------------- | -------- | ----------- | -----------
8197nqn                        | Required | string      | Subsystem NQN
8198tgt_name                   | Optional | string      | Parent NVMe-oF target name.
8199serial_number              | Optional | string      | Serial number of virtual controller
8200model_number               | Optional | string      | Model number of virtual controller
8201max_namespaces             | Optional | number      | Maximum number of namespaces that can be attached to the subsystem. Default: 32 (also used if user specifies 0)
8202allow_any_host             | Optional | boolean     | Allow any host (`true`) or enforce allowed host list (`false`). Default: `false`.
8203ana_reporting              | Optional | boolean     | Enable ANA reporting feature (default: `false`).
8204min_cntlid                 | Optional | number      | Minimum controller ID. Default: 1
8205max_cntlid                 | Optional | number      | Maximum controller ID. Default: 0xffef
8206max_discard_size_kib       | Optional | number      | Maximum discard size (Kib). Default: 0
8207max_write_zeroes_size_kib  | Optional | number      | Maximum write_zeroes size (Kib). Default: 0
8208
8209#### Example
8210
8211Example request:
8212
8213~~~json
8214{
8215  "jsonrpc": "2.0",
8216  "id": 1,
8217  "method": "nvmf_create_subsystem",
8218  "params": {
8219    "nqn": "nqn.2016-06.io.spdk:cnode1",
8220    "allow_any_host": false,
8221    "serial_number": "abcdef",
8222    "model_number": "ghijklmnop"
8223  }
8224}
8225~~~
8226
8227Example response:
8228
8229~~~json
8230{
8231  "jsonrpc": "2.0",
8232  "id": 1,
8233  "result": true
8234}
8235~~~
8236
8237### nvmf_delete_subsystem method {#rpc_nvmf_delete_subsystem}
8238
8239Delete an existing NVMe-oF subsystem.
8240
8241#### Parameters
8242
8243Parameter              | Optional | Type        | Description
8244---------------------- | -------- | ----------- | -----------
8245nqn                    | Required | string      | Subsystem NQN to delete.
8246tgt_name               | Optional | string      | Parent NVMe-oF target name.
8247
8248#### Example
8249
8250Example request:
8251
8252~~~json
8253{
8254  "jsonrpc": "2.0",
8255  "id": 1,
8256  "method": "nvmf_delete_subsystem",
8257  "params": {
8258    "nqn": "nqn.2016-06.io.spdk:cnode1"
8259  }
8260}
8261~~~
8262
8263Example response:
8264
8265~~~json
8266{
8267  "jsonrpc": "2.0",
8268  "id": 1,
8269  "result": true
8270}
8271~~~
8272
8273### nvmf_subsystem_add_listener  method {#rpc_nvmf_subsystem_add_listener}
8274
8275Add a new listen address to an NVMe-oF subsystem.
8276
8277This method will fail if listener with given address already exists.
8278
8279#### Parameters
8280
8281Name                    | Optional | Type        | Description
8282----------------------- | -------- | ----------- | -----------
8283nqn                     | Required | string      | Subsystem NQN
8284tgt_name                | Optional | string      | Parent NVMe-oF target name.
8285listen_address          | Required | object      | @ref rpc_nvmf_listen_address object
8286secure_channel          | Optional | bool        | Whether all connections immediately attempt to establish a secure channel
8287
8288#### listen_address {#rpc_nvmf_listen_address}
8289
8290The listen_address is used for adding the listeners to the NVMe-oF target
8291and for referring to discovery services on other targets.
8292
8293Name                    | Optional | Type        | Description
8294----------------------- | -------- | ----------- | -----------
8295trtype                  | Required | string      | Transport type ("RDMA")
8296adrfam                  | Optional | string      | Address family ("IPv4", "IPv6", "IB", or "FC")
8297traddr                  | Required | string      | Transport address
8298trsvcid                 | Optional | string      | Transport service ID (required for RDMA or TCP)
8299
8300#### Example
8301
8302Example request:
8303
8304~~~json
8305{
8306  "jsonrpc": "2.0",
8307  "id": 1,
8308  "method": "nvmf_subsystem_add_listener",
8309  "params": {
8310    "nqn": "nqn.2016-06.io.spdk:cnode1",
8311    "listen_address": {
8312      "trtype": "RDMA",
8313      "adrfam": "IPv4",
8314      "traddr": "192.168.0.123",
8315      "trsvcid": "4420"
8316    }
8317  }
8318}
8319~~~
8320
8321Example response:
8322
8323~~~json
8324{
8325  "jsonrpc": "2.0",
8326  "id": 1,
8327  "result": true
8328}
8329~~~
8330
8331### nvmf_subsystem_remove_listener  method {#rpc_nvmf_subsystem_remove_listener}
8332
8333Remove a listen address from an NVMe-oF subsystem.
8334
8335#### Parameters
8336
8337Name                    | Optional | Type        | Description
8338----------------------- | -------- | ----------- | -----------
8339nqn                     | Required | string      | Subsystem NQN
8340tgt_name                | Optional | string      | Parent NVMe-oF target name.
8341listen_address          | Required | object      | @ref rpc_nvmf_listen_address object
8342
8343#### Example
8344
8345Example request:
8346
8347~~~json
8348{
8349  "jsonrpc": "2.0",
8350  "id": 1,
8351  "method": "nvmf_subsystem_remove_listener",
8352  "params": {
8353    "nqn": "nqn.2016-06.io.spdk:cnode1",
8354    "listen_address": {
8355      "trtype": "RDMA",
8356      "adrfam": "IPv4",
8357      "traddr": "192.168.0.123",
8358      "trsvcid": "4420"
8359    }
8360  }
8361}
8362~~~
8363
8364Example response:
8365
8366~~~json
8367{
8368  "jsonrpc": "2.0",
8369  "id": 1,
8370  "result": true
8371}
8372~~~
8373
8374### nvmf_subsystem_listener_set_ana_state  method {#rpc_nvmf_subsystem_listener_set_ana_state}
8375
8376Set ANA state of a listener for an NVMe-oF subsystem. Only the ANA state of the specified ANA
8377group is updated, or ANA states of all ANA groups if ANA group is not specified.
8378
8379#### Parameters
8380
8381Name                    | Optional | Type        | Description
8382----------------------- | -------- | ----------- | -----------
8383nqn                     | Required | string      | Subsystem NQN
8384tgt_name                | Optional | string      | Parent NVMe-oF target name.
8385listen_address          | Required | object      | @ref rpc_nvmf_listen_address object
8386ana_state               | Required | string      | ANA state to set ("optimized", "non_optimized", or "inaccessible")
8387anagrpid                | Optional | number      | ANA group ID
8388
8389#### Example
8390
8391Example request:
8392
8393~~~json
8394{
8395  "jsonrpc": "2.0",
8396  "id": 1,
8397  "method": "nvmf_subsystem_listener_set_ana_state",
8398  "params": {
8399    "nqn": "nqn.2016-06.io.spdk:cnode1",
8400    "listen_address": {
8401      "trtype": "RDMA",
8402      "adrfam": "IPv4",
8403      "traddr": "192.168.0.123",
8404      "trsvcid": "4420"
8405    },
8406    "ana_state", "inaccessible"
8407  }
8408}
8409~~~
8410
8411Example response:
8412
8413~~~json
8414{
8415  "jsonrpc": "2.0",
8416  "id": 1,
8417  "result": true
8418}
8419~~~
8420
8421### nvmf_subsystem_add_ns method {#rpc_nvmf_subsystem_add_ns}
8422
8423Add a namespace to a subsystem. The namespace ID is returned as the result.
8424
8425### Parameters
8426
8427Name                    | Optional | Type        | Description
8428----------------------- | -------- | ----------- | -----------
8429nqn                     | Required | string      | Subsystem NQN
8430namespace               | Required | object      | @ref rpc_nvmf_namespace object
8431tgt_name                | Optional | string      | Parent NVMe-oF target name.
8432no_auto_visible         | Optional | bool        | Namespace is not automatically visible to controllers (default: false)
8433
8434#### namespace {#rpc_nvmf_namespace}
8435
8436Name                    | Optional | Type        | Description
8437----------------------- | -------- | ----------- | -----------
8438nsid                    | Optional | number      | Namespace ID between 1 and 4294967294, inclusive. Default: Automatically assign NSID.
8439bdev_name               | Required | string      | Name of bdev to expose as a namespace.
8440nguid                   | Optional | string      | 16-byte namespace globally unique identifier in hexadecimal (e.g. "ABCDEF0123456789ABCDEF0123456789")
8441eui64                   | Optional | string      | 8-byte namespace EUI-64 in hexadecimal (e.g. "ABCDEF0123456789")
8442uuid                    | Optional | string      | RFC 4122 UUID (e.g. "ceccf520-691e-4b46-9546-34af789907c5")
8443ptpl_file               | Optional | string      | File path to save/restore persistent reservation information
8444anagrpid                | Optional | number      | ANA group ID. Default: Namespace ID.
8445
8446#### Example
8447
8448Example request:
8449
8450~~~json
8451{
8452  "jsonrpc": "2.0",
8453  "id": 1,
8454  "method": "nvmf_subsystem_add_ns",
8455  "params": {
8456    "nqn": "nqn.2016-06.io.spdk:cnode1",
8457    "namespace": {
8458      "nsid": 3,
8459      "bdev_name": "Nvme0n1",
8460      "ptpl_file": "/opt/Nvme0n1PR.json"
8461    }
8462  }
8463}
8464~~~
8465
8466Example response:
8467
8468~~~json
8469{
8470  "jsonrpc": "2.0",
8471  "id": 1,
8472  "result": 3
8473}
8474~~~
8475
8476### nvmf_subsystem_remove_ns method {#rpc_nvmf_subsystem_remove_ns}
8477
8478Remove a namespace from a subsystem.
8479
8480#### Parameters
8481
8482Name                    | Optional | Type        | Description
8483----------------------- | -------- | ----------- | -----------
8484nqn                     | Required | string      | Subsystem NQN
8485nsid                    | Required | number      | Namespace ID
8486tgt_name                | Optional | string      | Parent NVMe-oF target name.
8487
8488#### Example
8489
8490Example request:
8491
8492~~~json
8493{
8494  "jsonrpc": "2.0",
8495  "id": 1,
8496  "method": "nvmf_subsystem_remove_ns",
8497  "params": {
8498    "nqn": "nqn.2016-06.io.spdk:cnode1",
8499    "nsid": 1
8500  }
8501}
8502~~~
8503
8504Example response:
8505
8506~~~json
8507{
8508  "jsonrpc": "2.0",
8509  "id": 1,
8510  "result": true
8511}
8512~~~
8513
8514### nvmf_subsystem_add_host method {#rpc_nvmf_subsystem_add_host}
8515
8516Add a host NQN to the list of allowed hosts.
8517
8518#### Parameters
8519
8520Name                    | Optional | Type        | Description
8521----------------------- | -------- | ----------- | -----------
8522nqn                     | Required | string      | Subsystem NQN
8523host                    | Required | string      | Host NQN to add to the list of allowed host NQNs
8524tgt_name                | Optional | string      | Parent NVMe-oF target name.
8525psk                     | Optional | string      | Path to a file containing PSK for TLS connection
8526
8527#### Example
8528
8529Example request:
8530
8531~~~json
8532{
8533  "jsonrpc": "2.0",
8534  "id": 1,
8535  "method": "nvmf_subsystem_add_host",
8536  "params": {
8537    "nqn": "nqn.2016-06.io.spdk:cnode1",
8538    "host": "nqn.2016-06.io.spdk:host1"
8539  }
8540}
8541~~~
8542
8543Example response:
8544
8545~~~json
8546{
8547  "jsonrpc": "2.0",
8548  "id": 1,
8549  "result": true
8550}
8551~~~
8552
8553### nvmf_subsystem_remove_host method {#rpc_nvmf_subsystem_remove_host}
8554
8555Remove a host NQN from the list of allowed hosts.
8556
8557#### Parameters
8558
8559Name                    | Optional | Type        | Description
8560----------------------- | -------- | ----------- | -----------
8561nqn                     | Required | string      | Subsystem NQN
8562host                    | Required | string      | Host NQN to remove from the list of allowed host NQNs
8563tgt_name                | Optional | string      | Parent NVMe-oF target name.
8564
8565#### Example
8566
8567Example request:
8568
8569~~~json
8570{
8571  "jsonrpc": "2.0",
8572  "id": 1,
8573  "method": "nvmf_subsystem_remove_host",
8574  "params": {
8575    "nqn": "nqn.2016-06.io.spdk:cnode1",
8576    "host": "nqn.2016-06.io.spdk:host1"
8577  }
8578}
8579~~~
8580
8581Example response:
8582
8583~~~json
8584{
8585  "jsonrpc": "2.0",
8586  "id": 1,
8587  "result": true
8588}
8589~~~
8590
8591### nvmf_subsystem_allow_any_host method {#rpc_nvmf_subsystem_allow_any_host}
8592
8593Configure a subsystem to allow any host to connect or to enforce the host NQN list.
8594
8595#### Parameters
8596
8597Name                    | Optional | Type        | Description
8598----------------------- | -------- | ----------- | -----------
8599nqn                     | Required | string      | Subsystem NQN
8600allow_any_host          | Required | boolean     | Allow any host (`true`) or enforce allowed host list (`false`).
8601tgt_name                | Optional | string      | Parent NVMe-oF target name.
8602
8603#### Example
8604
8605Example request:
8606
8607~~~json
8608{
8609  "jsonrpc": "2.0",
8610  "id": 1,
8611  "method": "nvmf_subsystem_allow_any_host",
8612  "params": {
8613    "nqn": "nqn.2016-06.io.spdk:cnode1",
8614    "allow_any_host": true
8615  }
8616}
8617~~~
8618
8619Example response:
8620
8621~~~json
8622{
8623  "jsonrpc": "2.0",
8624  "id": 1,
8625  "result": true
8626}
8627~~~
8628
8629### nvmf_subsystem_get_controllers {#rpc_nvmf_subsystem_get_controllers}
8630
8631#### Parameters
8632
8633Name                    | Optional | Type        | Description
8634----------------------- | -------- | ----------- | -----------
8635nqn                     | Required | string      | Subsystem NQN
8636tgt_name                | Optional | string      | Parent NVMe-oF target name.
8637
8638#### Example
8639
8640Example request:
8641
8642~~~json
8643{
8644  "jsonrpc": "2.0",
8645  "id": 1,
8646  "method": "nvmf_subsystem_get_controllers",
8647  "params": {
8648    "nqn": "nqn.2016-06.io.spdk:cnode1"
8649  }
8650}
8651~~~
8652
8653Example response:
8654
8655~~~json
8656{
8657  "jsonrpc": "2.0",
8658  "id": 1,
8659  "result": [
8660    {
8661      "cntlid": 1,
8662      "hostnqn": "nqn.2016-06.io.spdk:host1",
8663      "hostid": "27dad528-6368-41c3-82d3-0b956b49025d",
8664      "num_io_qpairs": 5
8665    }
8666  ]
8667}
8668~~~
8669
8670### nvmf_subsystem_get_qpairs {#rpc_nvmf_subsystem_get_qpairs}
8671
8672#### Parameters
8673
8674Name                    | Optional | Type        | Description
8675----------------------- | -------- | ----------- | -----------
8676nqn                     | Required | string      | Subsystem NQN
8677tgt_name                | Optional | string      | Parent NVMe-oF target name.
8678
8679#### Example
8680
8681Example request:
8682
8683~~~json
8684{
8685  "jsonrpc": "2.0",
8686  "id": 1,
8687  "method": "nvmf_subsystem_get_qpairs",
8688  "params": {
8689    "nqn": "nqn.2016-06.io.spdk:cnode1"
8690  }
8691}
8692~~~
8693
8694Example response:
8695
8696~~~json
8697{
8698  "jsonrpc": "2.0",
8699  "id": 1,
8700  "result": [
8701    {
8702      "cntlid": 1,
8703      "qid": 0,
8704      "state": "active",
8705      "listen_address": {
8706        "trtype": "RDMA",
8707        "adrfam": "IPv4",
8708        "traddr": "192.168.0.123",
8709        "trsvcid": "4420"
8710      }
8711    },
8712    {
8713      "cntlid": 1,
8714      "qid": 1,
8715      "state": "active",
8716      "listen_address": {
8717        "trtype": "RDMA",
8718        "adrfam": "IPv4",
8719        "traddr": "192.168.0.123",
8720        "trsvcid": "4420"
8721      }
8722    }
8723  ]
8724}
8725~~~
8726
8727### nvmf_subsystem_get_listeners {#rpc_nvmf_subsystem_get_listeners}
8728
8729#### Parameters
8730
8731Name                    | Optional | Type        | Description
8732----------------------- | -------- | ----------- | -----------
8733nqn                     | Required | string      | Subsystem NQN
8734tgt_name                | Optional | string      | Parent NVMe-oF target name.
8735
8736#### Example
8737
8738Example request:
8739
8740~~~json
8741{
8742  "jsonrpc": "2.0",
8743  "id": 1,
8744  "method": "nvmf_subsystem_get_listeners",
8745  "params": {
8746    "nqn": "nqn.2016-06.io.spdk:cnode1"
8747  }
8748}
8749~~~
8750
8751Example response:
8752
8753~~~json
8754{
8755  "jsonrpc": "2.0",
8756  "id": 1,
8757  "result": [
8758    {
8759      "address": {
8760        "trtype": "RDMA",
8761        "adrfam": "IPv4",
8762        "traddr": "192.168.0.123",
8763        "trsvcid": "4420"
8764      },
8765      "ana_state": "optimized"
8766    }
8767  ]
8768}
8769~~~
8770
8771### nvmf_ns_add_host {#rpc_nvmf_ns_add_host}
8772
8773Make the specified namespace of the specified subnqn visible to any existing
8774or future controllers with the specified hostnqn.
8775
8776Note: the namespace must have been added with no_auto_visible = false
8777(see @ref rpc_nvmf_subsystem_add_ns).
8778
8779#### Parameters
8780
8781Name                    | Optional | Type        | Description
8782----------------------- | -------- | ----------- | -----------
8783nqn                     | Required | string      | Subsystem NQN
8784nsid                    | Required | number      | Namespace ID
8785host                    | Required | string      | Host NQN
8786
8787#### Example
8788
8789Example request:
8790
8791~~~json
8792{
8793  "jsonrpc": "2.0",
8794  "id": 1,
8795  "method": "nvmf_ns_add_host",
8796  "params": {
8797    "nqn": "nqn.2016-06.io.spdk:cnode1",
8798    "nsid": 1,
8799    "host": "nqn.2024-01.io.spdk:host0"
8800  }
8801}
8802~~~
8803
8804Example response:
8805
8806~~~json
8807{
8808  "jsonrpc": "2.0",
8809  "id": 1,
8810  "result": true
8811}
8812~~~
8813
8814### nvmf_ns_remove_host {#rpc_nvmf_ns_remove_host}
8815
8816Make the specified namespace of the specified subnqn not visible to any existing
8817or future controllers with the specified hostnqn.
8818
8819Note: the namespace must have been added to the subsystem with
8820no_auto_visible = false (see @ref rpc_nvmf_subsystem_add_ns).
8821
8822#### Parameters
8823
8824Name                    | Optional | Type        | Description
8825----------------------- | -------- | ----------- | -----------
8826nqn                     | Required | string      | Subsystem NQN
8827nsid                    | Required | number      | Namespace ID
8828host                    | Required | string      | Host NQN
8829
8830#### Example
8831
8832Example request:
8833
8834~~~json
8835{
8836  "jsonrpc": "2.0",
8837  "id": 1,
8838  "method": "nvmf_ns_remove_host",
8839  "params": {
8840    "nqn": "nqn.2016-06.io.spdk:cnode1",
8841    "nsid": 1,
8842    "host": "nqn.2024-01.io.spdk:host0"
8843  }
8844}
8845~~~
8846
8847Example response:
8848
8849~~~json
8850{
8851  "jsonrpc": "2.0",
8852  "id": 1,
8853  "result": true
8854}
8855~~~
8856
8857### nvmf_set_max_subsystems {#rpc_nvmf_set_max_subsystems}
8858
8859Set the maximum allowed subsystems for the NVMe-oF target.  This RPC may only be called
8860before SPDK subsystems have been initialized.
8861
8862#### Parameters
8863
8864Name                    | Optional | Type        | Description
8865----------------------- | -------- | ----------- | -----------
8866max_subsystems          | Required | number      | Maximum number of NVMe-oF subsystems
8867
8868#### Example
8869
8870Example request:
8871
8872~~~json
8873{
8874  "jsonrpc": "2.0",
8875  "id": 1,
8876  "method": "nvmf_set_max_subsystems",
8877  "params": {
8878    "max_subsystems": 1024
8879  }
8880}
8881~~~
8882
8883Example response:
8884
8885~~~json
8886{
8887  "jsonrpc": "2.0",
8888  "id": 1,
8889  "result": true
8890}
8891~~~
8892
8893### nvmf_discovery_add_referral  method {#rpc_nvmf_discovery_add_referral}
8894
8895Add a discovery service referral to an NVMe-oF target. If a referral with the given
8896parameters already exists, no action will be taken.
8897
8898#### Parameters
8899
8900Name                    | Optional | Type        | Description
8901----------------------- | -------- | ----------- | -----------
8902tgt_name                | Optional | string      | Parent NVMe-oF target name.
8903address                 | Required | object      | @ref rpc_nvmf_listen_address object
8904secure_channel          | Optional | bool        | The connection to that discovery subsystem requires a secure channel
8905
8906#### Example
8907
8908Example request:
8909
8910~~~json
8911{
8912  "jsonrpc": "2.0",
8913  "id": 1,
8914  "method": "nvmf_discovery_add_referral",
8915  "params": {
8916    "address": {
8917      "trtype": "RDMA",
8918      "adrfam": "IPv4",
8919      "traddr": "192.168.0.123",
8920      "trsvcid": "4420"
8921    }
8922  }
8923}
8924~~~
8925
8926Example response:
8927
8928~~~json
8929{
8930  "jsonrpc": "2.0",
8931  "id": 1,
8932  "result": true
8933}
8934~~~
8935
8936### nvmf_discovery_remove_referral  method {#rpc_nvmf_discovery_remove_referral}
8937
8938Remove a discovery service referral from an NVMe-oF target.
8939
8940#### Parameters
8941
8942Name                    | Optional | Type        | Description
8943----------------------- | -------- | ----------- | -----------
8944tgt_name                | Optional | string      | Parent NVMe-oF target name.
8945address                 | Required | object      | @ref rpc_nvmf_listen_address object
8946
8947#### Example
8948
8949Example request:
8950
8951~~~json
8952{
8953  "jsonrpc": "2.0",
8954  "id": 1,
8955  "method": "nvmf_discovery_remove_referral",
8956  "params": {
8957    "address": {
8958      "trtype": "RDMA",
8959      "adrfam": "IPv4",
8960      "traddr": "192.168.0.123",
8961      "trsvcid": "4420"
8962    }
8963  }
8964}
8965~~~
8966
8967Example response:
8968
8969~~~json
8970{
8971  "jsonrpc": "2.0",
8972  "id": 1,
8973  "result": true
8974}
8975~~~
8976
8977### nvmf_discovery_get_referrals {#rpc_nvmf_discovery_get_referrals}
8978
8979#### Parameters
8980
8981Name                    | Optional | Type        | Description
8982----------------------- | -------- | ----------- | -----------
8983tgt_name                | Optional | string      | Parent NVMe-oF target name.
8984
8985#### Example
8986
8987Example request:
8988
8989~~~json
8990{
8991  "jsonrpc": "2.0",
8992  "id": 1,
8993  "method": "nvmf_discovery_get_referrals"
8994}
8995~~~
8996
8997Example response:
8998
8999~~~json
9000{
9001  "jsonrpc": "2.0",
9002  "id": 1,
9003  "result": [
9004    {
9005      "address": {
9006        "trtype": "RDMA",
9007        "adrfam": "IPv4",
9008        "traddr": "192.168.0.123",
9009        "trsvcid": "4420"
9010      }
9011    }
9012  ]
9013}
9014~~~
9015
9016### nvmf_set_config {#rpc_nvmf_set_config}
9017
9018Set global configuration of NVMe-oF target.  This RPC may only be called before SPDK subsystems
9019have been initialized.
9020
9021#### Parameters
9022
9023Name                    | Optional | Type        | Description
9024----------------------- | -------- | ----------- | -----------
9025acceptor_poll_rate      | Optional | number      | Polling interval of the acceptor for incoming connections (microseconds)
9026admin_cmd_passthru      | Optional | object      | Admin command passthru configuration
9027poll_groups_mask        | Optional | string      | Set cpumask for NVMf poll groups
9028discovery_filter        | Optional | string      | Set discovery filter, possible values are: `match_any` (default) or comma separated values: `transport`, `address`, `svcid`
9029
9030#### admin_cmd_passthru {#spdk_nvmf_admin_passthru_conf}
9031
9032Name                    | Optional | Type        | Description
9033----------------------- | -------- | ----------- | -----------
9034identify_ctrlr          | Required | bool        | If true, enables custom identify handler that reports some identify attributes from the underlying NVMe drive
9035
9036#### Example
9037
9038Example request:
9039
9040~~~json
9041{
9042  "jsonrpc": "2.0",
9043  "id": 1,
9044  "method": "nvmf_set_config",
9045  "params": {
9046    "acceptor_poll_rate": 10000
9047  }
9048}
9049~~~
9050
9051Example response:
9052
9053~~~json
9054{
9055  "jsonrpc": "2.0",
9056  "id": 1,
9057  "result": true
9058}
9059~~~
9060
9061### nvmf_get_transports method {#rpc_nvmf_get_transports}
9062
9063#### Parameters
9064
9065The user may specify no parameters in order to list all transports, or a transport may be
9066specified by type.
9067
9068Name                        | Optional | Type        | Description
9069--------------------------- | -------- | ------------| -----------
9070tgt_name                    | Optional | string      | Parent NVMe-oF target name.
9071trtype                      | Optional | string      | Transport type.
9072
9073#### Example
9074
9075Example request:
9076
9077~~~json
9078{
9079  "jsonrpc": "2.0",
9080  "id": 1,
9081  "method": "nvmf_get_transports"
9082}
9083~~~
9084
9085Example response:
9086
9087~~~json
9088{
9089  "jsonrpc": "2.0",
9090  "id": 1,
9091  "result": [
9092    {
9093      "type": "RDMA".
9094      "max_queue_depth": 128,
9095      "max_io_qpairs_per_ctrlr": 64,
9096      "in_capsule_data_size": 4096,
9097      "max_io_size": 131072,
9098      "io_unit_size": 131072,
9099      "abort_timeout_sec": 1
9100    }
9101  ]
9102}
9103~~~
9104
9105### nvmf_get_stats method {#rpc_nvmf_get_stats}
9106
9107Retrieve current statistics of the NVMf subsystem.
9108
9109#### Parameters
9110
9111Name                        | Optional | Type        | Description
9112--------------------------- | -------- | ------------| -----------
9113tgt_name                    | Optional | string      | Parent NVMe-oF target name.
9114
9115#### Response
9116
9117The response is an object containing NVMf subsystem statistics.
9118In the response, `admin_qpairs` and `io_qpairs` are reflecting cumulative queue pair counts while
9119`current_admin_qpairs` and `current_io_qpairs` are showing the current number.
9120
9121#### Example
9122
9123Example request:
9124
9125~~~json
9126{
9127  "jsonrpc": "2.0",
9128  "method": "nvmf_get_stats",
9129  "id": 1
9130}
9131~~~
9132
9133Example response:
9134
9135~~~json
9136{
9137  "jsonrpc": "2.0",
9138  "id": 1,
9139  "result": {
9140    "tick_rate": 2400000000,
9141    "poll_groups": [
9142      {
9143        "name": "app_thread",
9144        "admin_qpairs": 1,
9145        "io_qpairs": 4,
9146        "current_admin_qpairs": 1,
9147        "current_io_qpairs": 2,
9148        "pending_bdev_io": 1721,
9149        "transports": [
9150          {
9151            "trtype": "RDMA",
9152            "pending_data_buffer": 12131888,
9153            "devices": [
9154              {
9155                "name": "mlx5_1",
9156                "polls": 72284105,
9157                "completions": 0,
9158                "requests": 0,
9159                "request_latency": 0,
9160                "pending_free_request": 0,
9161                "pending_rdma_read": 0,
9162                "pending_rdma_write": 0,
9163                "total_send_wrs": 0,
9164                "send_doorbell_updates": 0,
9165                "total_recv_wrs": 0,
9166                "recv_doorbell_updates": 1
9167              },
9168              {
9169                "name": "mlx5_0",
9170                "polls": 72284105,
9171                "completions": 15165875,
9172                "requests": 7582935,
9173                "request_latency": 1249323766184,
9174                "pending_free_request": 0,
9175                "pending_rdma_read": 337602,
9176                "pending_rdma_write": 0,
9177                "total_send_wrs": 15165875,
9178                "send_doorbell_updates": 1516587,
9179                "total_recv_wrs": 15165875,
9180                "recv_doorbell_updates": 1516587
9181              }
9182            ]
9183          }
9184        ]
9185      }
9186    ]
9187  }
9188}
9189~~~
9190
9191### nvmf_set_crdt {#rpc_nvmf_set_crdt}
9192
9193Set the 3 CRDT (Command Retry Delay Time) values. For details about
9194CRDT, please refer to the NVMe specification. Currently all the
9195SPDK nvmf subsystems share the same CRDT values. The default values
9196are 0. This rpc can only be invoked in STARTUP stage. All values are
9197in units of 100 milliseconds (same as the NVMe specification).
9198
9199#### Parameters
9200
9201Name                    | Optional | Type        | Description
9202----------------------- | -------- | ----------- | -----------
9203crdt1                   | Optional | number      | Command Retry Delay Time 1
9204crdt2                   | Optional | number      | Command Retry Delay Time 2
9205crdt3                   | Optional | number      | Command Retry Delay Time 3
9206
9207## Vfio-user Target
9208
9209### vfu_tgt_set_base_path {#rpc_vfu_tgt_set_base_path}
9210
9211Set base path of Unix Domain socket file.
9212
9213#### Parameters
9214
9215Name                    | Optional | Type        | Description
9216----------------------- | -------- | ----------- | -----------
9217path                    | Required | string      | Base path
9218
9219#### Example
9220
9221Example request:
9222
9223~~~json
9224{
9225  "params": {
9226    "path": "/var/run/vfu_tgt"
9227  },
9228  "jsonrpc": "2.0",
9229  "method": "vfu_tgt_set_base_path",
9230  "id": 1
9231}
9232~~~
9233
9234Example response:
9235
9236~~~json
9237{
9238  "jsonrpc": "2.0",
9239  "id": 1,
9240  "result": true
9241}
9242~~~
9243
9244### vfu_virtio_delete_endpoint {#rpc_vfu_virtio_delete_endpoint}
9245
9246Delete PCI device via endpoint name.
9247
9248#### Parameters
9249
9250Name                    | Optional | Type        | Description
9251----------------------- | -------- | ----------- | -----------
9252name                    | Required | string      | Endpoint name
9253
9254#### Example
9255
9256Example request:
9257
9258~~~json
9259{
9260  "params": {
9261    "name": "vfu.0"
9262  },
9263  "jsonrpc": "2.0",
9264  "method": "vfu_virtio_delete_endpoint",
9265  "id": 1
9266}
9267~~~
9268
9269Example response:
9270
9271~~~json
9272{
9273  "jsonrpc": "2.0",
9274  "id": 1,
9275  "result": true
9276}
9277~~~
9278
9279### vfu_virtio_create_blk_endpoint {#rpc_vfu_virtio_create_blk_endpoint}
9280
9281Create vfio-user virtio-blk PCI endpoint.
9282
9283#### Parameters
9284
9285Name                    | Optional | Type        | Description
9286----------------------- | -------- | ----------- | -----------
9287name                    | Required | string      | Endpoint name
9288bdev_name               | Required | string      | Block device name
9289cpumask                 | Optional | string      | CPU masks
9290num_queues              | Optional | number      | Number of queues
9291qsize                   | Optional | number      | Queue size
9292packed_ring             | Optional | boolean     | Enable packed ring
9293
9294#### Example
9295
9296Example request:
9297
9298~~~json
9299{
9300  "params": {
9301    "name": "vfu.0",
9302    "bdev_name": "Malloc0",
9303    "cpumask": "0x2",
9304    "num_queues": 4,
9305    "qsize": 256
9306  },
9307  "jsonrpc": "2.0",
9308  "method": "vfu_virtio_create_blk_endpoint",
9309  "id": 1
9310}
9311~~~
9312
9313Example response:
9314
9315~~~json
9316{
9317  "jsonrpc": "2.0",
9318  "id": 1,
9319  "result": true
9320}
9321~~~
9322
9323### vfu_virtio_scsi_add_target {#rpc_vfu_virtio_scsi_add_target}
9324
9325Add block device to specified SCSI target of vfio-user virtio-scsi PCI endpoint.
9326
9327#### Parameters
9328
9329Name                    | Optional | Type        | Description
9330----------------------- | -------- | ----------- | -----------
9331name                    | Required | string      | Endpoint name
9332scsi_target_num         | Required | number      | SCSI target number
9333bdev_name               | Required | string      | Block device name
9334
9335#### Example
9336
9337Example request:
9338
9339~~~json
9340{
9341  "params": {
9342    "name": "vfu.0",
9343    "scsi_target_num": 0,
9344    "bdev_name": "Malloc0"
9345  },
9346  "jsonrpc": "2.0",
9347  "method": "vfu_virtio_scsi_add_target",
9348  "id": 1
9349}
9350~~~
9351
9352Example response:
9353
9354~~~json
9355{
9356  "jsonrpc": "2.0",
9357  "id": 1,
9358  "result": true
9359}
9360~~~
9361
9362### vfu_virtio_scsi_remove_target {#rpc_vfu_virtio_scsi_remove_target}
9363
9364Remove a SCSI target of vfio-user virtio-scsi PCI endpoint.
9365
9366#### Parameters
9367
9368Name                    | Optional | Type        | Description
9369----------------------- | -------- | ----------- | -----------
9370name                    | Required | string      | Endpoint name
9371scsi_target_num         | Required | number      | SCSI target number
9372
9373#### Example
9374
9375Example request:
9376
9377~~~json
9378{
9379  "params": {
9380    "name": "vfu.0",
9381    "scsi_target_num": 0
9382  },
9383  "jsonrpc": "2.0",
9384  "method": "vfu_virtio_scsi_remove_target",
9385  "id": 1
9386}
9387~~~
9388
9389Example response:
9390
9391~~~json
9392{
9393  "jsonrpc": "2.0",
9394  "id": 1,
9395  "result": true
9396}
9397~~~
9398
9399### vfu_virtio_create_scsi_endpoint {#rpc_vfu_virtio_create_scsi_endpoint}
9400
9401Create vfio-user virtio-scsi PCI endpoint.
9402
9403#### Parameters
9404
9405Name                    | Optional | Type        | Description
9406----------------------- | -------- | ----------- | -----------
9407name                    | Required | string      | Endpoint name
9408cpumask                 | Optional | string      | CPU masks
9409num_io_queues           | Optional | number      | Number of IO queues
9410qsize                   | Optional | number      | Queue size
9411packed_ring             | Optional | boolean     | Enable packed ring
9412
9413#### Example
9414
9415Example request:
9416
9417~~~json
9418{
9419  "params": {
9420    "name": "vfu.0",
9421    "cpumask": "0x2",
9422    "num_io_queues": 4,
9423    "qsize": 256
9424  },
9425  "jsonrpc": "2.0",
9426  "method": "vfu_virtio_create_scsi_endpoint",
9427  "id": 1
9428}
9429~~~
9430
9431Example response:
9432
9433~~~json
9434{
9435  "jsonrpc": "2.0",
9436  "id": 1,
9437  "result": true
9438}
9439~~~
9440
9441## Vhost Target {#jsonrpc_components_vhost_tgt}
9442
9443The following common preconditions need to be met in all target types.
9444
9445Controller name will be used to create UNIX domain socket. This implies that name concatenated with vhost socket
9446directory path needs to be valid UNIX socket name.
9447
9448@ref cpu_mask parameter is used to choose CPU on which pollers will be launched when new initiator is connecting.
9449It must be a subset of application CPU mask. Default value is CPU mask of the application.
9450
9451### vhost_controller_set_coalescing {#rpc_vhost_controller_set_coalescing}
9452
9453Controls interrupt coalescing for specific target. Because `delay_base_us` is used to calculate delay in CPU ticks
9454there is no hardcoded limit for this parameter. Only limitation is that final delay in CPU ticks might not overflow
945532 bit unsigned integer (which is more than 1s @ 4GHz CPU). In real scenarios `delay_base_us` should be much lower
9456than 150us. To disable coalescing set `delay_base_us` to 0.
9457
9458#### Parameters
9459
9460Name                    | Optional | Type        | Description
9461----------------------- | -------- | ----------- | -----------
9462ctrlr                   | Required | string      | Controller name
9463delay_base_us           | Required | number      | Base (minimum) coalescing time in microseconds
9464iops_threshold          | Required | number      | Coalescing activation level greater than 0 in IO per second
9465
9466#### Example
9467
9468Example request:
9469
9470~~~json
9471{
9472  "params": {
9473    "iops_threshold": 100000,
9474    "ctrlr": "VhostScsi0",
9475    "delay_base_us": 80
9476  },
9477  "jsonrpc": "2.0",
9478  "method": "vhost_controller_set_coalescing",
9479  "id": 1
9480}
9481~~~
9482
9483Example response:
9484
9485~~~json
9486{
9487  "jsonrpc": "2.0",
9488  "id": 1,
9489  "result": true
9490}
9491~~~
9492
9493### vhost_create_scsi_controller {#rpc_vhost_create_scsi_controller}
9494
9495Construct vhost SCSI target.
9496
9497#### Parameters
9498
9499Name                    | Optional | Type        | Description
9500----------------------- | -------- | ----------- | -----------
9501ctrlr                   | Required | string      | Controller name
9502cpumask                 | Optional | string      | @ref cpu_mask for this controller
9503delay                   | Optional | boolean     | If true, delay the controller startup.
9504
9505#### Example
9506
9507Example request:
9508
9509~~~json
9510{
9511  "params": {
9512    "cpumask": "0x2",
9513    "ctrlr": "VhostScsi0",
9514    "delay": true
9515  },
9516  "jsonrpc": "2.0",
9517  "method": "vhost_create_scsi_controller",
9518  "id": 1
9519}
9520~~~
9521
9522Example response:
9523
9524~~~json
9525{
9526  "jsonrpc": "2.0",
9527  "id": 1,
9528  "result": true
9529}
9530~~~
9531
9532### vhost_start_scsi_controller {#rpc_vhost_start_scsi_controller}
9533
9534Start vhost SCSI controller, if controller is already started, do nothing.
9535
9536#### Parameters
9537
9538Name                    | Optional | Type        | Description
9539----------------------- | -------- | ----------- | -----------
9540ctrlr                   | Required | string      | Controller name
9541
9542#### Example
9543
9544Example request:
9545
9546~~~json
9547{
9548  "params": {
9549    "ctrlr": "VhostScsi0",
9550  },
9551  "jsonrpc": "2.0",
9552  "method": "vhost_start_scsi_controller",
9553  "id": 1
9554}
9555~~~
9556
9557Example response:
9558
9559~~~json
9560response:
9561{
9562  "jsonrpc": "2.0",
9563  "id": 1,
9564  "result": true
9565}
9566~~~
9567
9568### vhost_scsi_controller_add_target {#rpc_vhost_scsi_controller_add_target}
9569
9570In vhost target `ctrlr` create SCSI target with ID `scsi_target_num` and add `bdev_name` as LUN 0.
9571
9572#### Parameters
9573
9574Name                    | Optional | Type        | Description
9575----------------------- | -------- | ----------- | -----------
9576ctrlr                   | Required | string      | Controller name
9577scsi_target_num         | Required | number      | SCSI target ID between 0 and 7 or -1 to use first free ID.
9578bdev_name               | Required | string      | Name of bdev to expose as a LUN 0
9579
9580#### Response
9581
9582SCSI target ID.
9583
9584#### Example
9585
9586Example request:
9587
9588~~~json
9589{
9590  "params": {
9591    "scsi_target_num": 1,
9592    "bdev_name": "Malloc0",
9593    "ctrlr": "VhostScsi0"
9594  },
9595  "jsonrpc": "2.0",
9596  "method": "vhost_scsi_controller_add_target",
9597  "id": 1
9598}
9599~~~
9600
9601Example response:
9602
9603~~~json
9604response:
9605{
9606  "jsonrpc": "2.0",
9607  "id": 1,
9608  "result": 1
9609}
9610~~~
9611
9612### vhost_scsi_controller_remove_target {#rpc_vhost_scsi_controller_remove_target}
9613
9614Remove SCSI target ID `scsi_target_num` from vhost target `scsi_target_num`.
9615
9616This method will fail if initiator is connected, but doesn't support hot-remove (the `VIRTIO_SCSI_F_HOTPLUG` is not negotiated).
9617
9618#### Parameters
9619
9620Name                    | Optional | Type        | Description
9621----------------------- | -------- | ----------- | -----------
9622ctrlr                   | Required | string      | Controller name
9623scsi_target_num         | Required | number      | SCSI target ID between 0 and 7
9624
9625#### Example
9626
9627Example request:
9628
9629~~~json
9630request:
9631{
9632  "params": {
9633    "scsi_target_num": 1,
9634    "ctrlr": "VhostScsi0"
9635  },
9636  "jsonrpc": "2.0",
9637  "method": "vhost_scsi_controller_remove_target",
9638  "id": 1
9639}
9640~~~
9641
9642Example response:
9643
9644~~~json
9645{
9646  "jsonrpc": "2.0",
9647  "id": 1,
9648  "result": true
9649}
9650~~~
9651
9652### virtio_blk_create_transport {#rpc_virtio_blk_create_transport}
9653
9654Create virtio blk transport.
9655
9656#### Parameters
9657
9658Name                    | Optional | Type        | Description
9659----------------------- | -------- | ----------- | -----------
9660name                    | Required | string      | Transport name
9661
9662#### Example
9663
9664Example request:
9665
9666~~~json
9667{
9668  "params": {
9669    "name": "vhost_user_blk"
9670  },
9671  "jsonrpc": "2.0",
9672  "method": "virtio_blk_create_transport",
9673  "id": 1
9674}
9675~~~
9676
9677Example response:
9678
9679~~~json
9680{
9681  "jsonrpc": "2.0",
9682  "id": 1,
9683  "result": true
9684}
9685~~~
9686
9687### virtio_blk_get_transports {#rpc_virtio_blk_get_transports}
9688
9689#### Parameters
9690
9691The user may specify no parameters in order to list all transports,
9692or a transport name may be specified.
9693
9694Name                        | Optional | Type        | Description
9695--------------------------- | -------- | ------------| -----------
9696name                        | Optional | string      | Transport name.
9697
9698#### Example
9699
9700Example request:
9701
9702~~~json
9703{
9704  "jsonrpc": "2.0",
9705  "method": "virtio_blk_get_transports",
9706  "id": 1
9707}
9708~~~
9709
9710Example response:
9711
9712~~~json
9713{
9714  "jsonrpc": "2.0",
9715  "id": 1,
9716  "result": [
9717    {
9718      "name": "vhost_user_blk"
9719    }
9720  ]
9721}
9722~~~
9723
9724### vhost_create_blk_controller {#rpc_vhost_create_blk_controller}
9725
9726Create vhost block controller
9727
9728If `readonly` is `true` then vhost block target will be created as read only and fail any write requests.
9729The `VIRTIO_BLK_F_RO` feature flag will be offered to the initiator.
9730
9731#### Parameters
9732
9733Name                    | Optional | Type        | Description
9734----------------------- | -------- | ----------- | -----------
9735ctrlr                   | Required | string      | Controller name
9736bdev_name               | Required | string      | Name of bdev to expose block device
9737readonly                | Optional | boolean     | If true, this target will be read only (default: false)
9738cpumask                 | Optional | string      | @ref cpu_mask for this controller
9739transport               | Optional | string      | virtio blk transport name (default: vhost_user_blk)
9740
9741#### Example
9742
9743Example request:
9744
9745~~~json
9746{
9747  "params": {
9748    "dev_name": "Malloc0",
9749    "ctrlr": "VhostBlk0"
9750  },
9751  "jsonrpc": "2.0",
9752  "method": "vhost_create_blk_controller",
9753  "id": 1
9754}
9755~~~
9756
9757Example response:
9758
9759~~~json
9760{
9761  "jsonrpc": "2.0",
9762  "id": 1,
9763  "result": true
9764}
9765~~~
9766
9767### vhost_get_controllers {#rpc_vhost_get_controllers}
9768
9769Display information about all or specific vhost controller(s).
9770
9771#### Parameters
9772
9773The user may specify no parameters in order to list all controllers, or a controller may be
9774specified by name.
9775
9776Name                    | Optional | Type        | Description
9777----------------------- | -------- | ----------- | -----------
9778name                    | Optional | string      | Vhost controller name
9779
9780#### Response {#rpc_vhost_get_controllers_response}
9781
9782Response is an array of objects describing requested controller(s). Common fields are:
9783
9784Name                    | Type        | Description
9785----------------------- | ----------- | -----------
9786ctrlr                   | string      | Controller name
9787cpumask                 | string      | @ref cpu_mask of this controller
9788delay_base_us           | number      | Base (minimum) coalescing time in microseconds (0 if disabled)
9789iops_threshold          | number      | Coalescing activation level
9790backend_specific        | object      | Backend specific information
9791
9792### Vhost block {#rpc_vhost_get_controllers_blk}
9793
9794`backend_specific` contains one `block` object  of type:
9795
9796Name                    | Type        | Description
9797----------------------- | ----------- | -----------
9798bdev                    | string      | Backing bdev name or Null if bdev is hot-removed
9799readonly                | boolean     | True if controllers is readonly, false otherwise
9800
9801### Vhost SCSI {#rpc_vhost_get_controllers_scsi}
9802
9803`backend_specific` contains `scsi` array of following objects:
9804
9805Name                    | Type        | Description
9806----------------------- | ----------- | -----------
9807target_name             | string      | Name of this SCSI target
9808id                      | number      | Unique SPDK global SCSI target ID
9809scsi_dev_num            | number      | SCSI target ID initiator will see when scanning this controller
9810luns                    | array       | array of objects describing @ref rpc_vhost_get_controllers_scsi_luns
9811
9812### Vhost SCSI LUN {#rpc_vhost_get_controllers_scsi_luns}
9813
9814Object of type:
9815
9816Name                    | Type        | Description
9817----------------------- | ----------- | -----------
9818id                      | number      | SCSI LUN ID
9819bdev_name               | string      | Backing bdev name
9820
9821### Vhost NVMe {#rpc_vhost_get_controllers_nvme}
9822
9823`backend_specific` contains `namespaces` array of following objects:
9824
9825Name                    | Type        | Description
9826----------------------- | ----------- | -----------
9827nsid                    | number      | Namespace ID
9828bdev                    | string      | Backing bdev name
9829
9830#### Example
9831
9832Example request:
9833
9834~~~json
9835{
9836  "jsonrpc": "2.0",
9837  "method": "vhost_get_controllers",
9838  "id": 1
9839}
9840~~~
9841
9842Example response:
9843
9844~~~json
9845{
9846  "jsonrpc": "2.0",
9847  "id": 1,
9848  "result": [
9849    {
9850      "cpumask": "0x2",
9851      "backend_specific": {
9852        "block": {
9853          "readonly": false,
9854          "bdev": "Malloc0"
9855        }
9856      },
9857      "iops_threshold": 60000,
9858      "ctrlr": "VhostBlk0",
9859      "delay_base_us": 100
9860    },
9861    {
9862      "cpumask": "0x2",
9863      "backend_specific": {
9864        "scsi": [
9865          {
9866            "target_name": "Target 2",
9867            "luns": [
9868              {
9869                "id": 0,
9870                "bdev_name": "Malloc1"
9871              }
9872            ],
9873            "id": 0,
9874            "scsi_dev_num": 2
9875          },
9876          {
9877            "target_name": "Target 5",
9878            "luns": [
9879              {
9880                "id": 0,
9881                "bdev_name": "Malloc2"
9882              }
9883            ],
9884            "id": 1,
9885            "scsi_dev_num": 5
9886          }
9887        ]
9888      },
9889      "iops_threshold": 60000,
9890      "ctrlr": "VhostScsi0",
9891      "delay_base_us": 0
9892    },
9893    {
9894      "cpumask": "0x2",
9895      "backend_specific": {
9896        "namespaces": [
9897          {
9898            "bdev": "Malloc3",
9899            "nsid": 1
9900          },
9901          {
9902            "bdev": "Malloc4",
9903            "nsid": 2
9904          }
9905        ]
9906      },
9907      "iops_threshold": 60000,
9908      "ctrlr": "VhostNvme0",
9909      "delay_base_us": 0
9910    }
9911  ]
9912}
9913~~~
9914
9915### vhost_delete_controller {#rpc_vhost_delete_controller}
9916
9917Remove vhost target.
9918
9919This call will fail if there is an initiator connected or there is at least one SCSI target configured in case of
9920vhost SCSI target. In the later case please remove all SCSI targets first using @ref rpc_vhost_scsi_controller_remove_target.
9921
9922#### Parameters
9923
9924Name                    | Optional | Type        | Description
9925----------------------- | -------- | ----------- | -----------
9926ctrlr                   | Required | string      | Controller name
9927
9928#### Example
9929
9930Example request:
9931
9932~~~json
9933{
9934  "params": {
9935    "ctrlr": "VhostNvme0"
9936  },
9937  "jsonrpc": "2.0",
9938  "method": "vhost_delete_controller",
9939  "id": 1
9940}
9941~~~
9942
9943Example response:
9944
9945~~~json
9946{
9947  "jsonrpc": "2.0",
9948  "id": 1,
9949  "result": true
9950}
9951~~~
9952
9953## Logical Volume {#jsonrpc_components_lvol}
9954
9955Identification of logical volume store and logical volume is explained first.
9956
9957A logical volume store has a UUID and a name for its identification.
9958The UUID is generated on creation and it can be used as a unique identifier.
9959The name is specified on creation and can be renamed.
9960Either UUID or name is used to access logical volume store in RPCs.
9961
9962A logical volume has a UUID and a name for its identification.
9963The UUID of the logical volume is generated on creation and it can be unique identifier.
9964The alias of the logical volume takes the format _lvs_name/lvol_name_ where:
9965
9966* _lvs_name_ is the name of the logical volume store.
9967* _lvol_name_ is specified on creation and can be renamed.
9968
9969### bdev_lvol_create_lvstore {#rpc_bdev_lvol_create_lvstore}
9970
9971Construct a logical volume store.
9972
9973#### Parameters
9974
9975Name                          | Optional | Type        | Description
9976----------------------------- | -------- | ----------- | -----------
9977bdev_name                     | Required | string      | Bdev on which to construct logical volume store
9978lvs_name                      | Required | string      | Name of the logical volume store to create
9979cluster_sz                    | Optional | number      | Cluster size of the logical volume store in bytes (Default: 4MiB)
9980clear_method                  | Optional | string      | Change clear method for data region. Available: none, unmap (default), write_zeroes
9981num_md_pages_per_cluster_ratio| Optional | number      | Reserved metadata pages per cluster (Default: 100)
9982
9983The num_md_pages_per_cluster_ratio defines the amount of metadata to
9984allocate when the logical volume store is created. The default value
9985is '100', which translates to 1 4KiB per cluster. For the default 4MiB
9986cluster size, this equates to about 0.1% of the underlying block
9987device allocated for metadata. Logical volume stores can be grown, if
9988the size of the underlying block device grows in the future, but only
9989if enough metadata pages were allocated to support the growth. So
9990num_md_pages_per_cluster_ratio should be set to a higher value if
9991wanting to support future growth. For example,
9992num_md_pages_per_cluster_ratio = 200 would support future 2x growth of
9993the logical volume store, and would result in 0.2% of the underlying
9994block device allocated for metadata (with a default 4MiB cluster
9995size).
9996
9997#### Response
9998
9999UUID of the created logical volume store is returned.
10000
10001#### Example
10002
10003Example request:
10004
10005~~~json
10006{
10007  "jsonrpc": "2.0",
10008  "id": 1,
10009  "method": "bdev_lvol_create_lvstore",
10010  "params": {
10011    "lvs_name": "LVS0",
10012    "bdev_name": "Malloc0"
10013    "clear_method": "write_zeroes"
10014  }
10015}
10016~~~
10017
10018Example response:
10019
10020~~~json
10021{
10022  "jsonrpc": "2.0",
10023  "id": 1,
10024  "result": "a9959197-b5e2-4f2d-8095-251ffb6985a5"
10025}
10026~~~
10027
10028### bdev_lvol_delete_lvstore {#rpc_bdev_lvol_delete_lvstore}
10029
10030Destroy a logical volume store.
10031
10032#### Parameters
10033
10034Name                    | Optional | Type        | Description
10035----------------------- | -------- | ----------- | -----------
10036uuid                    | Optional | string      | UUID of the logical volume store to destroy
10037lvs_name                | Optional | string      | Name of the logical volume store to destroy
10038
10039Either uuid or lvs_name must be specified, but not both.
10040
10041#### Example
10042
10043Example request:
10044
10045~~~json
10046{
10047  "jsonrpc": "2.0",
10048  "method": "bdev_lvol_delete_lvstore",
10049  "id": 1
10050  "params": {
10051    "uuid": "a9959197-b5e2-4f2d-8095-251ffb6985a5"
10052  }
10053}
10054~~~
10055
10056Example response:
10057
10058~~~json
10059{
10060  "jsonrpc": "2.0",
10061  "id": 1,
10062  "result": true
10063}
10064~~~
10065
10066### bdev_lvol_get_lvstores {#rpc_bdev_lvol_get_lvstores}
10067
10068Get a list of logical volume stores.
10069
10070#### Parameters
10071
10072Name                    | Optional | Type        | Description
10073----------------------- | -------- | ----------- | -----------
10074uuid                    | Optional | string      | UUID of the logical volume store to retrieve information about
10075lvs_name                | Optional | string      | Name of the logical volume store to retrieve information about
10076
10077Either uuid or lvs_name may be specified, but not both.
10078If both uuid and lvs_name are omitted, information about all logical volume stores is returned.
10079
10080#### Example
10081
10082Example request:
10083
10084~~~json
10085{
10086  "jsonrpc": "2.0",
10087  "method": "bdev_lvol_get_lvstores",
10088  "id": 1,
10089  "params": {
10090    "lvs_name": "LVS0"
10091  }
10092}
10093~~~
10094
10095Example response:
10096
10097~~~json
10098{
10099  "jsonrpc": "2.0",
10100  "id": 1,
10101  "result": [
10102    {
10103      "uuid": "a9959197-b5e2-4f2d-8095-251ffb6985a5",
10104      "base_bdev": "Malloc0",
10105      "free_clusters": 31,
10106      "cluster_size": 4194304,
10107      "total_data_clusters": 31,
10108      "block_size": 4096,
10109      "name": "LVS0"
10110    }
10111  ]
10112}
10113~~~
10114
10115### bdev_lvol_rename_lvstore {#rpc_bdev_lvol_rename_lvstore}
10116
10117Rename a logical volume store.
10118
10119#### Parameters
10120
10121Name                    | Optional | Type        | Description
10122----------------------- | -------- | ----------- | -----------
10123old_name                | Required | string      | Existing logical volume store name
10124new_name                | Required | string      | New logical volume store name
10125
10126#### Example
10127
10128Example request:
10129
10130~~~json
10131{
10132  "jsonrpc": "2.0",
10133  "method": "bdev_lvol_rename_lvstore",
10134  "id": 1,
10135  "params": {
10136    "old_name": "LVS0",
10137    "new_name": "LVS2"
10138  }
10139}
10140~~~
10141
10142Example response:
10143
10144~~~json
10145{
10146  "jsonrpc": "2.0",
10147  "id": 1,
10148  "result": true
10149}
10150~~~
10151
10152### bdev_lvol_grow_lvstore {#rpc_bdev_lvol_grow_lvstore}
10153
10154Grow the logical volume store to fill the underlying bdev
10155
10156#### Parameters
10157
10158Name                    | Optional | Type        | Description
10159----------------------- | -------- | ----------- | -----------
10160uuid                    | Optional | string      | UUID of the logical volume store to grow
10161lvs_name                | Optional | string      | Name of the logical volume store to grow
10162
10163Either uuid or lvs_name must be specified, but not both.
10164
10165#### Example
10166
10167Example request:
10168
10169~~~json
10170{
10171  "jsonrpc": "2.0",
10172  "method": "bdev_lvol_grow_lvstore",
10173  "id": 1
10174  "params": {
10175    "uuid": "a9959197-b5e2-4f2d-8095-251ffb6985a5"
10176  }
10177}
10178~~~
10179
10180Example response:
10181
10182~~~json
10183{
10184  "jsonrpc": "2.0",
10185  "id": 1,
10186  "result": true
10187}
10188~~~
10189
10190### bdev_lvol_create {#rpc_bdev_lvol_create}
10191
10192Create a logical volume on a logical volume store.
10193
10194#### Parameters
10195
10196Name                    | Optional | Type        | Description
10197----------------------- | -------- | ----------- | -----------
10198lvol_name               | Required | string      | Name of logical volume to create
10199size_in_mib             | Required | number      | Desired size of logical volume in MiB
10200thin_provision          | Optional | boolean     | True to enable thin provisioning
10201uuid                    | Optional | string      | UUID of logical volume store to create logical volume on
10202lvs_name                | Optional | string      | Name of logical volume store to create logical volume on
10203clear_method            | Optional | string      | Change default data clusters clear method. Available: none, unmap, write_zeroes
10204
10205Size will be rounded up to a multiple of cluster size. Either uuid or lvs_name must be specified, but not both.
10206lvol_name will be used in the alias of the created logical volume.
10207
10208#### Response
10209
10210UUID of the created logical volume is returned.
10211
10212#### Example
10213
10214Example request:
10215
10216~~~json
10217{
10218  "jsonrpc": "2.0",
10219  "method": "bdev_lvol_create",
10220  "id": 1,
10221  "params": {
10222    "lvol_name": "LVOL0",
10223    "size_in_mib": 1,
10224    "lvs_name": "LVS0",
10225    "clear_method": "unmap",
10226    "thin_provision": true
10227  }
10228}
10229~~~
10230
10231Example response:
10232
10233~~~json
10234{
10235  "jsonrpc": "2.0",
10236  "id": 1,
10237  "result": "1b38702c-7f0c-411e-a962-92c6a5a8a602"
10238}
10239~~~
10240
10241### bdev_lvol_snapshot {#rpc_bdev_lvol_snapshot}
10242
10243Capture a snapshot of the current state of a logical volume.
10244
10245#### Parameters
10246
10247Name                    | Optional | Type        | Description
10248----------------------- | -------- | ----------- | -----------
10249lvol_name               | Required | string      | UUID or alias of the logical volume to create a snapshot from
10250snapshot_name           | Required | string      | Name for the newly created snapshot
10251
10252#### Response
10253
10254UUID of the created logical volume snapshot is returned.
10255
10256#### Example
10257
10258Example request:
10259
10260~~~json
10261{
10262  "jsonrpc": "2.0",
10263  "method": "bdev_lvol_snapshot",
10264  "id": 1,
10265  "params": {
10266    "lvol_name": "1b38702c-7f0c-411e-a962-92c6a5a8a602",
10267    "snapshot_name": "SNAP1"
10268  }
10269}
10270~~~
10271
10272Example response:
10273
10274~~~json
10275{
10276  "jsonrpc": "2.0",
10277  "id": 1,
10278  "result": "cc8d7fdf-7865-4d1f-9fc6-35da8e368670"
10279}
10280~~~
10281
10282### bdev_lvol_clone {#rpc_bdev_lvol_clone}
10283
10284Create a logical volume based on a snapshot.
10285
10286#### Parameters
10287
10288Name                    | Optional | Type        | Description
10289----------------------- | -------- | ----------- | -----------
10290snapshot_name           | Required | string      | UUID or alias of the snapshot to clone
10291clone_name              | Required | string      | Name for the logical volume to create
10292
10293#### Response
10294
10295UUID of the created logical volume clone is returned.
10296
10297#### Example
10298
10299Example request:
10300
10301~~~json
10302{
10303  "jsonrpc": "2.0"
10304  "method": "bdev_lvol_clone",
10305  "id": 1,
10306  "params": {
10307    "snapshot_name": "cc8d7fdf-7865-4d1f-9fc6-35da8e368670",
10308    "clone_name": "CLONE1"
10309  }
10310}
10311~~~
10312
10313Example response:
10314
10315~~~json
10316{
10317  "jsonrpc": "2.0",
10318  "id": 1,
10319  "result": "8d87fccc-c278-49f0-9d4c-6237951aca09"
10320}
10321~~~
10322
10323### bdev_lvol_clone_bdev {#rpc_bdev_lvol_clone_bdev}
10324
10325Create a logical volume based on an external snapshot bdev. The external snapshot bdev
10326is a bdev that will not be written to by any consumer and must not be an lvol in the
10327lvstore as the clone.
10328
10329Regardless of whether the bdev is specified by name or UUID, the bdev UUID will be stored
10330in the logical volume's metadata for use while the lvolstore is loading. For this reason,
10331it is important that the bdev chosen has a static UUID.
10332
10333#### Parameters
10334
10335Name                    | Optional | Type        | Description
10336----------------------- | -------- | ----------- | -----------
10337bdev                    | Required | string      | Name or UUID for bdev that acts as the external snapshot
10338lvs_name                | Required | string      | logical volume store name
10339clone_name              | Required | string      | Name for the logical volume to create
10340
10341#### Response
10342
10343UUID of the created logical volume clone is returned.
10344
10345#### Example
10346
10347Example request:
10348
10349~~~json
10350{
10351  "jsonrpc": "2.0",
10352  "method": "bdev_lvol_clone_bdev",
10353  "id": 1,
10354  "params": {
10355    "bdev_uuid": "e4b40d8b-f623-416d-8234-baf5a4c83cbd",
10356    "lvs_name": "lvs1",
10357    "clone_name": "clone2"
10358  }
10359}
10360~~~
10361
10362Example response:
10363
10364~~~json
10365{
10366  "jsonrpc": "2.0",
10367  "id": 1,
10368  "result": "336f662b-08e5-4006-8e06-e2023f7f9886"
10369}
10370~~~
10371
10372### bdev_lvol_rename {#rpc_bdev_lvol_rename}
10373
10374Rename a logical volume. New name will rename only the alias of the logical volume.
10375
10376#### Parameters
10377
10378Name                    | Optional | Type        | Description
10379----------------------- | -------- | ----------- | -----------
10380old_name                | Required | string      | UUID or alias of the existing logical volume
10381new_name                | Required | string      | New logical volume name
10382
10383#### Example
10384
10385Example request:
10386
10387~~~json
10388{
10389  "jsonrpc": "2.0",
10390  "method": "bdev_lvol_rename",
10391  "id": 1,
10392  "params": {
10393    "old_name": "067df606-6dbc-4143-a499-0d05855cb3b8",
10394    "new_name": "LVOL2"
10395  }
10396}
10397~~~
10398
10399Example response:
10400
10401~~~json
10402{
10403  "jsonrpc": "2.0",
10404  "id": 1,
10405  "result": true
10406}
10407~~~
10408
10409### bdev_lvol_resize {#rpc_bdev_lvol_resize}
10410
10411Resize a logical volume.
10412
10413#### Parameters
10414
10415Name                    | Optional | Type        | Description
10416----------------------- | -------- | ----------- | -----------
10417name                    | Required | string      | UUID or alias of the logical volume to resize
10418size_in_mib             | Required | number      | Desired size of the logical volume in MiB
10419
10420#### Example
10421
10422Example request:
10423
10424~~~json
10425{
10426  "jsonrpc": "2.0",
10427  "method": "bdev_lvol_resize",
10428  "id": 1,
10429  "params": {
10430    "name": "51638754-ca16-43a7-9f8f-294a0805ab0a",
10431    "size_in_mib": 2
10432  }
10433}
10434~~~
10435
10436Example response:
10437
10438~~~json
10439{
10440  "jsonrpc": "2.0",
10441  "id": 1,
10442  "result": true
10443}
10444~~~
10445
10446### bdev_lvol_set_read_only{#rpc_bdev_lvol_set_read_only}
10447
10448Mark logical volume as read only.
10449
10450#### Parameters
10451
10452Name                    | Optional | Type        | Description
10453----------------------- | -------- | ----------- | -----------
10454name                    | Required | string      | UUID or alias of the logical volume to set as read only
10455
10456#### Example
10457
10458Example request:
10459
10460~~~json
10461{
10462  "jsonrpc": "2.0",
10463  "method": "bdev_lvol_set_read_only",
10464  "id": 1,
10465  "params": {
10466    "name": "51638754-ca16-43a7-9f8f-294a0805ab0a",
10467  }
10468}
10469~~~
10470
10471Example response:
10472
10473~~~json
10474{
10475  "jsonrpc": "2.0",
10476  "id": 1,
10477  "result": true
10478}
10479~~~
10480
10481### bdev_lvol_delete {#rpc_bdev_lvol_delete}
10482
10483Destroy a logical volume.
10484
10485#### Parameters
10486
10487Name                    | Optional | Type        | Description
10488----------------------- | -------- | ----------- | -----------
10489name                    | Required | string      | UUID or alias of the logical volume to destroy
10490
10491#### Example
10492
10493Example request:
10494
10495~~~json
10496{
10497  "jsonrpc": "2.0",
10498  "method": "bdev_lvol_delete",
10499  "id": 1,
10500  "params": {
10501    "name": "51638754-ca16-43a7-9f8f-294a0805ab0a"
10502  }
10503}
10504~~~
10505
10506Example response:
10507
10508~~~json
10509{
10510  "jsonrpc": "2.0",
10511  "id": 1,
10512  "result": true
10513}
10514~~~
10515
10516### bdev_lvol_inflate {#rpc_bdev_lvol_inflate}
10517
10518Inflate a logical volume. All unallocated clusters are allocated and copied from the parent or zero filled
10519if not allocated in the parent. Then all dependencies on the parent are removed.
10520
10521### Parameters
10522
10523Name                    | Optional | Type        | Description
10524----------------------- | -------- | ----------- | -----------
10525name                    | Required | string      | UUID or alias of the logical volume to inflate
10526
10527#### Example
10528
10529Example request:
10530
10531~~~json
10532{
10533  "jsonrpc": "2.0",
10534  "method": "bdev_lvol_inflate",
10535  "id": 1,
10536  "params": {
10537    "name": "8d87fccc-c278-49f0-9d4c-6237951aca09"
10538  }
10539}
10540~~~
10541
10542Example response:
10543
10544~~~json
10545{
10546  "jsonrpc": "2.0",
10547  "id": 1,
10548  "result": true
10549}
10550~~~
10551
10552### bdev_lvol_decouple_parent {#rpc_bdev_lvol_decouple_parent}
10553
10554Decouple the parent of a logical volume. For unallocated clusters which is allocated in the parent, they are
10555allocated and copied from the parent, but for unallocated clusters which is thin provisioned in the parent,
10556they are kept thin provisioned. Then all dependencies on the parent are removed.
10557
10558#### Parameters
10559
10560Name                    | Optional | Type        | Description
10561----------------------- | -------- | ----------- | -----------
10562name                    | Required | string      | UUID or alias of the logical volume to decouple the parent of it
10563
10564#### Example
10565
10566Example request:
10567
10568~~~json
10569{
10570  "jsonrpc": "2.0",
10571  "method": "bdev_lvol_decouple_parent",
10572  "id": 1.
10573  "params": {
10574    "name": "8d87fccc-c278-49f0-9d4c-6237951aca09"
10575  }
10576}
10577~~~
10578
10579Example response:
10580
10581~~~json
10582{
10583  "jsonrpc": "2.0",
10584  "id": 1,
10585  "result": true
10586}
10587~~~
10588
10589### bdev_lvol_get_lvols {#rpc_bdev_lvol_get_lvols}
10590
10591Get a list of logical volumes. This list can be limited by lvol store and will display volumes even if
10592they are degraded. Degraded lvols do not have an associated bdev, thus this RPC call may return lvols
10593not returned by `bdev_get_bdevs`.
10594
10595#### Parameters
10596
10597Name                    | Optional | Type        | Description
10598----------------------- | -------- | ----------- | -----------
10599lvs_uuid                | Optional | string      | Only show volumes in the logical volume store with this UUID
10600lvs_name                | Optional | string      | Only show volumes in the logical volume store with this name
10601
10602Either lvs_uuid or lvs_name may be specified, but not both.
10603If both lvs_uuid and lvs_name are omitted, information about lvols in all logical volume stores is returned.
10604
10605#### Example
10606
10607Example request:
10608
10609~~~json
10610{
10611  "jsonrpc": "2.0",
10612  "method": "bdev_lvol_get_lvols",
10613  "id": 1,
10614  "params": {
10615    "lvs_name": "lvs_test"
10616  }
10617}
10618~~~
10619
10620Example response:
10621
10622~~~json
10623[
10624  {
10625    "alias": "lvs_test/lvol1",
10626    "uuid": "b335c368-851d-4099-81e0-018cc494fdf6",
10627    "name": "lvol1",
10628    "is_thin_provisioned": false,
10629    "is_snapshot": false,
10630    "is_clone": false,
10631    "is_esnap_clone": false,
10632    "is_degraded": false,
10633    "lvs": {
10634      "name": "lvs_test",
10635      "uuid": "a1c8d950-5715-4558-936d-ab9e6eca0794"
10636    }
10637  }
10638]
10639~~~
10640
10641## RAID
10642
10643### bdev_raid_set_options {#rpc_bdev_raid_set_options}
10644
10645Set options for bdev raid.
10646
10647This RPC can be called at any time, but the new value will only take effect for new raid bdevs.
10648
10649The `process_window_size_kb` parameter defines the size of the "window" (LBA range of the raid bdev)
10650in which a background process like rebuild performs its work. Any positive value is valid, but the value
10651actually used by a raid bdev can be adjusted to the size of the raid bdev or the write unit size.
10652
10653#### Parameters
10654
10655Name                       | Optional | Type        | Description
10656-------------------------- | -------- | ----------- | -----------
10657process_window_size_kb     | Optional | number      | Background process (e.g. rebuild) window size in KiB
10658
10659#### Example
10660
10661Example request:
10662
10663~~~json
10664request:
10665{
10666  "jsonrpc": "2.0",
10667  "method": "bdev_raid_set_options",
10668  "id": 1,
10669  "params": {
10670    "process_window_size_kb": 512
10671  }
10672}
10673~~~
10674
10675Example response:
10676
10677~~~json
10678{
10679  "jsonrpc": "2.0",
10680  "id": 1,
10681  "result": true
10682}
10683~~~
10684
10685### bdev_raid_get_bdevs {#rpc_bdev_raid_get_bdevs}
10686
10687This is used to list all the raid bdev details based on the input category requested. Category should be one
10688of 'all', 'online', 'configuring' or 'offline'. 'all' means all the raid bdevs whether they are online or
10689configuring or offline. 'online' is the raid bdev which is registered with bdev layer. 'configuring' is
10690the raid bdev which does not have full configuration discovered yet. 'offline' is the raid bdev which is
10691not registered with bdev as of now and it has encountered any error or user has requested to offline
10692the raid bdev.
10693
10694#### Parameters
10695
10696Name                    | Optional | Type        | Description
10697----------------------- | -------- | ----------- | -----------
10698category                | Required | string      | all or online or configuring or offline
10699
10700#### Example
10701
10702Example request:
10703
10704~~~json
10705{
10706  "jsonrpc": "2.0",
10707  "method": "bdev_raid_get_bdevs",
10708  "id": 1,
10709  "params": {
10710    "category": "all"
10711  }
10712}
10713~~~
10714
10715Example response:
10716
10717~~~json
10718{
10719  "jsonrpc": "2.0",
10720  "id": 1,
10721  "result": [
10722    {
10723      "name": "RaidBdev0",
10724      "uuid": "7d352e83-fe27-40f2-8fef-64563355e076",
10725      "strip_size_kb": 128,
10726      "state": "online",
10727      "raid_level": "raid0",
10728      "num_base_bdevs": 2,
10729      "num_base_bdevs_discovered": 2,
10730      "num_base_bdevs_operational": 2,
10731      "base_bdevs_list": [
10732        {
10733          "name": "malloc0",
10734          "uuid": "d2788884-5b3e-4fd7-87ff-6c78177e14ab",
10735          "is_configured": true,
10736          "data_offset": 256,
10737          "data_size": 261888
10738        },
10739        {
10740          "name": "malloc1",
10741          "uuid": "a81bb1f8-5865-488a-8758-10152017e7d1",
10742          "is_configured": true,
10743          "data_offset": 256,
10744          "data_size": 261888
10745        }
10746      ]
10747    },
10748    {
10749      "name": "RaidBdev1",
10750      "uuid": "f7cb71ed-2d0e-4240-979e-27b0b7735f36",
10751      "strip_size_kb": 128,
10752      "state": "configuring",
10753      "raid_level": "raid0",
10754      "num_base_bdevs": 2,
10755      "num_base_bdevs_discovered": 1,
10756      "num_base_bdevs_operational": 2,
10757      "base_bdevs_list": [
10758        {
10759          "name": "malloc2",
10760          "uuid": "f60c20e1-3439-4f89-ae55-965a70333f86",
10761          "is_configured": true,
10762          "data_offset": 256,
10763          "data_size": 261888
10764        }
10765        {
10766          "name": "malloc3",
10767          "uuid": "00000000-0000-0000-0000-000000000000",
10768          "is_configured": false,
10769          "data_offset": 0,
10770          "data_size": 0
10771        }
10772      ]
10773    }
10774  ]
10775}
10776~~~
10777
10778### bdev_raid_create {#rpc_bdev_raid_create}
10779
10780Constructs new RAID bdev.
10781
10782#### Parameters
10783
10784Name                    | Optional | Type        | Description
10785----------------------- | -------- | ----------- | -----------
10786name                    | Required | string      | RAID bdev name
10787strip_size_kb           | Required | number      | Strip size in KB
10788raid_level              | Required | string      | RAID level
10789base_bdevs              | Required | string      | Base bdevs name, whitespace separated list in quotes
10790uuid                    | Optional | string      | UUID for this RAID bdev
10791superblock              | Optional | boolean     | If set, information about raid bdev will be stored in superblock on each base bdev (default: `false`)
10792
10793#### Example
10794
10795Example request:
10796
10797~~~json
10798{
10799  "jsonrpc": "2.0",
10800  "method": "bdev_raid_create",
10801  "id": 1,
10802  "params": {
10803    "name": "Raid0",
10804    "raid_level": "0",
10805    "base_bdevs": [
10806      "Malloc0",
10807      "Malloc1",
10808      "Malloc2",
10809      "Malloc3"
10810    ],
10811    "strip_size_kb": 4
10812  }
10813}
10814~~~
10815
10816Example response:
10817
10818~~~json
10819{
10820  "jsonrpc": "2.0",
10821  "id": 1,
10822  "result": true
10823}
10824~~~
10825
10826### bdev_raid_delete {#rpc_bdev_raid_delete}
10827
10828Removes RAID bdev.
10829
10830#### Parameters
10831
10832Name                    | Optional | Type        | Description
10833----------------------- | -------- | ----------- | -----------
10834name                    | Required | string      | RAID bdev name
10835
10836#### Example
10837
10838Example request:
10839
10840~~~json
10841{
10842  "jsonrpc": "2.0",
10843  "method": "bdev_raid_delete",
10844  "id": 1,
10845  "params": {
10846    "name": "Raid0"
10847  }
10848}
10849~~~
10850
10851Example response:
10852
10853~~~json
10854{
10855  "jsonrpc": "2.0",
10856  "id": 1,
10857  "result": true
10858}
10859~~~
10860
10861### bdev_raid_add_base_bdev {#rpc_bdev_raid_add_base_bdev}
10862
10863Add base bdev to existing raid bdev. The raid bdev must have an empty base bdev slot.
10864The bdev must be large enough and have the same block size and metadata format as the other base bdevs.
10865
10866#### Parameters
10867
10868Name                    | Optional | Type        | Description
10869----------------------- | -------- | ----------- | -----------
10870raid_bdev               | Required | string      | Raid bdev name
10871base_bdev               | Required | string      | Base bdev name
10872
10873#### Example
10874
10875Example request:
10876
10877~~~json
10878{
10879  "jsonrpc": "2.0",
10880  "method": "bdev_raid_add_base_bdev",
10881  "id": 1,
10882  "params": {
10883    "raid_bdev": "RaidBdev0",
10884    "base_bdev": "Nvme0n1"
10885  }
10886}
10887~~~
10888
10889Example response:
10890
10891~~~json
10892{
10893  "jsonrpc": "2.0",
10894  "id": 1,
10895  "result": true
10896}
10897~~~
10898### bdev_raid_remove_base_bdev {#rpc_bdev_raid_remove_base_bdev}
10899
10900Remove base bdev from existing raid bdev.
10901
10902#### Parameters
10903
10904Name                    | Optional | Type        | Description
10905----------------------- | -------- | ----------- | -----------
10906name                    | Required | string      | Base bdev name in RAID
10907
10908#### Example
10909
10910Example request:
10911
10912~~~json
10913{
10914  "jsonrpc": "2.0",
10915  "method": "bdev_raid_remove_base_bdev",
10916  "id": 1,
10917  "params": {
10918    "name": "Raid0"
10919  }
10920}
10921~~~
10922
10923Example response:
10924
10925~~~json
10926{
10927  "jsonrpc": "2.0",
10928  "id": 1,
10929  "result": true
10930}
10931~~~
10932
10933## SPLIT
10934
10935### bdev_split_create {#rpc_bdev_split_create}
10936
10937This is used to split an underlying block device and create several smaller equal-sized vbdevs.
10938
10939#### Parameters
10940
10941Name                    | Optional | Type        | Description
10942----------------------- | -------- | ----------- | -----------
10943base_bdev               | Required | string      | base bdev name
10944split_count             | Required | number      | number of splits
10945split_size_mb           | Optional | number      | size in MB to restrict the size
10946
10947#### Example
10948
10949Example request:
10950
10951~~~json
10952{
10953  "jsonrpc": "2.0",
10954  "method": "bdev_split_create",
10955  "id": 1,
10956  "params": {
10957    "base_bdev": "Malloc0",
10958    "split_count": 4
10959  }
10960}
10961~~~
10962
10963Example response:
10964
10965~~~json
10966{
10967  "jsonrpc": "2.0",
10968  "id": 1,
10969  "result": [
10970    "Malloc0p0",
10971    "Malloc0p1",
10972    "Malloc0p2",
10973    "Malloc0p3"
10974  ]
10975}
10976~~~
10977
10978### bdev_split_delete {#rpc_bdev_split_delete}
10979
10980This is used to remove the split vbdevs.
10981
10982#### Parameters
10983
10984Name                    | Optional | Type        | Description
10985----------------------- | -------- | ----------- | -----------
10986base_bdev               | Required | string      | base bdev name
10987
10988#### Example
10989
10990Example request:
10991
10992~~~json
10993{
10994  "jsonrpc": "2.0",
10995  "method": "bdev_split_delete",
10996  "id": 1,
10997  "params": {
10998    "base_bdev": "Malloc0"
10999  }
11000}
11001~~~
11002
11003Example response:
11004
11005~~~json
11006{
11007  "jsonrpc": "2.0",
11008  "id": 1,
11009  "result": true
11010}
11011~~~
11012
11013## Uring
11014
11015### bdev_uring_create {#rpc_bdev_uring_create}
11016
11017Create a bdev with io_uring backend.
11018
11019#### Parameters
11020
11021Name                    | Optional | Type        | Description
11022----------------------- | -------- | ----------- | -----------
11023filename                | Required | string      | path to device or file (ex: /dev/nvme0n1)
11024name                    | Required | string      | name of bdev
11025block_size              | Optional | number      | block size of device (If omitted, get the block size from the file)
11026uuid                    | Optional | string      | UUID of new bdev
11027
11028#### Example
11029
11030Example request:
11031
11032~~~json
11033{
11034  "jsonrpc": "2.0",
11035  "method": "bdev_uring_create",
11036  "id": 1,
11037  "params": {
11038    "name": "bdev_u0",
11039    "filename": "/dev/nvme0n1",
11040    "block_size": 512
11041  }
11042}
11043~~~
11044
11045Example response:
11046
11047~~~json
11048{
11049  "jsonrpc": "2.0",
11050  "id": 1,
11051  "result": "bdev_u0"
11052}
11053~~~
11054
11055### bdev_uring_rescan {#rpc_bdev_uring_rescan}
11056
11057Rescan the size of a uring bdev.
11058
11059#### Parameters
11060
11061Name | Optional | Type   | Description
11062---- | -------- | ------ | -----------
11063name | Required | string | name of uring bdev to rescan
11064
11065#### Example
11066
11067Example request:
11068
11069~~~json
11070{
11071  "jsonrpc": "2.0",
11072  "method": "bdev_uring_rescan",
11073  "id": 1,
11074  "params": {
11075    "name": "bdev_u0"
11076  }
11077}
11078~~~
11079
11080Example response:
11081
11082~~~json
11083{
11084  "jsonrpc": "2.0",
11085  "id": 1,
11086  "result": true
11087}
11088~~~
11089
11090### bdev_uring_delete {#rpc_bdev_uring_delete}
11091
11092Remove a uring bdev.
11093
11094#### Parameters
11095
11096Name                    | Optional | Type        | Description
11097----------------------- | -------- | ----------- | -----------
11098name                    | Required | string      | name of uring bdev to delete
11099
11100#### Example
11101
11102Example request:
11103
11104~~~json
11105{
11106  "jsonrpc": "2.0",
11107  "method": "bdev_uring_delete",
11108  "id": 1,
11109  "params": {
11110    "name": "bdev_u0"
11111  }
11112}
11113~~~
11114
11115Example response:
11116
11117~~~json
11118{
11119  "jsonrpc": "2.0",
11120  "id": 1,
11121  "result": true
11122}
11123~~~
11124
11125## OPAL
11126
11127### bdev_nvme_opal_init {#rpc_bdev_nvme_opal_init}
11128
11129This is used to initialize OPAL of a given NVMe ctrlr, including taking ownership and activating.
11130
11131#### Parameters
11132
11133Name                    | Optional | Type        | Description
11134----------------------- | -------- | ----------- | -----------
11135nvme_ctrlr_name         | Required | string      | name of nvme ctrlr
11136password                | Required | string      | admin password of OPAL
11137
11138#### Example
11139
11140Example request:
11141
11142~~~json
11143{
11144  "jsonrpc": "2.0",
11145  "method": "bdev_nvme_opal_init",
11146  "id": 1,
11147  "params": {
11148    "nvme_ctrlr_name": "nvme0",
11149    "password": "*****"
11150  }
11151}
11152~~~
11153
11154Example response:
11155
11156~~~json
11157{
11158  "jsonrpc": "2.0",
11159  "id": 1,
11160  "result": true
11161}
11162~~~
11163
11164### bdev_nvme_opal_revert {#rpc_bdev_nvme_opal_revert}
11165
11166This is used to revert OPAL to its factory settings. Erase all user configuration and data.
11167
11168#### Parameters
11169
11170Name                    | Optional | Type        | Description
11171----------------------- | -------- | ----------- | -----------
11172nvme_ctrlr_name         | Required | string      | name of nvme ctrlr
11173password                | Required | string      | admin password of OPAL
11174
11175#### Example
11176
11177Example request:
11178
11179~~~json
11180{
11181  "jsonrpc": "2.0",
11182  "method": "bdev_nvme_opal_revert",
11183  "id": 1,
11184  "params": {
11185    "nvme_ctrlr_name": "nvme0",
11186    "password": "*****"
11187  }
11188}
11189~~~
11190
11191Example response:
11192
11193~~~json
11194{
11195  "jsonrpc": "2.0",
11196  "id": 1,
11197  "result": true
11198}
11199~~~
11200
11201### bdev_opal_create {#rpc_bdev_opal_create}
11202
11203This is used to create an OPAL virtual bdev.
11204
11205#### Parameters
11206
11207Name                    | Optional | Type        | Description
11208----------------------- | -------- | ----------- | -----------
11209nvme_ctrlr_name         | Required | string      | name of nvme ctrlr that supports OPAL
11210nsid                    | Required | number      | namespace ID
11211locking_range_id        | Required | number      | OPAL locking range ID
11212range_start             | Required | number      | locking range start LBA
11213range_length            | Required | number      | locking range length
11214password                | Required | string      | admin password of OPAL
11215
11216#### Response
11217
11218The response is the name of created OPAL virtual bdev.
11219
11220#### Example
11221
11222Example request:
11223
11224~~~json
11225{
11226  "jsonrpc": "2.0",
11227  "method": "bdev_opal_create",
11228  "id": 1,
11229  "params": {
11230    "nvme_ctrlr_name": "nvme0",
11231    "nsid": 1,
11232    "locking_range_id": 1,
11233    "range_start": 0,
11234    "range_length": 4096,
11235    "password": "*****"
11236  }
11237}
11238~~~
11239
11240Example response:
11241
11242~~~json
11243{
11244  "jsonrpc": "2.0",
11245  "id": 1,
11246  "result": "nvme0n1r1"
11247}
11248~~~
11249
11250### bdev_opal_get_info {#rpc_bdev_opal_get_info}
11251
11252This is used to get information of a given OPAL bdev.
11253
11254#### Parameters
11255
11256Name                    | Optional | Type        | Description
11257----------------------- | -------- | ----------- | -----------
11258bdev_name               | Required | string      | name of OPAL vbdev
11259password                | Required | string      | admin password
11260
11261#### Response
11262
11263The response is the locking info of OPAL virtual bdev.
11264
11265#### Example
11266
11267Example request:
11268
11269~~~json
11270{
11271  "jsonrpc": "2.0",
11272  "method": "bdev_opal_get_info",
11273  "id": 1,
11274  "params": {
11275    "bdev_name": "nvme0n1r1",
11276    "password": "*****"
11277  }
11278}
11279~~~
11280
11281Example response:
11282
11283~~~json
11284{
11285  "jsonrpc": "2.0",
11286  "id": 1,
11287  "result": {
11288      "name": "nvme0n1r1",
11289      "range_start": 0,
11290      "range_length": 4096,
11291      "read_lock_enabled": true,
11292      "write_lock_enabled": true,
11293      "read_locked": false,
11294      "write_locked": false
11295    }
11296}
11297~~~
11298
11299### bdev_opal_delete {#rpc_bdev_opal_delete}
11300
11301This is used to delete OPAL vbdev.
11302
11303#### Parameters
11304
11305Name                    | Optional | Type        | Description
11306----------------------- | -------- | ----------- | -----------
11307bdev_name               | Required | string      | name of OPAL vbdev
11308password                | Required | string      | admin password
11309
11310#### Example
11311
11312Example request:
11313
11314~~~json
11315{
11316  "jsonrpc": "2.0",
11317  "method": "bdev_opal_delete",
11318  "id": 1,
11319  "params": {
11320    "bdev_name": "nvme0n1r1",
11321    "password": "*****"
11322  }
11323}
11324~~~
11325
11326Example response:
11327
11328~~~json
11329{
11330  "jsonrpc": "2.0",
11331  "id": 1,
11332  "result": true
11333}
11334~~~
11335
11336### bdev_opal_new_user {#rpc_bdev_opal_new_user}
11337
11338This enables a new user to the specified opal bdev so that the user can lock/unlock the bdev.
11339Recalling this for the same opal bdev, only the newest user will have the privilege.
11340
11341#### Parameters
11342
11343Name                    | Optional | Type        | Description
11344----------------------- | -------- | ----------- | -----------
11345bdev_name               | Required | string      | name of OPAL vbdev
11346admin_password          | Required | string      | admin password
11347user_id                 | Required | number      | user ID
11348user_password           | Required | string      | user password
11349
11350#### Example
11351
11352Example request:
11353
11354~~~json
11355{
11356  "jsonrpc": "2.0",
11357  "method": "bdev_opal_new_user",
11358  "id": 1,
11359  "params": {
11360    "bdev_name": "nvme0n1r1",
11361    "admin_password": "*****",
11362    "user_id": "1",
11363    "user_password": "********"
11364  }
11365}
11366~~~
11367
11368Example response:
11369
11370~~~json
11371{
11372  "jsonrpc": "2.0",
11373  "id": 1,
11374  "result": true
11375}
11376~~~
11377
11378### bdev_opal_set_lock_state {#rpc_bdev_opal_set_lock_state}
11379
11380This is used to lock/unlock specific opal bdev providing user ID and password.
11381
11382#### Parameters
11383
11384Name                    | Optional | Type        | Description
11385----------------------- | -------- | ----------- | -----------
11386bdev_name               | Required | string      | name of OPAL vbdev
11387user_id                 | Required | number      | user ID
11388password                | Required | string      | user password
11389lock_state              | Required | string      | lock state
11390
11391#### Example
11392
11393Example request:
11394
11395~~~json
11396{
11397  "jsonrpc": "2.0",
11398  "method": "bdev_opal_set_lock_state",
11399  "id": 1,
11400  "params": {
11401    "bdev_name": "nvme0n1r1",
11402    "user_id": "1",
11403    "user_password": "********",
11404    "lock_state": "rwlock"
11405  }
11406}
11407~~~
11408
11409Example response:
11410
11411~~~json
11412{
11413  "jsonrpc": "2.0",
11414  "id": 1,
11415  "result": true
11416}
11417~~~
11418
11419## Notifications
11420
11421### notify_get_types {#rpc_notify_get_types}
11422
11423Return list of all supported notification types.
11424
11425#### Parameters
11426
11427None
11428
11429#### Response
11430
11431The response is an array of strings - supported RPC notification types.
11432
11433#### Example
11434
11435Example request:
11436
11437~~~json
11438{
11439  "jsonrpc": "2.0",
11440  "method": "notify_get_types",
11441  "id": 1
11442}
11443~~~
11444
11445Example response:
11446
11447~~~json
11448{
11449  "id": 1,
11450  "result": [
11451    "bdev_register",
11452    "bdev_unregister"
11453  ],
11454  "jsonrpc": "2.0"
11455}
11456~~~
11457
11458### notify_get_notifications {#notify_get_notifications}
11459
11460Request notifications. Returns array of notifications that happened since the specified id (or first that is available).
11461
11462Notice: Notifications are kept in circular buffer with limited size. Older notifications might be inaccessible
11463due to being overwritten by new ones.
11464
11465#### Parameters
11466
11467Name                    | Optional | Type        | Description
11468----------------------- | -------- | ----------- | -----------
11469id                      | Optional | number      | First Event ID to fetch (default: first available).
11470max                     | Optional | number      | Maximum number of event to return (default: no limit).
11471
11472#### Response
11473
11474Response is an array of event objects.
11475
11476Name                    | Optional | Type        | Description
11477----------------------- | -------- | ----------- | -----------
11478id                      | Optional | number      | Event ID.
11479type                    | Optional | number      | Type of the event.
11480ctx                     | Optional | string      | Event context.
11481
11482#### Example
11483
11484Example request:
11485
11486~~~json
11487{
11488  "id": 1,
11489  "jsonrpc": "2.0",
11490  "method": "notify_get_notifications",
11491  "params": {
11492    "id": 1,
11493    "max": 10
11494  }
11495}
11496
11497~~~
11498
11499Example response:
11500
11501~~~json
11502{
11503  "jsonrpc": "2.0",
11504  "id": 1,
11505  "result": [
11506    {
11507      "ctx": "Malloc0",
11508      "type": "bdev_register",
11509      "id": 1
11510    },
11511    {
11512      "ctx": "Malloc2",
11513      "type": "bdev_register",
11514      "id": 2
11515    }
11516  ]
11517}
11518~~~
11519
11520## Linux Userspace Block Device (UBLK) {#jsonrpc_components_ublk}
11521
11522SPDK supports exporting bdevs though Linux ublk. The motivation behind it is to back a Linux kernel block device
11523with an SPDK user space bdev.
11524
11525To export a device over ublk, first make sure the Linux kernel ublk driver is loaded by running 'modprobe ublk_drv'.
11526
11527### ublk_create_target {#rpc_ublk_create_target}
11528
11529Start to create ublk threads and initialize ublk target. It will return an error if user calls this RPC twice without
11530ublk_destroy_target in between. It will use current cpumask in SPDK when user does not specify cpumask option.
11531
11532#### Parameters
11533
11534Name                    | Optional | Type        | Description
11535----------------------- | -------- | ----------- | -----------
11536cpumask                 | Optional | string      | Cpumask for ublk target
11537
11538#### Response
11539
11540True if ublk target initialization is successful; False if failed.
11541
11542#### Example
11543
11544Example request:
11545
11546~~~json
11547{
11548  "params": {
11549    "cpumask": "0x2"
11550  },
11551  "jsonrpc": "2.0",
11552  "method": "ublk_create_target",
11553  "id": 1
11554}
11555~~~
11556
11557Example response:
11558
11559~~~json
11560{
11561  "jsonrpc": "2.0",
11562  "id": 1,
11563  "result": true
11564}
11565~~~
11566
11567### ublk_destroy_target {#rpc_ublk_destroy_target}
11568
11569Release all UBLK devices and destroy ublk target.
11570
11571#### Response
11572
11573True if ublk target destruction is successful; False if failed.
11574
11575#### Example
11576
11577Example request:
11578
11579~~~json
11580{
11581  "jsonrpc": "2.0",
11582  "method": "ublk_destroy_target",
11583  "id": 1
11584}
11585~~~
11586
11587Example response:
11588
11589~~~json
11590{
11591  "jsonrpc": "2.0",
11592  "id": 1,
11593  "result": true
11594}
11595~~~
11596
11597### ublk_start_disk {#rpc_ublk_start_disk}
11598
11599Start to export one SPDK bdev as a UBLK device
11600
11601#### Parameters
11602
11603Name                    | Optional | Type        | Description
11604----------------------- | -------- | ----------- | -----------
11605bdev_name               | Required | string      | Bdev name to export
11606ublk_id                 | Required | int         | Device id
11607queue_depth             | Optional | int         | Device queue depth
11608num_queues              | Optional | int         | Total number of device queues
11609
11610#### Response
11611
11612UBLK device ID
11613
11614#### Example
11615
11616Example request:
11617
11618~~~json
11619{
11620 "params": {
11621    "ublk_id": "1",
11622    "bdev_name": "Malloc1"
11623  },
11624  "jsonrpc": "2.0",
11625  "method": "ublk_start_disk",
11626  "id": 1
11627}
11628~~~
11629
11630Example response:
11631
11632~~~json
11633{
11634  "jsonrpc": "2.0",
11635  "id": 1,
11636  "result": 1
11637}
11638~~~
11639
11640### ublk_recover_disk {#rpc_ublk_recover_disk}
11641
11642Recover original UBLK device with ID and block device
11643
11644#### Parameters
11645
11646Name                    | Optional | Type        | Description
11647----------------------- | -------- | ----------- | -----------
11648bdev_name               | Required | string      | Bdev name to export
11649ublk_id                 | Required | int         | Device id
11650
11651#### Response
11652
11653UBLK device ID
11654
11655#### Example
11656
11657Example request:
11658
11659~~~json
11660{
11661 "params": {
11662    "ublk_id": "1",
11663    "bdev_name": "Malloc1"
11664  },
11665  "jsonrpc": "2.0",
11666  "method": "ublk_recover_disk",
11667  "id": 1
11668}
11669~~~
11670
11671Example response:
11672
11673~~~json
11674{
11675  "jsonrpc": "2.0",
11676  "id": 1,
11677  "result": 1
11678}
11679
11680### ublk_stop_disk {#rpc_ublk_stop_disk}
11681
11682Delete a UBLK device
11683
11684#### Parameters
11685
11686Name                    | Optional | Type        | Description
11687----------------------- | -------- | ----------- | -----------
11688ublk_id                 | Required | int         | Device id to delete
11689
11690#### Response
11691
11692True if UBLK device is deleted successfully; False if failed.
11693
11694#### Example
11695
11696Example request:
11697
11698~~~json
11699{
11700 "params": {
11701    "ublk_id": "1",
11702  },
11703  "jsonrpc": "2.0",
11704  "method": "ublk_stop_disk",
11705  "id": 1
11706}
11707~~~
11708
11709Example response:
11710
11711~~~json
11712{
11713  "jsonrpc": "2.0",
11714  "id": 1,
11715  "result": true
11716}
11717~~~
11718
11719### ublk_get_disks {#rpc_ublk_get_disks}
11720
11721Display full or specified ublk device list
11722
11723#### Parameters
11724
11725Name                    | Optional | Type        | Description
11726----------------------- | -------- | ----------- | -----------
11727ublk_id                 | Optional | int         | ublk device id to display
11728
11729#### Response
11730
11731Display ublk device list
11732
11733#### Example
11734
11735Example request:
11736
11737~~~json
11738{
11739  "jsonrpc": "2.0",
11740  "method": "ublk_get_disks",
11741  "id": 1
11742}
11743~~~
11744
11745Example response:
11746
11747~~~json
11748{
11749  "jsonrpc": "2.0",
11750  "id": 1,
11751  "result":  [
11752    {
11753      "ublk_device": "/dev/ublkb1",
11754      "id": 1,
11755      "queue_depth": 512,
11756      "num_queues": 1,
11757      "bdev_name": "Malloc1"
11758    }
11759  ]
11760}
11761~~~
11762
11763## Linux Network Block Device (NBD) {#jsonrpc_components_nbd}
11764
11765SPDK supports exporting bdevs through Linux nbd. These devices then appear as standard Linux kernel block devices
11766and can be accessed using standard utilities like fdisk.
11767
11768In order to export a device over nbd, first make sure the Linux kernel nbd driver is loaded by running 'modprobe nbd'.
11769
11770### nbd_start_disk {#rpc_nbd_start_disk}
11771
11772Start to export one SPDK bdev as NBD disk
11773
11774#### Parameters
11775
11776Name                    | Optional | Type        | Description
11777----------------------- | -------- | ----------- | -----------
11778bdev_name               | Required | string      | Bdev name to export
11779nbd_device              | Optional | string      | NBD device name to assign
11780
11781#### Response
11782
11783Path of exported NBD disk
11784
11785#### Example
11786
11787Example request:
11788
11789~~~json
11790{
11791 "params": {
11792    "nbd_device": "/dev/nbd1",
11793    "bdev_name": "Malloc1"
11794  },
11795  "jsonrpc": "2.0",
11796  "method": "nbd_start_disk",
11797  "id": 1
11798}
11799~~~
11800
11801Example response:
11802
11803~~~json
11804{
11805  "jsonrpc": "2.0",
11806  "id": 1,
11807  "result": "/dev/nbd1"
11808}
11809~~~
11810
11811### nbd_stop_disk {#rpc_nbd_stop_disk}
11812
11813Stop one NBD disk which is based on SPDK bdev.
11814
11815#### Parameters
11816
11817Name                    | Optional | Type        | Description
11818----------------------- | -------- | ----------- | -----------
11819nbd_device              | Required | string      | NBD device name to stop
11820
11821#### Example
11822
11823Example request:
11824
11825~~~json
11826{
11827 "params": {
11828    "nbd_device": "/dev/nbd1",
11829  },
11830  "jsonrpc": "2.0",
11831  "method": "nbd_stop_disk",
11832  "id": 1
11833}
11834~~~
11835
11836Example response:
11837
11838~~~json
11839{
11840  "jsonrpc": "2.0",
11841  "id": 1,
11842  "result": "true"
11843}
11844~~~
11845
11846### nbd_get_disks {#rpc_nbd_get_disks}
11847
11848Display all or specified NBD device list
11849
11850#### Parameters
11851
11852Name                    | Optional | Type        | Description
11853----------------------- | -------- | ----------- | -----------
11854nbd_device              | Optional | string      | NBD device name to display
11855
11856#### Response
11857
11858The response is an array of exported NBD devices and their corresponding SPDK bdev.
11859
11860#### Example
11861
11862Example request:
11863
11864~~~json
11865{
11866  "jsonrpc": "2.0",
11867  "method": "nbd_get_disks",
11868  "id": 1
11869}
11870~~~
11871
11872Example response:
11873
11874~~~json
11875{
11876  "jsonrpc": "2.0",
11877  "id": 1,
11878  "result":  [
11879    {
11880      "bdev_name": "Malloc0",
11881      "nbd_device": "/dev/nbd0"
11882    },
11883    {
11884      "bdev_name": "Malloc1",
11885      "nbd_device": "/dev/nbd1"
11886    }
11887  ]
11888}
11889~~~
11890
11891## Blobfs {#jsonrpc_components_blobfs}
11892
11893### blobfs_detect {#rpc_blobfs_detect}
11894
11895Detect whether a blobfs exists on bdev.
11896
11897#### Parameters
11898
11899Name                    | Optional | Type        | Description
11900----------------------- | -------- | ----------- | -----------
11901bdev_name               | Required | string      | Block device name to detect blobfs
11902
11903#### Response
11904
11905True if a blobfs exists on the bdev; False otherwise.
11906
11907#### Example
11908
11909Example request:
11910
11911~~~json
11912{
11913  "jsonrpc": "2.0",
11914  "id": 1,
11915  "method": "blobfs_detect",
11916  "params": {
11917    "bdev_name": "Malloc0"
11918  }
11919}
11920~~~
11921
11922Example response:
11923
11924~~~json
11925{
11926  "jsonrpc": "2.0",
11927  "id": 1,
11928  "result": "true"
11929}
11930~~~
11931
11932### blobfs_create {#rpc_blobfs_create}
11933
11934Build blobfs on bdev.
11935
11936#### Parameters
11937
11938Name                    | Optional | Type        | Description
11939----------------------- | -------- | ----------- | -----------
11940bdev_name               | Required | string      | Block device name to create blobfs
11941cluster_sz              | Optional | number      | Size of cluster in bytes. Must be multiple of 4KiB page size, default and minimal value is 1M.
11942
11943#### Example
11944
11945Example request:
11946
11947~~~json
11948{
11949  "jsonrpc": "2.0",
11950  "id": 1,
11951  "method": "blobfs_create",
11952  "params": {
11953    "bdev_name": "Malloc0",
11954    "cluster_sz": 1M
11955  }
11956}
11957~~~
11958
11959Example response:
11960
11961~~~json
11962{
11963  "jsonrpc": "2.0",
11964  "id": 1,
11965  "result": "true"
11966}
11967~~~
11968
11969### blobfs_mount {#rpc_blobfs_mount}
11970
11971Mount a blobfs on bdev to one host path through FUSE
11972
11973#### Parameters
11974
11975Name                    | Optional | Type        | Description
11976----------------------- | -------- | ----------- | -----------
11977bdev_name               | Required | string      | Block device name where the blobfs is
11978mountpoint              | Required | string      | Mountpoint path in host to mount blobfs
11979
11980#### Example
11981
11982Example request:
11983
11984~~~json
11985{
11986  "jsonrpc": "2.0",
11987  "id": 1,
11988  "method": ""blobfs_mount"",
11989  "params": {
11990    "bdev_name": "Malloc0",
11991    "mountpoint": "/mnt/"
11992  }
11993}
11994~~~
11995
11996Example response:
11997
11998~~~json
11999{
12000  "jsonrpc": "2.0",
12001  "id": 1,
12002  "result": "true"
12003}
12004~~~
12005
12006### blobfs_set_cache_size {#rpc_blobfs_set_cache_size}
12007
12008Set cache pool size for blobfs filesystems.  This RPC is only permitted when the cache pool is not already initialized.
12009
12010The cache pool is initialized when the first blobfs filesystem is initialized or loaded.  It is freed when the all
12011initialized or loaded filesystems are unloaded.
12012
12013#### Parameters
12014
12015Name                    | Optional | Type        | Description
12016----------------------- | -------- | ----------- | -----------
12017size_in_mb              | Required | number      | Cache size in megabytes
12018
12019#### Response
12020
12021True if cache size is set successfully; False if failed to set.
12022
12023#### Example
12024
12025Example request:
12026
12027~~~json
12028{
12029  "jsonrpc": "2.0",
12030  "id": 1,
12031  "method": "blobfs_set_cache_size",
12032  "params": {
12033    "size_in_mb": 512,
12034  }
12035}
12036~~~
12037
12038Example response:
12039
12040~~~json
12041{
12042  "jsonrpc": "2.0",
12043  "id": 1,
12044  "result": true
12045}
12046~~~
12047
12048## Socket layer {#jsonrpc_components_sock}
12049
12050### sock_impl_get_options {#rpc_sock_impl_get_options}
12051
12052Get parameters for the socket layer implementation.
12053
12054#### Parameters
12055
12056Name                    | Optional | Type        | Description
12057----------------------- | -------- | ----------- | -----------
12058impl_name               | Required | string      | Name of socket implementation, e.g. posix
12059
12060#### Response
12061
12062Response is an object with current socket layer options for requested implementation.
12063
12064#### Example
12065
12066Example request:
12067
12068~~~json
12069{
12070  "jsonrpc": "2.0",
12071  "method": "sock_impl_get_options",
12072  "id": 1,
12073  "params": {
12074    "impl_name": "posix"
12075  }
12076}
12077~~~
12078
12079Example response:
12080
12081~~~json
12082{
12083  "jsonrpc": "2.0",
12084  "id": 1,
12085  "result": {
12086    "recv_buf_size": 2097152,
12087    "send_buf_size": 2097152,
12088    "enable_recv_pipe": true,
12089    "enable_quickack": true,
12090    "enable_placement_id": 0,
12091    "enable_zerocopy_send_server": true,
12092    "enable_zerocopy_send_client": false,
12093    "zerocopy_threshold": 0,
12094    "tls_version": 13,
12095    "enable_ktls": false
12096  }
12097}
12098~~~
12099
12100### sock_impl_set_options {#rpc_sock_impl_set_options}
12101
12102Set parameters for the socket layer implementation.
12103
12104#### Parameters
12105
12106Name                        | Optional | Type        | Description
12107--------------------------- | -------- | ----------- | -----------
12108impl_name                   | Required | string      | Name of socket implementation, e.g. posix
12109recv_buf_size               | Optional | number      | Size of socket receive buffer in bytes
12110send_buf_size               | Optional | number      | Size of socket send buffer in bytes
12111enable_recv_pipe            | Optional | boolean     | Enable or disable receive pipe
12112enable_quick_ack            | Optional | boolean     | Enable or disable quick ACK
12113enable_placement_id         | Optional | number      | Enable or disable placement_id. 0:disable,1:incoming_napi,2:incoming_cpu
12114enable_zerocopy_send_server | Optional | boolean     | Enable or disable zero copy on send for server sockets
12115enable_zerocopy_send_client | Optional | boolean     | Enable or disable zero copy on send for client sockets
12116zerocopy_threshold          | Optional | number      | Set zerocopy_threshold in bytes. A consecutive sequence of requests' iovecs
12117--                          | --       | --          | that fall below this threshold may be sent without zerocopy flag set
12118tls_version                 | Optional | number      | TLS protocol version, e.g. 13 for v1.3 (only applies when impl_name == ssl)
12119enable_ktls                 | Optional | boolean     | Enable or disable Kernel TLS (only applies when impl_name == ssl)
12120
12121#### Response
12122
12123True if socket layer options were set successfully.
12124
12125#### Example
12126
12127Example request:
12128
12129~~~json
12130{
12131  "jsonrpc": "2.0",
12132  "method": "sock_impl_set_options",
12133  "id": 1,
12134  "params": {
12135    "impl_name": "posix",
12136    "recv_buf_size": 2097152,
12137    "send_buf_size": 2097152,
12138    "enable_recv_pipe": false,
12139    "enable_quick_ack": false,
12140    "enable_placement_id": 0,
12141    "enable_zerocopy_send_server": true,
12142    "enable_zerocopy_send_client": false,
12143    "zerocopy_threshold": 10240,
12144    "tls_version": 13,
12145    "enable_ktls": false
12146  }
12147}
12148~~~
12149
12150Example response:
12151
12152~~~json
12153{
12154  "jsonrpc": "2.0",
12155  "id": 1,
12156  "result": true
12157}
12158~~~
12159
12160### sock_set_default_impl {#rpc_sock_set_default_impl}
12161
12162Set the default sock implementation.
12163
12164#### Parameters
12165
12166Name                    | Optional | Type        | Description
12167----------------------- | -------- | ----------- | -----------
12168impl_name               | Required | string      | Name of socket implementation, e.g. posix
12169
12170#### Response
12171
12172True if the default socket layer configuration was set successfully.
12173
12174#### Example
12175
12176Example request:
12177
12178~~~json
12179{
12180  "jsonrpc": "2.0",
12181  "method": "sock_set_default_impl",
12182  "id": 1,
12183  "params": {
12184    "impl_name": "posix"
12185  }
12186}
12187~~~
12188
12189Example response:
12190
12191~~~json
12192{
12193  "jsonrpc": "2.0",
12194  "id": 1,
12195  "result": true
12196}
12197~~~
12198
12199### sock_get_default_impl {#rpc_sock_get_default_impl}
12200
12201Get the name of the default sock implementation.
12202
12203#### Parameters
12204
12205This function has no parameters.
12206
12207#### Response
12208
12209The name of the current default socket implementation.
12210
12211#### Example
12212
12213Example request:
12214
12215~~~json
12216{
12217  "jsonrpc": "2.0",
12218  "method": "sock_get_default_impl",
12219  "id": 1
12220}
12221~~~
12222
12223Example response:
12224
12225~~~json
12226{
12227  "jsonrpc": "2.0",
12228  "id": 1,
12229  "result": {
12230    "impl_name": "posix"
12231  }
12232}
12233~~~
12234
12235## Miscellaneous RPC commands
12236
12237### bdev_nvme_send_cmd {#rpc_bdev_nvme_send_cmd}
12238
12239Send NVMe command directly to NVMe controller or namespace. Parameters and responses encoded by base64 urlsafe need further processing.
12240
12241Notice: bdev_nvme_send_cmd requires user to guarantee the correctness of NVMe command itself, and also optional parameters.
12242Illegal command contents or mismatching buffer size may result in unpredictable behavior.
12243
12244#### Parameters
12245
12246Name                    | Optional | Type        | Description
12247----------------------- | -------- | ----------- | -----------
12248name                    | Required | string      | Name of the operating NVMe controller
12249cmd_type                | Required | string      | Type of nvme cmd. Valid values are: admin, io
12250data_direction          | Required | string      | Direction of data transfer. Valid values are: c2h, h2c
12251cmdbuf                  | Required | string      | NVMe command encoded by base64 urlsafe
12252data                    | Optional | string      | Data transferring to controller from host, encoded by base64 urlsafe
12253metadata                | Optional | string      | Metadata transferring to controller from host, encoded by base64 urlsafe
12254data_len                | Optional | number      | Data length required to transfer from controller to host
12255metadata_len            | Optional | number      | Metadata length required to transfer from controller to host
12256timeout_ms              | Optional | number      | Command execution timeout value, in milliseconds
12257
12258#### Response
12259
12260Name                    | Type        | Description
12261----------------------- | ----------- | -----------
12262cpl                     | string      | NVMe completion queue entry, encoded by base64 urlsafe
12263data                    | string      | Data transferred from controller to host, encoded by base64 urlsafe
12264metadata                | string      | Metadata transferred from controller to host, encoded by base64 urlsafe
12265
12266#### Example
12267
12268Example request:
12269
12270~~~json
12271{
12272  "jsonrpc": "2.0",
12273  "method": "bdev_nvme_send_cmd",
12274  "id": 1,
12275  "params": {
12276    "name": "Nvme0",
12277    "cmd_type": "admin"
12278    "data_direction": "c2h",
12279    "cmdbuf": "BgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAsGUs9P5_AAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
12280    "data_len": 60,
12281  }
12282}
12283~~~
12284
12285Example response:
12286
12287~~~json
12288{
12289  "jsonrpc": "2.0",
12290  "id": 1,
12291  "result":  {
12292    "cpl": "AAAAAAAAAAARAAAAWrmwABAA==",
12293    "data": "sIjg6AAAAACwiODoAAAAALCI4OgAAAAAAAYAAREAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
12294  }
12295
12296}
12297~~~
12298
12299### vmd_enable {#rpc_enable_vmd}
12300
12301Enable VMD enumeration.
12302
12303#### Parameters
12304
12305This method has no parameters.
12306
12307#### Response
12308
12309Completion status of enumeration is returned as a boolean.
12310
12311### Example
12312
12313Example request:
12314
12315~~~json
12316{
12317  "jsonrpc": "2.0",
12318  "method": "vmd_enable",
12319  "id": 1
12320}
12321~~~
12322
12323Example response:
12324
12325~~~json
12326{
12327  "jsonrpc": "2.0",
12328  "id": 1,
12329  "result": true
12330}
12331~~~
12332
12333### vmd_remove_device {#rpc_vmd_remove_device}
12334
12335Remove a device behind a VMD.
12336
12337### Parameters
12338
12339Name                    | Optional | Type        | Description
12340----------------------- | -------- | ----------- | -----------
12341addr                    | Required | string      | Address of the device to remove.
12342
12343### Example
12344
12345~~~json
12346{
12347  "jsonrpc": "2.0",
12348  "method": "vmd_remove_device",
12349  "params": {
12350    "addr": "5d0505:01:00.0"
12351  }
12352  "id": 1
12353}
12354~~~
12355
12356Example response:
12357
12358~~~json
12359{
12360  "jsonrpc": "2.0",
12361  "id": 1,
12362  "result": true
12363}
12364~~~
12365
12366### vmd_rescan {#rpc_vmd_rescan}
12367
12368Force a rescan of the devices behind VMD.
12369
12370### Parameters
12371
12372This method has no parameters.
12373
12374#### Response
12375
12376The response is the number of new devices found.
12377
12378### Example
12379
12380~~~json
12381{
12382  "jsonrpc": "2.0",
12383  "method": "vmd_rescan",
12384  "id": 1
12385}
12386~~~
12387
12388Example response:
12389
12390~~~json
12391{
12392  "jsonrpc": "2.0",
12393  "id": 1,
12394  "result": {
12395    "count": 1
12396  }
12397}
12398~~~
12399
12400### spdk_get_version {#rpc_spdk_get_version}
12401
12402Get the version info of the running SPDK application.
12403
12404#### Parameters
12405
12406This method has no parameters.
12407
12408#### Response
12409
12410The response is the version number including major version number, minor version number, patch level number and suffix string.
12411
12412#### Example
12413
12414Example request:
12415
12416~~~json
12417{
12418  "jsonrpc": "2.0",
12419  "id": 1,
12420  "method": "spdk_get_version"
12421}
12422~~~
12423
12424Example response:
12425
12426~~~json
12427{
12428  "jsonrpc": "2.0",
12429  "id": 1,
12430  "result":  {
12431    "version": "19.04-pre",
12432    "fields" : {
12433      "major": 19,
12434      "minor": 4,
12435      "patch": 0,
12436      "suffix": "-pre"
12437    }
12438  }
12439}
12440~~~
12441
12442### framework_get_pci_devices
12443
12444List PCIe devices attached to an SPDK application and the contents of their config space.
12445
12446#### Parameters
12447
12448This method has no parameters.
12449
12450#### Response
12451
12452The response is an array of attached PCIe devices.
12453
12454#### Example
12455
12456Example request:
12457
12458~~~json
12459{
12460  "jsonrpc": "2.0",
12461  "id": 1,
12462  "method": "framework_get_pci_devices"
12463}
12464~~~
12465
12466Example response:
12467Note that the config space buffer was trimmed.
12468
12469~~~json
12470{
12471  "jsonrpc": "2.0",
12472  "id": 1,
12473  "result": {
12474    [
12475      {
12476        "address": "0000:00:04.0",
12477        "config_space": "8680455807051000...0000000000000000"
12478      },
12479      {
12480        "address": "0000:00:03.0",
12481        "config_space": "8680455807051000...0000000000000000"
12482      }
12483    ]
12484  }
12485}
12486~~~
12487
12488### bdev_nvme_add_error_injection {#rpc_bdev_nvme_add_error_injection}
12489
12490Add a NVMe command error injection for a bdev nvme controller.
12491
12492#### Parameters
12493
12494Name                    | Optional | Type        | Description
12495----------------------- | -------- | ----------- | -----------
12496name                    | Required | string      | Name of the operating NVMe controller
12497cmd_type                | Required | string      | Type of NVMe command. Valid values are: admin, io
12498opc                     | Required | number      | Opcode for which the error injection is applied
12499do_not_submit           | Optional | boolean     | Set to true if request should not be submitted to the controller (default false)
12500timeout_in_us           | Optional | number      | Wait specified microseconds when do_not_submit is true
12501err_count               | Optional | number      | Number of matching NVMe commands to inject errors
12502sct                     | Optional | number      | Status code type (default 0)
12503sc                      | Optional | number      | Status code (default 0)
12504
12505#### Response
12506
12507true on success
12508
12509#### Example
12510
12511Example request:
12512
12513~~~json
12514{
12515  "jsonrpc": "2.0",
12516  "method": "bdev_nvme_add_error_injection",
12517  "id": 1,
12518  "params": {
12519    "name": "HotInNvme0",
12520    "opc": 2,
12521    "cmd_type": "io",
12522    "err_count": 1111111,
12523    "sct": 11,
12524    "sc": 33
12525  }
12526}
12527
12528~~~
12529
12530Example response:
12531
12532~~~json
12533{
12534  "jsonrpc": "2.0",
12535  "id": 1,
12536  "result": true
12537}
12538
12539~~~
12540
12541### bdev_nvme_remove_error_injection {#rpc_bdev_nvme_remove_error_injection}
12542
12543Remove a NVMe command error injection.
12544
12545#### Parameters
12546
12547Name                    | Optional | Type        | Description
12548----------------------- | -------- | ----------- | -----------
12549name                    | Required | string      | Name of the operating NVMe controller
12550cmd_type                | Required | string      | Type of NVMe command. Valid values are: admin, io
12551opc                     | Required | number      | Opcode for which the error injection is applied
12552
12553#### Response
12554
12555true on success
12556
12557#### Example
12558
12559Example request:
12560
12561~~~json
12562{
12563  "jsonrpc": "2.0",
12564  "method": "bdev_nvme_remove_error_injection",
12565  "id": 1,
12566  "params": {
12567    "name": "HotInNvme0",
12568    "opc": 2,
12569    "cmd_type": "io"
12570  }
12571}
12572
12573
12574~~~
12575
12576Example response:
12577
12578~~~json
12579{
12580  "jsonrpc": "2.0",
12581  "id": 1,
12582  "result": true
12583}
12584
12585~~~
12586
12587### bdev_daos_create {#rpc_bdev_daos_create}
12588
12589Construct @ref bdev_config_daos
12590
12591#### Parameters
12592
12593Name                    | Optional | Type        | Description
12594----------------------- | -------- | ----------- | -----------
12595name                    | Required | string      | Bdev name to use
12596pool                    | Required | string      | DAOS pool label or its uuid
12597cont                    | Required | string      | DAOS cont label or its uuid
12598block_size              | Required | number      | Block size in bytes -must be multiple of 512
12599num_blocks              | Required | number      | Number of blocks
12600uuid                    | Optional | string      | UUID of new bdev
12601oclass                  | Optional | string      | DAOS object class (default SX)
12602
12603To find more about various object classes please visit [DAOS documentation](https://github.com/daos-stack/daos/blob/master/src/object/README.md).
12604Please note, that DAOS bdev module uses the same CLI flag notation as `dmg` and `daos` commands,
12605for instance, `SX` or `EC_4P2G2` rather than in DAOS header file `OC_SX` or `OC_EC_4P2G2`.
12606
12607#### Result
12608
12609Name of newly created bdev.
12610
12611#### Example
12612
12613Example request:
12614
12615~~~json
12616{
12617  "params": {
12618    "block_size": 4096,
12619    "num_blocks": 16384,
12620    "name": "daosdev0",
12621    "pool": "test-pool",
12622    "cont": "test-cont",
12623    "oclass": "EC_4P2G2"
12624  },
12625  "jsonrpc": "2.0",
12626  "method": "bdev_daos_create",
12627  "id": 1
12628}
12629~~~
12630
12631Example response:
12632
12633~~~json
12634{
12635  "jsonrpc": "2.0",
12636  "id": 1,
12637  "result": "daosdev0"
12638}
12639~~~
12640
12641### bdev_daos_delete {#rpc_bdev_daos_delete}
12642
12643Delete @ref bdev_config_daos
12644
12645#### Parameters
12646
12647Name                    | Optional | Type        | Description
12648----------------------- | -------- | ----------- | -----------
12649name                    | Required | string      | Bdev name
12650
12651#### Example
12652
12653Example request:
12654
12655~~~json
12656{
12657  "params": {
12658    "name": "daosdev0"
12659  },
12660  "jsonrpc": "2.0",
12661  "method": "bdev_daos_delete",
12662  "id": 1
12663}
12664~~~
12665
12666Example response:
12667
12668~~~json
12669{
12670  "jsonrpc": "2.0",
12671  "id": 1,
12672  "result": true
12673}
12674~~~
12675
12676### bdev_daos_resize {#rpc_bdev_daos_resize}
12677
12678Resize @ref bdev_config_daos.
12679
12680#### Parameters
12681
12682Name                    | Optional | Type        | Description
12683----------------------- | -------- | ----------- | -----------
12684name                    | Required | string      | Bdev name
12685new_size                | Required | number      | Bdev new capacity in MiB
12686
12687#### Example
12688
12689Example request:
12690
12691~~~json
12692{
12693  "params": {
12694    "name": "daosdev0",
12695    "new_size": 8192
12696  },
12697  "jsonrpc": "2.0",
12698  "method": "bdev_daos_resize",
12699  "id": 1
12700}
12701~~~
12702
12703Example response:
12704
12705~~~json
12706{
12707  "jsonrpc": "2.0",
12708  "id": 1,
12709  "result": true
12710}
12711~~~
12712
12713### iobuf_set_options {#rpc_iobuf_set_options}
12714
12715Set iobuf buffer pool options.
12716
12717#### Parameters
12718
12719Name                    | Optional | Type        | Description
12720----------------------- | -------- | ----------- | -----------
12721small_pool_count        | Optional | number      | Number of small buffers in the global pool
12722large_pool_count        | Optional | number      | Number of large buffers in the global pool
12723small_bufsize           | Optional | number      | Size of a small buffer
12724large_bufsize           | Optional | number      | Size of a small buffer
12725
12726#### Example
12727
12728Example request:
12729
12730~~~json
12731{
12732  "jsonrpc": "2.0",
12733  "id": 1,
12734  "method": "iobuf_set_options",
12735  "params": {
12736    "small_pool_count": 16383,
12737    "large_pool_count": 2047
12738  }
12739}
12740~~~
12741
12742Example response:
12743
12744~~~json
12745{
12746  "jsonrpc": "2.0",
12747  "id": 1,
12748  "result": true
12749}
12750~~~
12751
12752### iobuf_get_stats {#rpc_iobuf_get_stats}
12753
12754Retrieve iobuf's statistics.
12755
12756#### Parameters
12757
12758None.
12759
12760#### Example
12761
12762Example request:
12763
12764~~~json
12765{
12766  "jsonrpc": "2.0",
12767  "method": "iobuf_get_stats",
12768  "id": 1
12769}
12770~~~
12771
12772Example response:
12773
12774~~~json
12775{
12776  "jsonrpc": "2.0",
12777  "id": 1,
12778  "result": [
12779    {
12780      "module": "accel",
12781      "small_pool": {
12782        "cache": 0,
12783        "main": 0,
12784        "retry": 0
12785      },
12786      "large_pool": {
12787        "cache": 0,
12788        "main": 0,
12789        "retry": 0
12790      }
12791    },
12792    {
12793      "module": "bdev",
12794      "small_pool": {
12795        "cache": 421965,
12796        "main": 1218,
12797        "retry": 0
12798      },
12799      "large_pool": {
12800        "cache": 0,
12801        "main": 0,
12802        "retry": 0
12803      }
12804    },
12805    {
12806      "module": "nvmf_TCP",
12807      "small_pool": {
12808        "cache": 7,
12809        "main": 0,
12810        "retry": 0
12811      },
12812      "large_pool": {
12813        "cache": 0,
12814        "main": 0,
12815        "retry": 0
12816      }
12817    }
12818  ]
12819}
12820~~~
12821
12822### bdev_nvme_start_mdns_discovery {#rpc_bdev_nvme_start_mdns_discovery}
12823
12824Starts an mDNS based discovery service for the specified service type for the
12825auto-discovery of discovery controllers (NVMe TP-8009).
12826
12827The discovery service will listen for the mDNS discovery events from the
12828Avahi-daemon and will connect to the newly learnt discovery controllers.
12829Then the discovery service will automatically attach to any subsystem found in the
12830discovery log page from the discovery controllers learnt using mDNS.
12831When determining a controller name to use when attaching, it will use
12832the 'name' parameter as a prefix, followed by a unique integer assigned for each of the
12833discovery controllers learnt through mDNS, followed by a unique integer for that discovery
12834service. If the discovery service identifies a subsystem that has been previously
12835attached but is listed with a different path, it will use the same controller name
12836as the previous entry, and connect as a multipath.
12837
12838When the discovery service sees that a subsystem entry has been removed
12839from the log page, it will automatically detach from that controller as well.
12840
12841The 'name' is also used to later stop the discovery service.
12842
12843#### Parameters
12844
12845Name                       | Optional | Type        | Description
12846-------------------------- | -------- | ----------- | -----------
12847name                       | Required | string      | Prefix for NVMe discovery services found
12848svcname                    | Required | string      | Service to discover: e.g. _nvme-disc._tcp
12849hostnqn                    | Optional | string      | NVMe-oF hostnqn
12850
12851#### Example
12852
12853Example request:
12854
12855~~~json
12856{
12857  "jsonrpc": "2.0",
12858  "method": "bdev_nvme_start_mdns_discovery",
12859  "id": 1,
12860  "params": {
12861    "name": "cdc_auto",
12862    "svcname": "_nvme-disc._tcp",
12863    "hostnqn": "nqn.2021-12.io.spdk:host1",
12864  }
12865}
12866~~~
12867
12868Example response:
12869
12870~~~json
12871{
12872  "jsonrpc": "2.0",
12873  "id": 1,
12874  "result": true
12875}
12876~~~
12877
12878### bdev_nvme_stop_mdns_discovery {#rpc_bdev_nvme_stop_mdns_discovery}
12879
12880Stops a mDNS discovery service. This includes detaching any controllers that were
12881discovered via the service that is being stopped.
12882
12883#### Parameters
12884
12885Name                       | Optional | Type        | Description
12886-------------------------- | -------- | ----------- | -----------
12887name                       | Required | string      | Name of mDNS discovery instance to stop
12888
12889#### Example
12890
12891Example request:
12892
12893~~~json
12894{
12895  "jsonrpc": "2.0",
12896  "method": "bdev_nvme_stop_mdns_discovery",
12897  "id": 1,
12898  "params": {
12899    "name": "cdc_auto"
12900  }
12901}
12902~~~
12903
12904Example response:
12905
12906~~~json
12907{
12908  "jsonrpc": "2.0",
12909  "id": 1,
12910  "result": true
12911}
12912~~~
12913
12914### bdev_nvme_get_mdns_discovery_info {#rpc_bdev_nvme_get_mdns_discovery_info}
12915
12916Get the information about the mDNS discovery service instances.
12917
12918#### Example
12919
12920Example request:
12921~~~json
12922{
12923  "jsonrpc": "2.0",
12924  "method": "bdev_nvme_get_mdns_discovery_info",
12925  "id": 1
12926}
12927~~~
12928
12929Example response:
12930
12931~~~json
12932[
12933  {
12934    "name": "cdc_auto",
12935    "svcname": "_nvme-disc._tcp",
12936    "referrals": [
12937      {
12938        "name": "cdc_auto0",
12939        "trid": {
12940          "trtype": "TCP",
12941          "adrfam": "IPv4",
12942          "traddr": "66.1.2.21",
12943          "trsvcid": "8009",
12944          "subnqn": "nqn.2014-08.org.nvmexpress.discovery"
12945        }
12946      },
12947      {
12948        "name": "cdc_auto1",
12949        "trid": {
12950          "trtype": "TCP",
12951          "adrfam": "IPv4",
12952          "traddr": "66.1.1.21",
12953          "trsvcid": "8009",
12954          "subnqn": "nqn.2014-08.org.nvmexpress.discovery"
12955        }
12956      }
12957    ]
12958  }
12959]
12960~~~
12961
12962### keyring_file_add_key {#rpc_keyring_file_add_key}
12963
12964Add a file-based key to a keyring.
12965
12966#### Parameters
12967
12968Name                       | Optional | Type        | Description
12969-------------------------- | -------- | ----------- | -----------
12970name                       | Required | string      | Name of the key to add.
12971path                       | Required | string      | Path to a file containing the key.
12972
12973#### Example
12974
12975Example request:
12976
12977~~~json
12978{
12979  "jsonrpc": "2.0",
12980  "method": "keyring_file_add_key",
12981  "id": 1
12982  "params": {
12983    "name": "key0",
12984    "path": "/path/to/key0"
12985  }
12986}
12987~~~
12988
12989Example response:
12990
12991~~~json
12992{
12993  "jsonrpc": "2.0",
12994  "id": 1,
12995  "result": true
12996}
12997~~~
12998
12999### keyring_file_remove_key {#rpc_keyring_file_remove_key}
13000
13001Remove a file-based key from a keyring.
13002
13003#### Parameters
13004
13005Name                       | Optional | Type        | Description
13006-------------------------- | -------- | ----------- | -----------
13007name                       | Required | string      | Name of the key to remove.
13008
13009#### Example
13010
13011Example request:
13012
13013~~~json
13014{
13015  "jsonrpc": "2.0",
13016  "method": "keyring_file_remove_key",
13017  "id": 1
13018  "params": {
13019    "name": "key0"
13020  }
13021}
13022~~~
13023
13024Example response:
13025
13026~~~json
13027{
13028  "jsonrpc": "2.0",
13029  "id": 1,
13030  "result": true
13031}
13032~~~
13033
13034### keyring_get_keys {#rpc_keyring_get_keys}
13035
13036Get a list of available keys.  This RPC will only list keys that are currently attached to a
13037keyring.  Dynamically loaded keys (via the `probe_key()` callback) will only be included if they're
13038currently in-use (i.e. with active references obtained via `spdk_keyring_get_key()`).
13039
13040#### Example
13041
13042Example request:
13043~~~json
13044{
13045  "jsonrpc": "2.0",
13046  "method": "keyring_get_keys",
13047  "id": 1
13048}
13049~~~
13050
13051Example response:
13052
13053~~~json
13054{
13055  "jsonrpc": "2.0",
13056  "id": 1,
13057  "result": [
13058    {
13059      "name": "key0",
13060      "module": "keyring_file",
13061      "removed": false,
13062      "probed": false,
13063      "refcnt": 1,
13064      "path": "/path/to/key0"
13065    },
13066    {
13067      "name": "key1",
13068      "module": "keyring_file",
13069      "removed": false,
13070      "probed": false,
13071      "refcnt": 1,
13072      "path": "/path/to/key1"
13073    }
13074  ]
13075}
13076~~~
13077
13078### keyring_linux_set_options {#keyring_linux_set_options}
13079
13080Set options of the keyring_linux module.
13081
13082#### Parameters
13083
13084Name                    | Optional | Type        | Description
13085----------------------- | -------- | ----------- | -----------
13086enable                  | Optional | boolean     | Enable the module.
13087
13088#### Example
13089
13090Example request:
13091~~~json
13092{
13093  "jsonrpc": "2.0",
13094  "method": "keyring_linux_set_options",
13095  "id": 1
13096  "params": {
13097    "enable": true
13098  }
13099}
13100~~~
13101
13102Example response:
13103
13104~~~json
13105{
13106  "jsonrpc": "2.0",
13107  "id": 1,
13108  "result": true
13109}
13110~~~
13111