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