From 1d41852013bbbb4783729b5d19fcc8bcddb29656 Mon Sep 17 00:00:00 2001 From: Mikko Ylinen Date: Fri, 28 Feb 2020 13:45:14 +0200 Subject: [PATCH] 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 --- deployments/qat_plugin/base/intel-qat-plugin.yaml | 6 ++++++ pkg/deviceplugin/api.go | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/deployments/qat_plugin/base/intel-qat-plugin.yaml b/deployments/qat_plugin/base/intel-qat-plugin.yaml index 6d634fce..e5798062 100644 --- a/deployments/qat_plugin/base/intel-qat-plugin.yaml +++ b/deployments/qat_plugin/base/intel-qat-plugin.yaml @@ -42,11 +42,17 @@ spec: imagePullPolicy: IfNotPresent args: ["-dpdk-driver", "$(DPDK_DRIVER)", "-kernel-vf-drivers", "$(KERNEL_VF_DRIVERS)", "-max-num-devices", "$(MAX_NUM_DEVICES)", "-debug", "$(DEBUG)"] volumeMounts: + - name: devdir + mountPath: /dev/vfio + readOnly: true - name: pcidir mountPath: /sys/bus/pci - name: kubeletsockets mountPath: /var/lib/kubelet/device-plugins volumes: + - name: devdir + hostPath: + path: /dev/vfio - name: pcidir hostPath: path: /sys/bus/pci diff --git a/pkg/deviceplugin/api.go b/pkg/deviceplugin/api.go index 99594eba..728b6618 100644 --- a/pkg/deviceplugin/api.go +++ b/pkg/deviceplugin/api.go @@ -15,6 +15,8 @@ package deviceplugin import ( + "fmt" + "github.com/intel/intel-device-plugins-for-kubernetes/pkg/topology" pluginapi "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1" ) @@ -44,6 +46,8 @@ func NewDeviceInfo(state string, nodes []pluginapi.DeviceSpec, mounts []pluginap topologyInfo, err := topology.GetTopologyInfo(devPaths) if err == nil { deviceInfo.topology = topologyInfo + } else { + fmt.Printf("WARNING: GetTopologyInfo: %v\n", err) } return deviceInfo