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