Skip to content

Commit bef20d8

Browse files
committed
sgx: send nil TopologyInfo
/dev/sgx_* cannot be mapped to any topology. SGX itself is topology aware but we cannot control it with TopologyInfo. Currently, pkg/topology returns empty TopologyInfo{Nodes:[]*NUMANode{}} for /dev/sgx_* but kubelet TopologyManager (when enabled and with the policy other than 'none') interpretes that as "Hint Provider has no possible NUMA affinities for resource" and rejects the SGX resources. What we want is "Hint Provider has no preference for NUMA affinity with resource". This is communicated using nil TopologyInfo. See: kubernetes/kubernetes#112234 Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
1 parent 8360432 commit bef20d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/sgx_plugin/sgx_plugin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ func (dp *devicePlugin) scan() (dpapi.DeviceTree, error) {
9494
for i := uint(0); i < dp.nEnclave; i++ {
9595
devID := fmt.Sprintf("%s-%d", "sgx-enclave", i)
9696
nodes := []pluginapi.DeviceSpec{{HostPath: sgxEnclavePath, ContainerPath: sgxEnclavePath, Permissions: "rw"}}
97-
devTree.AddDevice(deviceTypeEnclave, devID, dpapi.NewDeviceInfo(pluginapi.Healthy, nodes, deprecatedMounts, nil, nil))
97+
devTree.AddDevice(deviceTypeEnclave, devID, dpapi.NewDeviceInfoWithTopologyHints(pluginapi.Healthy, nodes, deprecatedMounts, nil, nil, nil))
9898
}
9999

100100
for i := uint(0); i < dp.nProvision; i++ {
101101
devID := fmt.Sprintf("%s-%d", "sgx-provision", i)
102102
nodes := []pluginapi.DeviceSpec{{HostPath: sgxProvisionPath, ContainerPath: sgxProvisionPath, Permissions: "rw"}}
103-
devTree.AddDevice(deviceTypeProvision, devID, dpapi.NewDeviceInfo(pluginapi.Healthy, nodes, deprecatedMounts, nil, nil))
103+
devTree.AddDevice(deviceTypeProvision, devID, dpapi.NewDeviceInfoWithTopologyHints(pluginapi.Healthy, nodes, deprecatedMounts, nil, nil, nil))
104104
}
105105

106106
return devTree, nil

0 commit comments

Comments
 (0)