k8snetworkplumbingwg / sriov-network-device-plugin

SRIOV network device plugin for Kubernetes
Apache License 2.0
407 stars 177 forks source link

how to confirm which VF with dpdk is binded in the pod. #190

Closed ccmin closed 4 years ago

ccmin commented 4 years ago

I have created SR-IOV virtual functions and binded those VFs with vfio-pci driver, and i use dpdk-devbind.py bind drivers using devices PCI addresses.

[root@master usertools]# ./dpdk-devbind.py --status

Network devices using DPDK-compatible driver

0000:5e:10.0 'I350 Ethernet Controller Virtual Function 1520' drv=vfio-pci unused=igbvf 0000:5e:10.4 'I350 Ethernet Controller Virtual Function 1520' drv=vfio-pci unused=igbvf

Network devices using kernel driver

when i test the example in the dictionary /docs/dpdk. I have appied crd and pod_testpmd.yml. the pod state is runing, but could you tell me how can i confirm it use the sriov vf with dpdk, and which vf is used by the pod, thanks a lot

[root@master dpdk]# kubectl get pod NAME READY STATUS RESTARTS AGE testpmd 1/1 Running 0 33m testpod1 1/1 Running 0 23h testpod2 1/1 Running 0 23h [root@master dpdk]# kubectl exec -it testpmd ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 3: eth0@if125: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default link/ether 1a:38:bb:f6:cb:20 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 10.244.0.112/24 scope global eth0 valid_lft forever preferred_lft forever [root@master dpdk]#

zshi-redhat commented 4 years ago

@ccmin VF device ID (PCI address) is set in container environment variable with prefix PCIDEVICE_ The actual device attached to container is under /dev/vfio/<iommu group number>.

ccmin commented 4 years ago

@zshi-redhat thanks.

willzhang commented 1 year ago

@zshi-redhat thanks.