xref: /spdk/doc/jsonrpc.md (revision f30fdcf100267bd386c5a5c4c38a9f20959fbff8)
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).
3925
3926#### Example
3927
3928Example request:
3929
3930~~~json
3931request:
3932{
3933  "params": {
3934    "transport_retry_count": 5,
3935    "arbitration_burst": 3,
3936    "low_priority_weight": 8,
3937    "medium_priority_weight":8,
3938    "high_priority_weight": 8,
3939    "nvme_adminq_poll_period_us": 2000,
3940    "timeout_us": 10000000,
3941    "timeout_admin_us": 20000000,
3942    "keep_alive_timeout_ms": 600000,
3943    "action_on_timeout": "reset",
3944    "io_queue_requests" : 2048,
3945    "delay_cmd_submit": true
3946  },
3947  "jsonrpc": "2.0",
3948  "method": "bdev_nvme_set_options",
3949  "id": 1
3950}
3951~~~
3952
3953Example response:
3954
3955~~~json
3956{
3957  "jsonrpc": "2.0",
3958  "id": 1,
3959  "result": true
3960}
3961~~~
3962
3963### bdev_nvme_set_hotplug {#rpc_bdev_nvme_set_hotplug}
3964
3965Change settings of the NVMe hotplug feature. If enabled, PCIe NVMe bdevs will be automatically discovered on insertion
3966and deleted on removal.
3967
3968#### Parameters
3969
3970Name                    | Optional | Type        | Description
3971----------------------- | -------- | ----------- | -----------
3972enable                  | Required | string      | True to enable, false to disable
3973period_us               | Optional | number      | How often to poll for hot-insert and hot-remove events. Values: 0 - reset/use default or 1 to 10000000.
3974
3975#### Example
3976
3977Example request:
3978
3979~~~json
3980request:
3981{
3982  "params": {
3983    "enable": true,
3984    "period_us": 2000
3985  },
3986  "jsonrpc": "2.0",
3987  "method": "bdev_nvme_set_hotplug",
3988  "id": 1
3989}
3990~~~
3991
3992Example response:
3993
3994~~~json
3995{
3996  "jsonrpc": "2.0",
3997  "id": 1,
3998  "result": true
3999}
4000~~~
4001
4002### bdev_nvme_attach_controller {#rpc_bdev_nvme_attach_controller}
4003
4004Construct @ref bdev_config_nvme. This RPC can also be used to add additional paths to an existing controller to enable
4005multipathing. This is done by specifying the `name` parameter as an existing controller. When adding an additional
4006path, the hostnqn, hostsvcid, hostaddr, prchk_reftag, and prchk_guard_arguments must not be specified and are assumed
4007to have the same value as the existing path.
4008
4009The parameters, `ctrlr_loss_timeout_sec`, `reconnect_delay_sec`, and `fast_io_fail_timeout_sec`, are mutually dependent.
4010If `reconnect_delay_sec` is non-zero, `ctrlr_loss_timeout_sec` has to be -1 or not less than `reconnect_delay_sec`.
4011If `reconnect_delay_sec` is zero, `ctrlr_loss_timeout_sec` has to be zero.
4012If `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.
4013
4014#### Result
4015
4016Array of names of newly created bdevs.
4017
4018#### Parameters
4019
4020Name                       | Optional | Type        | Description
4021-------------------------- | -------- | ----------- | -----------
4022name                       | Required | string      | Name of the NVMe controller, prefix for each bdev name
4023trtype                     | Required | string      | NVMe-oF target trtype: rdma or pcie
4024traddr                     | Required | string      | NVMe-oF target address: ip or BDF
4025adrfam                     | Optional | string      | NVMe-oF target adrfam: ipv4, ipv6, ib, fc, intra_host
4026trsvcid                    | Optional | string      | NVMe-oF target trsvcid: port number
4027subnqn                     | Optional | string      | NVMe-oF target subnqn
4028hostnqn                    | Optional | string      | NVMe-oF target hostnqn
4029hostaddr                   | Optional | string      | NVMe-oF host address: ip address
4030hostsvcid                  | Optional | string      | NVMe-oF host trsvcid: port number
4031prchk_reftag               | Optional | bool        | Enable checking of PI reference tag for I/O processing
4032prchk_guard                | Optional | bool        | Enable checking of PI guard for I/O processing
4033hdgst                      | Optional | bool        | Enable TCP header digest
4034ddgst                      | Optional | bool        | Enable TCP data digest
4035fabrics_connect_timeout_us | Optional | bool        | Timeout for fabrics connect (in microseconds)
4036multipath                  | Optional | string      | Multipathing behavior: disable, failover, multipath. Default is failover.
4037num_io_queues              | Optional | number      | The number of IO queues to request during initialization. Range: (0, UINT16_MAX + 1], Default is 1024.
4038ctrlr_loss_timeout_sec     | Optional | number      | Time to wait until ctrlr is reconnected before deleting ctrlr.  -1 means infinite reconnects. 0 means no reconnect.
4039reconnect_delay_sec        | Optional | number      | Time to delay a reconnect trial. 0 means no reconnect.
4040fast_io_fail_timeout_sec   | Optional | number      | Time to wait until ctrlr is reconnected before failing I/O to ctrlr. 0 means no such timeout.
4041psk                        | Optional | string      | Name of the pre-shared key to be used for TLS (Enables SSL socket implementation for TCP)
4042max_bdevs                  | Optional | number      | The size of the name array for newly created bdevs. Default is 128.
4043
4044#### Example
4045
4046Example request:
4047
4048~~~json
4049{
4050  "params": {
4051    "trtype": "pcie",
4052    "name": "Nvme0",
4053    "traddr": "0000:0a:00.0"
4054  },
4055  "jsonrpc": "2.0",
4056  "method": "bdev_nvme_attach_controller",
4057  "id": 1
4058}
4059~~~
4060
4061Example response:
4062
4063~~~json
4064{
4065  "jsonrpc": "2.0",
4066  "id": 1,
4067  "result": [
4068    "Nvme0n1"
4069  ]
4070}
4071~~~
4072
4073### bdev_nvme_get_controllers {#rpc_bdev_nvme_get_controllers}
4074
4075Get information about NVMe controllers.
4076
4077#### Parameters
4078
4079The user may specify no parameters in order to list all NVMe controllers, or one NVMe controller may be
4080specified by name.
4081
4082Name                    | Optional | Type        | Description
4083----------------------- | -------- | ----------- | -----------
4084name                    | Optional | string      | NVMe controller name
4085
4086#### Response
4087
4088The response is an array of objects containing information about the requested NVMe controllers.
4089
4090#### Example
4091
4092Example request:
4093
4094~~~json
4095{
4096  "jsonrpc": "2.0",
4097  "id": 1,
4098  "method": "bdev_nvme_get_controllers",
4099  "params": {
4100    "name": "Nvme0"
4101  }
4102}
4103~~~
4104
4105Example response:
4106
4107~~~json
4108{
4109  "jsonrpc": "2.0",
4110  "id": 1,
4111  "result": [
4112    {
4113      "name": "Nvme0",
4114      "trid": {
4115        "trtype": "PCIe",
4116        "traddr": "0000:05:00.0"
4117      },
4118      "cntlid": 0
4119    }
4120  ]
4121}
4122~~~
4123
4124### bdev_nvme_detach_controller {#rpc_bdev_nvme_detach_controller}
4125
4126Detach NVMe controller and delete any associated bdevs. Optionally,
4127If all of the transport ID options are specified, only remove that
4128transport path from the specified controller. If that is the only
4129available path for the controller, this will also result in the
4130controller being detached and the associated bdevs being deleted.
4131
4132returns true if the controller and bdevs were successfully destroyed
4133or the address was properly removed, false otherwise.
4134
4135#### Parameters
4136
4137Name                    | Optional | Type        | Description
4138----------------------- | -------- | ----------- | -----------
4139name                    | Required | string      | Controller name
4140trtype                  | Optional | string      | NVMe-oF target trtype: rdma or tcp
4141traddr                  | Optional | string      | NVMe-oF target address: ip or BDF
4142adrfam                  | Optional | string      | NVMe-oF target adrfam: ipv4, ipv6, ib, fc, intra_host
4143trsvcid                 | Optional | string      | NVMe-oF target trsvcid: port number
4144subnqn                  | Optional | string      | NVMe-oF target subnqn
4145hostaddr                | Optional | string      | NVMe-oF host address: ip
4146hostsvcid               | Optional | string      | NVMe-oF host svcid: port number
4147
4148#### Example
4149
4150Example requests:
4151
4152~~~json
4153{
4154  "params": {
4155    "name": "Nvme0"
4156  },
4157  "jsonrpc": "2.0",
4158  "method": "bdev_nvme_detach_controller",
4159  "id": 1
4160}
4161~~~
4162
4163Example response:
4164
4165~~~json
4166{
4167  "jsonrpc": "2.0",
4168  "id": 1,
4169  "result": true
4170}
4171~~~
4172
4173### bdev_nvme_reset_controller {#rpc_bdev_nvme_reset_controller}
4174
4175For non NVMe multipath, reset an NVMe controller whose name is given by the `name` parameter.
4176
4177For NVMe multipath, an NVMe bdev controller is created and it aggregates multiple NVMe controllers.
4178The `name` parameter is an NVMe bdev controller name and the `cntlid` parameter is used to identify
4179an NVMe controller in the NVMe bdev controller. Reset only one NVMe-oF controller if the `cntlid`
4180parameter is specified, or all NVMe-oF controllers in an NVMe bdev controller if it is omitted.
4181
4182Returns true if the controller reset was successful, false otherwise.
4183
4184#### Parameters
4185
4186Name                    | Optional | Type        | Description
4187----------------------- | -------- | ----------- | -----------
4188name                    | Required | string      | NVMe controller name (or NVMe bdev controller name for multipath)
4189cntlid                  | Optional | number      | NVMe controller ID (used as NVMe controller name for multipath)
4190
4191#### Example
4192
4193Example request:
4194
4195~~~json
4196{
4197  "jsonrpc": "2.0",
4198  "id": 1,
4199  "method": "bdev_nvme_reset_controller",
4200  "params": {
4201    "name": "Nvme0"
4202  }
4203}
4204~~~
4205
4206Example response:
4207
4208~~~json
4209{
4210  "jsonrpc": "2.0",
4211  "id": 1,
4212  "result": true
4213}
4214~~~
4215
4216### bdev_nvme_enable_controller {#rpc_bdev_nvme_enable_controller}
4217
4218For non NVMe multipath, enable an NVMe controller whose name is given by the `name` parameter.
4219
4220For NVMe multipath, an NVMe bdev controller is created and it aggregates multiple NVMe controllers.
4221The `name` parameter is an NVMe bdev controller name and the `cntlid` parameter is used to identify
4222an NVMe controller in the NVMe bdev controller. Enable only one NVMe-oF controller if the `cntlid`
4223parameter is specified, or all NVMe-oF controllers in an NVMe bdev controller if it is omitted.
4224
4225Returns true if the controller enablement was successful or a controller was already enabled, false otherwise.
4226
4227#### Parameters
4228
4229Name                    | Optional | Type        | Description
4230----------------------- | -------- | ----------- | -----------
4231name                    | Required | string      | NVMe controller name (or NVMe bdev controller name for multipath)
4232cntlid                  | Optional | number      | NVMe controller ID (used as NVMe controller name for multipath)
4233
4234#### Example
4235
4236Example request:
4237
4238~~~json
4239{
4240  "jsonrpc": "2.0",
4241  "id": 1,
4242  "method": "bdev_nvme_enable_controller",
4243  "params": {
4244    "name": "Nvme0"
4245  }
4246}
4247~~~
4248
4249Example response:
4250
4251~~~json
4252{
4253  "jsonrpc": "2.0",
4254  "id": 1,
4255  "result": true
4256}
4257~~~
4258
4259### bdev_nvme_disable_controller {#rpc_bdev_nvme_disable_controller}
4260
4261For non NVMe multipath, disable an NVMe controller whose name is given by the `name` parameter.
4262
4263For NVMe multipath, an NVMe bdev controller is created and it aggregates multiple NVMe controllers.
4264The `name` parameter is an NVMe bdev controller name and the `cntlid` parameter is used to identify
4265an NVMe controller in the NVMe bdev controller. Disable only one NVMe-oF controller if the `cntlid`
4266parameter is specified, or all NVMe-oF controllers in an NVMe bdev controller if it is omitted.
4267
4268Returns true if the controller disablement was successful or a controller was already disabled, false otherwise.
4269
4270#### Parameters
4271
4272Name                    | Optional | Type        | Description
4273----------------------- | -------- | ----------- | -----------
4274name                    | Required | string      | NVMe controller name (or NVMe bdev controller name for multipath)
4275cntlid                  | Optional | number      | NVMe controller ID (used as NVMe controller name for multipath)
4276
4277#### Example
4278
4279Example request:
4280
4281~~~json
4282{
4283  "jsonrpc": "2.0",
4284  "id": 1,
4285  "method": "bdev_nvme_disable_controller",
4286  "params": {
4287    "name": "Nvme0"
4288  }
4289}
4290~~~
4291
4292Example response:
4293
4294~~~json
4295{
4296  "jsonrpc": "2.0",
4297  "id": 1,
4298  "result": true
4299}
4300~~~
4301
4302### bdev_nvme_start_discovery {#rpc_bdev_nvme_start_discovery}
4303
4304Start a discovery service for the discovery subsystem of the specified transport ID.
4305
4306The discovery service will read the discovery log page for the specified
4307discovery subsystem, and automatically attach to any subsystems found in the
4308log page. When determining a controller name to use when attaching, it will use
4309the 'name' parameter as a prefix, followed by a unique integer for that discovery
4310service. If the discovery service identifies a subsystem that has been previously
4311attached but is listed with a different path, it will use the same controller name
4312as the previous entry, and connect as a multipath.
4313
4314When the discovery service sees that a subsystem entry has been removed
4315from the log page, it will automatically detach from that controller as well.
4316
4317The 'name' is also used to later stop the discovery service.
4318
4319#### Parameters
4320
4321Name                       | Optional | Type        | Description
4322-------------------------- | -------- | ----------- | -----------
4323name                       | Required | string      | Prefix for NVMe controllers
4324trtype                     | Required | string      | NVMe-oF target trtype: rdma or tcp
4325traddr                     | Required | string      | NVMe-oF target address: ip
4326adrfam                     | Optional | string      | NVMe-oF target adrfam: ipv4, ipv6
4327trsvcid                    | Optional | string      | NVMe-oF target trsvcid: port number
4328hostnqn                    | Optional | string      | NVMe-oF target hostnqn
4329wait_for_attach            | Optional | bool        | Wait to complete until all discovered NVM subsystems are attached
4330attach_timeout_ms          | Optional | number      | Time to wait until the discovery and all discovered NVM subsystems are attached
4331ctrlr_loss_timeout_sec     | Optional | number      | Time to wait until ctrlr is reconnected before deleting ctrlr.  -1 means infinite reconnects. 0 means no reconnect.
4332reconnect_delay_sec        | Optional | number      | Time to delay a reconnect trial. 0 means no reconnect.
4333fast_io_fail_timeout_sec   | Optional | number      | Time to wait until ctrlr is reconnected before failing I/O to ctrlr. 0 means no such timeout.
4334
4335#### Example
4336
4337Example request:
4338
4339~~~json
4340{
4341  "jsonrpc": "2.0",
4342  "method": "bdev_nvme_start_discovery",
4343  "id": 1,
4344  "params": {
4345    "name": "nvme_auto",
4346    "trtype": "tcp",
4347    "traddr": "127.0.0.1",
4348    "hostnqn": "nqn.2021-12.io.spdk:host1",
4349    "adrfam": "ipv4",
4350    "trsvcid": "4420"
4351  }
4352}
4353~~~
4354
4355Example response:
4356
4357~~~json
4358{
4359  "jsonrpc": "2.0",
4360  "id": 1,
4361  "result": true
4362}
4363~~~
4364
4365### bdev_nvme_stop_discovery {#rpc_bdev_nvme_stop_discovery}
4366
4367Stop a discovery service. This includes detaching any controllers that were
4368discovered via the service that is being stopped.
4369
4370#### Parameters
4371
4372Name                       | Optional | Type        | Description
4373-------------------------- | -------- | ----------- | -----------
4374name                       | Required | string      | Name of service to stop
4375
4376#### Example
4377
4378Example request:
4379
4380~~~json
4381{
4382  "jsonrpc": "2.0",
4383  "method": "bdev_nvme_stop_discovery",
4384  "id": 1,
4385  "params": {
4386    "name": "nvme_auto"
4387  }
4388}
4389~~~
4390
4391Example response:
4392
4393~~~json
4394{
4395  "jsonrpc": "2.0",
4396  "id": 1,
4397  "result": true
4398}
4399~~~
4400
4401### bdev_nvme_get_discovery_info {#rpc_bdev_nvme_get_discovery_info}
4402
4403Get information about the discovery service.
4404
4405#### Example
4406
4407Example request:
4408~~~json
4409{
4410  "jsonrpc": "2.0",
4411  "method": "bdev_nvme_get_discovery_info",
4412  "id": 1
4413}
4414~~~
4415
4416Example response:
4417
4418~~~json
4419{
4420  "jsonrpc": "2.0",
4421  "id": 1,
4422  "result": [
4423    {
4424      "name": "nvme-disc",
4425      "trid": {
4426        "trtype": "TCP",
4427        "adrfam": "IPv4",
4428        "traddr": "127.0.0.1",
4429        "trsvcid": "8009",
4430        "subnqn": "nqn.2014-08.org.nvmexpress.discovery"
4431      },
4432      "referrals": []
4433    }
4434  ]
4435}
4436~~~
4437
4438### bdev_nvme_get_io_paths {#rpc_bdev_nvme_get_io_paths}
4439
4440Display all or the specified NVMe bdev's active I/O paths.
4441
4442#### Parameters
4443
4444Name                    | Optional | Type        | Description
4445----------------------- | -------- | ----------- | -----------
4446name                    | Optional | string      | Name of the NVMe bdev
4447
4448#### Example
4449
4450Example request:
4451
4452~~~json
4453{
4454  "jsonrpc": "2.0",
4455  "method": "bdev_nvme_get_io_paths",
4456  "id": 1,
4457  "params": {
4458    "name": "Nvme0n1"
4459  }
4460}
4461~~~
4462
4463Example response:
4464
4465~~~json
4466{
4467  "jsonrpc": "2.0",
4468  "id": 1,
4469  "result": {
4470    "poll_groups": [
4471      {
4472        "thread": "app_thread",
4473        "io_paths": [
4474          {
4475            "bdev_name": "Nvme0n1",
4476            "cntlid": 0,
4477            "current": true,
4478            "connected": true,
4479            "accessible": true,
4480            "transport": {
4481              "trtype": "RDMA",
4482              "traddr": "1.2.3.4",
4483              "trsvcid": "4420",
4484              "adrfam": "IPv4"
4485            }
4486          }
4487        ]
4488      }
4489    ]
4490  }
4491}
4492~~~
4493
4494### bdev_nvme_set_preferred_path {#rpc_bdev_nvme_set_preferred_path}
4495
4496Set the preferred I/O path for an NVMe bdev in multipath mode.
4497
4498NOTE: This RPC does not support NVMe bdevs in failover mode.
4499
4500#### Parameters
4501
4502Name                    | Optional | Type        | Description
4503----------------------- | -------- | ----------- | -----------
4504name                    | Required | string      | Name of the NVMe bdev
4505cntlid                  | Required | number      | NVMe-oF controller ID
4506
4507#### Example
4508
4509Example request:
4510
4511~~~json
4512{
4513  "jsonrpc": "2.0",
4514  "method": "bdev_nvme_set_preferred_path",
4515  "id": 1,
4516  "params": {
4517    "name": "Nvme0n1",
4518    "cntlid": 0
4519  }
4520}
4521~~~
4522
4523Example response:
4524
4525~~~json
4526{
4527  "jsonrpc": "2.0",
4528  "id": 1,
4529  "result": true
4530}
4531~~~
4532
4533### bdev_nvme_set_multipath_policy {#rpc_bdev_nvme_set_multipath_policy}
4534
4535Set multipath policy of the NVMe bdev in multipath mode or set multipath
4536selector for active-active multipath policy.
4537
4538#### Parameters
4539
4540Name                    | Optional | Type        | Description
4541----------------------- | -------- | ----------- | -----------
4542name                    | Required | string      | Name of the NVMe bdev
4543policy                  | Required | string      | Multipath policy: active_active or active_passive
4544selector                | Optional | string      | Multipath selector: round_robin or queue_depth, used in active-active mode. Default is round_robin
4545rr_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.
4546
4547#### Example
4548
4549Example request:
4550
4551~~~json
4552{
4553  "jsonrpc": "2.0",
4554  "method": "bdev_nvme_set_multipath_policy",
4555  "id": 1,
4556  "params": {
4557    "name": "Nvme0n1",
4558    "policy": "active_passive"
4559  }
4560}
4561~~~
4562
4563Example response:
4564
4565~~~json
4566{
4567  "jsonrpc": "2.0",
4568  "id": 1,
4569  "result": true
4570}
4571~~~
4572
4573### bdev_nvme_get_path_iostat {#rpc_bdev_nvme_get_path_iostat}
4574
4575Get I/O statistics for IO paths of the block device. Call RPC bdev_nvme_set_options to set enable_io_path_stat
4576true before using this RPC.
4577
4578#### Parameters
4579
4580Name                    | Optional | Type        | Description
4581----------------------- | -------- | ----------- | -----------
4582name                    | Required | string      | Name of the NVMe bdev
4583
4584#### Example
4585
4586Example request:
4587
4588~~~json
4589{
4590  "jsonrpc": "2.0",
4591  "method": "bdev_nvme_get_path_iostat",
4592  "id": 1,
4593  "params": {
4594    "name": "NVMe0n1"
4595  }
4596}
4597~~~
4598
4599Example response:
4600
4601~~~json
4602{
4603  "jsonrpc": "2.0",
4604  "id": 1,
4605  "result": {
4606    "name": "NVMe0n1",
4607    "stats": [
4608      {
4609        "trid": {
4610          "trtype": "TCP",
4611          "adrfam": "IPv4",
4612          "traddr": "10.169.204.201",
4613          "trsvcid": "4420",
4614          "subnqn": "nqn.2016-06.io.spdk:cnode1"
4615        },
4616        "stat": {
4617          "bytes_read": 676691968,
4618          "num_read_ops": 165201,
4619          "bytes_written": 0,
4620          "num_write_ops": 0,
4621          "bytes_unmapped": 0,
4622          "num_unmap_ops": 0,
4623          "max_read_latency_ticks": 521487,
4624          "min_read_latency_ticks": 0,
4625          "write_latency_ticks": 0,
4626          "max_write_latency_ticks": 0,
4627          "min_write_latency_ticks": 0,
4628          "unmap_latency_ticks": 0,
4629          "max_unmap_latency_ticks": 0,
4630          "min_unmap_latency_ticks": 0,
4631          "copy_latency_ticks": 0,
4632          "max_copy_latency_ticks": 0,
4633          "min_copy_latency_ticks": 0
4634        }
4635      },
4636      {
4637        "trid": {
4638          "trtype": "TCP",
4639          "adrfam": "IPv4",
4640          "traddr": "8.8.8.6",
4641          "trsvcid": "4420",
4642          "subnqn": "nqn.2016-06.io.spdk:cnode1"
4643        },
4644        "stat": {
4645          "bytes_read": 677138432,
4646          "num_read_ops": 165317,
4647          "bytes_written": 0,
4648          "num_write_ops": 0,
4649          "bytes_unmapped": 0,
4650          "num_unmap_ops": 0,
4651          "max_read_latency_ticks": 108525,
4652          "min_read_latency_ticks": 0,
4653          "write_latency_ticks": 0,
4654          "max_write_latency_ticks": 0,
4655          "min_write_latency_ticks": 0,
4656          "unmap_latency_ticks": 0,
4657          "max_unmap_latency_ticks": 0,
4658          "min_unmap_latency_ticks": 0,
4659          "copy_latency_ticks": 0,
4660          "max_copy_latency_ticks": 0,
4661          "min_copy_latency_ticks": 0
4662        }
4663      }
4664    ]
4665  }
4666}
4667~~~
4668
4669### bdev_nvme_cuse_register {#rpc_bdev_nvme_cuse_register}
4670
4671Register CUSE device on NVMe controller.
4672
4673#### Parameters
4674
4675Name                    | Optional | Type        | Description
4676----------------------- | -------- | ----------- | -----------
4677name                    | Required | string      | Name of the NVMe controller
4678
4679#### Example
4680
4681Example request:
4682
4683~~~json
4684{
4685  "jsonrpc": "2.0",
4686  "method": "bdev_nvme_cuse_register",
4687  "id": 1,
4688  "params": {
4689    "name": "Nvme0"
4690  }
4691}
4692~~~
4693
4694Example response:
4695
4696~~~json
4697{
4698  "jsonrpc": "2.0",
4699  "id": 1,
4700  "result": true
4701}
4702~~~
4703
4704### bdev_nvme_cuse_unregister {#rpc_bdev_nvme_cuse_unregister}
4705
4706Unregister CUSE device on NVMe controller.
4707
4708#### Parameters
4709
4710Name                    | Optional | Type        | Description
4711----------------------- | -------- | ----------- | -----------
4712name                    | Required | string      | Name of the NVMe controller
4713
4714#### Example
4715
4716Example request:
4717
4718~~~json
4719{
4720  "params": {
4721    "name": "Nvme0"
4722  },
4723  "jsonrpc": "2.0",
4724  "method": "bdev_nvme_cuse_unregister",
4725  "id": 1
4726}
4727~~~
4728
4729Example response:
4730
4731~~~json
4732{
4733  "jsonrpc": "2.0",
4734  "id": 1,
4735  "result": true
4736}
4737~~~
4738
4739### bdev_zone_block_create {#rpc_bdev_zone_block_create}
4740
4741Creates a virtual zone device on top of existing non-zoned bdev.
4742
4743#### Parameters
4744
4745Name                    | Optional | Type        | Description
4746----------------------- | -------- | ----------- | -----------
4747name                    | Required | string      | Name of the Zone device
4748base_bdev               | Required | string      | Name of the Base bdev
4749zone_capacity           | Required | number      | Zone capacity in blocks
4750optimal_open_zones      | Required | number      | Number of zones required to reach optimal write speed
4751
4752#### Example
4753
4754Example request:
4755
4756~~~json
4757{
4758  "jsonrpc": "2.0",
4759  "method": "bdev_zone_block_create",
4760  "id": 1,
4761  "params": {
4762    "name": "zone1",
4763    "base_bdev": "NVMe0n1",
4764    "zone_capacity": 4096,
4765    "optimal_open_zones": 32
4766  }
4767}
4768~~~
4769
4770Example response:
4771
4772~~~json
4773{
4774  "jsonrpc": "2.0",
4775  "id": 1,
4776  "result": "zone1"
4777}
4778~~~
4779
4780### bdev_zone_block_delete {#rpc_bdev_zone_block_delete}
4781
4782Deletes a virtual zone device.
4783
4784#### Parameters
4785
4786Name                    | Optional | Type        | Description
4787----------------------- | -------- | ----------- | -----------
4788name                    | Required | string      | Name of the Zone device
4789
4790#### Example
4791
4792Example request:
4793
4794~~~json
4795{
4796  "jsonrpc": "2.0",
4797  "method": "bdev_zone_block_delete",
4798  "id": 1,
4799  "params": {
4800    "name": "zone1"
4801  }
4802}
4803~~~
4804
4805Example response:
4806
4807~~~json
4808{
4809  "jsonrpc": "2.0",
4810  "id": 1,
4811  "result": true
4812}
4813~~~
4814
4815### bdev_nvme_apply_firmware {#rpc_bdev_nvme_apply_firmware}
4816
4817Download and commit firmware to NVMe device.
4818
4819#### Parameters
4820
4821Name                    | Optional | Type        | Description
4822----------------------- | -------- | ----------- | -----------
4823filename                | Required | string      | filename of the firmware to download
4824bdev_name               | Required | string      | Name of the NVMe block device
4825
4826#### Example
4827
4828Example request:
4829
4830~~~json
4831{
4832  "jsonrpc": "2.0",
4833  "method": "bdev_nvme_apply_firmware",
4834  "id": 1,
4835  "params": {
4836    "filename": "firmware_file",
4837    "bdev_name": "NVMe0n1"
4838  }
4839}
4840~~~
4841
4842### bdev_nvme_get_transport_statistics {#rpc_bdev_nvme_get_transport_statistics}
4843
4844Get bdev_nvme poll group transport statistics.
4845
4846#### Parameters
4847
4848This RPC method accepts no parameters
4849
4850#### Response
4851
4852The response is an array of objects containing information about transport statistics per NVME poll group.
4853
4854#### Example
4855
4856Example request:
4857
4858~~~json
4859{
4860  "jsonrpc": "2.0",
4861  "id": 1,
4862  "method": "bdev_nvme_get_transport_statistics",
4863}
4864~~~
4865
4866Example response:
4867
4868~~~json
4869{
4870  "jsonrpc": "2.0",
4871  "id": 1,
4872	"result": {
4873	  "poll_groups": [
4874		{
4875		  "thread": "nvmf_tgt_poll_group_0",
4876		  "transports": [
4877			{
4878			  "trname": "RDMA",
4879			  "devices": [
4880				{
4881				  "dev_name": "mlx5_1",
4882				  "polls": 137492169,
4883				  "idle_polls": 137492169,
4884				  "completions": 0,
4885				  "queued_requests": 0,
4886				  "total_send_wrs": 0,
4887				  "send_sq_doorbell_updates": 0,
4888				  "total_recv_wrs": 0,
4889				  "recv_sq_doorbell_updates": 0
4890				},
4891				{
4892				  "dev_name": "mlx5_0",
4893				  "polls": 137985185,
4894				  "idle_polls": 137492169,
4895				  "completions": 1474593,
4896				  "queued_requests": 0,
4897				  "total_send_wrs": 1474593,
4898				  "send_sq_doorbell_updates": 426147,
4899				  "total_recv_wrs": 1474721,
4900				  "recv_sq_doorbell_updates": 348445
4901				}
4902			  ]
4903			},
4904			{
4905			  "trname": "PCIE",
4906			  "polls": 435419831,
4907			  "idle_polls": 434901004,
4908			  "completions": 1485543,
4909			  "cq_doorbell_updates": 518827,
4910			  "queued_requests": 0,
4911			  "submitted_requests": 1485543,
4912			  "sq_doorbell_updates": 516081
4913			}
4914		  ]
4915		},
4916		{
4917		  "thread": "nvmf_tgt_poll_group_1",
4918		  "transports": [
4919			{
4920			  "trname": "RDMA",
4921			  "devices": [
4922				{
4923				  "dev_name": "mlx5_1",
4924				  "polls": 140245630,
4925				  "idle_polls": 140245630,
4926				  "completions": 0,
4927				  "queued_requests": 0,
4928				  "total_send_wrs": 0,
4929				  "send_sq_doorbell_updates": 0,
4930				  "total_recv_wrs": 0,
4931				  "recv_sq_doorbell_updates": 0
4932				},
4933				{
4934				  "dev_name": "mlx5_0",
4935				  "polls": 140751844,
4936				  "idle_polls": 140245630,
4937				  "completions": 1489298,
4938				  "queued_requests": 0,
4939				  "total_send_wrs": 1489298,
4940				  "send_sq_doorbell_updates": 433510,
4941				  "total_recv_wrs": 1489426,
4942				  "recv_sq_doorbell_updates": 357956
4943				}
4944			  ]
4945			},
4946			{
4947			  "trname": "PCIE",
4948			  "polls": 429044294,
4949			  "idle_polls": 428525658,
4950			  "completions": 1478730,
4951			  "cq_doorbell_updates": 518636,
4952			  "queued_requests": 0,
4953			  "submitted_requests": 1478730,
4954			  "sq_doorbell_updates": 511658
4955			}
4956		  ]
4957		}
4958	  ]
4959	}
4960}
4961~~~
4962
4963### bdev_nvme_get_controller_health_info {#rpc_bdev_nvme_get_controller_health_info}
4964
4965Display health log of the required NVMe bdev device.
4966
4967#### Parameters
4968
4969Name                    | Optional | Type        | Description
4970----------------------- | -------- | ----------- | -----------
4971name                    | Required | string      | Name of the NVMe bdev controller
4972
4973#### Response
4974
4975The response is the object containing information about health log of the NVMe controller.
4976
4977#### Example
4978
4979Example request:
4980
4981~~~json
4982{
4983  "jsonrpc": "2.0",
4984  "method": "bdev_nvme_get_controller_health_info",
4985  "id": 1,
4986  "params": {
4987    "name": "Nvme0"
4988  }
4989}
4990~~~
4991
4992Example response:
4993
4994~~~json
4995{
4996  "model_number": "INTEL SSDPE2KX020T8",
4997  "serial_number": "BTLJ72430ARH2P0BGN",
4998  "firmware_revision": "VDV10110",
4999  "traddr": "0000:08:00.0",
5000  "temperature_celsius": 32,
5001  "available_spare_percentage": 99,
5002  "available_spare_threshold_percentage": 10,
5003  "percentage_used": 2,
5004  "data_units_read": 1013408619,
5005  "data_units_written": 346792685,
5006  "host_read_commands": 30457773282,
5007  "host_write_commands": 18949677715,
5008  "controller_busy_time": 4979,
5009  "power_cycles": 49,
5010  "power_on_hours": 31118,
5011  "unsafe_shutdowns": 18,
5012  "media_errors": 17,
5013  "num_err_log_entries": 19,
5014  "warning_temperature_time_minutes": 0,
5015  "critical_composite_temperature_time_minutes": 0
5016}
5017~~~
5018
5019### bdev_rbd_register_cluster {#rpc_bdev_rbd_register_cluster}
5020
5021This method is available only if SPDK was build with Ceph RBD support.
5022
5023#### Parameters
5024
5025Name                    | Optional | Type        | Description
5026----------------------- | -------- | ----------- | -----------
5027name                    | Required | string      | Registered Rados cluster object name
5028user_id                 | Optional | string      | Ceph ID (i.e. admin, not client.admin)
5029config_param            | Optional | string map  | Explicit librados configuration
5030config_file             | Optional | string      | File path of libraodos configuration file
5031key_file                | Optional | string      | File path of libraodos key file
5032
5033This RPC registers a Rados Cluster object handle which is only known
5034to rbd module, it uses user_id + config_param or user_id + config_file +
5035key_file or user_id + config_param + config_file + key_file to identify
5036a Rados cluster object.
5037
5038When accessing the Ceph cluster as some user other than "admin" (the
5039default), the "user_id" has to be set.
5040
5041The configuration items and secret key can be specified by setting config_param,
5042config_file and key_file, all of them, or none of them. If only config_param is
5043passed, all key/value pairs are passed to rados_conf_set to configure cluster access.
5044In practice, "mon_host" (= list of monitor address+port) and "key" (= the secret key
5045stored in Ceph keyrings) are enough. If config_file and key_file are specified, they must
5046exist with all relevant settings for accessing the Ceph cluster. If config_param, config_file
5047and key_file are specified, get the key/value pairs from config_file first and set to
5048rados_conf_set function, then set pairs in config_param and keyring in key_file. If nothing
5049is specified, it will get configuration file and key file from the default location
5050/etc/ceph/ceph.conf and /etc/ceph/ceph.client.user_id.keyring.
5051
5052#### Result
5053
5054Name of newly created Rados cluster object.
5055
5056#### Example
5057
5058Example request:
5059
5060~~
5061{
5062  "params": {
5063    "name": "rbd_cluster",
5064    "user_id": cinder,
5065    "config_file": "/root/ceph_conf/ceph.conf",
5066    "key_file": "/root/ceph_conf/ceph.client.cinder.keyring"
5067  },
5068  "jsonrpc": "2.0",
5069  "method": "bdev_rbd_register_cluster",
5070  "id": 1
5071}
5072~~
5073
5074Example response:
5075
5076~~
5077response:
5078{
5079  "jsonrpc": "2.0",
5080  "id": 1,
5081  "result": "rbd_cluster"
5082}
5083~~
5084
5085### bdev_rbd_unregister_cluster {#rpc_bdev_rbd_unregister_cluster}
5086
5087This method is available only if SPDK was build with Ceph RBD support.
5088If there is still rbd bdev using this cluster, the unregisteration operation
5089will fail.
5090
5091#### Result
5092
5093`true` if Rados cluster object with provided name was deleted or `false` otherwise.
5094
5095#### Parameters
5096
5097Name                    | Optional | Type        | Description
5098----------------------- | -------- | ----------- | -------------------------
5099name                    | Required | string      | Rados cluster object name
5100
5101#### Example
5102
5103Example request:
5104
5105~~
5106{
5107  "params": {
5108    "name": "rbd_cluster"
5109  },
5110  "jsonrpc": "2.0",
5111  "method": "bdev_rbd_unregister_cluster",
5112  "id": 1
5113}
5114~~
5115
5116Example response:
5117
5118~~
5119{
5120  "jsonrpc": "2.0",
5121  "id": 1,
5122  "result": true
5123}
5124~~
5125
5126### bdev_rbd_get_clusters_info {#rpc_bdev_rbd_get_clusters_info}
5127
5128This method is available only if SPDK was build with Ceph RBD support.
5129
5130#### Result
5131
5132Returns the cluster info of the Rados Cluster name if provided. Otherwise, it
5133returns the cluster info of every registered Raods Cluster name.
5134
5135#### Parameters
5136
5137Name                    | Optional | Type        | Description
5138----------------------- | -------- | ----------- | -------------------------
5139name                    | Optional | string      | Rados cluster object name
5140
5141#### Example
5142
5143Example request:
5144
5145~~
5146{
5147  "params": {
5148    "name": "rbd_cluster"
5149  },
5150  "jsonrpc": "2.0",
5151  "method": "bdev_rbd_get_clusters_info",
5152  "id": 1
5153}
5154~~
5155
5156Example response:
5157
5158~~
5159{
5160  "jsonrpc": "2.0",
5161  "cluster_name": "rbd_cluster"
5162}
5163~~
5164
5165### bdev_rbd_create {#rpc_bdev_rbd_create}
5166
5167Create @ref bdev_config_rbd bdev
5168
5169This method is available only if SPDK was build with Ceph RBD support.
5170
5171#### Parameters
5172
5173Name                    | Optional | Type        | Description
5174----------------------- | -------- | ----------- | -----------
5175name                    | Optional | string      | Bdev name
5176user_id                 | Optional | string      | Ceph ID (i.e. admin, not client.admin)
5177pool_name               | Required | string      | Pool name
5178rbd_name                | Required | string      | Image name
5179block_size              | Required | number      | Block size
5180config                  | Optional | string map  | Explicit librados configuration
5181cluster_name            | Optional | string      | Rados cluster object name created in this module.
5182uuid                    | Optional | string      | UUID of new bdev
5183
5184If no config is specified, Ceph configuration files must exist with
5185all relevant settings for accessing the pool. If a config map is
5186passed, the configuration files are ignored and instead all key/value
5187pairs are passed to rados_conf_set to configure cluster access. In
5188practice, "mon_host" (= list of monitor address+port) and "key" (= the
5189secret key stored in Ceph keyrings) are enough.
5190
5191When accessing the image as some user other than "admin" (the
5192default), the "user_id" has to be set.
5193
5194If provided with cluster_name option, it will use the Rados cluster object
5195referenced by the name (created by bdev_rbd_register_cluster RPC) and ignores
5196"user_id + config" combination to create its own Rados cluster. In this scenario,
5197all the bdevs will share the same cluster with one connection of Ceph in librbd module.
5198Performance tuning on the I/O workload could be done by estimating how many io_contxt
5199threads and messager threads in Ceph side and how many cores would be reasonable to provide
5200for SPDK to get up to your projections.
5201
5202#### Result
5203
5204Name of newly created bdev.
5205
5206#### Example
5207
5208Example request with `key` from `/etc/ceph/ceph.client.admin.keyring`:
5209
5210~~~json
5211{
5212  "params": {
5213    "pool_name": "rbd",
5214    "rbd_name": "foo",
5215    "config": {
5216      "mon_host": "192.168.7.1:6789,192.168.7.2:6789",
5217      "key": "AQDwf8db7zR1GRAA5k7NKXjS5S5V4mntwUDnGQ==",
5218    }
5219    "block_size": 4096,
5220    "uuid": "76210ea4-7920-40a0-a07b-8992a7443c76"
5221  },
5222  "jsonrpc": "2.0",
5223  "method": "bdev_rbd_create",
5224  "id": 1
5225}
5226~~~
5227
5228Example response:
5229
5230~~~json
5231response:
5232{
5233  "jsonrpc": "2.0",
5234  "id": 1,
5235  "result": "Ceph0"
5236}
5237~~~
5238
5239Example request with `cluster_name`:
5240
5241~~
5242{
5243  "params": {
5244    "pool_name": "rbd",
5245    "rbd_name": "foo",
5246    "block_size": 4096,
5247    "cluster_name": "rbd_cluster"
5248  },
5249  "jsonrpc": "2.0",
5250  "method": "bdev_rbd_create",
5251  "id": 1
5252}
5253~~
5254
5255Example response:
5256
5257~~
5258response:
5259{
5260  "jsonrpc": "2.0",
5261  "id": 1,
5262  "result": "Ceph0"
5263}
5264~~
5265
5266### bdev_rbd_delete {#rpc_bdev_rbd_delete}
5267
5268Delete @ref bdev_config_rbd bdev
5269
5270This method is available only if SPDK was build with Ceph RBD support.
5271
5272#### Result
5273
5274`true` if bdev with provided name was deleted or `false` otherwise.
5275
5276#### Parameters
5277
5278Name                    | Optional | Type        | Description
5279----------------------- | -------- | ----------- | -----------
5280name                    | Required | string      | Bdev name
5281
5282#### Example
5283
5284Example request:
5285
5286~~~json
5287{
5288  "params": {
5289    "name": "Rbd0"
5290  },
5291  "jsonrpc": "2.0",
5292  "method": "bdev_rbd_delete",
5293  "id": 1
5294}
5295~~~
5296
5297Example response:
5298
5299~~~json
5300{
5301  "jsonrpc": "2.0",
5302  "id": 1,
5303  "result": true
5304}
5305~~~
5306
5307### bdev_rbd_resize {#rpc_bdev_rbd_resize}
5308
5309Resize @ref bdev_config_rbd bdev
5310
5311This method is available only if SPDK was build with Ceph RBD support.
5312
5313#### Result
5314
5315`true` if bdev with provided name was resized or `false` otherwise.
5316
5317#### Parameters
5318
5319Name                    | Optional | Type        | Description
5320----------------------- | -------- | ----------- | -----------
5321name                    | Required | string      | Bdev name
5322new_size                | Required | int         | New bdev size for resize operation in MiB
5323
5324#### Example
5325
5326Example request:
5327
5328~~~json
5329{
5330  "params": {
5331    "name": "Rbd0"
5332    "new_size": "4096"
5333  },
5334  "jsonrpc": "2.0",
5335  "method": "bdev_rbd_resize",
5336  "id": 1
5337}
5338~~~
5339
5340Example response:
5341
5342~~~json
5343{
5344  "jsonrpc": "2.0",
5345  "id": 1,
5346  "result": true
5347}
5348~~~
5349
5350### bdev_delay_create {#rpc_bdev_delay_create}
5351
5352Create delay bdev. This bdev type redirects all IO to it's base bdev and inserts a delay on the completion
5353path to create an artificial drive latency. All latency values supplied to this bdev should be in microseconds.
5354
5355#### Parameters
5356
5357Name                    | Optional | Type        | Description
5358----------------------- | -------- | ----------- | -----------
5359name                    | Required | string      | Bdev name
5360base_bdev_name          | Required | string      | Base bdev name
5361avg_read_latency        | Required | number      | average read latency (us)
5362p99_read_latency        | Required | number      | p99 read latency (us)
5363avg_write_latency       | Required | number      | average write latency (us)
5364p99_write_latency       | Required | number      | p99 write latency (us)
5365
5366#### Result
5367
5368Name of newly created bdev.
5369
5370#### Example
5371
5372Example request:
5373
5374~~~json
5375{
5376  "params": {
5377    "base_bdev_name": "Null0",
5378    "name": "Delay0",
5379    "avg_read_latency": "15",
5380    "p99_read_latency": "50",
5381    "avg_write_latency": "40",
5382    "p99_write_latency": "110",
5383  },
5384  "jsonrpc": "2.0",
5385  "method": "bdev_delay_create",
5386  "id": 1
5387}
5388~~~
5389
5390Example response:
5391
5392~~~json
5393{
5394  "jsonrpc": "2.0",
5395  "id": 1,
5396  "result": "Delay0"
5397}
5398~~~
5399
5400### bdev_delay_delete {#rpc_bdev_delay_delete}
5401
5402Delete delay bdev.
5403
5404#### Parameters
5405
5406Name                    | Optional | Type        | Description
5407----------------------- | -------- | ----------- | -----------
5408name                    | Required | string      | Bdev name
5409
5410#### Example
5411
5412Example request:
5413
5414~~~json
5415{
5416  "params": {
5417    "name": "Delay0"
5418  },
5419  "jsonrpc": "2.0",
5420  "method": "bdev_delay_delete",
5421  "id": 1
5422}
5423
5424~~~
5425
5426Example response:
5427
5428~~~json
5429{
5430  "jsonrpc": "2.0",
5431  "id": 1,
5432  "result": true
5433}
5434~~~
5435
5436### bdev_delay_update_latency {#rpc_bdev_delay_update_latency}
5437
5438Update a target latency value associated with a given delay bdev. Any currently
5439outstanding I/O will be completed with the old latency.
5440
5441#### Parameters
5442
5443Name                    | Optional | Type        | Description
5444----------------------- | -------- | ----------- | -----------
5445delay_bdev_name         | Required | string      | Name of the delay bdev
5446latency_type            | Required | string      | One of: avg_read, avg_write, p99_read, p99_write
5447latency_us              | Required | number      | The new latency value in microseconds
5448
5449#### Result
5450
5451Name of newly created bdev.
5452
5453#### Example
5454
5455Example request:
5456
5457~~~json
5458{
5459  "params": {
5460    "delay_bdev_name": "Delay0",
5461    "latency_type": "avg_read",
5462    "latency_us": "100",
5463  },
5464  "jsonrpc": "2.0",
5465  "method": "bdev_delay_update_latency",
5466  "id": 1
5467}
5468~~~
5469
5470Example response:
5471
5472~~~json
5473{
5474  "result": "true"
5475}
5476~~~
5477
5478### bdev_error_create {#rpc_bdev_error_create}
5479
5480Construct error bdev.
5481
5482#### Parameters
5483
5484Name                    | Optional | Type        | Description
5485----------------------- | -------- | ----------- | -----------
5486base_name               | Required | string      | Base bdev name
5487uuid                    | Optional | string      | UUID for this bdev
5488
5489#### Example
5490
5491Example request:
5492
5493~~~json
5494{
5495  "params": {
5496    "base_name": "Malloc0"
5497  },
5498  "jsonrpc": "2.0",
5499  "method": "bdev_error_create",
5500  "id": 1
5501}
5502~~~
5503
5504Example response:
5505
5506~~~json
5507{
5508  "jsonrpc": "2.0",
5509  "id": 1,
5510  "result": true
5511}
5512~~~
5513
5514### bdev_error_delete {#rpc_bdev_error_delete}
5515
5516Delete error bdev
5517
5518#### Result
5519
5520`true` if bdev with provided name was deleted or `false` otherwise.
5521
5522#### Parameters
5523
5524Name                    | Optional | Type        | Description
5525----------------------- | -------- | ----------- | -----------
5526name                    | Required | string      | Error bdev name
5527
5528#### Example
5529
5530Example request:
5531
5532~~~json
5533{
5534  "params": {
5535    "name": "EE_Malloc0"
5536  },
5537  "jsonrpc": "2.0",
5538  "method": "bdev_error_delete",
5539  "id": 1
5540}
5541~~~
5542
5543Example response:
5544
5545~~~json
5546{
5547  "jsonrpc": "2.0",
5548  "id": 1,
5549  "result": true
5550}
5551~~~
5552
5553### bdev_error_inject_error {#rpc_bdev_error_inject_error}
5554
5555Inject an error via an error bdev. Create an error bdev on base bdev first. Default 'num'
5556value is 1 and if 'num' is set to zero, the specified injection is disabled.
5557
5558#### Parameters
5559
5560Name                    | Optional | Type        | Description
5561----------------------- | -------- | ----------- | -----------
5562name                    | Required | string      | Name of the error injection bdev
5563io_type                 | Required | string      | io type 'clear' 'read' 'write' 'unmap' 'flush' 'all'
5564error_type              | Required | string      | error type 'failure' 'pending' 'corrupt_data' 'nomem'
5565num                     | Optional | int         | the number of commands you want to fail.(default:1)
5566queue_depth             | Optional | int         | the queue depth at which to trigger the error
5567corrupt_offset          | Optional | int         | the offset in bytes to xor with corrupt_value
5568corrupt_value           | Optional | int         | the value for xor (1-255, 0 is invalid)
5569
5570#### Example
5571
5572Example request:
5573
5574~~~json
5575{
5576  "jsonrpc": "2.0",
5577  "method": "bdev_error_inject_error",
5578  "id": 1,
5579  "params": {
5580    "name": "EE_Malloc0",
5581    "io_type": "write",
5582    "error_type": "pending",
5583    "num": 1
5584  }
5585}
5586~~~
5587
5588Example response:
5589
5590~~~json
5591{
5592  "jsonrpc": "2.0",
5593  "id": 1,
5594  "result": true
5595}
5596~~~
5597
5598### bdev_iscsi_set_options {#rpc_bdev_iscsi_set_options}
5599
5600This RPC can be called at any time, but the new value will only take effect for new iSCSI bdevs.
5601
5602#### Parameters
5603
5604Name                       | Optional | Type        | Description
5605-------------------------- | -------- | ----------- | -----------
5606timeout_sec                | Optional | number      | Timeout for command, in seconds, if 0, don't track timeout
5607
5608#### Example
5609
5610Example request:
5611
5612~~~json
5613request:
5614{
5615  "params": {
5616    "timeout_sec": 30
5617  },
5618  "jsonrpc": "2.0",
5619  "method": "bdev_iscsi_set_options",
5620  "id": 1
5621}
5622~~~
5623
5624Example response:
5625
5626~~~json
5627{
5628  "jsonrpc": "2.0",
5629  "id": 1,
5630  "result": true
5631}
5632~~~
5633
5634### bdev_iscsi_create {#rpc_bdev_iscsi_create}
5635
5636Connect to iSCSI target and create bdev backed by this connection.
5637
5638This method is available only if SPDK was build with iSCSI initiator support.
5639
5640#### Parameters
5641
5642Name                    | Optional | Type        | Description
5643----------------------- | -------- | ----------- | -----------
5644name                    | Required | string      | Bdev name
5645initiator_iqn           | Required | string      | IQN name used during connection
5646url                     | Required | string      | iSCSI resource URI
5647
5648#### Result
5649
5650Name of newly created bdev.
5651
5652#### Example
5653
5654Example request:
5655
5656~~~json
5657{
5658  "params": {
5659    "url": "iscsi://127.0.0.1/iqn.2016-06.io.spdk:disk1/0",
5660    "initiator_iqn": "iqn.2016-06.io.spdk:init",
5661    "name": "iSCSI0"
5662  },
5663  "jsonrpc": "2.0",
5664  "method": "bdev_iscsi_create",
5665  "id": 1
5666}
5667~~~
5668
5669Example response:
5670
5671~~~json
5672{
5673  "jsonrpc": "2.0",
5674  "id": 1,
5675  "result": "iSCSI0"
5676}
5677~~~
5678
5679### bdev_iscsi_delete {#rpc_bdev_iscsi_delete}
5680
5681Delete iSCSI bdev and terminate connection to target.
5682
5683This method is available only if SPDK was built with iSCSI initiator support.
5684
5685#### Parameters
5686
5687Name                    | Optional | Type        | Description
5688----------------------- | -------- | ----------- | -----------
5689name                    | Required | string      | Bdev name
5690
5691#### Example
5692
5693Example request:
5694
5695~~~json
5696{
5697  "params": {
5698    "name": "iSCSI0"
5699  },
5700  "jsonrpc": "2.0",
5701  "method": "bdev_iscsi_delete",
5702  "id": 1
5703}
5704~~~
5705
5706Example response:
5707
5708~~~json
5709{
5710  "jsonrpc": "2.0",
5711  "id": 1,
5712  "result": true
5713}
5714~~~
5715
5716### bdev_ftl_create {#rpc_bdev_ftl_create}
5717
5718Create FTL bdev.
5719
5720This RPC is subject to change.
5721
5722#### Parameters
5723
5724Name                    | Optional | Type        | Description
5725----------------------- | -------- | ----------- | -----------
5726name                    | Required | string      | Bdev name
5727base_bdev               | Required | string      | Name of the base device
5728cache                   | Required | string      | Name of the cache device
5729uuid                    | Optional | string      | UUID of restored bdev (not applicable when creating new instance)
5730core_mask               | Optional | string      | CPU core(s) possible for placement of the ftl core thread, application main thread by default
5731overprovisioning        | Optional | int         | Percentage of base device used for relocation, 20% by default
5732fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data on target application shutdown and rely on shared memory during next load
5733
5734#### Result
5735
5736Name of newly created bdev.
5737
5738#### Example
5739
5740Example request:
5741
5742~~~json
5743{
5744  "params": {
5745    "name": "ftl0",
5746    "base_bdev": "nvme0n1",
5747    "cache": "nvme1n1",
5748    "uuid": "4a7481ce-786f-41a0-9b86-8f7465c8f4d3",
5749    "core_mask": "[0]",
5750    "overprovisioning": 10
5751  },
5752  "jsonrpc": "2.0",
5753  "method": "bdev_ftl_create",
5754  "id": 1
5755}
5756~~~
5757
5758Example response:
5759
5760~~~json
5761{
5762  "jsonrpc": "2.0",
5763  "id": 1,
5764  "result": {
5765      "name" : "ftl0"
5766      "uuid" : "4a7481ce-786f-41a0-9b86-8f7465c8f4d3"
5767  }
5768}
5769~~~
5770
5771### bdev_ftl_load {#rpc_bdev_ftl_load}
5772
5773Loads FTL bdev.
5774
5775This RPC is subject to change.
5776
5777#### Parameters
5778
5779Name                    | Optional | Type        | Description
5780----------------------- | -------- | ----------- | -----------
5781name                    | Required | string      | Bdev name
5782base_bdev               | Required | string      | Name of the base device
5783cache                   | Required | string      | Name of the cache device
5784uuid                    | Required | string      | UUID of restored bdev
5785core_mask               | Optional | string      | CPU core(s) possible for placement of the ftl core thread, application main thread by default
5786overprovisioning        | Optional | int         | Percentage of base device used for relocation, 20% by default
5787fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data on target application shutdown and rely on shared memory during next load
5788
5789#### Result
5790
5791Name of loaded bdev.
5792
5793#### Example
5794
5795Example request:
5796
5797~~~json
5798{
5799  "params": {
5800    "name": "ftl0",
5801    "base_bdev": "nvme0n1",
5802    "cache": "nvme1n1",
5803    "uuid": "4a7481ce-786f-41a0-9b86-8f7465c8f4d3",
5804    "core_mask": "[0]",
5805    "overprovisioning": 10
5806  },
5807  "jsonrpc": "2.0",
5808  "method": "bdev_ftl_load",
5809  "id": 1
5810}
5811~~~
5812
5813Example response:
5814
5815~~~json
5816{
5817  "jsonrpc": "2.0",
5818  "id": 1,
5819  "result": {
5820      "name" : "ftl0"
5821      "uuid" : "4a7481ce-786f-41a0-9b86-8f7465c8f4d3"
5822  }
5823}
5824~~~
5825
5826### bdev_ftl_delete {#rpc_bdev_ftl_delete}
5827
5828Delete FTL bdev.
5829
5830This RPC is subject to change.
5831
5832#### Parameters
5833
5834Name                    | Optional | Type        | Description
5835----------------------- | -------- | ----------- | -----------
5836name                    | Required | string      | Bdev name
5837fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data during deletion and rely on shared memory during next load
5838
5839#### Example
5840
5841Example request:
5842
5843~~~json
5844{
5845  "params": {
5846    "name": "ftl0"
5847  },
5848  "jsonrpc": "2.0",
5849  "method": "bdev_ftl_delete",
5850  "id": 1
5851}
5852~~~
5853
5854Example response:
5855
5856~~~json
5857{
5858  "jsonrpc": "2.0",
5859  "id": 1,
5860  "result": true
5861}
5862~~~
5863
5864### bdev_ftl_unload {#rpc_bdev_ftl_unload}
5865
5866Unloads FTL bdev.
5867
5868This RPC is subject to change.
5869
5870#### Parameters
5871
5872Name                    | Optional | Type        | Description
5873----------------------- | -------- | ----------- | -----------
5874name                    | Required | string      | Bdev name
5875fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data during deletion and rely on shared memory during next load
5876
5877#### Example
5878
5879Example request:
5880
5881~~~json
5882{
5883  "params": {
5884    "name": "ftl0"
5885  },
5886  "jsonrpc": "2.0",
5887  "method": "bdev_ftl_unload",
5888  "id": 1
5889}
5890~~~
5891
5892Example response:
5893
5894~~~json
5895{
5896  "jsonrpc": "2.0",
5897  "id": 1,
5898  "result": true
5899}
5900~~~
5901
5902### bdev_ftl_unmap {#rpc_bdev_ftl_unmap}
5903
5904Unmap range of LBAs.
5905
5906This RPC is subject to change.
5907
5908#### Parameters
5909
5910Name                    | Optional | Type        | Description
5911----------------------- | -------- | ----------- | -----------
5912name                    | Required | string      | Bdev name
5913lba                     | Required | number      | start lba, aligned to 1024
5914num_blocks              | Required | number      | number of blocks, aligned to 1024
5915
5916#### Example
5917
5918Example request:
5919
5920~~~json
5921{
5922  "params": {
5923    "name": "ftl0"
5924    "lba": "0"
5925    "num_blocks": "1024"
5926  },
5927  "jsonrpc": "2.0",
5928  "method": "bdev_ftl_unmap",
5929  "id": 1
5930}
5931~~~
5932
5933Example response:
5934
5935~~~json
5936{
5937  "jsonrpc": "2.0",
5938  "id": 1,
5939  "result": true
5940}
5941~~~
5942
5943### bdev_ftl_get_stats {#rpc_bdev_ftl_get_stats}
5944
5945Get IO statistics for FTL bdev
5946
5947This RPC is subject to change.
5948
5949#### Parameters
5950
5951Name                    | Optional | Type        | Description
5952----------------------- | -------- | ----------- | -----------
5953name                    | Required | string      | Bdev name
5954
5955#### Response
5956
5957The response is an object containing IO statistics for an FTL instance, split into multiple subobjects:
5958
5959- `user` - contains information about number of IOs, and errors for any incoming requests,
5960- `cmp` - information about IO for the compaction process,
5961- `gc` - information about IO for the garbage collection process,
5962- `md_base` - internal metadata requests to the base FTL device,
5963- `md_nv_cache` - internal metadata requests to the cache device,
5964- `l2p` - requests done on the L2P cache region.
5965
5966Each subobject contains the following information:
5967
5968- `ios` - describes the total number of IOs requested,
5969- `blocks` - the total number of requested blocks,
5970- `errors` - describes the number of detected errors for a given operation, with the following distinctions:
5971  - `media` - media errors,
5972  - `crc` - mismatch in calculated CRC versus saved checksum in the metadata,
5973  - `other` - any other errors.
5974
5975#### Example
5976
5977Example request:
5978
5979~~~json
5980{
5981  "params": {
5982    "name": "ftl0"
5983  },
5984  "jsonrpc": "2.0",
5985  "method": "bdev_ftl_get_stats",
5986  "id": 1
5987}
5988~~~
5989
5990Example response:
5991
5992~~~json
5993{
5994  "jsonrpc": "2.0",
5995  "id": 1,
5996  "result": {
5997      "name": "ftl0",
5998      "user": {
5999        "read": {
6000          "ios": 0,
6001          "blocks": 0,
6002          "errors": {
6003            "media": 0,
6004            "crc": 0,
6005            "other": 0
6006          }
6007        },
6008        "write": {
6009          "ios": 318707,
6010          "blocks": 318707,
6011          "errors": {
6012            "media": 0,
6013            "other": 0
6014          }
6015        }
6016      },
6017      "cmp": {
6018        "read": {
6019          "ios": 0,
6020          "blocks": 0,
6021          "errors": {
6022            "media": 0,
6023            "crc": 0,
6024            "other": 0
6025          }
6026        },
6027        "write": {
6028          "ios": 0,
6029          "blocks": 0,
6030          "errors": {
6031            "media": 0,
6032            "other": 0
6033          }
6034        }
6035      },
6036      "gc": {
6037        "read": {
6038          "ios": 0,
6039          "blocks": 0,
6040          "errors": {
6041            "media": 0,
6042            "crc": 0,
6043            "other": 0
6044          }
6045        },
6046        "write": {
6047          "ios": 0,
6048          "blocks": 0,
6049          "errors": {
6050            "media": 0,
6051            "other": 0
6052          }
6053        }
6054      },
6055      "md_base": {
6056        "read": {
6057          "ios": 0,
6058          "blocks": 0,
6059          "errors": {
6060            "media": 0,
6061            "crc": 0,
6062            "other": 0
6063          }
6064        },
6065        "write": {
6066          "ios": 1,
6067          "blocks": 32,
6068          "errors": {
6069            "media": 0,
6070            "other": 0
6071          }
6072        }
6073      },
6074      "md_nv_cache": {
6075        "read": {
6076          "ios": 0,
6077          "blocks": 0,
6078          "errors": {
6079            "media": 0,
6080            "crc": 0,
6081            "other": 0
6082          }
6083        },
6084        "write": {
6085          "ios": 1064,
6086          "blocks": 1073896,
6087          "errors": {
6088            "media": 0,
6089            "other": 0
6090          }
6091        }
6092      },
6093      "l2p": {
6094        "read": {
6095          "ios": 240659,
6096          "blocks": 240659,
6097          "errors": {
6098            "media": 0,
6099            "crc": 0,
6100            "other": 0
6101          }
6102        },
6103        "write": {
6104          "ios": 235745,
6105          "blocks": 235745,
6106          "errors": {
6107            "media": 0,
6108            "other": 0
6109          }
6110        }
6111      }
6112    }
6113}
6114~~~
6115
6116### bdev_ftl_get_properties {#rpc_bdev_ftl_get_properties}
6117
6118Get FTL properties
6119
6120#### Parameters
6121
6122Name                    | Optional | Type        | Description
6123----------------------- | -------- | ----------- | -----------
6124name                    | Required | string      | Bdev name
6125
6126#### Response
6127
6128The response contains FTL bdev properties. Some of them can be modified, other
6129reported as read only.
6130
6131#### Example
6132
6133Example request:
6134
6135~~~json
6136{
6137  "params": {
6138    "name": "ftl0"
6139  },
6140  "jsonrpc": "2.0",
6141  "method": "bdev_ftl_get_properties",
6142  "id": 1
6143}
6144~~~
6145
6146Example response:
6147
6148~~~json
6149{
6150  "jsonrpc": "2.0",
6151  "id": 1,
6152  "result": {
6153    "name": "ftl0",
6154    "properties": [
6155      {
6156        "name": "property1",
6157        "value": "Property Value 1",
6158        "unit": "MiB/s",
6159        "desc": "This is an example of read-only property",
6160        "read-only": true
6161      },
6162      {
6163        "name": "property2",
6164        "value": 17,
6165        "unit": "s",
6166        "desc": "This is an example of FTL modifiable property",
6167        "read-only": false
6168      }
6169    ]
6170  }
6171}
6172~~~
6173
6174### bdev_ftl_set_property {#rpc_bdev_ftl_set_property}
6175
6176Set FTL property. Trying to set a read-only property will result in an error.
6177
6178#### Parameters
6179
6180Name                    | Optional | Type        | Description
6181----------------------- | -------- | ----------- | -----------
6182name                    | Required | string      | Bdev name
6183property                | Required | string      | Name of the property to modify
6184value                   | Required | string      | New value of the property to be set
6185
6186#### Example
6187
6188Example request:
6189
6190~~~json
6191{
6192  "params": {
6193    "name": "ftl0"
6194    "property": "nv_cache.flush"
6195    "value": "true"
6196  },
6197  "jsonrpc": "2.0",
6198  "method": "bdev_ftl_set_property",
6199  "id": 1
6200}
6201~~~
6202
6203Example response:
6204
6205~~~json
6206{
6207  "jsonrpc": "2.0",
6208  "id": 1,
6209  "result": true
6210}
6211~~~
6212
6213### bdev_passthru_create {#rpc_bdev_passthru_create}
6214
6215Create passthru bdev. This bdev type redirects all IO to it's base bdev. It has no other purpose than being an example
6216and a starting point in development of new bdev type.
6217
6218#### Parameters
6219
6220Name                    | Optional | Type        | Description
6221----------------------- | -------- | ----------- | -----------
6222name                    | Required | string      | Bdev name
6223base_bdev_name          | Required | string      | Base bdev name
6224uuid                    | Optional | string      | UUID of new bdev
6225
6226#### Result
6227
6228Name of newly created bdev.
6229
6230#### Example
6231
6232Example request:
6233
6234~~~json
6235{
6236  "params": {
6237    "base_bdev_name": "Malloc0",
6238    "name": "Passsthru0"
6239  },
6240  "jsonrpc": "2.0",
6241  "method": "bdev_passthru_create",
6242  "id": 1
6243}
6244~~~
6245
6246Example response:
6247
6248~~~json
6249{
6250  "jsonrpc": "2.0",
6251  "id": 1,
6252  "result": "Passsthru0"
6253}
6254~~~
6255
6256### bdev_passthru_delete {#rpc_bdev_passthru_delete}
6257
6258Delete passthru bdev.
6259
6260#### Parameters
6261
6262Name                    | Optional | Type        | Description
6263----------------------- | -------- | ----------- | -----------
6264name                    | Required | string      | Bdev name
6265
6266#### Example
6267
6268Example request:
6269
6270~~~json
6271{
6272  "params": {
6273    "name": "Passsthru0"
6274  },
6275  "jsonrpc": "2.0",
6276  "method": "bdev_passthru_delete",
6277  "id": 1
6278}
6279
6280~~~
6281
6282Example response:
6283
6284~~~json
6285{
6286  "jsonrpc": "2.0",
6287  "id": 1,
6288  "result": true
6289}
6290~~~
6291
6292### bdev_xnvme_create {#rpc_bdev_xnvme_create}
6293
6294Create xnvme bdev. This bdev type redirects all IO to its underlying backend.
6295
6296#### Parameters
6297
6298Name                    | Optional | Type        | Description
6299----------------------- | -------- | ----------- | -----------
6300name                    | Required | string      | name of xNVMe bdev to create
6301filename                | Required | string      | path to device or file (ex: /dev/nvme0n1)
6302io_mechanism            | Required | string      | IO mechanism to use (ex: libaio, io_uring, io_uring_cmd, etc.)
6303conserve_cpu            | Optional | boolean     | Whether or not to conserve CPU when polling (default: false)
6304
6305#### Result
6306
6307Name of newly created bdev.
6308
6309#### Example
6310
6311Example request:
6312
6313~~~json
6314{
6315  "jsonrpc": "2.0",
6316  "method": "bdev_xnvme_create",
6317  "id": 1,
6318  "params": {
6319    "name": "bdev_ng0n1",
6320    "filename": "/dev/ng0n1",
6321    "io_mechanism": "io_uring_cmd",
6322    "conserve_cpu": false,
6323  }
6324}
6325~~~
6326
6327Example response:
6328
6329~~~json
6330{
6331  "jsonrpc": "2.0",
6332  "id": 1,
6333  "result": "bdev_ng0n1"
6334}
6335~~~
6336
6337### bdev_xnvme_delete {#rpc_bdev_xnvme_delete}
6338
6339Delete xnvme bdev.
6340
6341#### Parameters
6342
6343Name                    | Optional | Type        | Description
6344----------------------- | -------- | ----------- | -----------
6345name                    | Required | string      | name of xnvme bdev to delete
6346
6347#### Example
6348
6349Example request:
6350
6351~~~json
6352{
6353  "params": {
6354    "name": "bdev_ng0n1"
6355  },
6356  "jsonrpc": "2.0",
6357  "method": "bdev_xnvme_delete",
6358  "id": 1
6359}
6360
6361~~~
6362
6363Example response:
6364
6365~~~json
6366{
6367  "jsonrpc": "2.0",
6368  "id": 1,
6369  "result": true
6370}
6371~~~
6372
6373### bdev_virtio_attach_controller {#rpc_bdev_virtio_attach_controller}
6374
6375Create new initiator @ref bdev_config_virtio_scsi or @ref bdev_config_virtio_blk and expose all found bdevs.
6376
6377#### Parameters
6378
6379Name                    | Optional | Type        | Description
6380----------------------- | -------- | ----------- | -----------
6381name                    | Required | string      | Virtio SCSI base bdev name or Virtio Blk bdev name
6382trtype                  | Required | string      | Virtio target trtype: pci or user
6383traddr                  | Required | string      | target address: BDF or UNIX socket file path
6384dev_type                | Required | string      | Virtio device type: blk or scsi
6385vq_count                | Optional | number      | Number of queues this controller will utilize (default: 1)
6386vq_size                 | Optional | number      | Size of each queue. Must be power of 2. (default: 512)
6387
6388In case of Virtio SCSI the `name` parameter will be base name for new created bdevs. For Virtio Blk `name` will be the
6389name of created bdev.
6390
6391`vq_count` and `vq_size` parameters are valid only if `trtype` is `user`.
6392
6393#### Result
6394
6395Array of names of newly created bdevs.
6396
6397#### Example
6398
6399Example request:
6400
6401~~~json
6402{
6403  "params": {
6404    "name": "VirtioScsi0",
6405    "trtype": "user",
6406    "vq_size": 128,
6407    "dev_type": "scsi",
6408    "traddr": "/tmp/VhostScsi0",
6409    "vq_count": 4
6410  },
6411  "jsonrpc": "2.0",
6412  "method": "bdev_virtio_attach_controller",
6413  "id": 1
6414}
6415~~~
6416
6417Example response:
6418
6419~~~json
6420{
6421  "jsonrpc": "2.0",
6422  "id": 1,
6423  "result": ["VirtioScsi0t2", "VirtioScsi0t4"]
6424}
6425~~~
6426
6427### bdev_virtio_scsi_get_devices {#rpc_bdev_virtio_scsi_get_devices}
6428
6429Show information about all available Virtio SCSI devices.
6430
6431#### Parameters
6432
6433This method has no parameters.
6434
6435#### Result
6436
6437Array of Virtio SCSI information objects.
6438
6439#### Example
6440
6441Example request:
6442
6443~~~json
6444{
6445  "jsonrpc": "2.0",
6446  "method": "bdev_virtio_scsi_get_devices",
6447  "id": 1
6448}
6449~~~
6450
6451Example response:
6452
6453~~~json
6454{
6455  "jsonrpc": "2.0",
6456  "id": 1,
6457  "result": [
6458    {
6459      "name": "VirtioScsi0",
6460      "virtio": {
6461          "vq_size": 128,
6462          "vq_count": 4,
6463          "type": "user",
6464          "socket": "/tmp/VhostScsi0"
6465      }
6466    }
6467  ]
6468}
6469~~~
6470
6471### bdev_virtio_detach_controller {#rpc_bdev_virtio_detach_controller}
6472
6473Remove a Virtio device. This command can be used to remove any type of virtio device.
6474
6475#### Parameters
6476
6477Name                    | Optional | Type        | Description
6478----------------------- | -------- | ----------- | -----------
6479name                    | Required | string      | Virtio name
6480
6481#### Example
6482
6483Example request:
6484
6485~~~json
6486{
6487  "params": {
6488    "name": "VirtioUser0"
6489  },
6490  "jsonrpc": "2.0",
6491  "method": "bdev_virtio_detach_controller",
6492  "id": 1
6493}
6494
6495~~~
6496
6497Example response:
6498
6499~~~json
6500{
6501  "jsonrpc": "2.0",
6502  "id": 1,
6503  "result": true
6504}
6505~~~
6506
6507### bdev_virtio_blk_set_hotplug {#rpc_bdev_virtio_blk_set_hotplug}
6508
6509Enable/Disable the virtio blk hotplug monitor or change the monitor period time
6510
6511#### Parameters
6512
6513Name                    | Optional | Type        | Description
6514----------------------- | -------- | ----------- | -----------
6515enable                  | Required | bool        | Enable or disable the virtio blk hotplug monitor
6516period-us               | Optional | number      | The period time of the monitor
6517
6518When the enable is true then the period-us is optional. If user don't set the period time then use the default
6519value. When the enable is false then the period-us is not required.
6520
6521#### Result
6522
6523True the rpc is successful otherwise false
6524
6525#### Example
6526
6527Example request:
6528
6529~~~json
6530{
6531  "params": {
6532    "enable": "true",
6533    "period-us": "1000000"
6534  },
6535  "jsonrpc": "2.0",
6536  "method": "bdev_virtio_blk_set_hotplug",
6537  "id": 1
6538}
6539~~~
6540
6541Example response:
6542
6543~~~json
6544{
6545  "jsonrpc": "2.0",
6546  "id": 1,
6547  "result": true
6548}
6549~~~
6550
6551## iSCSI Target {#jsonrpc_components_iscsi_tgt}
6552
6553### iscsi_set_options method {#rpc_iscsi_set_options}
6554
6555Set global parameters for iSCSI targets.
6556
6557This RPC may only be called before SPDK subsystems have been initialized. This RPC can be called only once.
6558
6559#### Parameters
6560
6561Name                            | Optional | Type    | Description
6562------------------------------- | -------- | ------- | -----------
6563auth_file                       | Optional | string  | Path to CHAP shared secret file (default: "")
6564node_base                       | Optional | string  | Prefix of the name of iSCSI target node (default: "iqn.2016-06.io.spdk")
6565nop_timeout                     | Optional | number  | Timeout in seconds to nop-in request to the initiator (default: 60)
6566nop_in_interval                 | Optional | number  | Time interval in secs between nop-in requests by the target (default: 30)
6567disable_chap                    | Optional | boolean | CHAP for discovery session should be disabled (default: `false`)
6568require_chap                    | Optional | boolean | CHAP for discovery session should be required (default: `false`)
6569mutual_chap                     | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`)
6570chap_group                      | Optional | number  | CHAP group ID for discovery session (default: 0)
6571max_sessions                    | Optional | number  | Maximum number of sessions in the host (default: 128)
6572max_queue_depth                 | Optional | number  | Maximum number of outstanding I/Os per queue (default: 64)
6573max_connections_per_session     | Optional | number  | Session specific parameter, MaxConnections (default: 2)
6574default_time2wait               | Optional | number  | Session specific parameter, DefaultTime2Wait (default: 2)
6575default_time2retain             | Optional | number  | Session specific parameter, DefaultTime2Retain (default: 20)
6576first_burst_length              | Optional | number  | Session specific parameter, FirstBurstLength (default: 8192)
6577immediate_data                  | Optional | boolean | Session specific parameter, ImmediateData (default: `true`)
6578error_recovery_level            | Optional | number  | Session specific parameter, ErrorRecoveryLevel (default: 0)
6579allow_duplicated_isid           | Optional | boolean | Allow duplicated initiator session ID (default: `false`)
6580max_large_datain_per_connection | Optional | number  | Max number of outstanding split read I/Os per connection (default: 64)
6581max_r2t_per_connection          | Optional | number  | Max number of outstanding R2Ts per connection (default: 4)
6582pdu_pool_size                   | Optional | number  | Number of PDUs in the pool (default: approximately 2 * max_sessions * (max_queue_depth + max_connections_per_session))
6583immediate_data_pool_size        | Optional | number  | Number of immediate data buffers in the pool (default: 128 * max_sessions)
6584data_out_pool_size              | Optional | number  | Number of data out buffers in the pool (default: 16 * max_sessions)
6585
6586To load CHAP shared secret file, its path is required to specify explicitly in the parameter `auth_file`.
6587
6588Parameters `disable_chap` and `require_chap` are mutually exclusive. Parameters `no_discovery_auth`, `req_discovery_auth`,
6589`req_discovery_auth_mutual`, and `discovery_auth_group` are still available instead of `disable_chap`, `require_chap`,
6590`mutual_chap`, and `chap_group`, respectivey but will be removed in future releases.
6591
6592#### Example
6593
6594Example request:
6595
6596~~~json
6597{
6598  "params": {
6599    "allow_duplicated_isid": true,
6600    "default_time2retain": 60,
6601    "first_burst_length": 8192,
6602    "immediate_data": true,
6603    "node_base": "iqn.2016-06.io.spdk",
6604    "max_sessions": 128,
6605    "nop_timeout": 30,
6606    "nop_in_interval": 30,
6607    "auth_file": "/usr/local/etc/spdk/auth.conf",
6608    "disable_chap": true,
6609    "default_time2wait": 2
6610  },
6611  "jsonrpc": "2.0",
6612  "method": "iscsi_set_options",
6613  "id": 1
6614}
6615~~~
6616
6617Example response:
6618
6619~~~json
6620{
6621  "jsonrpc": "2.0",
6622  "id": 1,
6623  "result": true
6624}
6625~~~
6626
6627### iscsi_get_options method {#rpc_iscsi_get_options}
6628
6629Show global parameters of iSCSI targets.
6630
6631#### Parameters
6632
6633This method has no parameters.
6634
6635#### Example
6636
6637Example request:
6638
6639~~~json
6640request:
6641{
6642  "jsonrpc": "2.0",
6643  "method": "iscsi_get_options",
6644  "id": 1
6645}
6646~~~
6647
6648Example response:
6649
6650~~~json
6651{
6652  "jsonrpc": "2.0",
6653  "id": 1,
6654  "result": {
6655    "allow_duplicated_isid": true,
6656    "default_time2retain": 60,
6657    "first_burst_length": 8192,
6658    "immediate_data": true,
6659    "node_base": "iqn.2016-06.io.spdk",
6660    "mutual_chap": false,
6661    "nop_in_interval": 30,
6662    "chap_group": 0,
6663    "max_connections_per_session": 2,
6664    "max_queue_depth": 64,
6665    "nop_timeout": 30,
6666    "max_sessions": 128,
6667    "error_recovery_level": 0,
6668    "auth_file": "/usr/local/etc/spdk/auth.conf",
6669    "disable_chap": true,
6670    "default_time2wait": 2,
6671    "require_chap": false,
6672    "max_large_datain_per_connection": 64,
6673    "max_r2t_per_connection": 4
6674  }
6675}
6676~~~
6677
6678### scsi_get_devices {#rpc_scsi_get_devices}
6679
6680Display SCSI devices
6681
6682#### Parameters
6683
6684This method has no parameters.
6685
6686#### Example
6687
6688Example request:
6689
6690~~~json
6691{
6692  "jsonrpc": "2.0",
6693  "method": "scsi_get_devices",
6694  "id": 1
6695}
6696~~~
6697
6698Example response:
6699
6700~~~json
6701{
6702  "jsonrpc": "2.0",
6703  "id": 1,
6704  "result": [
6705    {
6706      "id": 0,
6707      "device_name": "iqn.2016-06.io.spdk:Target3"
6708    }
6709  ]
6710}
6711~~~
6712
6713### iscsi_set_discovery_auth method {#rpc_iscsi_set_discovery_auth}
6714
6715Set CHAP authentication for sessions dynamically.
6716
6717#### Parameters
6718
6719Name                        | Optional | Type    | Description
6720--------------------------- | -------- | --------| -----------
6721disable_chap                | Optional | boolean | CHAP for discovery session should be disabled (default: `false`)
6722require_chap                | Optional | boolean | CHAP for discovery session should be required (default: `false`)
6723mutual_chap                 | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`)
6724chap_group                  | Optional | number  | CHAP group ID for discovery session (default: 0)
6725
6726Parameters `disable_chap` and `require_chap` are mutually exclusive.
6727
6728#### Example
6729
6730Example request:
6731
6732~~~json
6733request:
6734{
6735  "params": {
6736    "chap_group": 1,
6737    "require_chap": true,
6738    "mutual_chap": true
6739  },
6740  "jsonrpc": "2.0",
6741  "method": "iscsi_set_discovery_auth",
6742  "id": 1
6743}
6744~~~
6745
6746Example response:
6747
6748~~~json
6749{
6750  "jsonrpc": "2.0",
6751  "id": 1,
6752  "result": true
6753}
6754~~~
6755
6756### iscsi_create_auth_group method {#rpc_iscsi_create_auth_group}
6757
6758Create an authentication group for CHAP authentication.
6759
6760#### Parameters
6761
6762Name                        | Optional | Type    | Description
6763--------------------------- | -------- | --------| -----------
6764tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6765secrets                     | Optional | array   | Array of @ref rpc_iscsi_create_auth_group_secret objects
6766
6767#### secret {#rpc_iscsi_create_auth_group_secret}
6768
6769Name                        | Optional | Type    | Description
6770--------------------------- | ---------| --------| -----------
6771user                        | Required | string  | Unidirectional CHAP name
6772secret                      | Required | string  | Unidirectional CHAP secret
6773muser                       | Optional | string  | Bidirectional CHAP name
6774msecret                     | Optional | string  | Bidirectional CHAP secret
6775
6776#### Example
6777
6778Example request:
6779
6780~~~json
6781{
6782  "params": {
6783    "secrets": [
6784      {
6785        "muser": "mu1",
6786        "secret": "s1",
6787        "user": "u1",
6788        "msecret": "ms1"
6789      }
6790    ],
6791    "tag": 2
6792  },
6793  "jsonrpc": "2.0",
6794  "method": "iscsi_create_auth_group",
6795  "id": 1
6796}
6797~~~
6798
6799Example response:
6800
6801~~~json
6802{
6803  "jsonrpc": "2.0",
6804  "id": 1,
6805  "result": true
6806}
6807~~~
6808
6809### iscsi_delete_auth_group method {#rpc_iscsi_delete_auth_group}
6810
6811Delete an existing authentication group for CHAP authentication.
6812
6813#### Parameters
6814
6815Name                        | Optional | Type    | Description
6816--------------------------- | -------- | --------| -----------
6817tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6818
6819#### Example
6820
6821Example request:
6822
6823~~~json
6824{
6825  "params": {
6826    "tag": 2
6827  },
6828  "jsonrpc": "2.0",
6829  "method": "iscsi_delete_auth_group",
6830  "id": 1
6831}
6832~~~
6833
6834Example response:
6835
6836~~~json
6837{
6838  "jsonrpc": "2.0",
6839  "id": 1,
6840  "result": true
6841}
6842~~~
6843
6844### iscsi_get_auth_groups {#rpc_iscsi_get_auth_groups}
6845
6846Show information about all existing authentication group for CHAP authentication.
6847
6848#### Parameters
6849
6850This method has no parameters.
6851
6852#### Result
6853
6854Array of objects describing authentication group.
6855
6856Name                        | Type    | Description
6857--------------------------- | --------| -----------
6858tag                         | number  | Authentication group tag
6859secrets                     | array   | Array of @ref rpc_iscsi_create_auth_group_secret objects
6860
6861#### Example
6862
6863Example request:
6864
6865~~~json
6866{
6867  "jsonrpc": "2.0",
6868  "method": "iscsi_get_auth_groups",
6869  "id": 1
6870}
6871~~~
6872
6873Example response:
6874
6875~~~json
6876{
6877  "jsonrpc": "2.0",
6878  "id": 1,
6879  "result": [
6880    {
6881      "secrets": [
6882        {
6883          "muser": "mu1",
6884          "secret": "s1",
6885          "user": "u1",
6886          "msecret": "ms1"
6887        }
6888      ],
6889      "tag": 1
6890    },
6891    {
6892      "secrets": [
6893        {
6894          "secret": "s2",
6895          "user": "u2"
6896        }
6897      ],
6898      "tag": 2
6899    }
6900  ]
6901}
6902~~~
6903
6904### iscsi_auth_group_add_secret {#rpc_iscsi_auth_group_add_secret}
6905
6906Add a secret to an existing authentication group for CHAP authentication.
6907
6908#### Parameters
6909
6910Name                        | Optional | Type    | Description
6911--------------------------- | -------- | --------| -----------
6912tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6913user                        | Required | string  | Unidirectional CHAP name
6914secret                      | Required | string  | Unidirectional CHAP secret
6915muser                       | Optional | string  | Bidirectional CHAP name
6916msecret                     | Optional | string  | Bidirectional CHAP secret
6917
6918#### Example
6919
6920Example request:
6921
6922~~~json
6923{
6924  "params": {
6925    "muser": "mu3",
6926    "secret": "s3",
6927    "tag": 2,
6928    "user": "u3",
6929    "msecret": "ms3"
6930  },
6931  "jsonrpc": "2.0",
6932  "method": "iscsi_auth_group_add_secret",
6933  "id": 1
6934}
6935~~~json
6936
6937Example response:
6938
6939~~~json
6940{
6941  "jsonrpc": "2.0",
6942  "id": 1,
6943  "result": true
6944}
6945~~~
6946
6947### iscsi_auth_group_remove_secret {#rpc_iscsi_auth_group_remove_secret}
6948
6949Remove a secret from an existing authentication group for CHAP authentication.
6950
6951#### Parameters
6952
6953Name                        | Optional | Type    | Description
6954--------------------------- | -------- | --------| -----------
6955tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6956user                        | Required | string  | Unidirectional CHAP name
6957
6958#### Example
6959
6960Example request:
6961
6962~~~json
6963{
6964  "params": {
6965    "tag": 2,
6966    "user": "u3"
6967  },
6968  "jsonrpc": "2.0",
6969  "method": "iscsi_auth_group_remove_secret",
6970  "id": 1
6971}
6972~~~
6973
6974Example response:
6975
6976~~~json
6977{
6978  "jsonrpc": "2.0",
6979  "id": 1,
6980  "result": true
6981}
6982~~~
6983
6984### iscsi_get_initiator_groups method {#rpc_iscsi_get_initiator_groups}
6985
6986Show information about all available initiator groups.
6987
6988#### Parameters
6989
6990This method has no parameters.
6991
6992#### Result
6993
6994Array of objects describing initiator groups.
6995
6996Name                        | Type    | Description
6997--------------------------- | --------| -----------
6998tag                         | number  | Initiator group tag
6999initiators                  | array   | Array of initiator hostnames or IP addresses
7000netmasks                    | array   | Array of initiator netmasks
7001
7002#### Example
7003
7004Example request:
7005
7006~~~json
7007{
7008  "jsonrpc": "2.0",
7009  "method": "iscsi_get_initiator_groups",
7010  "id": 1
7011}
7012~~~
7013
7014Example response:
7015
7016~~~json
7017{
7018  "jsonrpc": "2.0",
7019  "id": 1,
7020  "result": [
7021    {
7022      "initiators": [
7023        "iqn.2016-06.io.spdk:host1",
7024        "iqn.2016-06.io.spdk:host2"
7025      ],
7026      "tag": 1,
7027      "netmasks": [
7028        "192.168.1.0/24"
7029      ]
7030    }
7031  ]
7032}
7033~~~
7034
7035### iscsi_create_initiator_group method {#rpc_iscsi_create_initiator_group}
7036
7037Add an initiator group.
7038
7039#### Parameters
7040
7041Name                        | Optional | Type    | Description
7042--------------------------- | -------- | --------| -----------
7043tag                         | Required | number  | Initiator group tag (unique, integer > 0)
7044initiators                  | Required | array   | Not empty array of initiator hostnames or IP addresses
7045netmasks                    | Required | array   | Not empty array of initiator netmasks
7046
7047#### Example
7048
7049Example request:
7050
7051~~~json
7052{
7053  "params": {
7054    "initiators": [
7055      "iqn.2016-06.io.spdk:host1",
7056      "iqn.2016-06.io.spdk:host2"
7057    ],
7058    "tag": 1,
7059    "netmasks": [
7060      "192.168.1.0/24"
7061    ]
7062  },
7063  "jsonrpc": "2.0",
7064  "method": "iscsi_create_initiator_group",
7065  "id": 1
7066}
7067~~~
7068
7069Example response:
7070
7071~~~json
7072response:
7073{
7074  "jsonrpc": "2.0",
7075  "id": 1,
7076  "result": true
7077}
7078~~~
7079
7080### iscsi_delete_initiator_group method {#rpc_iscsi_delete_initiator_group}
7081
7082Delete an existing initiator group.
7083
7084#### Parameters
7085
7086Name                        | Optional | Type    | Description
7087--------------------------- | -------- | --------| -----------
7088tag                         | Required | number  | Initiator group tag (unique, integer > 0)
7089
7090#### Example
7091
7092Example request:
7093
7094~~~json
7095{
7096  "params": {
7097    "tag": 1
7098  },
7099  "jsonrpc": "2.0",
7100  "method": "iscsi_delete_initiator_group",
7101  "id": 1
7102}
7103~~~
7104
7105Example response:
7106
7107~~~json
7108{
7109  "jsonrpc": "2.0",
7110  "id": 1,
7111  "result": true
7112}
7113~~~
7114
7115### iscsi_initiator_group_add_initiators method {#rpc_iscsi_initiator_group_add_initiators}
7116
7117Add initiators to an existing initiator group.
7118
7119#### Parameters
7120
7121Name                        | Optional | Type    | Description
7122--------------------------- | -------- | --------| -----------
7123tag                         | Required | number  | Existing initiator group tag.
7124initiators                  | Optional | array   | Array of initiator hostnames or IP addresses
7125netmasks                    | Optional | array   | Array of initiator netmasks
7126
7127#### Example
7128
7129Example request:
7130
7131~~~json
7132request:
7133{
7134  "params": {
7135    "initiators": [
7136      "iqn.2016-06.io.spdk:host3"
7137    ],
7138    "tag": 1,
7139    "netmasks": [
7140      "255.255.255.1"
7141    ]
7142  },
7143  "jsonrpc": "2.0",
7144  "method": "iscsi_initiator_group_add_initiators",
7145  "id": 1
7146}
7147~~~
7148
7149Example response:
7150
7151~~~json
7152response:
7153{
7154  "jsonrpc": "2.0",
7155  "id": 1,
7156  "result": true
7157}
7158~~~
7159
7160### iscsi_initiator_group_remove_initiators method {#rpc_iscsi_initiator_group_remove_initiators}
7161
7162Remove initiators from an initiator group.
7163
7164#### Parameters
7165
7166Name                        | Optional | Type    | Description
7167--------------------------- | -------- | --------| -----------
7168tag                         | Required | number  | Existing initiator group tag.
7169initiators                  | Optional | array   | Array of initiator hostnames or IP addresses
7170netmasks                    | Optional | array   | Array of initiator netmasks
7171
7172#### Example
7173
7174Example request:
7175
7176~~~json
7177request:
7178{
7179  "params": {
7180    "initiators": [
7181      "iqn.2016-06.io.spdk:host3"
7182    ],
7183    "tag": 1,
7184    "netmasks": [
7185      "255.255.255.1"
7186    ]
7187  },
7188  "jsonrpc": "2.0",
7189  "method": "iscsi_initiator_group_remove_initiators",
7190  "id": 1
7191}
7192~~~
7193
7194Example response:
7195
7196~~~json
7197response:
7198{
7199  "jsonrpc": "2.0",
7200  "id": 1,
7201  "result": true
7202}
7203~~~
7204
7205### iscsi_get_target_nodes method {#rpc_iscsi_get_target_nodes}
7206
7207Show information about all available iSCSI target nodes.
7208
7209#### Parameters
7210
7211This method has no parameters.
7212
7213#### Result
7214
7215Array of objects describing target node.
7216
7217Name                        | Type    | Description
7218--------------------------- | --------| -----------
7219name                        | string  | Target node name (ASCII)
7220alias_name                  | string  | Target node alias name (ASCII)
7221pg_ig_maps                  | array   | Array of Portal_Group_Tag:Initiator_Group_Tag mappings
7222luns                        | array   | Array of Bdev names to LUN ID mappings
7223queue_depth                 | number  | Target queue depth
7224disable_chap                | boolean | CHAP authentication should be disabled for this target
7225require_chap                | boolean | CHAP authentication should be required for this target
7226mutual_chap                 | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`)
7227chap_group                  | number  | Authentication group ID for this target node
7228header_digest               | boolean | Header Digest should be required for this target node
7229data_digest                 | boolean | Data Digest should be required for this target node
7230
7231#### Example
7232
7233Example request:
7234
7235~~~json
7236{
7237  "jsonrpc": "2.0",
7238  "method": "iscsi_get_target_nodes",
7239  "id": 1
7240}
7241~~~
7242
7243Example response:
7244
7245~~~json
7246{
7247  "jsonrpc": "2.0",
7248  "id": 1,
7249  "result": [
7250    {
7251      "luns": [
7252        {
7253          "lun_id": 0,
7254          "bdev_name": "Nvme0n1"
7255        }
7256      ],
7257      "mutual_chap": false,
7258      "name": "iqn.2016-06.io.spdk:target1",
7259      "alias_name": "iscsi-target1-alias",
7260      "require_chap": false,
7261      "chap_group": 0,
7262      "pg_ig_maps": [
7263        {
7264          "ig_tag": 1,
7265          "pg_tag": 1
7266        }
7267      ],
7268      "data_digest": false,
7269      "disable_chap": false,
7270      "header_digest": false,
7271      "queue_depth": 64
7272    }
7273  ]
7274}
7275~~~
7276
7277### iscsi_create_target_node method {#rpc_iscsi_create_target_node}
7278
7279Add an iSCSI target node.
7280
7281#### Parameters
7282
7283Name                        | Optional | Type    | Description
7284--------------------------- | -------- | --------| -----------
7285name                        | Required | string  | Target node name (ASCII)
7286alias_name                  | Required | string  | Target node alias name (ASCII)
7287pg_ig_maps                  | Required | array   | Array of (Portal_Group_Tag:Initiator_Group_Tag) mappings
7288luns                        | Required | array   | Array of Bdev names to LUN ID mappings
7289queue_depth                 | Required | number  | Target queue depth
7290disable_chap                | Optional | boolean | CHAP authentication should be disabled for this target
7291require_chap                | Optional | boolean | CHAP authentication should be required for this target
7292mutual_chap                 | Optional | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`)
7293chap_group                  | Optional | number  | Authentication group ID for this target node
7294header_digest               | Optional | boolean | Header Digest should be required for this target node
7295data_digest                 | Optional | boolean | Data Digest should be required for this target node
7296
7297Parameters `disable_chap` and `require_chap` are mutually exclusive.
7298
7299#### Example
7300
7301Example request:
7302
7303~~~json
7304{
7305  "params": {
7306    "luns": [
7307      {
7308        "lun_id": 0,
7309        "bdev_name": "Nvme0n1"
7310      }
7311    ],
7312    "mutual_chap": true,
7313    "name": "target2",
7314    "alias_name": "iscsi-target2-alias",
7315    "pg_ig_maps": [
7316      {
7317        "ig_tag": 1,
7318        "pg_tag": 1
7319      },
7320      {
7321        "ig_tag": 2,
7322        "pg_tag": 2
7323      }
7324    ],
7325    "data_digest": true,
7326    "disable_chap": true,
7327    "header_digest": true,
7328    "queue_depth": 24
7329  },
7330  "jsonrpc": "2.0",
7331  "method": "iscsi_create_target_node",
7332  "id": 1
7333}
7334~~~
7335
7336Example response:
7337
7338~~~json
7339{
7340  "jsonrpc": "2.0",
7341  "id": 1,
7342  "result": true
7343}
7344~~~
7345
7346### iscsi_target_node_set_auth method {#rpc_iscsi_target_node_set_auth}
7347
7348Set CHAP authentication to an existing iSCSI target node.
7349
7350#### Parameters
7351
7352Name                        | Optional | Type    | Description
7353--------------------------- | -------- | --------| -----------
7354name                        | Required | string  | Target node name (ASCII)
7355disable_chap                | Optional | boolean | CHAP authentication should be disabled for this target
7356require_chap                | Optional | boolean | CHAP authentication should be required for this target
7357mutual_chap                 | Optional | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`)
7358chap_group                  | Optional | number  | Authentication group ID for this target node
7359
7360Parameters `disable_chap` and `require_chap` are mutually exclusive.
7361
7362#### Example
7363
7364Example request:
7365
7366~~~json
7367{
7368  "params": {
7369    "chap_group": 1,
7370    "require_chap": true,
7371    "name": "iqn.2016-06.io.spdk:target1",
7372    "mutual_chap": true
7373  },
7374  "jsonrpc": "2.0",
7375  "method": "iscsi_target_node_set_auth",
7376  "id": 1
7377}
7378~~~
7379
7380Example response:
7381
7382~~~json
7383{
7384  "jsonrpc": "2.0",
7385  "id": 1,
7386  "result": true
7387}
7388~~~
7389
7390### iscsi_target_node_add_pg_ig_maps method {#rpc_iscsi_target_node_add_pg_ig_maps}
7391
7392Add initiator group to portal group mappings to an existing iSCSI target node.
7393
7394#### Parameters
7395
7396Name                        | Optional | Type    | Description
7397--------------------------- | -------- | --------| -----------
7398name                        | Required | string  | Target node name (ASCII)
7399pg_ig_maps                  | Required | array   | Not empty array of initiator to portal group mappings objects
7400
7401Portal to Initiator group mappings object:
7402
7403Name                        | Optional | Type    | Description
7404--------------------------- | -------- | --------| -----------
7405ig_tag                      | Required | number  | Existing initiator group tag
7406pg_tag                      | Required | number  | Existing portal group tag
7407
7408#### Example
7409
7410Example request:
7411
7412~~~json
7413{
7414  "params": {
7415    "pg_ig_maps": [
7416      {
7417        "ig_tag": 1,
7418        "pg_tag": 1
7419      },
7420      {
7421        "ig_tag": 2,
7422        "pg_tag": 2
7423      },
7424      {
7425        "ig_tag": 3,
7426        "pg_tag": 3
7427      }
7428    ],
7429    "name": "iqn.2016-06.io.spdk:target3"
7430  },
7431  "jsonrpc": "2.0",
7432  "method": "iscsi_target_node_add_pg_ig_maps",
7433  "id": 1
7434}
7435~~~
7436
7437Example response:
7438
7439~~~json
7440{
7441  "jsonrpc": "2.0",
7442  "id": 1,
7443  "result": true
7444}
7445~~~
7446
7447### iscsi_target_node_remove_pg_ig_maps method {#rpc_iscsi_target_node_remove_pg_ig_maps}
7448
7449Delete initiator group to portal group mappings from an existing iSCSI target node.
7450
7451#### Parameters
7452
7453Name                        | Optional | Type    | Description
7454--------------------------- | -------- | --------| -----------
7455name                        | Required | string  | Target node name (ASCII)
7456pg_ig_maps                  | Required | array   | Not empty array of Portal to Initiator group mappings objects
7457
7458Portal to Initiator group mappings object:
7459
7460Name                        | Optional | Type    | Description
7461--------------------------- | -------- | --------| -----------
7462ig_tag                      | Required | number  | Existing initiator group tag
7463pg_tag                      | Required | number  | Existing portal group tag
7464
7465#### Example
7466
7467Example request:
7468
7469~~~json
7470{
7471  "params": {
7472    "pg_ig_maps": [
7473      {
7474        "ig_tag": 1,
7475        "pg_tag": 1
7476      },
7477      {
7478        "ig_tag": 2,
7479        "pg_tag": 2
7480      },
7481      {
7482        "ig_tag": 3,
7483        "pg_tag": 3
7484      }
7485    ],
7486    "name": "iqn.2016-06.io.spdk:target3"
7487  },
7488  "jsonrpc": "2.0",
7489  "method": "iscsi_target_node_remove_pg_ig_maps",
7490  "id": 1
7491}
7492~~~
7493
7494Example response:
7495
7496~~~json
7497{
7498  "jsonrpc": "2.0",
7499  "id": 1,
7500  "result": true
7501}
7502~~~
7503
7504### iscsi_delete_target_node method {#rpc_iscsi_delete_target_node}
7505
7506Delete an iSCSI target node.
7507
7508#### Parameters
7509
7510Name                        | Optional | Type    | Description
7511--------------------------- | -------- | --------| -----------
7512name                        | Required | string  | Target node name (ASCII)
7513
7514#### Example
7515
7516Example request:
7517
7518~~~json
7519{
7520  "params": {
7521    "name": "iqn.2016-06.io.spdk:target1"
7522  },
7523  "jsonrpc": "2.0",
7524  "method": "iscsi_delete_target_node",
7525  "id": 1
7526}
7527~~~
7528
7529Example response:
7530
7531~~~json
7532{
7533  "jsonrpc": "2.0",
7534  "id": 1,
7535  "result": true
7536}
7537~~~
7538
7539### iscsi_get_portal_groups method {#rpc_iscsi_get_portal_groups}
7540
7541Show information about all available portal groups.
7542
7543#### Parameters
7544
7545This method has no parameters.
7546
7547#### Example
7548
7549Example request:
7550
7551~~~json
7552request:
7553{
7554  "jsonrpc": "2.0",
7555  "method": "iscsi_get_portal_groups",
7556  "id": 1
7557}
7558~~~
7559
7560Example response:
7561
7562~~~json
7563{
7564  "jsonrpc": "2.0",
7565  "id": 1,
7566  "result": [
7567    {
7568      "portals": [
7569        {
7570          "host": "127.0.0.1",
7571          "port": "3260"
7572        }
7573      ],
7574      "tag": 1,
7575      "private": false
7576    }
7577  ]
7578}
7579~~~
7580
7581### iscsi_create_portal_group method {#rpc_iscsi_create_portal_group}
7582
7583Add a portal group.
7584
7585#### Parameters
7586
7587Name                        | Optional | Type    | Description
7588--------------------------- | -------- | --------| -----------
7589tag                         | Required | number  | Portal group tag
7590portals                     | Required | array   | Not empty array of portals
7591private                     | Optional | boolean | When true, portals in this group are not returned by a discovery session. Used for login redirection. (default: `false`)
7592wait                        | Optional | boolean | When true, do not listen on portals until it is started explicitly. (default: `false`)
7593
7594Portal object
7595
7596Name                        | Optional | Type    | Description
7597--------------------------- | -------- | --------| -----------
7598host                        | Required | string  | Hostname or IP address
7599port                        | Required | string  | Port number
7600
7601#### Example
7602
7603Example request:
7604
7605~~~json
7606{
7607  "params": {
7608    "portals": [
7609      {
7610        "host": "127.0.0.1",
7611        "port": "3260"
7612      }
7613    ],
7614    "tag": 1
7615  },
7616  "jsonrpc": "2.0",
7617  "method": "iscsi_create_portal_group",
7618  "id": 1
7619}
7620~~~
7621
7622Example response:
7623
7624~~~json
7625{
7626  "jsonrpc": "2.0",
7627  "id": 1,
7628  "result": true
7629}
7630~~~
7631
7632### iscsi_start_portal_group method {#rpc_iscsi_start_portal_group}
7633
7634Start listening on portals if the portal group is not started yet, or do nothing
7635if the portal group already started. Return a success response for both cases.
7636
7637#### Parameters
7638
7639Name                        | Optional | Type    | Description
7640--------------------------- | -------- | --------| -----------
7641tag                         | Required | number  | Existing portal group tag
7642
7643#### Example
7644
7645Example request:
7646
7647~~~json
7648{
7649  "params": {
7650    "tag": 1
7651  },
7652  "jsonrpc": "2.0",
7653  "method": "iscsi_start_portal_group",
7654  "id": 1
7655}
7656~~~
7657
7658Example response:
7659
7660~~~json
7661{
7662  "jsonrpc": "2.0",
7663  "id": 1,
7664  "result": true
7665}
7666~~~
7667
7668### iscsi_delete_portal_group method {#rpc_iscsi_delete_portal_group}
7669
7670Delete an existing portal group.
7671
7672#### Parameters
7673
7674Name                        | Optional | Type    | Description
7675--------------------------- | -------- | --------| -----------
7676tag                         | Required | number  | Existing portal group tag
7677
7678#### Example
7679
7680Example request:
7681
7682~~~json
7683{
7684  "params": {
7685    "tag": 1
7686  },
7687  "jsonrpc": "2.0",
7688  "method": "iscsi_delete_portal_group",
7689  "id": 1
7690}
7691~~~
7692
7693Example response:
7694
7695~~~json
7696{
7697  "jsonrpc": "2.0",
7698  "id": 1,
7699  "result": true
7700}
7701~~~
7702
7703### iscsi_portal_group_set_auth method {#rpc_iscsi_portal_group_set_auth}
7704
7705Set CHAP authentication for discovery sessions specific for the existing iSCSI portal group.
7706This RPC overwrites the setting by the global parameters for the iSCSI portal group.
7707
7708#### Parameters
7709
7710Name                        | Optional | Type    | Description
7711--------------------------- | -------- | --------| -----------
7712disable_chap                | Optional | boolean | CHAP for discovery session should be disabled (default: `false`)
7713require_chap                | Optional | boolean | CHAP for discovery session should be required (default: `false`)
7714mutual_chap                 | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`)
7715chap_group                  | Optional | number  | CHAP group ID for discovery session (default: 0)
7716
7717Parameters `disable_chap` and `require_chap` are mutually exclusive.
7718
7719#### Example
7720
7721Example request:
7722
7723~~~json
7724request:
7725{
7726  "params": {
7727    "tag": 1,
7728    "chap_group": 1,
7729    "require_chap": true,
7730    "mutual_chap": true
7731  },
7732  "jsonrpc": "2.0",
7733  "method": "iscsi_portal_group_set_auth",
7734  "id": 1
7735}
7736~~~
7737
7738Example response:
7739
7740~~~json
7741{
7742  "jsonrpc": "2.0",
7743  "id": 1,
7744  "result": true
7745}
7746~~~
7747
7748### iscsi_get_connections method {#rpc_iscsi_get_connections}
7749
7750Show information about all active connections.
7751
7752#### Parameters
7753
7754This method has no parameters.
7755
7756#### Results
7757
7758Array of objects describing iSCSI connection.
7759
7760Name                        | Type    | Description
7761--------------------------- | --------| -----------
7762id                          | number  | Index (used for TTT - Target Transfer Tag)
7763cid                         | number  | CID (Connection ID)
7764tsih                        | number  | TSIH (Target Session Identifying Handle)
7765lcore_id                    | number  | Core number on which the iSCSI connection runs
7766initiator_addr              | string  | Initiator address
7767target_addr                 | string  | Target address
7768target_node_name            | string  | Target node name (ASCII) without prefix
7769
7770#### Example
7771
7772Example request:
7773
7774~~~json
7775{
7776  "jsonrpc": "2.0",
7777  "method": "iscsi_get_connections",
7778  "id": 1
7779}
7780~~~
7781
7782Example response:
7783
7784~~~json
7785{
7786  "jsonrpc": "2.0",
7787  "id": 1,
7788  "result": [
7789    {
7790      "tsih": 4,
7791      "cid": 0,
7792      "target_node_name": "target1",
7793      "lcore_id": 0,
7794      "initiator_addr": "10.0.0.2",
7795      "target_addr": "10.0.0.1",
7796      "id": 0
7797    }
7798  ]
7799}
7800~~~
7801
7802### iscsi_get_stats method {#iscsi_get_stats}
7803
7804Show stat information of iSCSI connections.
7805
7806#### Parameters
7807
7808This method has no parameters.
7809
7810#### Results
7811
7812Stat information of iSCSI connections.
7813
7814Name                        | Type    | Description
7815--------------------------- | --------| -----------
7816invalid                     | number  | The number of invalid connections
7817running                     | number  | The number of running connections
7818exiting                     | number  | The number of exiting connections
7819exited                      | number  | The number of exited connections
7820
7821#### Example
7822
7823Example request:
7824
7825~~~json
7826{
7827  "jsonrpc": "2.0",
7828  "method": "iscsi_get_stats",
7829  "id": 1
7830}
7831~~~
7832
7833Example response:
7834
7835~~~json
7836{
7837  "jsonrpc": "2.0",
7838  "id": 1,
7839  "result":
7840    {
7841      "invalid": 0,
7842      "running": 5,
7843      "exiting": 0,
7844      "exited": 0
7845    }
7846
7847}
7848~~~
7849
7850### iscsi_target_node_add_lun method {#rpc_iscsi_target_node_add_lun}
7851
7852Add an LUN to an existing iSCSI target node.
7853
7854#### Parameters
7855
7856Name                        | Optional | Type    | Description
7857--------------------------- | -------- | --------| -----------
7858name                        | Required | string  | Target node name (ASCII)
7859bdev_name                   | Required | string  | bdev name to be added as a LUN
7860lun_id                      | Optional | number  | LUN ID (default: first free ID)
7861
7862#### Example
7863
7864Example request:
7865
7866~~~json
7867{
7868  "params": {
7869    "lun_id": 2,
7870    "name": "iqn.2016-06.io.spdk:target1",
7871    "bdev_name": "Malloc0"
7872  },
7873  "jsonrpc": "2.0",
7874  "method": "iscsi_target_node_add_lun",
7875  "id": 1
7876}
7877~~~
7878
7879Example response:
7880
7881~~~json
7882{
7883  "jsonrpc": "2.0",
7884  "id": 1,
7885  "result": true
7886}
7887~~~
7888
7889### iscsi_target_node_set_redirect method {#rpc_iscsi_target_node_set_redirect}
7890
7891Update redirect portal of the primary portal group for the target node,
7892
7893#### Parameters
7894
7895Name                        | Optional | Type    | Description
7896--------------------------- | -------- | --------| -----------
7897name                        | Required | string  | Target node name (ASCII)
7898pg_tag                      | Required | number  | Existing portal group tag
7899redirect_host               | Optional | string  | Numeric IP address to which the target node is redirected
7900redirect_port               | Optional | string  | Numeric TCP port to which the target node is redirected
7901
7902If both redirect_host and redirect_port are omitted, clear the redirect portal.
7903
7904#### Example
7905
7906Example request:
7907
7908~~~json
7909{
7910  "params": {
7911    "name": "iqn.2016-06.io.spdk:target1",
7912    "pg_tag": 1,
7913    "redirect_host": "10.0.0.3",
7914    "redirect_port": "3260"
7915  },
7916  "jsonrpc": "2.0",
7917  "method": "iscsi_target_node_set_redirect",
7918  "id": 1
7919}
7920~~~
7921
7922Example response:
7923
7924~~~json
7925{
7926  "jsonrpc": "2.0",
7927  "id": 1,
7928  "result": true
7929}
7930~~~
7931
7932### iscsi_target_node_request_logout method {#rpc_iscsi_target_node_request_logout}
7933
7934For the target node, request connections whose portal group tag match to logout,
7935or request all connections to logout if portal group tag is omitted.
7936
7937#### Parameters
7938
7939Name                        | Optional | Type    | Description
7940--------------------------- | -------- | --------| -----------
7941name                        | Required | string  | Target node name (ASCII)
7942pg_tag                      | Optional | number  | Existing portal group tag
7943
7944#### Example
7945
7946Example request:
7947
7948~~~json
7949{
7950  "params": {
7951    "name": "iqn.2016-06.io.spdk:target1",
7952    "pg_tag": 1
7953  },
7954  "jsonrpc": "2.0",
7955  "method": "iscsi_target_node_request_logout",
7956  "id": 1
7957}
7958~~~
7959
7960Example response:
7961
7962~~~json
7963{
7964  "jsonrpc": "2.0",
7965  "id": 1,
7966  "result": true
7967}
7968~~~
7969
7970## NVMe-oF Target {#jsonrpc_components_nvmf_tgt}
7971
7972### nvmf_create_transport method {#rpc_nvmf_create_transport}
7973
7974Initialize an NVMe-oF transport with the given options.
7975
7976#### Parameters
7977
7978Name                        | Optional | Type    | Description
7979--------------------------- | -------- | --------| -----------
7980trtype                      | Required | string  | Transport type (ex. RDMA)
7981tgt_name                    | Optional | string  | Parent NVMe-oF target name.
7982max_queue_depth             | Optional | number  | Max number of outstanding I/O per queue
7983max_io_qpairs_per_ctrlr     | Optional | number  | Max number of IO qpairs per controller
7984in_capsule_data_size        | Optional | number  | Max number of in-capsule data size
7985max_io_size                 | Optional | number  | Max I/O size (bytes)
7986io_unit_size                | Optional | number  | I/O unit size (bytes)
7987max_aq_depth                | Optional | number  | Max number of admin cmds per AQ
7988num_shared_buffers          | Optional | number  | The number of pooled data buffers available to the transport
7989buf_cache_size              | Optional | number  | The number of shared buffers to reserve for each poll group
7990num_cqe                     | Optional | number  | The number of CQ entries. Only used when no_srq=true (RDMA only)
7991max_srq_depth               | Optional | number  | The number of elements in a per-thread shared receive queue (RDMA only)
7992no_srq                      | Optional | boolean | Disable shared receive queue even for devices that support it. (RDMA only)
7993c2h_success                 | Optional | boolean | Disable C2H success optimization (TCP only)
7994dif_insert_or_strip         | Optional | boolean | Enable DIF insert for write I/O and DIF strip for read I/O DIF
7995sock_priority               | Optional | number  | The socket priority of the connection owned by this transport (TCP only)
7996acceptor_backlog            | Optional | number  | The number of pending connections allowed in backlog before failing new connection attempts (RDMA only)
7997abort_timeout_sec           | Optional | number  | Abort execution timeout value, in seconds
7998no_wr_batching              | Optional | boolean | Disable work requests batching (RDMA only)
7999control_msg_num             | Optional | number  | The number of control messages per poll group (TCP only)
8000disable_mappable_bar0       | Optional | boolean | disable client mmap() of BAR0 (VFIO-USER only)
8001disable_adaptive_irq        | Optional | boolean | Disable adaptive interrupt feature (VFIO-USER only)
8002disable_shadow_doorbells    | Optional | boolean | disable shadow doorbell support (VFIO-USER only)
8003zcopy                       | Optional | boolean | Use zero-copy operations if the underlying bdev supports them
8004ack_timeout                 | Optional | number  | ACK timeout in milliseconds
8005
8006#### Example
8007
8008Example request:
8009
8010~~~json
8011{
8012  "jsonrpc": "2.0",
8013  "method": "nvmf_create_transport",
8014  "id": 1,
8015  "params": {
8016    "trtype": "RDMA",
8017    "max_queue_depth": 32
8018  }
8019}
8020~~~
8021
8022Example response:
8023
8024~~~json
8025{
8026  "jsonrpc": "2.0",
8027  "id": 1,
8028  "result": true
8029}
8030~~~
8031
8032### nvmf_get_subsystems method {#rpc_nvmf_get_subsystems}
8033
8034#### Parameters
8035
8036Name                        | Optional | Type        | Description
8037--------------------------- | -------- | ------------| -----------
8038tgt_name                    | Optional | string      | Parent NVMe-oF target name.
8039
8040#### Example
8041
8042Example request:
8043
8044~~~json
8045{
8046  "jsonrpc": "2.0",
8047  "id": 1,
8048  "method": "nvmf_get_subsystems"
8049}
8050~~~
8051
8052Example response:
8053
8054~~~json
8055{
8056  "jsonrpc": "2.0",
8057  "id": 1,
8058  "result": [
8059    {
8060      "nqn": "nqn.2014-08.org.nvmexpress.discovery",
8061      "subtype": "Discovery"
8062      "listen_addresses": [],
8063      "hosts": [],
8064      "allow_any_host": true
8065    },
8066    {
8067      "nqn": "nqn.2016-06.io.spdk:cnode1",
8068      "subtype": "NVMe",
8069      "listen_addresses": [
8070        {
8071          "trtype": "RDMA",
8072          "adrfam": "IPv4",
8073          "traddr": "192.168.0.123",
8074          "trsvcid": "4420"
8075        }
8076      ],
8077      "hosts": [
8078        {"nqn": "nqn.2016-06.io.spdk:host1"}
8079      ],
8080      "allow_any_host": false,
8081      "serial_number": "abcdef",
8082      "model_number": "ghijklmnop",
8083      "namespaces": [
8084        {"nsid": 1, "name": "Malloc2"},
8085        {"nsid": 2, "name": "Nvme0n1"}
8086      ]
8087    }
8088  ]
8089}
8090~~~
8091
8092### nvmf_create_subsystem method {#rpc_nvmf_create_subsystem}
8093
8094Construct an NVMe over Fabrics target subsystem.
8095
8096#### Parameters
8097
8098Name                       | Optional | Type        | Description
8099-------------------------- | -------- | ----------- | -----------
8100nqn                        | Required | string      | Subsystem NQN
8101tgt_name                   | Optional | string      | Parent NVMe-oF target name.
8102serial_number              | Optional | string      | Serial number of virtual controller
8103model_number               | Optional | string      | Model number of virtual controller
8104max_namespaces             | Optional | number      | Maximum number of namespaces that can be attached to the subsystem. Default: 32 (also used if user specifies 0)
8105allow_any_host             | Optional | boolean     | Allow any host (`true`) or enforce allowed host list (`false`). Default: `false`.
8106ana_reporting              | Optional | boolean     | Enable ANA reporting feature (default: `false`).
8107min_cntlid                 | Optional | number      | Minimum controller ID. Default: 1
8108max_cntlid                 | Optional | number      | Maximum controller ID. Default: 0xffef
8109max_discard_size_kib       | Optional | number      | Maximum discard size (Kib). Default: 0
8110max_write_zeroes_size_kib  | Optional | number      | Maximum write_zeroes size (Kib). Default: 0
8111
8112#### Example
8113
8114Example request:
8115
8116~~~json
8117{
8118  "jsonrpc": "2.0",
8119  "id": 1,
8120  "method": "nvmf_create_subsystem",
8121  "params": {
8122    "nqn": "nqn.2016-06.io.spdk:cnode1",
8123    "allow_any_host": false,
8124    "serial_number": "abcdef",
8125    "model_number": "ghijklmnop"
8126  }
8127}
8128~~~
8129
8130Example response:
8131
8132~~~json
8133{
8134  "jsonrpc": "2.0",
8135  "id": 1,
8136  "result": true
8137}
8138~~~
8139
8140### nvmf_delete_subsystem method {#rpc_nvmf_delete_subsystem}
8141
8142Delete an existing NVMe-oF subsystem.
8143
8144#### Parameters
8145
8146Parameter              | Optional | Type        | Description
8147---------------------- | -------- | ----------- | -----------
8148nqn                    | Required | string      | Subsystem NQN to delete.
8149tgt_name               | Optional | string      | Parent NVMe-oF target name.
8150
8151#### Example
8152
8153Example request:
8154
8155~~~json
8156{
8157  "jsonrpc": "2.0",
8158  "id": 1,
8159  "method": "nvmf_delete_subsystem",
8160  "params": {
8161    "nqn": "nqn.2016-06.io.spdk:cnode1"
8162  }
8163}
8164~~~
8165
8166Example response:
8167
8168~~~json
8169{
8170  "jsonrpc": "2.0",
8171  "id": 1,
8172  "result": true
8173}
8174~~~
8175
8176### nvmf_subsystem_add_listener  method {#rpc_nvmf_subsystem_add_listener}
8177
8178Add a new listen address to an NVMe-oF subsystem.
8179
8180#### Parameters
8181
8182Name                    | Optional | Type        | Description
8183----------------------- | -------- | ----------- | -----------
8184nqn                     | Required | string      | Subsystem NQN
8185tgt_name                | Optional | string      | Parent NVMe-oF target name.
8186listen_address          | Required | object      | @ref rpc_nvmf_listen_address object
8187secure_channel          | Optional | bool        | Whether all connections immediately attempt to establish a secure channel
8188
8189#### listen_address {#rpc_nvmf_listen_address}
8190
8191The listen_address is used for adding the listeners to the NVMe-oF target
8192and for referring to discovery services on other targets.
8193
8194Name                    | Optional | Type        | Description
8195----------------------- | -------- | ----------- | -----------
8196trtype                  | Required | string      | Transport type ("RDMA")
8197adrfam                  | Required | string      | Address family ("IPv4", "IPv6", "IB", or "FC")
8198traddr                  | Required | string      | Transport address
8199trsvcid                 | Optional | string      | Transport service ID (required for RDMA or TCP)
8200
8201#### Example
8202
8203Example request:
8204
8205~~~json
8206{
8207  "jsonrpc": "2.0",
8208  "id": 1,
8209  "method": "nvmf_subsystem_add_listener",
8210  "params": {
8211    "nqn": "nqn.2016-06.io.spdk:cnode1",
8212    "listen_address": {
8213      "trtype": "RDMA",
8214      "adrfam": "IPv4",
8215      "traddr": "192.168.0.123",
8216      "trsvcid": "4420"
8217    }
8218  }
8219}
8220~~~
8221
8222Example response:
8223
8224~~~json
8225{
8226  "jsonrpc": "2.0",
8227  "id": 1,
8228  "result": true
8229}
8230~~~
8231
8232### nvmf_subsystem_remove_listener  method {#rpc_nvmf_subsystem_remove_listener}
8233
8234Remove a listen address from an NVMe-oF subsystem.
8235
8236#### Parameters
8237
8238Name                    | Optional | Type        | Description
8239----------------------- | -------- | ----------- | -----------
8240nqn                     | Required | string      | Subsystem NQN
8241tgt_name                | Optional | string      | Parent NVMe-oF target name.
8242listen_address          | Required | object      | @ref rpc_nvmf_listen_address object
8243
8244#### Example
8245
8246Example request:
8247
8248~~~json
8249{
8250  "jsonrpc": "2.0",
8251  "id": 1,
8252  "method": "nvmf_subsystem_remove_listener",
8253  "params": {
8254    "nqn": "nqn.2016-06.io.spdk:cnode1",
8255    "listen_address": {
8256      "trtype": "RDMA",
8257      "adrfam": "IPv4",
8258      "traddr": "192.168.0.123",
8259      "trsvcid": "4420"
8260    }
8261  }
8262}
8263~~~
8264
8265Example response:
8266
8267~~~json
8268{
8269  "jsonrpc": "2.0",
8270  "id": 1,
8271  "result": true
8272}
8273~~~
8274
8275### nvmf_subsystem_listener_set_ana_state  method {#rpc_nvmf_subsystem_listener_set_ana_state}
8276
8277Set ANA state of a listener for an NVMe-oF subsystem. Only the ANA state of the specified ANA
8278group is updated, or ANA states of all ANA groups if ANA group is not specified.
8279
8280#### Parameters
8281
8282Name                    | Optional | Type        | Description
8283----------------------- | -------- | ----------- | -----------
8284nqn                     | Required | string      | Subsystem NQN
8285tgt_name                | Optional | string      | Parent NVMe-oF target name.
8286listen_address          | Required | object      | @ref rpc_nvmf_listen_address object
8287ana_state               | Required | string      | ANA state to set ("optimized", "non_optimized", or "inaccessible")
8288anagrpid                | Optional | number      | ANA group ID
8289
8290#### Example
8291
8292Example request:
8293
8294~~~json
8295{
8296  "jsonrpc": "2.0",
8297  "id": 1,
8298  "method": "nvmf_subsystem_listener_set_ana_state",
8299  "params": {
8300    "nqn": "nqn.2016-06.io.spdk:cnode1",
8301    "listen_address": {
8302      "trtype": "RDMA",
8303      "adrfam": "IPv4",
8304      "traddr": "192.168.0.123",
8305      "trsvcid": "4420"
8306    },
8307    "ana_state", "inaccessible"
8308  }
8309}
8310~~~
8311
8312Example response:
8313
8314~~~json
8315{
8316  "jsonrpc": "2.0",
8317  "id": 1,
8318  "result": true
8319}
8320~~~
8321
8322### nvmf_subsystem_add_ns method {#rpc_nvmf_subsystem_add_ns}
8323
8324Add a namespace to a subsystem. The namespace ID is returned as the result.
8325
8326### Parameters
8327
8328Name                    | Optional | Type        | Description
8329----------------------- | -------- | ----------- | -----------
8330nqn                     | Required | string      | Subsystem NQN
8331namespace               | Required | object      | @ref rpc_nvmf_namespace object
8332tgt_name                | Optional | string      | Parent NVMe-oF target name.
8333
8334#### namespace {#rpc_nvmf_namespace}
8335
8336Name                    | Optional | Type        | Description
8337----------------------- | -------- | ----------- | -----------
8338nsid                    | Optional | number      | Namespace ID between 1 and 4294967294, inclusive. Default: Automatically assign NSID.
8339bdev_name               | Required | string      | Name of bdev to expose as a namespace.
8340nguid                   | Optional | string      | 16-byte namespace globally unique identifier in hexadecimal (e.g. "ABCDEF0123456789ABCDEF0123456789")
8341eui64                   | Optional | string      | 8-byte namespace EUI-64 in hexadecimal (e.g. "ABCDEF0123456789")
8342uuid                    | Optional | string      | RFC 4122 UUID (e.g. "ceccf520-691e-4b46-9546-34af789907c5")
8343ptpl_file               | Optional | string      | File path to save/restore persistent reservation information
8344anagrpid                | Optional | number      | ANA group ID. Default: Namespace ID.
8345
8346#### Example
8347
8348Example request:
8349
8350~~~json
8351{
8352  "jsonrpc": "2.0",
8353  "id": 1,
8354  "method": "nvmf_subsystem_add_ns",
8355  "params": {
8356    "nqn": "nqn.2016-06.io.spdk:cnode1",
8357    "namespace": {
8358      "nsid": 3,
8359      "bdev_name": "Nvme0n1",
8360      "ptpl_file": "/opt/Nvme0n1PR.json"
8361    }
8362  }
8363}
8364~~~
8365
8366Example response:
8367
8368~~~json
8369{
8370  "jsonrpc": "2.0",
8371  "id": 1,
8372  "result": 3
8373}
8374~~~
8375
8376### nvmf_subsystem_remove_ns method {#rpc_nvmf_subsystem_remove_ns}
8377
8378Remove a namespace from a subsystem.
8379
8380#### Parameters
8381
8382Name                    | Optional | Type        | Description
8383----------------------- | -------- | ----------- | -----------
8384nqn                     | Required | string      | Subsystem NQN
8385nsid                    | Required | number      | Namespace ID
8386tgt_name                | Optional | string      | Parent NVMe-oF target name.
8387
8388#### Example
8389
8390Example request:
8391
8392~~~json
8393{
8394  "jsonrpc": "2.0",
8395  "id": 1,
8396  "method": "nvmf_subsystem_remove_ns",
8397  "params": {
8398    "nqn": "nqn.2016-06.io.spdk:cnode1",
8399    "nsid": 1
8400  }
8401}
8402~~~
8403
8404Example response:
8405
8406~~~json
8407{
8408  "jsonrpc": "2.0",
8409  "id": 1,
8410  "result": true
8411}
8412~~~
8413
8414### nvmf_subsystem_add_host method {#rpc_nvmf_subsystem_add_host}
8415
8416Add a host NQN to the list of allowed hosts.
8417
8418#### Parameters
8419
8420Name                    | Optional | Type        | Description
8421----------------------- | -------- | ----------- | -----------
8422nqn                     | Required | string      | Subsystem NQN
8423host                    | Required | string      | Host NQN to add to the list of allowed host NQNs
8424tgt_name                | Optional | string      | Parent NVMe-oF target name.
8425psk                     | Optional | string      | Path to a file containing PSK for TLS connection
8426
8427#### Example
8428
8429Example request:
8430
8431~~~json
8432{
8433  "jsonrpc": "2.0",
8434  "id": 1,
8435  "method": "nvmf_subsystem_add_host",
8436  "params": {
8437    "nqn": "nqn.2016-06.io.spdk:cnode1",
8438    "host": "nqn.2016-06.io.spdk:host1"
8439  }
8440}
8441~~~
8442
8443Example response:
8444
8445~~~json
8446{
8447  "jsonrpc": "2.0",
8448  "id": 1,
8449  "result": true
8450}
8451~~~
8452
8453### nvmf_subsystem_remove_host method {#rpc_nvmf_subsystem_remove_host}
8454
8455Remove a host NQN from the list of allowed hosts.
8456
8457#### Parameters
8458
8459Name                    | Optional | Type        | Description
8460----------------------- | -------- | ----------- | -----------
8461nqn                     | Required | string      | Subsystem NQN
8462host                    | Required | string      | Host NQN to remove from the list of allowed host NQNs
8463tgt_name                | Optional | string      | Parent NVMe-oF target name.
8464
8465#### Example
8466
8467Example request:
8468
8469~~~json
8470{
8471  "jsonrpc": "2.0",
8472  "id": 1,
8473  "method": "nvmf_subsystem_remove_host",
8474  "params": {
8475    "nqn": "nqn.2016-06.io.spdk:cnode1",
8476    "host": "nqn.2016-06.io.spdk:host1"
8477  }
8478}
8479~~~
8480
8481Example response:
8482
8483~~~json
8484{
8485  "jsonrpc": "2.0",
8486  "id": 1,
8487  "result": true
8488}
8489~~~
8490
8491### nvmf_subsystem_allow_any_host method {#rpc_nvmf_subsystem_allow_any_host}
8492
8493Configure a subsystem to allow any host to connect or to enforce the host NQN list.
8494
8495#### Parameters
8496
8497Name                    | Optional | Type        | Description
8498----------------------- | -------- | ----------- | -----------
8499nqn                     | Required | string      | Subsystem NQN
8500allow_any_host          | Required | boolean     | Allow any host (`true`) or enforce allowed host list (`false`).
8501tgt_name                | Optional | string      | Parent NVMe-oF target name.
8502
8503#### Example
8504
8505Example request:
8506
8507~~~json
8508{
8509  "jsonrpc": "2.0",
8510  "id": 1,
8511  "method": "nvmf_subsystem_allow_any_host",
8512  "params": {
8513    "nqn": "nqn.2016-06.io.spdk:cnode1",
8514    "allow_any_host": true
8515  }
8516}
8517~~~
8518
8519Example response:
8520
8521~~~json
8522{
8523  "jsonrpc": "2.0",
8524  "id": 1,
8525  "result": true
8526}
8527~~~
8528
8529### nvmf_subsystem_get_controllers {#rpc_nvmf_subsystem_get_controllers}
8530
8531#### Parameters
8532
8533Name                    | Optional | Type        | Description
8534----------------------- | -------- | ----------- | -----------
8535nqn                     | Required | string      | Subsystem NQN
8536tgt_name                | Optional | string      | Parent NVMe-oF target name.
8537
8538#### Example
8539
8540Example request:
8541
8542~~~json
8543{
8544  "jsonrpc": "2.0",
8545  "id": 1,
8546  "method": "nvmf_subsystem_get_controllers",
8547  "params": {
8548    "nqn": "nqn.2016-06.io.spdk:cnode1"
8549  }
8550}
8551~~~
8552
8553Example response:
8554
8555~~~json
8556{
8557  "jsonrpc": "2.0",
8558  "id": 1,
8559  "result": [
8560    {
8561      "cntlid": 1,
8562      "hostnqn": "nqn.2016-06.io.spdk:host1",
8563      "hostid": "27dad528-6368-41c3-82d3-0b956b49025d",
8564      "num_io_qpairs": 5
8565    }
8566  ]
8567}
8568~~~
8569
8570### nvmf_subsystem_get_qpairs {#rpc_nvmf_subsystem_get_qpairs}
8571
8572#### Parameters
8573
8574Name                    | Optional | Type        | Description
8575----------------------- | -------- | ----------- | -----------
8576nqn                     | Required | string      | Subsystem NQN
8577tgt_name                | Optional | string      | Parent NVMe-oF target name.
8578
8579#### Example
8580
8581Example request:
8582
8583~~~json
8584{
8585  "jsonrpc": "2.0",
8586  "id": 1,
8587  "method": "nvmf_subsystem_get_qpairs",
8588  "params": {
8589    "nqn": "nqn.2016-06.io.spdk:cnode1"
8590  }
8591}
8592~~~
8593
8594Example response:
8595
8596~~~json
8597{
8598  "jsonrpc": "2.0",
8599  "id": 1,
8600  "result": [
8601    {
8602      "cntlid": 1,
8603      "qid": 0,
8604      "state": "active",
8605      "listen_address": {
8606        "trtype": "RDMA",
8607        "adrfam": "IPv4",
8608        "traddr": "192.168.0.123",
8609        "trsvcid": "4420"
8610      }
8611    },
8612    {
8613      "cntlid": 1,
8614      "qid": 1,
8615      "state": "active",
8616      "listen_address": {
8617        "trtype": "RDMA",
8618        "adrfam": "IPv4",
8619        "traddr": "192.168.0.123",
8620        "trsvcid": "4420"
8621      }
8622    }
8623  ]
8624}
8625~~~
8626
8627### nvmf_subsystem_get_listeners {#rpc_nvmf_subsystem_get_listeners}
8628
8629#### Parameters
8630
8631Name                    | Optional | Type        | Description
8632----------------------- | -------- | ----------- | -----------
8633nqn                     | Required | string      | Subsystem NQN
8634tgt_name                | Optional | string      | Parent NVMe-oF target name.
8635
8636#### Example
8637
8638Example request:
8639
8640~~~json
8641{
8642  "jsonrpc": "2.0",
8643  "id": 1,
8644  "method": "nvmf_subsystem_get_listeners",
8645  "params": {
8646    "nqn": "nqn.2016-06.io.spdk:cnode1"
8647  }
8648}
8649~~~
8650
8651Example response:
8652
8653~~~json
8654{
8655  "jsonrpc": "2.0",
8656  "id": 1,
8657  "result": [
8658    {
8659      "address": {
8660        "trtype": "RDMA",
8661        "adrfam": "IPv4",
8662        "traddr": "192.168.0.123",
8663        "trsvcid": "4420"
8664      },
8665      "ana_state": "optimized"
8666    }
8667  ]
8668}
8669~~~
8670
8671### nvmf_set_max_subsystems {#rpc_nvmf_set_max_subsystems}
8672
8673Set the maximum allowed subsystems for the NVMe-oF target.  This RPC may only be called
8674before SPDK subsystems have been initialized.
8675
8676#### Parameters
8677
8678Name                    | Optional | Type        | Description
8679----------------------- | -------- | ----------- | -----------
8680max_subsystems          | Required | number      | Maximum number of NVMe-oF subsystems
8681
8682#### Example
8683
8684Example request:
8685
8686~~~json
8687{
8688  "jsonrpc": "2.0",
8689  "id": 1,
8690  "method": "nvmf_set_max_subsystems",
8691  "params": {
8692    "max_subsystems": 1024
8693  }
8694}
8695~~~
8696
8697Example response:
8698
8699~~~json
8700{
8701  "jsonrpc": "2.0",
8702  "id": 1,
8703  "result": true
8704}
8705~~~
8706
8707### nvmf_discovery_add_referral  method {#rpc_nvmf_discovery_add_referral}
8708
8709Add a discovery service referral to an NVMe-oF target. If a referral with the given
8710parameters already exists, no action will be taken.
8711
8712#### Parameters
8713
8714Name                    | Optional | Type        | Description
8715----------------------- | -------- | ----------- | -----------
8716tgt_name                | Optional | string      | Parent NVMe-oF target name.
8717address                 | Required | object      | @ref rpc_nvmf_listen_address object
8718secure_channel          | Optional | bool        | The connection to that discovery subsystem requires a secure channel
8719
8720#### Example
8721
8722Example request:
8723
8724~~~json
8725{
8726  "jsonrpc": "2.0",
8727  "id": 1,
8728  "method": "nvmf_discovery_add_referral",
8729  "params": {
8730    "address": {
8731      "trtype": "RDMA",
8732      "adrfam": "IPv4",
8733      "traddr": "192.168.0.123",
8734      "trsvcid": "4420"
8735    }
8736  }
8737}
8738~~~
8739
8740Example response:
8741
8742~~~json
8743{
8744  "jsonrpc": "2.0",
8745  "id": 1,
8746  "result": true
8747}
8748~~~
8749
8750### nvmf_discovery_remove_referral  method {#rpc_nvmf_discovery_remove_referral}
8751
8752Remove a discovery service referral from an NVMe-oF target.
8753
8754#### Parameters
8755
8756Name                    | Optional | Type        | Description
8757----------------------- | -------- | ----------- | -----------
8758tgt_name                | Optional | string      | Parent NVMe-oF target name.
8759address                 | Required | object      | @ref rpc_nvmf_listen_address object
8760
8761#### Example
8762
8763Example request:
8764
8765~~~json
8766{
8767  "jsonrpc": "2.0",
8768  "id": 1,
8769  "method": "nvmf_discovery_remove_referral",
8770  "params": {
8771    "address": {
8772      "trtype": "RDMA",
8773      "adrfam": "IPv4",
8774      "traddr": "192.168.0.123",
8775      "trsvcid": "4420"
8776    }
8777  }
8778}
8779~~~
8780
8781Example response:
8782
8783~~~json
8784{
8785  "jsonrpc": "2.0",
8786  "id": 1,
8787  "result": true
8788}
8789~~~
8790
8791### nvmf_discovery_get_referrals {#rpc_nvmf_discovery_get_referrals}
8792
8793#### Parameters
8794
8795Name                    | Optional | Type        | Description
8796----------------------- | -------- | ----------- | -----------
8797tgt_name                | Optional | string      | Parent NVMe-oF target name.
8798
8799#### Example
8800
8801Example request:
8802
8803~~~json
8804{
8805  "jsonrpc": "2.0",
8806  "id": 1,
8807  "method": "nvmf_discovery_get_referrals"
8808}
8809~~~
8810
8811Example response:
8812
8813~~~json
8814{
8815  "jsonrpc": "2.0",
8816  "id": 1,
8817  "result": [
8818    {
8819      "address": {
8820        "trtype": "RDMA",
8821        "adrfam": "IPv4",
8822        "traddr": "192.168.0.123",
8823        "trsvcid": "4420"
8824      }
8825    }
8826  ]
8827}
8828~~~
8829
8830### nvmf_set_config {#rpc_nvmf_set_config}
8831
8832Set global configuration of NVMe-oF target.  This RPC may only be called before SPDK subsystems
8833have been initialized.
8834
8835#### Parameters
8836
8837Name                    | Optional | Type        | Description
8838----------------------- | -------- | ----------- | -----------
8839acceptor_poll_rate      | Optional | number      | Polling interval of the acceptor for incoming connections (microseconds)
8840admin_cmd_passthru      | Optional | object      | Admin command passthru configuration
8841poll_groups_mask        | Optional | string      | Set cpumask for NVMf poll groups
8842discovery_filter        | Optional | string      | Set discovery filter, possible values are: `match_any` (default) or comma separated values: `transport`, `address`, `svcid`
8843
8844#### admin_cmd_passthru {#spdk_nvmf_admin_passthru_conf}
8845
8846Name                    | Optional | Type        | Description
8847----------------------- | -------- | ----------- | -----------
8848identify_ctrlr          | Required | bool        | If true, enables custom identify handler that reports some identify attributes from the underlying NVMe drive
8849
8850#### Example
8851
8852Example request:
8853
8854~~~json
8855{
8856  "jsonrpc": "2.0",
8857  "id": 1,
8858  "method": "nvmf_set_config",
8859  "params": {
8860    "acceptor_poll_rate": 10000
8861  }
8862}
8863~~~
8864
8865Example response:
8866
8867~~~json
8868{
8869  "jsonrpc": "2.0",
8870  "id": 1,
8871  "result": true
8872}
8873~~~
8874
8875### nvmf_get_transports method {#rpc_nvmf_get_transports}
8876
8877#### Parameters
8878
8879The user may specify no parameters in order to list all transports, or a transport may be
8880specified by type.
8881
8882Name                        | Optional | Type        | Description
8883--------------------------- | -------- | ------------| -----------
8884tgt_name                    | Optional | string      | Parent NVMe-oF target name.
8885trtype                      | Optional | string      | Transport type.
8886
8887#### Example
8888
8889Example request:
8890
8891~~~json
8892{
8893  "jsonrpc": "2.0",
8894  "id": 1,
8895  "method": "nvmf_get_transports"
8896}
8897~~~
8898
8899Example response:
8900
8901~~~json
8902{
8903  "jsonrpc": "2.0",
8904  "id": 1,
8905  "result": [
8906    {
8907      "type": "RDMA".
8908      "max_queue_depth": 128,
8909      "max_io_qpairs_per_ctrlr": 64,
8910      "in_capsule_data_size": 4096,
8911      "max_io_size": 131072,
8912      "io_unit_size": 131072,
8913      "abort_timeout_sec": 1
8914    }
8915  ]
8916}
8917~~~
8918
8919### nvmf_get_stats method {#rpc_nvmf_get_stats}
8920
8921Retrieve current statistics of the NVMf subsystem.
8922
8923#### Parameters
8924
8925Name                        | Optional | Type        | Description
8926--------------------------- | -------- | ------------| -----------
8927tgt_name                    | Optional | string      | Parent NVMe-oF target name.
8928
8929#### Response
8930
8931The response is an object containing NVMf subsystem statistics.
8932In the response, `admin_qpairs` and `io_qpairs` are reflecting cumulative queue pair counts while
8933`current_admin_qpairs` and `current_io_qpairs` are showing the current number.
8934
8935#### Example
8936
8937Example request:
8938
8939~~~json
8940{
8941  "jsonrpc": "2.0",
8942  "method": "nvmf_get_stats",
8943  "id": 1
8944}
8945~~~
8946
8947Example response:
8948
8949~~~json
8950{
8951  "jsonrpc": "2.0",
8952  "id": 1,
8953  "result": {
8954    "tick_rate": 2400000000,
8955    "poll_groups": [
8956      {
8957        "name": "app_thread",
8958        "admin_qpairs": 1,
8959        "io_qpairs": 4,
8960        "current_admin_qpairs": 1,
8961        "current_io_qpairs": 2,
8962        "pending_bdev_io": 1721,
8963        "transports": [
8964          {
8965            "trtype": "RDMA",
8966            "pending_data_buffer": 12131888,
8967            "devices": [
8968              {
8969                "name": "mlx5_1",
8970                "polls": 72284105,
8971                "completions": 0,
8972                "requests": 0,
8973                "request_latency": 0,
8974                "pending_free_request": 0,
8975                "pending_rdma_read": 0,
8976                "pending_rdma_write": 0,
8977                "total_send_wrs": 0,
8978                "send_doorbell_updates": 0,
8979                "total_recv_wrs": 0,
8980                "recv_doorbell_updates": 1
8981              },
8982              {
8983                "name": "mlx5_0",
8984                "polls": 72284105,
8985                "completions": 15165875,
8986                "requests": 7582935,
8987                "request_latency": 1249323766184,
8988                "pending_free_request": 0,
8989                "pending_rdma_read": 337602,
8990                "pending_rdma_write": 0,
8991                "total_send_wrs": 15165875,
8992                "send_doorbell_updates": 1516587,
8993                "total_recv_wrs": 15165875,
8994                "recv_doorbell_updates": 1516587
8995              }
8996            ]
8997          }
8998        ]
8999      }
9000    ]
9001  }
9002}
9003~~~
9004
9005### nvmf_set_crdt {#rpc_nvmf_set_crdt}
9006
9007Set the 3 CRDT (Command Retry Delay Time) values. For details about
9008CRDT, please refer to the NVMe specification. Currently all the
9009SPDK nvmf subsystems share the same CRDT values. The default values
9010are 0. This rpc can only be invoked in STARTUP stage. All values are
9011in units of 100 milliseconds (same as the NVMe specification).
9012
9013#### Parameters
9014
9015Name                    | Optional | Type        | Description
9016----------------------- | -------- | ----------- | -----------
9017crdt1                   | Optional | number      | Command Retry Delay Time 1
9018crdt2                   | Optional | number      | Command Retry Delay Time 2
9019crdt3                   | Optional | number      | Command Retry Delay Time 3
9020
9021## Vfio-user Target
9022
9023### vfu_tgt_set_base_path {#rpc_vfu_tgt_set_base_path}
9024
9025Set base path of Unix Domain socket file.
9026
9027#### Parameters
9028
9029Name                    | Optional | Type        | Description
9030----------------------- | -------- | ----------- | -----------
9031path                    | Required | string      | Base path
9032
9033#### Example
9034
9035Example request:
9036
9037~~~json
9038{
9039  "params": {
9040    "path": "/var/run/vfu_tgt"
9041  },
9042  "jsonrpc": "2.0",
9043  "method": "vfu_tgt_set_base_path",
9044  "id": 1
9045}
9046~~~
9047
9048Example response:
9049
9050~~~json
9051{
9052  "jsonrpc": "2.0",
9053  "id": 1,
9054  "result": true
9055}
9056~~~
9057
9058### vfu_virtio_delete_endpoint {#rpc_vfu_virtio_delete_endpoint}
9059
9060Delete PCI device via endpoint name.
9061
9062#### Parameters
9063
9064Name                    | Optional | Type        | Description
9065----------------------- | -------- | ----------- | -----------
9066name                    | Required | string      | Endpoint name
9067
9068#### Example
9069
9070Example request:
9071
9072~~~json
9073{
9074  "params": {
9075    "name": "vfu.0"
9076  },
9077  "jsonrpc": "2.0",
9078  "method": "vfu_virtio_delete_endpoint",
9079  "id": 1
9080}
9081~~~
9082
9083Example response:
9084
9085~~~json
9086{
9087  "jsonrpc": "2.0",
9088  "id": 1,
9089  "result": true
9090}
9091~~~
9092
9093### vfu_virtio_create_blk_endpoint {#rpc_vfu_virtio_create_blk_endpoint}
9094
9095Create vfio-user virtio-blk PCI endpoint.
9096
9097#### Parameters
9098
9099Name                    | Optional | Type        | Description
9100----------------------- | -------- | ----------- | -----------
9101name                    | Required | string      | Endpoint name
9102bdev_name               | Required | string      | Block device name
9103cpumask                 | Optional | string      | CPU masks
9104num_queues              | Optional | number      | Number of queues
9105qsize                   | Optional | number      | Queue size
9106packed_ring             | Optional | boolean     | Enable packed ring
9107
9108#### Example
9109
9110Example request:
9111
9112~~~json
9113{
9114  "params": {
9115    "name": "vfu.0",
9116    "bdev_name": "Malloc0",
9117    "cpumask": "0x2",
9118    "num_queues": 4,
9119    "qsize": 256
9120  },
9121  "jsonrpc": "2.0",
9122  "method": "vfu_virtio_create_blk_endpoint",
9123  "id": 1
9124}
9125~~~
9126
9127Example response:
9128
9129~~~json
9130{
9131  "jsonrpc": "2.0",
9132  "id": 1,
9133  "result": true
9134}
9135~~~
9136
9137### vfu_virtio_scsi_add_target {#rpc_vfu_virtio_scsi_add_target}
9138
9139Add block device to specified SCSI target of vfio-user virtio-scsi PCI endpoint.
9140
9141#### Parameters
9142
9143Name                    | Optional | Type        | Description
9144----------------------- | -------- | ----------- | -----------
9145name                    | Required | string      | Endpoint name
9146scsi_target_num         | Required | number      | SCSI target number
9147bdev_name               | Required | string      | Block device name
9148
9149#### Example
9150
9151Example request:
9152
9153~~~json
9154{
9155  "params": {
9156    "name": "vfu.0",
9157    "scsi_target_num": 0,
9158    "bdev_name": "Malloc0"
9159  },
9160  "jsonrpc": "2.0",
9161  "method": "vfu_virtio_scsi_add_target",
9162  "id": 1
9163}
9164~~~
9165
9166Example response:
9167
9168~~~json
9169{
9170  "jsonrpc": "2.0",
9171  "id": 1,
9172  "result": true
9173}
9174~~~
9175
9176### vfu_virtio_scsi_remove_target {#rpc_vfu_virtio_scsi_remove_target}
9177
9178Remove a SCSI target of vfio-user virtio-scsi PCI endpoint.
9179
9180#### Parameters
9181
9182Name                    | Optional | Type        | Description
9183----------------------- | -------- | ----------- | -----------
9184name                    | Required | string      | Endpoint name
9185scsi_target_num         | Required | number      | SCSI target number
9186
9187#### Example
9188
9189Example request:
9190
9191~~~json
9192{
9193  "params": {
9194    "name": "vfu.0",
9195    "scsi_target_num": 0
9196  },
9197  "jsonrpc": "2.0",
9198  "method": "vfu_virtio_scsi_remove_target",
9199  "id": 1
9200}
9201~~~
9202
9203Example response:
9204
9205~~~json
9206{
9207  "jsonrpc": "2.0",
9208  "id": 1,
9209  "result": true
9210}
9211~~~
9212
9213### vfu_virtio_create_scsi_endpoint {#rpc_vfu_virtio_create_scsi_endpoint}
9214
9215Create vfio-user virtio-scsi PCI endpoint.
9216
9217#### Parameters
9218
9219Name                    | Optional | Type        | Description
9220----------------------- | -------- | ----------- | -----------
9221name                    | Required | string      | Endpoint name
9222cpumask                 | Optional | string      | CPU masks
9223num_io_queues           | Optional | number      | Number of IO queues
9224qsize                   | Optional | number      | Queue size
9225packed_ring             | Optional | boolean     | Enable packed ring
9226
9227#### Example
9228
9229Example request:
9230
9231~~~json
9232{
9233  "params": {
9234    "name": "vfu.0",
9235    "cpumask": "0x2",
9236    "num_io_queues": 4,
9237    "qsize": 256
9238  },
9239  "jsonrpc": "2.0",
9240  "method": "vfu_virtio_create_scsi_endpoint",
9241  "id": 1
9242}
9243~~~
9244
9245Example response:
9246
9247~~~json
9248{
9249  "jsonrpc": "2.0",
9250  "id": 1,
9251  "result": true
9252}
9253~~~
9254
9255## Vhost Target {#jsonrpc_components_vhost_tgt}
9256
9257The following common preconditions need to be met in all target types.
9258
9259Controller name will be used to create UNIX domain socket. This implies that name concatenated with vhost socket
9260directory path needs to be valid UNIX socket name.
9261
9262@ref cpu_mask parameter is used to choose CPU on which pollers will be launched when new initiator is connecting.
9263It must be a subset of application CPU mask. Default value is CPU mask of the application.
9264
9265### vhost_controller_set_coalescing {#rpc_vhost_controller_set_coalescing}
9266
9267Controls interrupt coalescing for specific target. Because `delay_base_us` is used to calculate delay in CPU ticks
9268there is no hardcoded limit for this parameter. Only limitation is that final delay in CPU ticks might not overflow
926932 bit unsigned integer (which is more than 1s @ 4GHz CPU). In real scenarios `delay_base_us` should be much lower
9270than 150us. To disable coalescing set `delay_base_us` to 0.
9271
9272#### Parameters
9273
9274Name                    | Optional | Type        | Description
9275----------------------- | -------- | ----------- | -----------
9276ctrlr                   | Required | string      | Controller name
9277delay_base_us           | Required | number      | Base (minimum) coalescing time in microseconds
9278iops_threshold          | Required | number      | Coalescing activation level greater than 0 in IO per second
9279
9280#### Example
9281
9282Example request:
9283
9284~~~json
9285{
9286  "params": {
9287    "iops_threshold": 100000,
9288    "ctrlr": "VhostScsi0",
9289    "delay_base_us": 80
9290  },
9291  "jsonrpc": "2.0",
9292  "method": "vhost_controller_set_coalescing",
9293  "id": 1
9294}
9295~~~
9296
9297Example response:
9298
9299~~~json
9300{
9301  "jsonrpc": "2.0",
9302  "id": 1,
9303  "result": true
9304}
9305~~~
9306
9307### vhost_create_scsi_controller {#rpc_vhost_create_scsi_controller}
9308
9309Construct vhost SCSI target.
9310
9311#### Parameters
9312
9313Name                    | Optional | Type        | Description
9314----------------------- | -------- | ----------- | -----------
9315ctrlr                   | Required | string      | Controller name
9316cpumask                 | Optional | string      | @ref cpu_mask for this controller
9317delay                   | Optional | boolean     | If true, delay the controller startup.
9318
9319#### Example
9320
9321Example request:
9322
9323~~~json
9324{
9325  "params": {
9326    "cpumask": "0x2",
9327    "ctrlr": "VhostScsi0",
9328    "delay": true
9329  },
9330  "jsonrpc": "2.0",
9331  "method": "vhost_create_scsi_controller",
9332  "id": 1
9333}
9334~~~
9335
9336Example response:
9337
9338~~~json
9339{
9340  "jsonrpc": "2.0",
9341  "id": 1,
9342  "result": true
9343}
9344~~~
9345
9346### vhost_start_scsi_controller {#rpc_vhost_start_scsi_controller}
9347
9348Start vhost SCSI controller, if controller is already started, do nothing.
9349
9350#### Parameters
9351
9352Name                    | Optional | Type        | Description
9353----------------------- | -------- | ----------- | -----------
9354ctrlr                   | Required | string      | Controller name
9355
9356#### Example
9357
9358Example request:
9359
9360~~~json
9361{
9362  "params": {
9363    "ctrlr": "VhostScsi0",
9364  },
9365  "jsonrpc": "2.0",
9366  "method": "vhost_start_scsi_controller",
9367  "id": 1
9368}
9369~~~
9370
9371Example response:
9372
9373~~~json
9374response:
9375{
9376  "jsonrpc": "2.0",
9377  "id": 1,
9378  "result": true
9379}
9380~~~
9381
9382### vhost_scsi_controller_add_target {#rpc_vhost_scsi_controller_add_target}
9383
9384In vhost target `ctrlr` create SCSI target with ID `scsi_target_num` and add `bdev_name` as LUN 0.
9385
9386#### Parameters
9387
9388Name                    | Optional | Type        | Description
9389----------------------- | -------- | ----------- | -----------
9390ctrlr                   | Required | string      | Controller name
9391scsi_target_num         | Required | number      | SCSI target ID between 0 and 7 or -1 to use first free ID.
9392bdev_name               | Required | string      | Name of bdev to expose as a LUN 0
9393
9394#### Response
9395
9396SCSI target ID.
9397
9398#### Example
9399
9400Example request:
9401
9402~~~json
9403{
9404  "params": {
9405    "scsi_target_num": 1,
9406    "bdev_name": "Malloc0",
9407    "ctrlr": "VhostScsi0"
9408  },
9409  "jsonrpc": "2.0",
9410  "method": "vhost_scsi_controller_add_target",
9411  "id": 1
9412}
9413~~~
9414
9415Example response:
9416
9417~~~json
9418response:
9419{
9420  "jsonrpc": "2.0",
9421  "id": 1,
9422  "result": 1
9423}
9424~~~
9425
9426### vhost_scsi_controller_remove_target {#rpc_vhost_scsi_controller_remove_target}
9427
9428Remove SCSI target ID `scsi_target_num` from vhost target `scsi_target_num`.
9429
9430This method will fail if initiator is connected, but doesn't support hot-remove (the `VIRTIO_SCSI_F_HOTPLUG` is not negotiated).
9431
9432#### Parameters
9433
9434Name                    | Optional | Type        | Description
9435----------------------- | -------- | ----------- | -----------
9436ctrlr                   | Required | string      | Controller name
9437scsi_target_num         | Required | number      | SCSI target ID between 0 and 7
9438
9439#### Example
9440
9441Example request:
9442
9443~~~json
9444request:
9445{
9446  "params": {
9447    "scsi_target_num": 1,
9448    "ctrlr": "VhostScsi0"
9449  },
9450  "jsonrpc": "2.0",
9451  "method": "vhost_scsi_controller_remove_target",
9452  "id": 1
9453}
9454~~~
9455
9456Example response:
9457
9458~~~json
9459{
9460  "jsonrpc": "2.0",
9461  "id": 1,
9462  "result": true
9463}
9464~~~
9465
9466### virtio_blk_create_transport {#rpc_virtio_blk_create_transport}
9467
9468Create virtio blk transport.
9469
9470#### Parameters
9471
9472Name                    | Optional | Type        | Description
9473----------------------- | -------- | ----------- | -----------
9474name                    | Required | string      | Transport name
9475
9476#### Example
9477
9478Example request:
9479
9480~~~json
9481{
9482  "params": {
9483    "name": "vhost_user_blk"
9484  },
9485  "jsonrpc": "2.0",
9486  "method": "virtio_blk_create_transport",
9487  "id": 1
9488}
9489~~~
9490
9491Example response:
9492
9493~~~json
9494{
9495  "jsonrpc": "2.0",
9496  "id": 1,
9497  "result": true
9498}
9499~~~
9500
9501### virtio_blk_get_transports {#rpc_virtio_blk_get_transports}
9502
9503#### Parameters
9504
9505The user may specify no parameters in order to list all transports,
9506or a transport name may be specified.
9507
9508Name                        | Optional | Type        | Description
9509--------------------------- | -------- | ------------| -----------
9510name                        | Optional | string      | Transport name.
9511
9512#### Example
9513
9514Example request:
9515
9516~~~json
9517{
9518  "jsonrpc": "2.0",
9519  "method": "virtio_blk_get_transports",
9520  "id": 1
9521}
9522~~~
9523
9524Example response:
9525
9526~~~json
9527{
9528  "jsonrpc": "2.0",
9529  "id": 1,
9530  "result": [
9531    {
9532      "name": "vhost_user_blk"
9533    }
9534  ]
9535}
9536~~~
9537
9538### vhost_create_blk_controller {#rpc_vhost_create_blk_controller}
9539
9540Create vhost block controller
9541
9542If `readonly` is `true` then vhost block target will be created as read only and fail any write requests.
9543The `VIRTIO_BLK_F_RO` feature flag will be offered to the initiator.
9544
9545#### Parameters
9546
9547Name                    | Optional | Type        | Description
9548----------------------- | -------- | ----------- | -----------
9549ctrlr                   | Required | string      | Controller name
9550bdev_name               | Required | string      | Name of bdev to expose block device
9551readonly                | Optional | boolean     | If true, this target will be read only (default: false)
9552cpumask                 | Optional | string      | @ref cpu_mask for this controller
9553transport               | Optional | string      | virtio blk transport name (default: vhost_user_blk)
9554
9555#### Example
9556
9557Example request:
9558
9559~~~json
9560{
9561  "params": {
9562    "dev_name": "Malloc0",
9563    "ctrlr": "VhostBlk0"
9564  },
9565  "jsonrpc": "2.0",
9566  "method": "vhost_create_blk_controller",
9567  "id": 1
9568}
9569~~~
9570
9571Example response:
9572
9573~~~json
9574{
9575  "jsonrpc": "2.0",
9576  "id": 1,
9577  "result": true
9578}
9579~~~
9580
9581### vhost_get_controllers {#rpc_vhost_get_controllers}
9582
9583Display information about all or specific vhost controller(s).
9584
9585#### Parameters
9586
9587The user may specify no parameters in order to list all controllers, or a controller may be
9588specified by name.
9589
9590Name                    | Optional | Type        | Description
9591----------------------- | -------- | ----------- | -----------
9592name                    | Optional | string      | Vhost controller name
9593
9594#### Response {#rpc_vhost_get_controllers_response}
9595
9596Response is an array of objects describing requested controller(s). Common fields are:
9597
9598Name                    | Type        | Description
9599----------------------- | ----------- | -----------
9600ctrlr                   | string      | Controller name
9601cpumask                 | string      | @ref cpu_mask of this controller
9602delay_base_us           | number      | Base (minimum) coalescing time in microseconds (0 if disabled)
9603iops_threshold          | number      | Coalescing activation level
9604backend_specific        | object      | Backend specific information
9605
9606### Vhost block {#rpc_vhost_get_controllers_blk}
9607
9608`backend_specific` contains one `block` object  of type:
9609
9610Name                    | Type        | Description
9611----------------------- | ----------- | -----------
9612bdev                    | string      | Backing bdev name or Null if bdev is hot-removed
9613readonly                | boolean     | True if controllers is readonly, false otherwise
9614
9615### Vhost SCSI {#rpc_vhost_get_controllers_scsi}
9616
9617`backend_specific` contains `scsi` array of following objects:
9618
9619Name                    | Type        | Description
9620----------------------- | ----------- | -----------
9621target_name             | string      | Name of this SCSI target
9622id                      | number      | Unique SPDK global SCSI target ID
9623scsi_dev_num            | number      | SCSI target ID initiator will see when scanning this controller
9624luns                    | array       | array of objects describing @ref rpc_vhost_get_controllers_scsi_luns
9625
9626### Vhost SCSI LUN {#rpc_vhost_get_controllers_scsi_luns}
9627
9628Object of type:
9629
9630Name                    | Type        | Description
9631----------------------- | ----------- | -----------
9632id                      | number      | SCSI LUN ID
9633bdev_name               | string      | Backing bdev name
9634
9635### Vhost NVMe {#rpc_vhost_get_controllers_nvme}
9636
9637`backend_specific` contains `namespaces` array of following objects:
9638
9639Name                    | Type        | Description
9640----------------------- | ----------- | -----------
9641nsid                    | number      | Namespace ID
9642bdev                    | string      | Backing bdev name
9643
9644#### Example
9645
9646Example request:
9647
9648~~~json
9649{
9650  "jsonrpc": "2.0",
9651  "method": "vhost_get_controllers",
9652  "id": 1
9653}
9654~~~
9655
9656Example response:
9657
9658~~~json
9659{
9660  "jsonrpc": "2.0",
9661  "id": 1,
9662  "result": [
9663    {
9664      "cpumask": "0x2",
9665      "backend_specific": {
9666        "block": {
9667          "readonly": false,
9668          "bdev": "Malloc0"
9669        }
9670      },
9671      "iops_threshold": 60000,
9672      "ctrlr": "VhostBlk0",
9673      "delay_base_us": 100
9674    },
9675    {
9676      "cpumask": "0x2",
9677      "backend_specific": {
9678        "scsi": [
9679          {
9680            "target_name": "Target 2",
9681            "luns": [
9682              {
9683                "id": 0,
9684                "bdev_name": "Malloc1"
9685              }
9686            ],
9687            "id": 0,
9688            "scsi_dev_num": 2
9689          },
9690          {
9691            "target_name": "Target 5",
9692            "luns": [
9693              {
9694                "id": 0,
9695                "bdev_name": "Malloc2"
9696              }
9697            ],
9698            "id": 1,
9699            "scsi_dev_num": 5
9700          }
9701        ]
9702      },
9703      "iops_threshold": 60000,
9704      "ctrlr": "VhostScsi0",
9705      "delay_base_us": 0
9706    },
9707    {
9708      "cpumask": "0x2",
9709      "backend_specific": {
9710        "namespaces": [
9711          {
9712            "bdev": "Malloc3",
9713            "nsid": 1
9714          },
9715          {
9716            "bdev": "Malloc4",
9717            "nsid": 2
9718          }
9719        ]
9720      },
9721      "iops_threshold": 60000,
9722      "ctrlr": "VhostNvme0",
9723      "delay_base_us": 0
9724    }
9725  ]
9726}
9727~~~
9728
9729### vhost_delete_controller {#rpc_vhost_delete_controller}
9730
9731Remove vhost target.
9732
9733This call will fail if there is an initiator connected or there is at least one SCSI target configured in case of
9734vhost SCSI target. In the later case please remove all SCSI targets first using @ref rpc_vhost_scsi_controller_remove_target.
9735
9736#### Parameters
9737
9738Name                    | Optional | Type        | Description
9739----------------------- | -------- | ----------- | -----------
9740ctrlr                   | Required | string      | Controller name
9741
9742#### Example
9743
9744Example request:
9745
9746~~~json
9747{
9748  "params": {
9749    "ctrlr": "VhostNvme0"
9750  },
9751  "jsonrpc": "2.0",
9752  "method": "vhost_delete_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## Logical Volume {#jsonrpc_components_lvol}
9768
9769Identification of logical volume store and logical volume is explained first.
9770
9771A logical volume store has a UUID and a name for its identification.
9772The UUID is generated on creation and it can be used as a unique identifier.
9773The name is specified on creation and can be renamed.
9774Either UUID or name is used to access logical volume store in RPCs.
9775
9776A logical volume has a UUID and a name for its identification.
9777The UUID of the logical volume is generated on creation and it can be unique identifier.
9778The alias of the logical volume takes the format _lvs_name/lvol_name_ where:
9779
9780* _lvs_name_ is the name of the logical volume store.
9781* _lvol_name_ is specified on creation and can be renamed.
9782
9783### bdev_lvol_create_lvstore {#rpc_bdev_lvol_create_lvstore}
9784
9785Construct a logical volume store.
9786
9787#### Parameters
9788
9789Name                          | Optional | Type        | Description
9790----------------------------- | -------- | ----------- | -----------
9791bdev_name                     | Required | string      | Bdev on which to construct logical volume store
9792lvs_name                      | Required | string      | Name of the logical volume store to create
9793cluster_sz                    | Optional | number      | Cluster size of the logical volume store in bytes (Default: 4MiB)
9794clear_method                  | Optional | string      | Change clear method for data region. Available: none, unmap (default), write_zeroes
9795num_md_pages_per_cluster_ratio| Optional | number      | Reserved metadata pages per cluster (Default: 100)
9796
9797The num_md_pages_per_cluster_ratio defines the amount of metadata to
9798allocate when the logical volume store is created. The default value
9799is '100', which translates to 1 4KiB per cluster. For the default 4MiB
9800cluster size, this equates to about 0.1% of the underlying block
9801device allocated for metadata. Logical volume stores can be grown, if
9802the size of the underlying block device grows in the future, but only
9803if enough metadata pages were allocated to support the growth. So
9804num_md_pages_per_cluster_ratio should be set to a higher value if
9805wanting to support future growth. For example,
9806num_md_pages_per_cluster_ratio = 200 would support future 2x growth of
9807the logical volume store, and would result in 0.2% of the underlying
9808block device allocated for metadata (with a default 4MiB cluster
9809size).
9810
9811#### Response
9812
9813UUID of the created logical volume store is returned.
9814
9815#### Example
9816
9817Example request:
9818
9819~~~json
9820{
9821  "jsonrpc": "2.0",
9822  "id": 1,
9823  "method": "bdev_lvol_create_lvstore",
9824  "params": {
9825    "lvs_name": "LVS0",
9826    "bdev_name": "Malloc0"
9827    "clear_method": "write_zeroes"
9828  }
9829}
9830~~~
9831
9832Example response:
9833
9834~~~json
9835{
9836  "jsonrpc": "2.0",
9837  "id": 1,
9838  "result": "a9959197-b5e2-4f2d-8095-251ffb6985a5"
9839}
9840~~~
9841
9842### bdev_lvol_delete_lvstore {#rpc_bdev_lvol_delete_lvstore}
9843
9844Destroy a logical volume store.
9845
9846#### Parameters
9847
9848Name                    | Optional | Type        | Description
9849----------------------- | -------- | ----------- | -----------
9850uuid                    | Optional | string      | UUID of the logical volume store to destroy
9851lvs_name                | Optional | string      | Name of the logical volume store to destroy
9852
9853Either uuid or lvs_name must be specified, but not both.
9854
9855#### Example
9856
9857Example request:
9858
9859~~~json
9860{
9861  "jsonrpc": "2.0",
9862  "method": "bdev_lvol_delete_lvstore",
9863  "id": 1
9864  "params": {
9865    "uuid": "a9959197-b5e2-4f2d-8095-251ffb6985a5"
9866  }
9867}
9868~~~
9869
9870Example response:
9871
9872~~~json
9873{
9874  "jsonrpc": "2.0",
9875  "id": 1,
9876  "result": true
9877}
9878~~~
9879
9880### bdev_lvol_get_lvstores {#rpc_bdev_lvol_get_lvstores}
9881
9882Get a list of logical volume stores.
9883
9884#### Parameters
9885
9886Name                    | Optional | Type        | Description
9887----------------------- | -------- | ----------- | -----------
9888uuid                    | Optional | string      | UUID of the logical volume store to retrieve information about
9889lvs_name                | Optional | string      | Name of the logical volume store to retrieve information about
9890
9891Either uuid or lvs_name may be specified, but not both.
9892If both uuid and lvs_name are omitted, information about all logical volume stores is returned.
9893
9894#### Example
9895
9896Example request:
9897
9898~~~json
9899{
9900  "jsonrpc": "2.0",
9901  "method": "bdev_lvol_get_lvstores",
9902  "id": 1,
9903  "params": {
9904    "lvs_name": "LVS0"
9905  }
9906}
9907~~~
9908
9909Example response:
9910
9911~~~json
9912{
9913  "jsonrpc": "2.0",
9914  "id": 1,
9915  "result": [
9916    {
9917      "uuid": "a9959197-b5e2-4f2d-8095-251ffb6985a5",
9918      "base_bdev": "Malloc0",
9919      "free_clusters": 31,
9920      "cluster_size": 4194304,
9921      "total_data_clusters": 31,
9922      "block_size": 4096,
9923      "name": "LVS0"
9924    }
9925  ]
9926}
9927~~~
9928
9929### bdev_lvol_rename_lvstore {#rpc_bdev_lvol_rename_lvstore}
9930
9931Rename a logical volume store.
9932
9933#### Parameters
9934
9935Name                    | Optional | Type        | Description
9936----------------------- | -------- | ----------- | -----------
9937old_name                | Required | string      | Existing logical volume store name
9938new_name                | Required | string      | New logical volume store name
9939
9940#### Example
9941
9942Example request:
9943
9944~~~json
9945{
9946  "jsonrpc": "2.0",
9947  "method": "bdev_lvol_rename_lvstore",
9948  "id": 1,
9949  "params": {
9950    "old_name": "LVS0",
9951    "new_name": "LVS2"
9952  }
9953}
9954~~~
9955
9956Example response:
9957
9958~~~json
9959{
9960  "jsonrpc": "2.0",
9961  "id": 1,
9962  "result": true
9963}
9964~~~
9965
9966### bdev_lvol_grow_lvstore {#rpc_bdev_lvol_grow_lvstore}
9967
9968Grow the logical volume store to fill the underlying bdev
9969
9970#### Parameters
9971
9972Name                    | Optional | Type        | Description
9973----------------------- | -------- | ----------- | -----------
9974uuid                    | Optional | string      | UUID of the logical volume store to grow
9975lvs_name                | Optional | string      | Name of the logical volume store to grow
9976
9977Either uuid or lvs_name must be specified, but not both.
9978
9979#### Example
9980
9981Example request:
9982
9983~~~json
9984{
9985  "jsonrpc": "2.0",
9986  "method": "bdev_lvol_grow_lvstore",
9987  "id": 1
9988  "params": {
9989    "uuid": "a9959197-b5e2-4f2d-8095-251ffb6985a5"
9990  }
9991}
9992~~~
9993
9994Example response:
9995
9996~~~json
9997{
9998  "jsonrpc": "2.0",
9999  "id": 1,
10000  "result": true
10001}
10002~~~
10003
10004### bdev_lvol_create {#rpc_bdev_lvol_create}
10005
10006Create a logical volume on a logical volume store.
10007
10008#### Parameters
10009
10010Name                    | Optional | Type        | Description
10011----------------------- | -------- | ----------- | -----------
10012lvol_name               | Required | string      | Name of logical volume to create
10013size                    | Optional | number      | Desired size of logical volume in bytes (Deprecated. Please use size_in_mib instead.)
10014size_in_mib             | Optional | number      | Desired size of logical volume in MiB
10015thin_provision          | Optional | boolean     | True to enable thin provisioning
10016uuid                    | Optional | string      | UUID of logical volume store to create logical volume on
10017lvs_name                | Optional | string      | Name of logical volume store to create logical volume on
10018clear_method            | Optional | string      | Change default data clusters clear method. Available: none, unmap, write_zeroes
10019
10020Size will be rounded up to a multiple of cluster size. Either uuid or lvs_name must be specified, but not both.
10021lvol_name will be used in the alias of the created logical volume.
10022
10023#### Response
10024
10025UUID of the created logical volume is returned.
10026
10027#### Example
10028
10029Example request:
10030
10031~~~json
10032{
10033  "jsonrpc": "2.0",
10034  "method": "bdev_lvol_create",
10035  "id": 1,
10036  "params": {
10037    "lvol_name": "LVOL0",
10038    "size_in_mib": 1,
10039    "lvs_name": "LVS0",
10040    "clear_method": "unmap",
10041    "thin_provision": true
10042  }
10043}
10044~~~
10045
10046Example response:
10047
10048~~~json
10049{
10050  "jsonrpc": "2.0",
10051  "id": 1,
10052  "result": "1b38702c-7f0c-411e-a962-92c6a5a8a602"
10053}
10054~~~
10055
10056### bdev_lvol_snapshot {#rpc_bdev_lvol_snapshot}
10057
10058Capture a snapshot of the current state of a logical volume.
10059
10060#### Parameters
10061
10062Name                    | Optional | Type        | Description
10063----------------------- | -------- | ----------- | -----------
10064lvol_name               | Required | string      | UUID or alias of the logical volume to create a snapshot from
10065snapshot_name           | Required | string      | Name for the newly created snapshot
10066
10067#### Response
10068
10069UUID of the created logical volume snapshot is returned.
10070
10071#### Example
10072
10073Example request:
10074
10075~~~json
10076{
10077  "jsonrpc": "2.0",
10078  "method": "bdev_lvol_snapshot",
10079  "id": 1,
10080  "params": {
10081    "lvol_name": "1b38702c-7f0c-411e-a962-92c6a5a8a602",
10082    "snapshot_name": "SNAP1"
10083  }
10084}
10085~~~
10086
10087Example response:
10088
10089~~~json
10090{
10091  "jsonrpc": "2.0",
10092  "id": 1,
10093  "result": "cc8d7fdf-7865-4d1f-9fc6-35da8e368670"
10094}
10095~~~
10096
10097### bdev_lvol_clone {#rpc_bdev_lvol_clone}
10098
10099Create a logical volume based on a snapshot.
10100
10101#### Parameters
10102
10103Name                    | Optional | Type        | Description
10104----------------------- | -------- | ----------- | -----------
10105snapshot_name           | Required | string      | UUID or alias of the snapshot to clone
10106clone_name              | Required | string      | Name for the logical volume to create
10107
10108#### Response
10109
10110UUID of the created logical volume clone is returned.
10111
10112#### Example
10113
10114Example request:
10115
10116~~~json
10117{
10118  "jsonrpc": "2.0"
10119  "method": "bdev_lvol_clone",
10120  "id": 1,
10121  "params": {
10122    "snapshot_name": "cc8d7fdf-7865-4d1f-9fc6-35da8e368670",
10123    "clone_name": "CLONE1"
10124  }
10125}
10126~~~
10127
10128Example response:
10129
10130~~~json
10131{
10132  "jsonrpc": "2.0",
10133  "id": 1,
10134  "result": "8d87fccc-c278-49f0-9d4c-6237951aca09"
10135}
10136~~~
10137
10138### bdev_lvol_clone_bdev {#rpc_bdev_lvol_clone_bdev}
10139
10140Create a logical volume based on an external snapshot bdev. The external snapshot bdev
10141is a bdev that will not be written to by any consumer and must not be an lvol in the
10142lvstore as the clone.
10143
10144Regardless of whether the bdev is specified by name or UUID, the bdev UUID will be stored
10145in the logical volume's metadata for use while the lvolstore is loading. For this reason,
10146it is important that the bdev chosen has a static UUID.
10147
10148#### Parameters
10149
10150Name                    | Optional | Type        | Description
10151----------------------- | -------- | ----------- | -----------
10152bdev                    | Required | string      | Name or UUID for bdev that acts as the external snapshot
10153lvs_name                | Required | string      | logical volume store name
10154clone_name              | Required | string      | Name for the logical volume to create
10155
10156#### Response
10157
10158UUID of the created logical volume clone is returned.
10159
10160#### Example
10161
10162Example request:
10163
10164~~~json
10165{
10166  "jsonrpc": "2.0",
10167  "method": "bdev_lvol_clone_bdev",
10168  "id": 1,
10169  "params": {
10170    "bdev_uuid": "e4b40d8b-f623-416d-8234-baf5a4c83cbd",
10171    "lvs_name": "lvs1",
10172    "clone_name": "clone2"
10173  }
10174}
10175~~~
10176
10177Example response:
10178
10179~~~json
10180{
10181  "jsonrpc": "2.0",
10182  "id": 1,
10183  "result": "336f662b-08e5-4006-8e06-e2023f7f9886"
10184}
10185~~~
10186
10187### bdev_lvol_rename {#rpc_bdev_lvol_rename}
10188
10189Rename a logical volume. New name will rename only the alias of the logical volume.
10190
10191#### Parameters
10192
10193Name                    | Optional | Type        | Description
10194----------------------- | -------- | ----------- | -----------
10195old_name                | Required | string      | UUID or alias of the existing logical volume
10196new_name                | Required | string      | New logical volume name
10197
10198#### Example
10199
10200Example request:
10201
10202~~~json
10203{
10204  "jsonrpc": "2.0",
10205  "method": "bdev_lvol_rename",
10206  "id": 1,
10207  "params": {
10208    "old_name": "067df606-6dbc-4143-a499-0d05855cb3b8",
10209    "new_name": "LVOL2"
10210  }
10211}
10212~~~
10213
10214Example response:
10215
10216~~~json
10217{
10218  "jsonrpc": "2.0",
10219  "id": 1,
10220  "result": true
10221}
10222~~~
10223
10224### bdev_lvol_resize {#rpc_bdev_lvol_resize}
10225
10226Resize a logical volume.
10227
10228#### Parameters
10229
10230Name                    | Optional | Type        | Description
10231----------------------- | -------- | ----------- | -----------
10232name                    | Required | string      | UUID or alias of the logical volume to resize
10233size                    | Optional | number      | Desired size of the logical volume in bytes (Deprecated. Please use size_in_mib instead.)
10234size_in_mib             | Optional | number      | Desired size of the logical volume in MiB
10235
10236#### Example
10237
10238Example request:
10239
10240~~~json
10241{
10242  "jsonrpc": "2.0",
10243  "method": "bdev_lvol_resize",
10244  "id": 1,
10245  "params": {
10246    "name": "51638754-ca16-43a7-9f8f-294a0805ab0a",
10247    "size_in_mib": 2
10248  }
10249}
10250~~~
10251
10252Example response:
10253
10254~~~json
10255{
10256  "jsonrpc": "2.0",
10257  "id": 1,
10258  "result": true
10259}
10260~~~
10261
10262### bdev_lvol_set_read_only{#rpc_bdev_lvol_set_read_only}
10263
10264Mark logical volume as read only.
10265
10266#### Parameters
10267
10268Name                    | Optional | Type        | Description
10269----------------------- | -------- | ----------- | -----------
10270name                    | Required | string      | UUID or alias of the logical volume to set as read only
10271
10272#### Example
10273
10274Example request:
10275
10276~~~json
10277{
10278  "jsonrpc": "2.0",
10279  "method": "bdev_lvol_set_read_only",
10280  "id": 1,
10281  "params": {
10282    "name": "51638754-ca16-43a7-9f8f-294a0805ab0a",
10283  }
10284}
10285~~~
10286
10287Example response:
10288
10289~~~json
10290{
10291  "jsonrpc": "2.0",
10292  "id": 1,
10293  "result": true
10294}
10295~~~
10296
10297### bdev_lvol_delete {#rpc_bdev_lvol_delete}
10298
10299Destroy a logical volume.
10300
10301#### Parameters
10302
10303Name                    | Optional | Type        | Description
10304----------------------- | -------- | ----------- | -----------
10305name                    | Required | string      | UUID or alias of the logical volume to destroy
10306
10307#### Example
10308
10309Example request:
10310
10311~~~json
10312{
10313  "jsonrpc": "2.0",
10314  "method": "bdev_lvol_delete",
10315  "id": 1,
10316  "params": {
10317    "name": "51638754-ca16-43a7-9f8f-294a0805ab0a"
10318  }
10319}
10320~~~
10321
10322Example response:
10323
10324~~~json
10325{
10326  "jsonrpc": "2.0",
10327  "id": 1,
10328  "result": true
10329}
10330~~~
10331
10332### bdev_lvol_inflate {#rpc_bdev_lvol_inflate}
10333
10334Inflate a logical volume. All unallocated clusters are allocated and copied from the parent or zero filled
10335if not allocated in the parent. Then all dependencies on the parent are removed.
10336
10337### Parameters
10338
10339Name                    | Optional | Type        | Description
10340----------------------- | -------- | ----------- | -----------
10341name                    | Required | string      | UUID or alias of the logical volume to inflate
10342
10343#### Example
10344
10345Example request:
10346
10347~~~json
10348{
10349  "jsonrpc": "2.0",
10350  "method": "bdev_lvol_inflate",
10351  "id": 1,
10352  "params": {
10353    "name": "8d87fccc-c278-49f0-9d4c-6237951aca09"
10354  }
10355}
10356~~~
10357
10358Example response:
10359
10360~~~json
10361{
10362  "jsonrpc": "2.0",
10363  "id": 1,
10364  "result": true
10365}
10366~~~
10367
10368### bdev_lvol_decouple_parent {#rpc_bdev_lvol_decouple_parent}
10369
10370Decouple the parent of a logical volume. For unallocated clusters which is allocated in the parent, they are
10371allocated and copied from the parent, but for unallocated clusters which is thin provisioned in the parent,
10372they are kept thin provisioned. Then all dependencies on the parent are removed.
10373
10374#### Parameters
10375
10376Name                    | Optional | Type        | Description
10377----------------------- | -------- | ----------- | -----------
10378name                    | Required | string      | UUID or alias of the logical volume to decouple the parent of it
10379
10380#### Example
10381
10382Example request:
10383
10384~~~json
10385{
10386  "jsonrpc": "2.0",
10387  "method": "bdev_lvol_decouple_parent",
10388  "id": 1.
10389  "params": {
10390    "name": "8d87fccc-c278-49f0-9d4c-6237951aca09"
10391  }
10392}
10393~~~
10394
10395Example response:
10396
10397~~~json
10398{
10399  "jsonrpc": "2.0",
10400  "id": 1,
10401  "result": true
10402}
10403~~~
10404
10405### bdev_lvol_get_lvols {#rpc_bdev_lvol_get_lvols}
10406
10407Get a list of logical volumes. This list can be limited by lvol store and will display volumes even if
10408they are degraded. Degraded lvols do not have an associated bdev, thus this RPC call may return lvols
10409not returned by `bdev_get_bdevs`.
10410
10411#### Parameters
10412
10413Name                    | Optional | Type        | Description
10414----------------------- | -------- | ----------- | -----------
10415lvs_uuid                | Optional | string      | Only show volumes in the logical volume store with this UUID
10416lvs_name                | Optional | string      | Only show volumes in the logical volume store with this name
10417
10418Either lvs_uuid or lvs_name may be specified, but not both.
10419If both lvs_uuid and lvs_name are omitted, information about lvols in all logical volume stores is returned.
10420
10421#### Example
10422
10423Example request:
10424
10425~~~json
10426{
10427  "jsonrpc": "2.0",
10428  "method": "bdev_lvol_get_lvols",
10429  "id": 1,
10430  "params": {
10431    "lvs_name": "lvs_test"
10432  }
10433}
10434~~~
10435
10436Example response:
10437
10438~~~json
10439[
10440  {
10441    "alias": "lvs_test/lvol1",
10442    "uuid": "b335c368-851d-4099-81e0-018cc494fdf6",
10443    "name": "lvol1",
10444    "is_thin_provisioned": false,
10445    "is_snapshot": false,
10446    "is_clone": false,
10447    "is_esnap_clone": false,
10448    "is_degraded": false,
10449    "lvs": {
10450      "name": "lvs_test",
10451      "uuid": "a1c8d950-5715-4558-936d-ab9e6eca0794"
10452    }
10453  }
10454]
10455~~~
10456
10457## RAID
10458
10459### bdev_raid_set_options {#rpc_bdev_raid_set_options}
10460
10461Set options for bdev raid.
10462
10463This RPC can be called at any time, but the new value will only take effect for new raid bdevs.
10464
10465The `process_window_size_kb` parameter defines the size of the "window" (LBA range of the raid bdev)
10466in which a background process like rebuild performs its work. Any positive value is valid, but the value
10467actually used by a raid bdev can be adjusted to the size of the raid bdev or the write unit size.
10468
10469#### Parameters
10470
10471Name                       | Optional | Type        | Description
10472-------------------------- | -------- | ----------- | -----------
10473process_window_size_kb     | Optional | number      | Background process (e.g. rebuild) window size in KiB
10474
10475#### Example
10476
10477Example request:
10478
10479~~~json
10480request:
10481{
10482  "jsonrpc": "2.0",
10483  "method": "bdev_raid_set_options",
10484  "id": 1,
10485  "params": {
10486    "process_window_size_kb": 512
10487  }
10488}
10489~~~
10490
10491Example response:
10492
10493~~~json
10494{
10495  "jsonrpc": "2.0",
10496  "id": 1,
10497  "result": true
10498}
10499~~~
10500
10501### bdev_raid_get_bdevs {#rpc_bdev_raid_get_bdevs}
10502
10503This is used to list all the raid bdev details based on the input category requested. Category should be one
10504of 'all', 'online', 'configuring' or 'offline'. 'all' means all the raid bdevs whether they are online or
10505configuring or offline. 'online' is the raid bdev which is registered with bdev layer. 'configuring' is
10506the raid bdev which does not have full configuration discovered yet. 'offline' is the raid bdev which is
10507not registered with bdev as of now and it has encountered any error or user has requested to offline
10508the raid bdev.
10509
10510#### Parameters
10511
10512Name                    | Optional | Type        | Description
10513----------------------- | -------- | ----------- | -----------
10514category                | Required | string      | all or online or configuring or offline
10515
10516#### Example
10517
10518Example request:
10519
10520~~~json
10521{
10522  "jsonrpc": "2.0",
10523  "method": "bdev_raid_get_bdevs",
10524  "id": 1,
10525  "params": {
10526    "category": "all"
10527  }
10528}
10529~~~
10530
10531Example response:
10532
10533~~~json
10534{
10535  "jsonrpc": "2.0",
10536  "id": 1,
10537  "result": [
10538    {
10539      "name": "RaidBdev0",
10540      "uuid": "7d352e83-fe27-40f2-8fef-64563355e076",
10541      "strip_size_kb": 128,
10542      "state": "online",
10543      "raid_level": "raid0",
10544      "num_base_bdevs": 2,
10545      "num_base_bdevs_discovered": 2,
10546      "num_base_bdevs_operational": 2,
10547      "base_bdevs_list": [
10548        {
10549          "name": "malloc0",
10550          "uuid": "d2788884-5b3e-4fd7-87ff-6c78177e14ab",
10551          "is_configured": true,
10552          "data_offset": 256,
10553          "data_size": 261888
10554        },
10555        {
10556          "name": "malloc1",
10557          "uuid": "a81bb1f8-5865-488a-8758-10152017e7d1",
10558          "is_configured": true,
10559          "data_offset": 256,
10560          "data_size": 261888
10561        }
10562      ]
10563    },
10564    {
10565      "name": "RaidBdev1",
10566      "uuid": "f7cb71ed-2d0e-4240-979e-27b0b7735f36",
10567      "strip_size_kb": 128,
10568      "state": "configuring",
10569      "raid_level": "raid0",
10570      "num_base_bdevs": 2,
10571      "num_base_bdevs_discovered": 1,
10572      "num_base_bdevs_operational": 2,
10573      "base_bdevs_list": [
10574        {
10575          "name": "malloc2",
10576          "uuid": "f60c20e1-3439-4f89-ae55-965a70333f86",
10577          "is_configured": true,
10578          "data_offset": 256,
10579          "data_size": 261888
10580        }
10581        {
10582          "name": "malloc3",
10583          "uuid": "00000000-0000-0000-0000-000000000000",
10584          "is_configured": false,
10585          "data_offset": 0,
10586          "data_size": 0
10587        }
10588      ]
10589    }
10590  ]
10591}
10592~~~
10593
10594### bdev_raid_create {#rpc_bdev_raid_create}
10595
10596Constructs new RAID bdev.
10597
10598#### Parameters
10599
10600Name                    | Optional | Type        | Description
10601----------------------- | -------- | ----------- | -----------
10602name                    | Required | string      | RAID bdev name
10603strip_size_kb           | Required | number      | Strip size in KB
10604raid_level              | Required | string      | RAID level
10605base_bdevs              | Required | string      | Base bdevs name, whitespace separated list in quotes
10606uuid                    | Optional | string      | UUID for this RAID bdev
10607superblock              | Optional | boolean     | If set, information about raid bdev will be stored in superblock on each base bdev (default: `false`)
10608
10609#### Example
10610
10611Example request:
10612
10613~~~json
10614{
10615  "jsonrpc": "2.0",
10616  "method": "bdev_raid_create",
10617  "id": 1,
10618  "params": {
10619    "name": "Raid0",
10620    "raid_level": "0",
10621    "base_bdevs": [
10622      "Malloc0",
10623      "Malloc1",
10624      "Malloc2",
10625      "Malloc3"
10626    ],
10627    "strip_size_kb": 4
10628  }
10629}
10630~~~
10631
10632Example response:
10633
10634~~~json
10635{
10636  "jsonrpc": "2.0",
10637  "id": 1,
10638  "result": true
10639}
10640~~~
10641
10642### bdev_raid_delete {#rpc_bdev_raid_delete}
10643
10644Removes RAID bdev.
10645
10646#### Parameters
10647
10648Name                    | Optional | Type        | Description
10649----------------------- | -------- | ----------- | -----------
10650name                    | Required | string      | RAID bdev name
10651
10652#### Example
10653
10654Example request:
10655
10656~~~json
10657{
10658  "jsonrpc": "2.0",
10659  "method": "bdev_raid_delete",
10660  "id": 1,
10661  "params": {
10662    "name": "Raid0"
10663  }
10664}
10665~~~
10666
10667Example response:
10668
10669~~~json
10670{
10671  "jsonrpc": "2.0",
10672  "id": 1,
10673  "result": true
10674}
10675~~~
10676
10677### bdev_raid_add_base_bdev {#rpc_bdev_raid_add_base_bdev}
10678
10679Add base bdev to existing raid bdev. The raid bdev must have an empty base bdev slot.
10680The bdev must be large enough and have the same block size and metadata format as the other base bdevs.
10681
10682#### Parameters
10683
10684Name                    | Optional | Type        | Description
10685----------------------- | -------- | ----------- | -----------
10686raid_bdev               | Required | string      | Raid bdev name
10687base_bdev               | Required | string      | Base bdev name
10688
10689#### Example
10690
10691Example request:
10692
10693~~~json
10694{
10695  "jsonrpc": "2.0",
10696  "method": "bdev_raid_add_base_bdev",
10697  "id": 1,
10698  "params": {
10699    "raid_bdev": "RaidBdev0",
10700    "base_bdev": "Nvme0n1"
10701  }
10702}
10703~~~
10704
10705Example response:
10706
10707~~~json
10708{
10709  "jsonrpc": "2.0",
10710  "id": 1,
10711  "result": true
10712}
10713~~~
10714### bdev_raid_remove_base_bdev {#rpc_bdev_raid_remove_base_bdev}
10715
10716Remove base bdev from existing raid bdev.
10717
10718#### Parameters
10719
10720Name                    | Optional | Type        | Description
10721----------------------- | -------- | ----------- | -----------
10722name                    | Required | string      | Base bdev name in RAID
10723
10724#### Example
10725
10726Example request:
10727
10728~~~json
10729{
10730  "jsonrpc": "2.0",
10731  "method": "bdev_raid_remove_base_bdev",
10732  "id": 1,
10733  "params": {
10734    "name": "Raid0"
10735  }
10736}
10737~~~
10738
10739Example response:
10740
10741~~~json
10742{
10743  "jsonrpc": "2.0",
10744  "id": 1,
10745  "result": true
10746}
10747~~~
10748
10749## SPLIT
10750
10751### bdev_split_create {#rpc_bdev_split_create}
10752
10753This is used to split an underlying block device and create several smaller equal-sized vbdevs.
10754
10755#### Parameters
10756
10757Name                    | Optional | Type        | Description
10758----------------------- | -------- | ----------- | -----------
10759base_bdev               | Required | string      | base bdev name
10760split_count             | Required | number      | number of splits
10761split_size_mb           | Optional | number      | size in MB to restrict the size
10762
10763#### Example
10764
10765Example request:
10766
10767~~~json
10768{
10769  "jsonrpc": "2.0",
10770  "method": "bdev_split_create",
10771  "id": 1,
10772  "params": {
10773    "base_bdev": "Malloc0",
10774    "split_count": 4
10775  }
10776}
10777~~~
10778
10779Example response:
10780
10781~~~json
10782{
10783  "jsonrpc": "2.0",
10784  "id": 1,
10785  "result": [
10786    "Malloc0p0",
10787    "Malloc0p1",
10788    "Malloc0p2",
10789    "Malloc0p3"
10790  ]
10791}
10792~~~
10793
10794### bdev_split_delete {#rpc_bdev_split_delete}
10795
10796This is used to remove the split vbdevs.
10797
10798#### Parameters
10799
10800Name                    | Optional | Type        | Description
10801----------------------- | -------- | ----------- | -----------
10802base_bdev               | Required | string      | base bdev name
10803
10804#### Example
10805
10806Example request:
10807
10808~~~json
10809{
10810  "jsonrpc": "2.0",
10811  "method": "bdev_split_delete",
10812  "id": 1,
10813  "params": {
10814    "base_bdev": "Malloc0"
10815  }
10816}
10817~~~
10818
10819Example response:
10820
10821~~~json
10822{
10823  "jsonrpc": "2.0",
10824  "id": 1,
10825  "result": true
10826}
10827~~~
10828
10829## Uring
10830
10831### bdev_uring_create {#rpc_bdev_uring_create}
10832
10833Create a bdev with io_uring backend.
10834
10835#### Parameters
10836
10837Name                    | Optional | Type        | Description
10838----------------------- | -------- | ----------- | -----------
10839filename                | Required | string      | path to device or file (ex: /dev/nvme0n1)
10840name                    | Required | string      | name of bdev
10841block_size              | Optional | number      | block size of device (If omitted, get the block size from the file)
10842uuid                    | Optional | string      | UUID of new bdev
10843
10844#### Example
10845
10846Example request:
10847
10848~~~json
10849{
10850  "jsonrpc": "2.0",
10851  "method": "bdev_uring_create",
10852  "id": 1,
10853  "params": {
10854    "name": "bdev_u0",
10855    "filename": "/dev/nvme0n1",
10856    "block_size": 512
10857  }
10858}
10859~~~
10860
10861Example response:
10862
10863~~~json
10864{
10865  "jsonrpc": "2.0",
10866  "id": 1,
10867  "result": "bdev_u0"
10868}
10869~~~
10870
10871### bdev_uring_rescan {#rpc_bdev_uring_rescan}
10872
10873Rescan the size of a uring bdev.
10874
10875#### Parameters
10876
10877Name | Optional | Type   | Description
10878---- | -------- | ------ | -----------
10879name | Required | string | name of uring bdev to rescan
10880
10881#### Example
10882
10883Example request:
10884
10885~~~json
10886{
10887  "jsonrpc": "2.0",
10888  "method": "bdev_uring_rescan",
10889  "id": 1,
10890  "params": {
10891    "name": "bdev_u0"
10892  }
10893}
10894~~~
10895
10896Example response:
10897
10898~~~json
10899{
10900  "jsonrpc": "2.0",
10901  "id": 1,
10902  "result": true
10903}
10904~~~
10905
10906### bdev_uring_delete {#rpc_bdev_uring_delete}
10907
10908Remove a uring bdev.
10909
10910#### Parameters
10911
10912Name                    | Optional | Type        | Description
10913----------------------- | -------- | ----------- | -----------
10914name                    | Required | string      | name of uring bdev to delete
10915
10916#### Example
10917
10918Example request:
10919
10920~~~json
10921{
10922  "jsonrpc": "2.0",
10923  "method": "bdev_uring_delete",
10924  "id": 1,
10925  "params": {
10926    "name": "bdev_u0"
10927  }
10928}
10929~~~
10930
10931Example response:
10932
10933~~~json
10934{
10935  "jsonrpc": "2.0",
10936  "id": 1,
10937  "result": true
10938}
10939~~~
10940
10941## OPAL
10942
10943### bdev_nvme_opal_init {#rpc_bdev_nvme_opal_init}
10944
10945This is used to initialize OPAL of a given NVMe ctrlr, including taking ownership and activating.
10946
10947#### Parameters
10948
10949Name                    | Optional | Type        | Description
10950----------------------- | -------- | ----------- | -----------
10951nvme_ctrlr_name         | Required | string      | name of nvme ctrlr
10952password                | Required | string      | admin password of OPAL
10953
10954#### Example
10955
10956Example request:
10957
10958~~~json
10959{
10960  "jsonrpc": "2.0",
10961  "method": "bdev_nvme_opal_init",
10962  "id": 1,
10963  "params": {
10964    "nvme_ctrlr_name": "nvme0",
10965    "password": "*****"
10966  }
10967}
10968~~~
10969
10970Example response:
10971
10972~~~json
10973{
10974  "jsonrpc": "2.0",
10975  "id": 1,
10976  "result": true
10977}
10978~~~
10979
10980### bdev_nvme_opal_revert {#rpc_bdev_nvme_opal_revert}
10981
10982This is used to revert OPAL to its factory settings. Erase all user configuration and data.
10983
10984#### Parameters
10985
10986Name                    | Optional | Type        | Description
10987----------------------- | -------- | ----------- | -----------
10988nvme_ctrlr_name         | Required | string      | name of nvme ctrlr
10989password                | Required | string      | admin password of OPAL
10990
10991#### Example
10992
10993Example request:
10994
10995~~~json
10996{
10997  "jsonrpc": "2.0",
10998  "method": "bdev_nvme_opal_revert",
10999  "id": 1,
11000  "params": {
11001    "nvme_ctrlr_name": "nvme0",
11002    "password": "*****"
11003  }
11004}
11005~~~
11006
11007Example response:
11008
11009~~~json
11010{
11011  "jsonrpc": "2.0",
11012  "id": 1,
11013  "result": true
11014}
11015~~~
11016
11017### bdev_opal_create {#rpc_bdev_opal_create}
11018
11019This is used to create an OPAL virtual bdev.
11020
11021#### Parameters
11022
11023Name                    | Optional | Type        | Description
11024----------------------- | -------- | ----------- | -----------
11025nvme_ctrlr_name         | Required | string      | name of nvme ctrlr that supports OPAL
11026nsid                    | Required | number      | namespace ID
11027locking_range_id        | Required | number      | OPAL locking range ID
11028range_start             | Required | number      | locking range start LBA
11029range_length            | Required | number      | locking range length
11030password                | Required | string      | admin password of OPAL
11031
11032#### Response
11033
11034The response is the name of created OPAL virtual bdev.
11035
11036#### Example
11037
11038Example request:
11039
11040~~~json
11041{
11042  "jsonrpc": "2.0",
11043  "method": "bdev_opal_create",
11044  "id": 1,
11045  "params": {
11046    "nvme_ctrlr_name": "nvme0",
11047    "nsid": 1,
11048    "locking_range_id": 1,
11049    "range_start": 0,
11050    "range_length": 4096,
11051    "password": "*****"
11052  }
11053}
11054~~~
11055
11056Example response:
11057
11058~~~json
11059{
11060  "jsonrpc": "2.0",
11061  "id": 1,
11062  "result": "nvme0n1r1"
11063}
11064~~~
11065
11066### bdev_opal_get_info {#rpc_bdev_opal_get_info}
11067
11068This is used to get information of a given OPAL bdev.
11069
11070#### Parameters
11071
11072Name                    | Optional | Type        | Description
11073----------------------- | -------- | ----------- | -----------
11074bdev_name               | Required | string      | name of OPAL vbdev
11075password                | Required | string      | admin password
11076
11077#### Response
11078
11079The response is the locking info of OPAL virtual bdev.
11080
11081#### Example
11082
11083Example request:
11084
11085~~~json
11086{
11087  "jsonrpc": "2.0",
11088  "method": "bdev_opal_get_info",
11089  "id": 1,
11090  "params": {
11091    "bdev_name": "nvme0n1r1",
11092    "password": "*****"
11093  }
11094}
11095~~~
11096
11097Example response:
11098
11099~~~json
11100{
11101  "jsonrpc": "2.0",
11102  "id": 1,
11103  "result": {
11104      "name": "nvme0n1r1",
11105      "range_start": 0,
11106      "range_length": 4096,
11107      "read_lock_enabled": true,
11108      "write_lock_enabled": true,
11109      "read_locked": false,
11110      "write_locked": false
11111    }
11112}
11113~~~
11114
11115### bdev_opal_delete {#rpc_bdev_opal_delete}
11116
11117This is used to delete OPAL vbdev.
11118
11119#### Parameters
11120
11121Name                    | Optional | Type        | Description
11122----------------------- | -------- | ----------- | -----------
11123bdev_name               | Required | string      | name of OPAL vbdev
11124password                | Required | string      | admin password
11125
11126#### Example
11127
11128Example request:
11129
11130~~~json
11131{
11132  "jsonrpc": "2.0",
11133  "method": "bdev_opal_delete",
11134  "id": 1,
11135  "params": {
11136    "bdev_name": "nvme0n1r1",
11137    "password": "*****"
11138  }
11139}
11140~~~
11141
11142Example response:
11143
11144~~~json
11145{
11146  "jsonrpc": "2.0",
11147  "id": 1,
11148  "result": true
11149}
11150~~~
11151
11152### bdev_opal_new_user {#rpc_bdev_opal_new_user}
11153
11154This enables a new user to the specified opal bdev so that the user can lock/unlock the bdev.
11155Recalling this for the same opal bdev, only the newest user will have the privilege.
11156
11157#### Parameters
11158
11159Name                    | Optional | Type        | Description
11160----------------------- | -------- | ----------- | -----------
11161bdev_name               | Required | string      | name of OPAL vbdev
11162admin_password          | Required | string      | admin password
11163user_id                 | Required | number      | user ID
11164user_password           | Required | string      | user password
11165
11166#### Example
11167
11168Example request:
11169
11170~~~json
11171{
11172  "jsonrpc": "2.0",
11173  "method": "bdev_opal_new_user",
11174  "id": 1,
11175  "params": {
11176    "bdev_name": "nvme0n1r1",
11177    "admin_password": "*****",
11178    "user_id": "1",
11179    "user_password": "********"
11180  }
11181}
11182~~~
11183
11184Example response:
11185
11186~~~json
11187{
11188  "jsonrpc": "2.0",
11189  "id": 1,
11190  "result": true
11191}
11192~~~
11193
11194### bdev_opal_set_lock_state {#rpc_bdev_opal_set_lock_state}
11195
11196This is used to lock/unlock specific opal bdev providing user ID and password.
11197
11198#### Parameters
11199
11200Name                    | Optional | Type        | Description
11201----------------------- | -------- | ----------- | -----------
11202bdev_name               | Required | string      | name of OPAL vbdev
11203user_id                 | Required | number      | user ID
11204password                | Required | string      | user password
11205lock_state              | Required | string      | lock state
11206
11207#### Example
11208
11209Example request:
11210
11211~~~json
11212{
11213  "jsonrpc": "2.0",
11214  "method": "bdev_opal_set_lock_state",
11215  "id": 1,
11216  "params": {
11217    "bdev_name": "nvme0n1r1",
11218    "user_id": "1",
11219    "user_password": "********",
11220    "lock_state": "rwlock"
11221  }
11222}
11223~~~
11224
11225Example response:
11226
11227~~~json
11228{
11229  "jsonrpc": "2.0",
11230  "id": 1,
11231  "result": true
11232}
11233~~~
11234
11235## Notifications
11236
11237### notify_get_types {#rpc_notify_get_types}
11238
11239Return list of all supported notification types.
11240
11241#### Parameters
11242
11243None
11244
11245#### Response
11246
11247The response is an array of strings - supported RPC notification types.
11248
11249#### Example
11250
11251Example request:
11252
11253~~~json
11254{
11255  "jsonrpc": "2.0",
11256  "method": "notify_get_types",
11257  "id": 1
11258}
11259~~~
11260
11261Example response:
11262
11263~~~json
11264{
11265  "id": 1,
11266  "result": [
11267    "bdev_register",
11268    "bdev_unregister"
11269  ],
11270  "jsonrpc": "2.0"
11271}
11272~~~
11273
11274### notify_get_notifications {#notify_get_notifications}
11275
11276Request notifications. Returns array of notifications that happened since the specified id (or first that is available).
11277
11278Notice: Notifications are kept in circular buffer with limited size. Older notifications might be inaccessible
11279due to being overwritten by new ones.
11280
11281#### Parameters
11282
11283Name                    | Optional | Type        | Description
11284----------------------- | -------- | ----------- | -----------
11285id                      | Optional | number      | First Event ID to fetch (default: first available).
11286max                     | Optional | number      | Maximum number of event to return (default: no limit).
11287
11288#### Response
11289
11290Response is an array of event objects.
11291
11292Name                    | Optional | Type        | Description
11293----------------------- | -------- | ----------- | -----------
11294id                      | Optional | number      | Event ID.
11295type                    | Optional | number      | Type of the event.
11296ctx                     | Optional | string      | Event context.
11297
11298#### Example
11299
11300Example request:
11301
11302~~~json
11303{
11304  "id": 1,
11305  "jsonrpc": "2.0",
11306  "method": "notify_get_notifications",
11307  "params": {
11308    "id": 1,
11309    "max": 10
11310  }
11311}
11312
11313~~~
11314
11315Example response:
11316
11317~~~json
11318{
11319  "jsonrpc": "2.0",
11320  "id": 1,
11321  "result": [
11322    {
11323      "ctx": "Malloc0",
11324      "type": "bdev_register",
11325      "id": 1
11326    },
11327    {
11328      "ctx": "Malloc2",
11329      "type": "bdev_register",
11330      "id": 2
11331    }
11332  ]
11333}
11334~~~
11335
11336## Linux Userspace Block Device (UBLK) {#jsonrpc_components_ublk}
11337
11338SPDK supports exporting bdevs though Linux ublk. The motivation behind it is to back a Linux kernel block device
11339with an SPDK user space bdev.
11340
11341To export a device over ublk, first make sure the Linux kernel ublk driver is loaded by running 'modprobe ublk_drv'.
11342
11343### ublk_create_target {#rpc_ublk_create_target}
11344
11345Start to create ublk threads and initialize ublk target. It will return an error if user calls this RPC twice without
11346ublk_destroy_target in between. It will use current cpumask in SPDK when user does not specify cpumask option.
11347
11348#### Parameters
11349
11350Name                    | Optional | Type        | Description
11351----------------------- | -------- | ----------- | -----------
11352cpumask                 | Optional | string      | Cpumask for ublk target
11353
11354#### Response
11355
11356True if ublk target initialization is successful; False if failed.
11357
11358#### Example
11359
11360Example request:
11361
11362~~~json
11363{
11364  "params": {
11365    "cpumask": "0x2"
11366  },
11367  "jsonrpc": "2.0",
11368  "method": "ublk_create_target",
11369  "id": 1
11370}
11371~~~
11372
11373Example response:
11374
11375~~~json
11376{
11377  "jsonrpc": "2.0",
11378  "id": 1,
11379  "result": true
11380}
11381~~~
11382
11383### ublk_destroy_target {#rpc_ublk_destroy_target}
11384
11385Release all UBLK devices and destroy ublk target.
11386
11387#### Response
11388
11389True if ublk target destruction is successful; False if failed.
11390
11391#### Example
11392
11393Example request:
11394
11395~~~json
11396{
11397  "jsonrpc": "2.0",
11398  "method": "ublk_destroy_target",
11399  "id": 1
11400}
11401~~~
11402
11403Example response:
11404
11405~~~json
11406{
11407  "jsonrpc": "2.0",
11408  "id": 1,
11409  "result": true
11410}
11411~~~
11412
11413### ublk_start_disk {#rpc_ublk_start_disk}
11414
11415Start to export one SPDK bdev as a UBLK device
11416
11417#### Parameters
11418
11419Name                    | Optional | Type        | Description
11420----------------------- | -------- | ----------- | -----------
11421bdev_name               | Required | string      | Bdev name to export
11422ublk_id                 | Required | int         | Device id
11423queue_depth             | Optional | int         | Device queue depth
11424num_queues              | Optional | int         | Total number of device queues
11425
11426#### Response
11427
11428UBLK device ID
11429
11430#### Example
11431
11432Example request:
11433
11434~~~json
11435{
11436 "params": {
11437    "ublk_id": "1",
11438    "bdev_name": "Malloc1"
11439  },
11440  "jsonrpc": "2.0",
11441  "method": "ublk_start_disk",
11442  "id": 1
11443}
11444~~~
11445
11446Example response:
11447
11448~~~json
11449{
11450  "jsonrpc": "2.0",
11451  "id": 1,
11452  "result": 1
11453}
11454~~~
11455
11456### ublk_recover_disk {#rpc_ublk_recover_disk}
11457
11458Recover original UBLK device with ID and block device
11459
11460#### Parameters
11461
11462Name                    | Optional | Type        | Description
11463----------------------- | -------- | ----------- | -----------
11464bdev_name               | Required | string      | Bdev name to export
11465ublk_id                 | Required | int         | Device id
11466
11467#### Response
11468
11469UBLK device ID
11470
11471#### Example
11472
11473Example request:
11474
11475~~~json
11476{
11477 "params": {
11478    "ublk_id": "1",
11479    "bdev_name": "Malloc1"
11480  },
11481  "jsonrpc": "2.0",
11482  "method": "ublk_recover_disk",
11483  "id": 1
11484}
11485~~~
11486
11487Example response:
11488
11489~~~json
11490{
11491  "jsonrpc": "2.0",
11492  "id": 1,
11493  "result": 1
11494}
11495
11496### ublk_stop_disk {#rpc_ublk_stop_disk}
11497
11498Delete a UBLK device
11499
11500#### Parameters
11501
11502Name                    | Optional | Type        | Description
11503----------------------- | -------- | ----------- | -----------
11504ublk_id                 | Required | int         | Device id to delete
11505
11506#### Response
11507
11508True if UBLK device is deleted successfully; False if failed.
11509
11510#### Example
11511
11512Example request:
11513
11514~~~json
11515{
11516 "params": {
11517    "ublk_id": "1",
11518  },
11519  "jsonrpc": "2.0",
11520  "method": "ublk_stop_disk",
11521  "id": 1
11522}
11523~~~
11524
11525Example response:
11526
11527~~~json
11528{
11529  "jsonrpc": "2.0",
11530  "id": 1,
11531  "result": true
11532}
11533~~~
11534
11535### ublk_get_disks {#rpc_ublk_get_disks}
11536
11537Display full or specified ublk device list
11538
11539#### Parameters
11540
11541Name                    | Optional | Type        | Description
11542----------------------- | -------- | ----------- | -----------
11543ublk_id                 | Optional | int         | ublk device id to display
11544
11545#### Response
11546
11547Display ublk device list
11548
11549#### Example
11550
11551Example request:
11552
11553~~~json
11554{
11555  "jsonrpc": "2.0",
11556  "method": "ublk_get_disks",
11557  "id": 1
11558}
11559~~~
11560
11561Example response:
11562
11563~~~json
11564{
11565  "jsonrpc": "2.0",
11566  "id": 1,
11567  "result":  [
11568    {
11569      "ublk_device": "/dev/ublkb1",
11570      "id": 1,
11571      "queue_depth": 512,
11572      "num_queues": 1,
11573      "bdev_name": "Malloc1"
11574    }
11575  ]
11576}
11577~~~
11578
11579## Linux Network Block Device (NBD) {#jsonrpc_components_nbd}
11580
11581SPDK supports exporting bdevs through Linux nbd. These devices then appear as standard Linux kernel block devices
11582and can be accessed using standard utilities like fdisk.
11583
11584In order to export a device over nbd, first make sure the Linux kernel nbd driver is loaded by running 'modprobe nbd'.
11585
11586### nbd_start_disk {#rpc_nbd_start_disk}
11587
11588Start to export one SPDK bdev as NBD disk
11589
11590#### Parameters
11591
11592Name                    | Optional | Type        | Description
11593----------------------- | -------- | ----------- | -----------
11594bdev_name               | Required | string      | Bdev name to export
11595nbd_device              | Optional | string      | NBD device name to assign
11596
11597#### Response
11598
11599Path of exported NBD disk
11600
11601#### Example
11602
11603Example request:
11604
11605~~~json
11606{
11607 "params": {
11608    "nbd_device": "/dev/nbd1",
11609    "bdev_name": "Malloc1"
11610  },
11611  "jsonrpc": "2.0",
11612  "method": "nbd_start_disk",
11613  "id": 1
11614}
11615~~~
11616
11617Example response:
11618
11619~~~json
11620{
11621  "jsonrpc": "2.0",
11622  "id": 1,
11623  "result": "/dev/nbd1"
11624}
11625~~~
11626
11627### nbd_stop_disk {#rpc_nbd_stop_disk}
11628
11629Stop one NBD disk which is based on SPDK bdev.
11630
11631#### Parameters
11632
11633Name                    | Optional | Type        | Description
11634----------------------- | -------- | ----------- | -----------
11635nbd_device              | Required | string      | NBD device name to stop
11636
11637#### Example
11638
11639Example request:
11640
11641~~~json
11642{
11643 "params": {
11644    "nbd_device": "/dev/nbd1",
11645  },
11646  "jsonrpc": "2.0",
11647  "method": "nbd_stop_disk",
11648  "id": 1
11649}
11650~~~
11651
11652Example response:
11653
11654~~~json
11655{
11656  "jsonrpc": "2.0",
11657  "id": 1,
11658  "result": "true"
11659}
11660~~~
11661
11662### nbd_get_disks {#rpc_nbd_get_disks}
11663
11664Display all or specified NBD device list
11665
11666#### Parameters
11667
11668Name                    | Optional | Type        | Description
11669----------------------- | -------- | ----------- | -----------
11670nbd_device              | Optional | string      | NBD device name to display
11671
11672#### Response
11673
11674The response is an array of exported NBD devices and their corresponding SPDK bdev.
11675
11676#### Example
11677
11678Example request:
11679
11680~~~json
11681{
11682  "jsonrpc": "2.0",
11683  "method": "nbd_get_disks",
11684  "id": 1
11685}
11686~~~
11687
11688Example response:
11689
11690~~~json
11691{
11692  "jsonrpc": "2.0",
11693  "id": 1,
11694  "result":  [
11695    {
11696      "bdev_name": "Malloc0",
11697      "nbd_device": "/dev/nbd0"
11698    },
11699    {
11700      "bdev_name": "Malloc1",
11701      "nbd_device": "/dev/nbd1"
11702    }
11703  ]
11704}
11705~~~
11706
11707## Blobfs {#jsonrpc_components_blobfs}
11708
11709### blobfs_detect {#rpc_blobfs_detect}
11710
11711Detect whether a blobfs exists on bdev.
11712
11713#### Parameters
11714
11715Name                    | Optional | Type        | Description
11716----------------------- | -------- | ----------- | -----------
11717bdev_name               | Required | string      | Block device name to detect blobfs
11718
11719#### Response
11720
11721True if a blobfs exists on the bdev; False otherwise.
11722
11723#### Example
11724
11725Example request:
11726
11727~~~json
11728{
11729  "jsonrpc": "2.0",
11730  "id": 1,
11731  "method": "blobfs_detect",
11732  "params": {
11733    "bdev_name": "Malloc0"
11734  }
11735}
11736~~~
11737
11738Example response:
11739
11740~~~json
11741{
11742  "jsonrpc": "2.0",
11743  "id": 1,
11744  "result": "true"
11745}
11746~~~
11747
11748### blobfs_create {#rpc_blobfs_create}
11749
11750Build blobfs on bdev.
11751
11752#### Parameters
11753
11754Name                    | Optional | Type        | Description
11755----------------------- | -------- | ----------- | -----------
11756bdev_name               | Required | string      | Block device name to create blobfs
11757cluster_sz              | Optional | number      | Size of cluster in bytes. Must be multiple of 4KiB page size, default and minimal value is 1M.
11758
11759#### Example
11760
11761Example request:
11762
11763~~~json
11764{
11765  "jsonrpc": "2.0",
11766  "id": 1,
11767  "method": "blobfs_create",
11768  "params": {
11769    "bdev_name": "Malloc0",
11770    "cluster_sz": 1M
11771  }
11772}
11773~~~
11774
11775Example response:
11776
11777~~~json
11778{
11779  "jsonrpc": "2.0",
11780  "id": 1,
11781  "result": "true"
11782}
11783~~~
11784
11785### blobfs_mount {#rpc_blobfs_mount}
11786
11787Mount a blobfs on bdev to one host path through FUSE
11788
11789#### Parameters
11790
11791Name                    | Optional | Type        | Description
11792----------------------- | -------- | ----------- | -----------
11793bdev_name               | Required | string      | Block device name where the blobfs is
11794mountpoint              | Required | string      | Mountpoint path in host to mount blobfs
11795
11796#### Example
11797
11798Example request:
11799
11800~~~json
11801{
11802  "jsonrpc": "2.0",
11803  "id": 1,
11804  "method": ""blobfs_mount"",
11805  "params": {
11806    "bdev_name": "Malloc0",
11807    "mountpoint": "/mnt/"
11808  }
11809}
11810~~~
11811
11812Example response:
11813
11814~~~json
11815{
11816  "jsonrpc": "2.0",
11817  "id": 1,
11818  "result": "true"
11819}
11820~~~
11821
11822### blobfs_set_cache_size {#rpc_blobfs_set_cache_size}
11823
11824Set cache pool size for blobfs filesystems.  This RPC is only permitted when the cache pool is not already initialized.
11825
11826The cache pool is initialized when the first blobfs filesystem is initialized or loaded.  It is freed when the all
11827initialized or loaded filesystems are unloaded.
11828
11829#### Parameters
11830
11831Name                    | Optional | Type        | Description
11832----------------------- | -------- | ----------- | -----------
11833size_in_mb              | Required | number      | Cache size in megabytes
11834
11835#### Response
11836
11837True if cache size is set successfully; False if failed to set.
11838
11839#### Example
11840
11841Example request:
11842
11843~~~json
11844{
11845  "jsonrpc": "2.0",
11846  "id": 1,
11847  "method": "blobfs_set_cache_size",
11848  "params": {
11849    "size_in_mb": 512,
11850  }
11851}
11852~~~
11853
11854Example response:
11855
11856~~~json
11857{
11858  "jsonrpc": "2.0",
11859  "id": 1,
11860  "result": true
11861}
11862~~~
11863
11864## Socket layer {#jsonrpc_components_sock}
11865
11866### sock_impl_get_options {#rpc_sock_impl_get_options}
11867
11868Get parameters for the socket layer implementation.
11869
11870#### Parameters
11871
11872Name                    | Optional | Type        | Description
11873----------------------- | -------- | ----------- | -----------
11874impl_name               | Required | string      | Name of socket implementation, e.g. posix
11875
11876#### Response
11877
11878Response is an object with current socket layer options for requested implementation.
11879
11880#### Example
11881
11882Example request:
11883
11884~~~json
11885{
11886  "jsonrpc": "2.0",
11887  "method": "sock_impl_get_options",
11888  "id": 1,
11889  "params": {
11890    "impl_name": "posix"
11891  }
11892}
11893~~~
11894
11895Example response:
11896
11897~~~json
11898{
11899  "jsonrpc": "2.0",
11900  "id": 1,
11901  "result": {
11902    "recv_buf_size": 2097152,
11903    "send_buf_size": 2097152,
11904    "enable_recv_pipe": true,
11905    "enable_quickack": true,
11906    "enable_placement_id": 0,
11907    "enable_zerocopy_send_server": true,
11908    "enable_zerocopy_send_client": false,
11909    "zerocopy_threshold": 0,
11910    "tls_version": 13,
11911    "enable_ktls": false
11912  }
11913}
11914~~~
11915
11916### sock_impl_set_options {#rpc_sock_impl_set_options}
11917
11918Set parameters for the socket layer implementation.
11919
11920#### Parameters
11921
11922Name                        | Optional | Type        | Description
11923--------------------------- | -------- | ----------- | -----------
11924impl_name                   | Required | string      | Name of socket implementation, e.g. posix
11925recv_buf_size               | Optional | number      | Size of socket receive buffer in bytes
11926send_buf_size               | Optional | number      | Size of socket send buffer in bytes
11927enable_recv_pipe            | Optional | boolean     | Enable or disable receive pipe
11928enable_quick_ack            | Optional | boolean     | Enable or disable quick ACK
11929enable_placement_id         | Optional | number      | Enable or disable placement_id. 0:disable,1:incoming_napi,2:incoming_cpu
11930enable_zerocopy_send_server | Optional | boolean     | Enable or disable zero copy on send for server sockets
11931enable_zerocopy_send_client | Optional | boolean     | Enable or disable zero copy on send for client sockets
11932zerocopy_threshold          | Optional | number      | Set zerocopy_threshold in bytes. A consecutive sequence of requests' iovecs
11933--                          | --       | --          | that fall below this threshold may be sent without zerocopy flag set
11934tls_version                 | Optional | number      | TLS protocol version, e.g. 13 for v1.3 (only applies when impl_name == ssl)
11935enable_ktls                 | Optional | boolean     | Enable or disable Kernel TLS (only applies when impl_name == ssl)
11936
11937#### Response
11938
11939True if socket layer options were set successfully.
11940
11941#### Example
11942
11943Example request:
11944
11945~~~json
11946{
11947  "jsonrpc": "2.0",
11948  "method": "sock_impl_set_options",
11949  "id": 1,
11950  "params": {
11951    "impl_name": "posix",
11952    "recv_buf_size": 2097152,
11953    "send_buf_size": 2097152,
11954    "enable_recv_pipe": false,
11955    "enable_quick_ack": false,
11956    "enable_placement_id": 0,
11957    "enable_zerocopy_send_server": true,
11958    "enable_zerocopy_send_client": false,
11959    "zerocopy_threshold": 10240,
11960    "tls_version": 13,
11961    "enable_ktls": false
11962  }
11963}
11964~~~
11965
11966Example response:
11967
11968~~~json
11969{
11970  "jsonrpc": "2.0",
11971  "id": 1,
11972  "result": true
11973}
11974~~~
11975
11976### sock_set_default_impl {#rpc_sock_set_default_impl}
11977
11978Set the default sock implementation.
11979
11980#### Parameters
11981
11982Name                    | Optional | Type        | Description
11983----------------------- | -------- | ----------- | -----------
11984impl_name               | Required | string      | Name of socket implementation, e.g. posix
11985
11986#### Response
11987
11988True if the default socket layer configuration was set successfully.
11989
11990#### Example
11991
11992Example request:
11993
11994~~~json
11995{
11996  "jsonrpc": "2.0",
11997  "method": "sock_set_default_impl",
11998  "id": 1,
11999  "params": {
12000    "impl_name": "posix"
12001  }
12002}
12003~~~
12004
12005Example response:
12006
12007~~~json
12008{
12009  "jsonrpc": "2.0",
12010  "id": 1,
12011  "result": true
12012}
12013~~~
12014
12015## Miscellaneous RPC commands
12016
12017### bdev_nvme_send_cmd {#rpc_bdev_nvme_send_cmd}
12018
12019Send NVMe command directly to NVMe controller or namespace. Parameters and responses encoded by base64 urlsafe need further processing.
12020
12021Notice: bdev_nvme_send_cmd requires user to guarantee the correctness of NVMe command itself, and also optional parameters.
12022Illegal command contents or mismatching buffer size may result in unpredictable behavior.
12023
12024#### Parameters
12025
12026Name                    | Optional | Type        | Description
12027----------------------- | -------- | ----------- | -----------
12028name                    | Required | string      | Name of the operating NVMe controller
12029cmd_type                | Required | string      | Type of nvme cmd. Valid values are: admin, io
12030data_direction          | Required | string      | Direction of data transfer. Valid values are: c2h, h2c
12031cmdbuf                  | Required | string      | NVMe command encoded by base64 urlsafe
12032data                    | Optional | string      | Data transferring to controller from host, encoded by base64 urlsafe
12033metadata                | Optional | string      | Metadata transferring to controller from host, encoded by base64 urlsafe
12034data_len                | Optional | number      | Data length required to transfer from controller to host
12035metadata_len            | Optional | number      | Metadata length required to transfer from controller to host
12036timeout_ms              | Optional | number      | Command execution timeout value, in milliseconds
12037
12038#### Response
12039
12040Name                    | Type        | Description
12041----------------------- | ----------- | -----------
12042cpl                     | string      | NVMe completion queue entry, encoded by base64 urlsafe
12043data                    | string      | Data transferred from controller to host, encoded by base64 urlsafe
12044metadata                | string      | Metadata transferred from controller to host, encoded by base64 urlsafe
12045
12046#### Example
12047
12048Example request:
12049
12050~~~json
12051{
12052  "jsonrpc": "2.0",
12053  "method": "bdev_nvme_send_cmd",
12054  "id": 1,
12055  "params": {
12056    "name": "Nvme0",
12057    "cmd_type": "admin"
12058    "data_direction": "c2h",
12059    "cmdbuf": "BgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAsGUs9P5_AAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
12060    "data_len": 60,
12061  }
12062}
12063~~~
12064
12065Example response:
12066
12067~~~json
12068{
12069  "jsonrpc": "2.0",
12070  "id": 1,
12071  "result":  {
12072    "cpl": "AAAAAAAAAAARAAAAWrmwABAA==",
12073    "data": "sIjg6AAAAACwiODoAAAAALCI4OgAAAAAAAYAAREAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
12074  }
12075
12076}
12077~~~
12078
12079### vmd_enable {#rpc_enable_vmd}
12080
12081Enable VMD enumeration.
12082
12083#### Parameters
12084
12085This method has no parameters.
12086
12087#### Response
12088
12089Completion status of enumeration is returned as a boolean.
12090
12091### Example
12092
12093Example request:
12094
12095~~~json
12096{
12097  "jsonrpc": "2.0",
12098  "method": "vmd_enable",
12099  "id": 1
12100}
12101~~~
12102
12103Example response:
12104
12105~~~json
12106{
12107  "jsonrpc": "2.0",
12108  "id": 1,
12109  "result": true
12110}
12111~~~
12112
12113### vmd_remove_device {#rpc_vmd_remove_device}
12114
12115Remove a device behind a VMD.
12116
12117### Parameters
12118
12119Name                    | Optional | Type        | Description
12120----------------------- | -------- | ----------- | -----------
12121addr                    | Required | string      | Address of the device to remove.
12122
12123### Example
12124
12125~~~json
12126{
12127  "jsonrpc": "2.0",
12128  "method": "vmd_remove_device",
12129  "params": {
12130    "addr": "5d0505:01:00.0"
12131  }
12132  "id": 1
12133}
12134~~~
12135
12136Example response:
12137
12138~~~json
12139{
12140  "jsonrpc": "2.0",
12141  "id": 1,
12142  "result": true
12143}
12144~~~
12145
12146### vmd_rescan {#rpc_vmd_rescan}
12147
12148Force a rescan of the devices behind VMD.
12149
12150### Parameters
12151
12152This method has no parameters.
12153
12154#### Response
12155
12156The response is the number of new devices found.
12157
12158### Example
12159
12160~~~json
12161{
12162  "jsonrpc": "2.0",
12163  "method": "vmd_rescan",
12164  "id": 1
12165}
12166~~~
12167
12168Example response:
12169
12170~~~json
12171{
12172  "jsonrpc": "2.0",
12173  "id": 1,
12174  "result": {
12175    "count": 1
12176  }
12177}
12178~~~
12179
12180### spdk_get_version {#rpc_spdk_get_version}
12181
12182Get the version info of the running SPDK application.
12183
12184#### Parameters
12185
12186This method has no parameters.
12187
12188#### Response
12189
12190The response is the version number including major version number, minor version number, patch level number and suffix string.
12191
12192#### Example
12193
12194Example request:
12195
12196~~~json
12197{
12198  "jsonrpc": "2.0",
12199  "id": 1,
12200  "method": "spdk_get_version"
12201}
12202~~~
12203
12204Example response:
12205
12206~~~json
12207{
12208  "jsonrpc": "2.0",
12209  "id": 1,
12210  "result":  {
12211    "version": "19.04-pre",
12212    "fields" : {
12213      "major": 19,
12214      "minor": 4,
12215      "patch": 0,
12216      "suffix": "-pre"
12217    }
12218  }
12219}
12220~~~
12221
12222### framework_get_pci_devices
12223
12224List PCIe devices attached to an SPDK application and the contents of their config space.
12225
12226#### Parameters
12227
12228This method has no parameters.
12229
12230#### Response
12231
12232The response is an array of attached PCIe devices.
12233
12234#### Example
12235
12236Example request:
12237
12238~~~json
12239{
12240  "jsonrpc": "2.0",
12241  "id": 1,
12242  "method": "framework_get_pci_devices"
12243}
12244~~~
12245
12246Example response:
12247Note that the config space buffer was trimmed.
12248
12249~~~json
12250{
12251  "jsonrpc": "2.0",
12252  "id": 1,
12253  "result": {
12254    [
12255      {
12256        "address": "0000:00:04.0",
12257        "config_space": "8680455807051000...0000000000000000"
12258      },
12259      {
12260        "address": "0000:00:03.0",
12261        "config_space": "8680455807051000...0000000000000000"
12262      }
12263    ]
12264  }
12265}
12266~~~
12267
12268### bdev_nvme_add_error_injection {#rpc_bdev_nvme_add_error_injection}
12269
12270Add a NVMe command error injection for a bdev nvme controller.
12271
12272#### Parameters
12273
12274Name                    | Optional | Type        | Description
12275----------------------- | -------- | ----------- | -----------
12276name                    | Required | string      | Name of the operating NVMe controller
12277cmd_type                | Required | string      | Type of NVMe command. Valid values are: admin, io
12278opc                     | Required | number      | Opcode for which the error injection is applied
12279do_not_submit           | Optional | boolean     | Set to true if request should not be submitted to the controller (default false)
12280timeout_in_us           | Optional | number      | Wait specified microseconds when do_not_submit is true
12281err_count               | Optional | number      | Number of matching NVMe commands to inject errors
12282sct                     | Optional | number      | Status code type (default 0)
12283sc                      | Optional | number      | Status code (default 0)
12284
12285#### Response
12286
12287true on success
12288
12289#### Example
12290
12291Example request:
12292
12293~~~json
12294{
12295  "jsonrpc": "2.0",
12296  "method": "bdev_nvme_add_error_injection",
12297  "id": 1,
12298  "params": {
12299    "name": "HotInNvme0",
12300    "opc": 2,
12301    "cmd_type": "io",
12302    "err_count": 1111111,
12303    "sct": 11,
12304    "sc": 33
12305  }
12306}
12307
12308~~~
12309
12310Example response:
12311
12312~~~json
12313{
12314  "jsonrpc": "2.0",
12315  "id": 1,
12316  "result": true
12317}
12318
12319~~~
12320
12321### bdev_nvme_remove_error_injection {#rpc_bdev_nvme_remove_error_injection}
12322
12323Remove a NVMe command error injection.
12324
12325#### Parameters
12326
12327Name                    | Optional | Type        | Description
12328----------------------- | -------- | ----------- | -----------
12329name                    | Required | string      | Name of the operating NVMe controller
12330cmd_type                | Required | string      | Type of NVMe command. Valid values are: admin, io
12331opc                     | Required | number      | Opcode for which the error injection is applied
12332
12333#### Response
12334
12335true on success
12336
12337#### Example
12338
12339Example request:
12340
12341~~~json
12342{
12343  "jsonrpc": "2.0",
12344  "method": "bdev_nvme_remove_error_injection",
12345  "id": 1,
12346  "params": {
12347    "name": "HotInNvme0",
12348    "opc": 2,
12349    "cmd_type": "io"
12350  }
12351}
12352
12353
12354~~~
12355
12356Example response:
12357
12358~~~json
12359{
12360  "jsonrpc": "2.0",
12361  "id": 1,
12362  "result": true
12363}
12364
12365~~~
12366
12367### bdev_daos_create {#rpc_bdev_daos_create}
12368
12369Construct @ref bdev_config_daos
12370
12371#### Parameters
12372
12373Name                    | Optional | Type        | Description
12374----------------------- | -------- | ----------- | -----------
12375name                    | Required | string      | Bdev name to use
12376pool                    | Required | string      | DAOS pool label or its uuid
12377cont                    | Required | string      | DAOS cont label or its uuid
12378block_size              | Required | number      | Block size in bytes -must be multiple of 512
12379num_blocks              | Required | number      | Number of blocks
12380uuid                    | Optional | string      | UUID of new bdev
12381oclass                  | Optional | string      | DAOS object class (default SX)
12382
12383To find more about various object classes please visit [DAOS documentation](https://github.com/daos-stack/daos/blob/master/src/object/README.md).
12384Please note, that DAOS bdev module uses the same CLI flag notation as `dmg` and `daos` commands,
12385for instance, `SX` or `EC_4P2G2` rather than in DAOS header file `OC_SX` or `OC_EC_4P2G2`.
12386
12387#### Result
12388
12389Name of newly created bdev.
12390
12391#### Example
12392
12393Example request:
12394
12395~~~json
12396{
12397  "params": {
12398    "block_size": 4096,
12399    "num_blocks": 16384,
12400    "name": "daosdev0",
12401    "pool": "test-pool",
12402    "cont": "test-cont",
12403    "oclass": "EC_4P2G2"
12404  },
12405  "jsonrpc": "2.0",
12406  "method": "bdev_daos_create",
12407  "id": 1
12408}
12409~~~
12410
12411Example response:
12412
12413~~~json
12414{
12415  "jsonrpc": "2.0",
12416  "id": 1,
12417  "result": "daosdev0"
12418}
12419~~~
12420
12421### bdev_daos_delete {#rpc_bdev_daos_delete}
12422
12423Delete @ref bdev_config_daos
12424
12425#### Parameters
12426
12427Name                    | Optional | Type        | Description
12428----------------------- | -------- | ----------- | -----------
12429name                    | Required | string      | Bdev name
12430
12431#### Example
12432
12433Example request:
12434
12435~~~json
12436{
12437  "params": {
12438    "name": "daosdev0"
12439  },
12440  "jsonrpc": "2.0",
12441  "method": "bdev_daos_delete",
12442  "id": 1
12443}
12444~~~
12445
12446Example response:
12447
12448~~~json
12449{
12450  "jsonrpc": "2.0",
12451  "id": 1,
12452  "result": true
12453}
12454~~~
12455
12456### bdev_daos_resize {#rpc_bdev_daos_resize}
12457
12458Resize @ref bdev_config_daos.
12459
12460#### Parameters
12461
12462Name                    | Optional | Type        | Description
12463----------------------- | -------- | ----------- | -----------
12464name                    | Required | string      | Bdev name
12465new_size                | Required | number      | Bdev new capacity in MiB
12466
12467#### Example
12468
12469Example request:
12470
12471~~~json
12472{
12473  "params": {
12474    "name": "daosdev0",
12475    "new_size": 8192
12476  },
12477  "jsonrpc": "2.0",
12478  "method": "bdev_daos_resize",
12479  "id": 1
12480}
12481~~~
12482
12483Example response:
12484
12485~~~json
12486{
12487  "jsonrpc": "2.0",
12488  "id": 1,
12489  "result": true
12490}
12491~~~
12492
12493### iobuf_set_options {#rpc_iobuf_set_options}
12494
12495Set iobuf buffer pool options.
12496
12497#### Parameters
12498
12499Name                    | Optional | Type        | Description
12500----------------------- | -------- | ----------- | -----------
12501small_pool_count        | Optional | number      | Number of small buffers in the global pool
12502large_pool_count        | Optional | number      | Number of large buffers in the global pool
12503small_bufsize           | Optional | number      | Size of a small buffer
12504large_bufsize           | Optional | number      | Size of a small buffer
12505
12506#### Example
12507
12508Example request:
12509
12510~~~json
12511{
12512  "jsonrpc": "2.0",
12513  "id": 1,
12514  "method": "iobuf_set_options",
12515  "params": {
12516    "small_pool_count": 16383,
12517    "large_pool_count": 2047
12518  }
12519}
12520~~~
12521
12522Example response:
12523
12524~~~json
12525{
12526  "jsonrpc": "2.0",
12527  "id": 1,
12528  "result": true
12529}
12530~~~
12531
12532### iobuf_get_stats {#rpc_iobuf_get_stats}
12533
12534Retrieve iobuf's statistics.
12535
12536#### Parameters
12537
12538None.
12539
12540#### Example
12541
12542Example request:
12543
12544~~~json
12545{
12546  "jsonrpc": "2.0",
12547  "method": "iobuf_get_stats",
12548  "id": 1
12549}
12550~~~
12551
12552Example response:
12553
12554~~~json
12555{
12556  "jsonrpc": "2.0",
12557  "id": 1,
12558  "result": [
12559    {
12560      "module": "accel",
12561      "small_pool": {
12562        "cache": 0,
12563        "main": 0,
12564        "retry": 0
12565      },
12566      "large_pool": {
12567        "cache": 0,
12568        "main": 0,
12569        "retry": 0
12570      }
12571    },
12572    {
12573      "module": "bdev",
12574      "small_pool": {
12575        "cache": 421965,
12576        "main": 1218,
12577        "retry": 0
12578      },
12579      "large_pool": {
12580        "cache": 0,
12581        "main": 0,
12582        "retry": 0
12583      }
12584    },
12585    {
12586      "module": "nvmf_TCP",
12587      "small_pool": {
12588        "cache": 7,
12589        "main": 0,
12590        "retry": 0
12591      },
12592      "large_pool": {
12593        "cache": 0,
12594        "main": 0,
12595        "retry": 0
12596      }
12597    }
12598  ]
12599}
12600~~~
12601
12602### bdev_nvme_start_mdns_discovery {#rpc_bdev_nvme_start_mdns_discovery}
12603
12604Starts an mDNS based discovery service for the specified service type for the
12605auto-discovery of discovery controllers (NVMe TP-8009).
12606
12607The discovery service will listen for the mDNS discovery events from the
12608Avahi-daemon and will connect to the newly learnt discovery controllers.
12609Then the discovery service will automatically attach to any subsystem found in the
12610discovery log page from the discovery controllers learnt using mDNS.
12611When determining a controller name to use when attaching, it will use
12612the 'name' parameter as a prefix, followed by a unique integer assigned for each of the
12613discovery controllers learnt through mDNS, followed by a unique integer for that discovery
12614service. If the discovery service identifies a subsystem that has been previously
12615attached but is listed with a different path, it will use the same controller name
12616as the previous entry, and connect as a multipath.
12617
12618When the discovery service sees that a subsystem entry has been removed
12619from the log page, it will automatically detach from that controller as well.
12620
12621The 'name' is also used to later stop the discovery service.
12622
12623#### Parameters
12624
12625Name                       | Optional | Type        | Description
12626-------------------------- | -------- | ----------- | -----------
12627name                       | Required | string      | Prefix for NVMe discovery services found
12628svcname                    | Required | string      | Service to discover: e.g. _nvme-disc._tcp
12629hostnqn                    | Optional | string      | NVMe-oF hostnqn
12630
12631#### Example
12632
12633Example request:
12634
12635~~~json
12636{
12637  "jsonrpc": "2.0",
12638  "method": "bdev_nvme_start_mdns_discovery",
12639  "id": 1,
12640  "params": {
12641    "name": "cdc_auto",
12642    "svcname": "_nvme-disc._tcp",
12643    "hostnqn": "nqn.2021-12.io.spdk:host1",
12644  }
12645}
12646~~~
12647
12648Example response:
12649
12650~~~json
12651{
12652  "jsonrpc": "2.0",
12653  "id": 1,
12654  "result": true
12655}
12656~~~
12657
12658### bdev_nvme_stop_mdns_discovery {#rpc_bdev_nvme_stop_mdns_discovery}
12659
12660Stops a mDNS discovery service. This includes detaching any controllers that were
12661discovered via the service that is being stopped.
12662
12663#### Parameters
12664
12665Name                       | Optional | Type        | Description
12666-------------------------- | -------- | ----------- | -----------
12667name                       | Required | string      | Name of mDNS discovery instance to stop
12668
12669#### Example
12670
12671Example request:
12672
12673~~~json
12674{
12675  "jsonrpc": "2.0",
12676  "method": "bdev_nvme_stop_mdns_discovery",
12677  "id": 1,
12678  "params": {
12679    "name": "cdc_auto"
12680  }
12681}
12682~~~
12683
12684Example response:
12685
12686~~~json
12687{
12688  "jsonrpc": "2.0",
12689  "id": 1,
12690  "result": true
12691}
12692~~~
12693
12694### bdev_nvme_get_mdns_discovery_info {#rpc_bdev_nvme_get_mdns_discovery_info}
12695
12696Get the information about the mDNS discovery service instances.
12697
12698#### Example
12699
12700Example request:
12701~~~json
12702{
12703  "jsonrpc": "2.0",
12704  "method": "bdev_nvme_get_mdns_discovery_info",
12705  "id": 1
12706}
12707~~~
12708
12709Example response:
12710
12711~~~json
12712[
12713  {
12714    "name": "cdc_auto",
12715    "svcname": "_nvme-disc._tcp",
12716    "referrals": [
12717      {
12718        "name": "cdc_auto0",
12719        "trid": {
12720          "trtype": "TCP",
12721          "adrfam": "IPv4",
12722          "traddr": "66.1.2.21",
12723          "trsvcid": "8009",
12724          "subnqn": "nqn.2014-08.org.nvmexpress.discovery"
12725        }
12726      },
12727      {
12728        "name": "cdc_auto1",
12729        "trid": {
12730          "trtype": "TCP",
12731          "adrfam": "IPv4",
12732          "traddr": "66.1.1.21",
12733          "trsvcid": "8009",
12734          "subnqn": "nqn.2014-08.org.nvmexpress.discovery"
12735        }
12736      }
12737    ]
12738  }
12739]
12740~~~
12741
12742### keyring_file_add_key {#rpc_keyring_file_add_key}
12743
12744Add a file-based key to a keyring.
12745
12746#### Parameters
12747
12748Name                       | Optional | Type        | Description
12749-------------------------- | -------- | ----------- | -----------
12750name                       | Required | string      | Name of the key to add.
12751path                       | Required | string      | Path to a file containing the key.
12752
12753#### Example
12754
12755Example request:
12756
12757~~~json
12758{
12759  "jsonrpc": "2.0",
12760  "method": "keyring_file_add_key",
12761  "id": 1
12762  "params": {
12763    "name": "key0",
12764    "path": "/path/to/key0"
12765  }
12766}
12767~~~
12768
12769Example response:
12770
12771~~~json
12772{
12773  "jsonrpc": "2.0",
12774  "id": 1,
12775  "result": true
12776}
12777~~~
12778
12779### keyring_file_remove_key {#rpc_keyring_file_remove_key}
12780
12781Remove a file-based key from a keyring.
12782
12783#### Parameters
12784
12785Name                       | Optional | Type        | Description
12786-------------------------- | -------- | ----------- | -----------
12787name                       | Required | string      | Name of the key to remove.
12788
12789#### Example
12790
12791Example request:
12792
12793~~~json
12794{
12795  "jsonrpc": "2.0",
12796  "method": "keyring_file_remove_key",
12797  "id": 1
12798  "params": {
12799    "name": "key0"
12800  }
12801}
12802~~~
12803
12804Example response:
12805
12806~~~json
12807{
12808  "jsonrpc": "2.0",
12809  "id": 1,
12810  "result": true
12811}
12812~~~
12813
12814### keyring_get_keys {#rpc_keyring_get_keys}
12815
12816Get a list of available keys.  This RPC will only list keys that are currently attached to a
12817keyring.  Dynamically loaded keys (via the `probe_key()` callback) will only be included if they're
12818currently in-use (i.e. with active references obtained via `spdk_keyring_get_key()`).
12819
12820#### Example
12821
12822Example request:
12823~~~json
12824{
12825  "jsonrpc": "2.0",
12826  "method": "keyring_get_keys",
12827  "id": 1
12828}
12829~~~
12830
12831Example response:
12832
12833~~~json
12834{
12835  "jsonrpc": "2.0",
12836  "id": 1,
12837  "result": [
12838    {
12839      "name": "key0",
12840      "module": "keyring_file",
12841      "removed": false,
12842      "probed": false,
12843      "refcnt": 1,
12844      "path": "/path/to/key0"
12845    },
12846    {
12847      "name": "key1",
12848      "module": "keyring_file",
12849      "removed": false,
12850      "probed": false,
12851      "refcnt": 1,
12852      "path": "/path/to/key1"
12853    }
12854  ]
12855}
12856~~~
12857
12858### keyring_linux_set_options {#keyring_linux_set_options}
12859
12860Set options of the keyring_linux module.
12861
12862#### Parameters
12863
12864Name                    | Optional | Type        | Description
12865----------------------- | -------- | ----------- | -----------
12866enable                  | Optional | boolean     | Enable the module.
12867
12868#### Example
12869
12870Example request:
12871~~~json
12872{
12873  "jsonrpc": "2.0",
12874  "method": "keyring_linux_set_options",
12875  "id": 1
12876  "params": {
12877    "enable": true
12878  }
12879}
12880~~~
12881
12882Example response:
12883
12884~~~json
12885{
12886  "jsonrpc": "2.0",
12887  "id": 1,
12888  "result": true
12889}
12890~~~
12891