2019-11-07 11:11:24 +00:00
|
|
|
# VMD driver {#vmd}
|
|
|
|
|
2021-08-02 12:27:54 +00:00
|
|
|
## In this document {#vmd_toc}
|
2019-11-07 11:11:24 +00:00
|
|
|
|
|
|
|
* @ref vmd_intro
|
|
|
|
* @ref vmd_interface
|
|
|
|
* @ref vmd_key_functions
|
|
|
|
* @ref vmd_config
|
|
|
|
* @ref vmd_app_frame
|
|
|
|
* @ref vmd_app
|
|
|
|
* @ref vmd_led
|
|
|
|
|
2021-08-02 12:27:54 +00:00
|
|
|
## Introduction {#vmd_intro}
|
2019-11-07 11:11:24 +00:00
|
|
|
|
|
|
|
Intel Volume Management Device is a hardware logic inside processor's Root Complex
|
|
|
|
responsible for management of PCIe NVMe SSDs. It provides robust Hot Plug support
|
|
|
|
and Status LED management.
|
|
|
|
|
|
|
|
The driver is responsible for enumeration and hooking NVMe devices behind VMD
|
|
|
|
into SPDK PCIe subsystem. It also provides API for LED management and hot plug.
|
|
|
|
|
2021-08-02 12:27:54 +00:00
|
|
|
## Public Interface {#vmd_interface}
|
2019-11-07 11:11:24 +00:00
|
|
|
|
|
|
|
- spdk/vmd.h
|
|
|
|
|
2021-08-02 12:27:54 +00:00
|
|
|
## Key Functions {#vmd_key_functions}
|
2019-11-07 11:11:24 +00:00
|
|
|
|
|
|
|
Function | Description
|
|
|
|
--------------------------------------- | -----------
|
|
|
|
spdk_vmd_init() | @copybrief spdk_vmd_init()
|
|
|
|
spdk_vmd_pci_device_list() | @copybrief spdk_vmd_pci_device_list()
|
|
|
|
spdk_vmd_set_led_state() | @copybrief spdk_vmd_set_led_state()
|
|
|
|
spdk_vmd_get_led_state() | @copybrief spdk_vmd_get_led_state()
|
|
|
|
spdk_vmd_hotplug_monitor() | @copybrief spdk_vmd_hotplug_monitor()
|
|
|
|
|
2021-08-02 12:27:54 +00:00
|
|
|
## Configuration {#vmd_config}
|
2019-11-07 11:11:24 +00:00
|
|
|
|
|
|
|
To enable VMD driver enumeration, the following steps are required:
|
|
|
|
|
|
|
|
Check for available VMD devices (VMD needs to be properly set up in BIOS first).
|
|
|
|
|
|
|
|
Example:
|
|
|
|
```
|
|
|
|
$ lspci | grep 201d
|
|
|
|
|
|
|
|
$ 5d:05.5 RAID bus controller: Intel Corporation Device 201d (rev 04)
|
|
|
|
$ d7:05.5 RAID bus controller: Intel Corporation Device 201d (rev 04)
|
|
|
|
```
|
|
|
|
|
2020-11-25 20:31:42 +00:00
|
|
|
Run setup.sh script with VMD devices set in PCI_ALLOWED.
|
2019-11-07 11:11:24 +00:00
|
|
|
|
|
|
|
Example:
|
|
|
|
```
|
2020-11-25 20:31:42 +00:00
|
|
|
$ PCI_ALLOWED="0000:5d:05.5 0000:d7:05.5" scripts/setup.sh
|
2019-11-07 11:11:24 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Check for available devices behind the VMD with spdk_lspci.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
```
|
2020-05-11 21:15:03 +00:00
|
|
|
$ ./build/bin/spdk_lspci
|
2019-11-07 11:11:24 +00:00
|
|
|
|
|
|
|
5d0505:01:00.0 (8086 a54) (NVMe disk behind VMD)
|
|
|
|
5d0505:03:00.0 (8086 a54) (NVMe disk behind VMD)
|
|
|
|
d70505:01:00.0 (8086 a54) (NVMe disk behind VMD)
|
|
|
|
d70505:03:00.0 (8086 a54) (NVMe disk behind VMD)
|
|
|
|
0000:5d:05.5 (8086 201d) (VMD)
|
|
|
|
0000:d7:05.5 (8086 201d) (VMD)
|
|
|
|
```
|
|
|
|
|
|
|
|
VMD NVMe BDF could be used as regular NVMe BDF.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
```
|
|
|
|
$ ./scripts/rpc.py bdev_nvme_attach_controller -b NVMe1 -t PCIe -a 5d0505:01:00.0
|
|
|
|
```
|
|
|
|
|
2021-08-02 12:27:54 +00:00
|
|
|
## Application framework {#vmd_app_frame}
|
2019-11-07 11:11:24 +00:00
|
|
|
|
|
|
|
When application framework is used, VMD section needs to be added to the configuration file:
|
|
|
|
|
|
|
|
JSON config:
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"subsystem": "vmd",
|
|
|
|
"config": [
|
|
|
|
{
|
|
|
|
"method": "enable_vmd",
|
|
|
|
"params": {}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
or use RPC call before framework starts e.g.
|
|
|
|
```
|
2020-05-11 21:15:03 +00:00
|
|
|
$ ./build/bin/spdk_tgt --wait_for_rpc
|
2019-11-07 11:11:24 +00:00
|
|
|
$ ./scripts/rpc.py enable_vmd
|
|
|
|
$ ./scripts/rpc.py framework_start_init
|
|
|
|
```
|
2021-08-02 12:27:54 +00:00
|
|
|
## Applications w/o application framework {#vmd_app}
|
2019-11-07 11:11:24 +00:00
|
|
|
|
|
|
|
To enable VMD enumeration in SPDK application that are not using application framework
|
|
|
|
e.g nvme/perf, nvme/identify -V flag is required - please refer to app help if it supports VMD.
|
|
|
|
|
|
|
|
Applications need to call spdk_vmd_init() to enumerate NVMe devices behind the VMD prior to calling
|
|
|
|
spdk_nvme_(probe|connect).
|
|
|
|
To support hot plugs spdk_vmd_hotplug_monitor() needs to be called periodically.
|
|
|
|
|
2021-08-02 12:27:54 +00:00
|
|
|
## LED management {#vmd_led}
|
2019-11-07 11:11:24 +00:00
|
|
|
|
|
|
|
VMD LED utility in the [examples/vmd/led](https://github.com/spdk/spdk/tree/master/examples/vmd/led)
|
|
|
|
could be used to set LED states.
|
2019-12-06 10:09:38 +00:00
|
|
|
|
|
|
|
In order to verify that a platform is correctly configured to support LED management, ledctl(8) can
|
|
|
|
be utilized. For instructions on how to use it, consult the manual page of this utility.
|