Skip to content

Commit 069d2ac

Browse files
committed
document vdpa device type
Signed-off-by: Adrian Moreno <[email protected]>
1 parent 911330a commit 069d2ac

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ This selector is applicable when "deviceType" is "netDevice"(note: this is defau
258258
| "ddpProfiles" | N | A map of device selectors | `string` list Default: `null` | "ddpProfiles": ["GTPv1-C/U IPv4/IPv6 payload"] |
259259
| "isRdma" | N | Mount RDMA resources | `bool` values `true` or `false` Default: `false` | "isRdma": `true` |
260260
| "needVhostNet"| N | Share /dev/vhost-net | `bool` values `true` or `false` Default: `false` | "needVhostNet": `true` |
261+
| "vdpaType" | N | The type of vDPA device (virtio, vhost or `nil`) | `string` values `vhost` or `virtio` Default: `null` | "vdpaType": "vhost" |
261262

262263

263264
[//]: # (The tables above generated using: https://ozh.github.io/ascii-tables/)

docs/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ This page contains supplimentary documention that users may find useful for vari
77
* [Running RDMA application in Kubernetes](rdma/)
88
* [SR-IOV network device plugin with DDP](ddp/)
99
* [Using node specific config file for running device plugin DaemonSet](config-file)
10+
* [Using vDPA devices in Kuberenets](vdpa/)

docs/vdpa/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Using vDPA devices in Kuberenets
2+
3+
vDPA-capable devices can be used to expose an accelerated, yet standard interface to pods. These devices implement the virtIO ring layout that is used for the data-plane.
4+
The control plane, however, is translated by the vDPA kernel framework which takes care of configuring the virtio devices and virtqueues.
5+
6+
The vDPA kernel framework is composed of a vdpa bus (/sys/bus/vdpa), vdpa devices (/sys/bus/vdpa/devices) and vdpa drivers (/sys/bus/vdpa/drivers). Currently, two vdpa drivers are implemented:
7+
* virtio_vdpa: Exposes the device as a virtio-net netdev
8+
* virtio_vdpa: Exposes the device as a vhost-vdpa device. This device uses an extension of the vhost-net protocol to allow userspace applications access the rings directly
9+
10+
## Supported NICs:
11+
* Mellanox ConnectX®-6 DX
12+
13+
## vDPA device creation
14+
Each NIC might require diffent steps to create vDPA devices on top of the VFs.
15+
16+
## Bind the desired vdpa driver
17+
The vdpa bus works similar to the pci bus. To unbind a driver from a device, run:
18+
``echo ${DEV_NAME} > /sys/bus/vdpa/devices/${DEV_NAME}/driver/unbind``
19+
20+
To bind a driver to a device, run:
21+
``echo ${DEV_NAME} > /sys/bus/vdpa/drivers/${DRIVER_NAME}/bind``
22+
23+
## Priviledges
24+
IPC_LOCK capability privilege is required for "vhost" mode to be used in a Kubernetes Pod.

docs/vdpa/configMap.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: sriovdp-config
5+
namespace: kube-system
6+
data:
7+
config.json: |
8+
{
9+
"resourceList": [{
10+
{
11+
"resourceName": "vdpa_mlx_virtio",
12+
"selectors": {
13+
"vendors": ["15b3"],
14+
"devices": ["101e"],
15+
"drivers": ["mlx5_core"],
16+
"vdpaType": "virtio"
17+
}
18+
},
19+
{
20+
"resourceName": "vdpa_mlx_vhost",
21+
"selectors": {
22+
"vendors": ["15b3"],
23+
"devices": ["101e"],
24+
"drivers": ["mlx5_core"],
25+
"vdpaType": "vhost"
26+
}
27+
}
28+
]
29+
}
30+

0 commit comments

Comments
 (0)