Skip to content

Commit 1d41852

Browse files
committed
qat: mount VFIO devices for topology hints to work
Previously, /dev/vfio/xx devices were just arbitrary strings and the plugin did not need the devices for anything. After adding the checks for topology hints, we need to read the devices attached to those so the device nodes must be bind mounted in the plugin container. Moreover, be more verbose about any errors coming from the topology code. Signed-off-by: Mikko Ylinen <[email protected]>
1 parent 2f142aa commit 1d41852

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

deployments/qat_plugin/base/intel-qat-plugin.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,17 @@ spec:
4242
imagePullPolicy: IfNotPresent
4343
args: ["-dpdk-driver", "$(DPDK_DRIVER)", "-kernel-vf-drivers", "$(KERNEL_VF_DRIVERS)", "-max-num-devices", "$(MAX_NUM_DEVICES)", "-debug", "$(DEBUG)"]
4444
volumeMounts:
45+
- name: devdir
46+
mountPath: /dev/vfio
47+
readOnly: true
4548
- name: pcidir
4649
mountPath: /sys/bus/pci
4750
- name: kubeletsockets
4851
mountPath: /var/lib/kubelet/device-plugins
4952
volumes:
53+
- name: devdir
54+
hostPath:
55+
path: /dev/vfio
5056
- name: pcidir
5157
hostPath:
5258
path: /sys/bus/pci

pkg/deviceplugin/api.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
package deviceplugin
1616

1717
import (
18+
"fmt"
19+
1820
"github.com/intel/intel-device-plugins-for-kubernetes/pkg/topology"
1921
pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"
2022
)
@@ -44,6 +46,8 @@ func NewDeviceInfo(state string, nodes []pluginapi.DeviceSpec, mounts []pluginap
4446
topologyInfo, err := topology.GetTopologyInfo(devPaths)
4547
if err == nil {
4648
deviceInfo.topology = topologyInfo
49+
} else {
50+
fmt.Printf("WARNING: GetTopologyInfo: %v\n", err)
4751
}
4852

4953
return deviceInfo

0 commit comments

Comments
 (0)