Add some notes on mechanics and VFIO kernel driver
This commit is contained in:
26
README.md
26
README.md
@ -32,7 +32,9 @@ docker run --cap-add=NET_ADMIN --cap-add=SYS_NICE --cap-add=SYS_PTRACE \
|
|||||||
docker network connect network2 clab-pim
|
docker network connect network2 clab-pim
|
||||||
```
|
```
|
||||||
|
|
||||||
Note, DPDK will be disabled by default as it requires hugepages and VFIO and/or UIO to use physical
|
### A note on DPDK
|
||||||
|
|
||||||
|
DPDK will be disabled by default as it requires hugepages and VFIO and/or UIO to use physical
|
||||||
network cards. If DPDK at some future point is desired, mapping VFIO can be done by adding this:
|
network cards. If DPDK at some future point is desired, mapping VFIO can be done by adding this:
|
||||||
```
|
```
|
||||||
--device=/dev/vfio/vfio:/dev/vfio/vfio
|
--device=/dev/vfio/vfio:/dev/vfio/vfio
|
||||||
@ -50,8 +52,25 @@ my-node:
|
|||||||
- /dev/vhost-net
|
- /dev/vhost-net
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If using DPDK in a container, one of the userspace IO kernel drivers must be loaded in the host
|
||||||
|
kernel. Options are `igb_uio`, `vfio_pci`, or `uio_pci_generic`:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ sudo modprobe igb_uio
|
||||||
|
$ sudo modprobe vfio_pci
|
||||||
|
$ sudo modprobe uio_pci_generic
|
||||||
|
```
|
||||||
|
|
||||||
|
Particularly the VFIO driver needs to be present before one can attempt to bindmount
|
||||||
|
`/dev/vfio/vfio` into the container!
|
||||||
|
|
||||||
## Configuring VPP
|
## Configuring VPP
|
||||||
|
|
||||||
|
When Containerlab starts the docker containers, it'll offer one or more `vethpair` point to point
|
||||||
|
network links, which will show up as `eth1` and further. `eth0` is the default NIC that belongs to
|
||||||
|
the management plane in Containerlab (the one which you'll see with `containerlab inspect`). Before
|
||||||
|
VPP can use these `vethpair` interfaces, it needs to bind them, like so:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker exec -it clab-pim vppctl
|
docker exec -it clab-pim vppctl
|
||||||
```
|
```
|
||||||
@ -66,3 +85,8 @@ vpp-clab# set interface ip address eth1 172.19.1.2/24
|
|||||||
vpp-clab# set interface ip address eth1 fec0::2/64
|
vpp-clab# set interface ip address eth1 fec0::2/64
|
||||||
vpp-clab# set interface state eth1 up
|
vpp-clab# set interface state eth1 up
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Containerlab will generate a config file called `/etc/vpp/clab.vpp` which contains all of these
|
||||||
|
comands. You can add more commands that'll execute on startup by copying in
|
||||||
|
`/etc/vpp/manual-pre.vpp` (to be executed _before_ the containerlab stuff) or
|
||||||
|
`/etc/vpp/manual-post.vpp` (to be executed _after_ the containerlab stuff).
|
||||||
|
Reference in New Issue
Block a user