Skip to content

Commit fa6bff4

Browse files
committed
specs-go/config: Define RDMA cgroup
Linux kernel 4.11 adds support for RDMA cgroup resource controller. This allows limiting maximum number of open hca_handle and maximum number of hca_objects which can be created by processes. Signed-off-by: Parav Pandit <[email protected]>
1 parent 75c847a commit fa6bff4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

specs-go/config.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,16 @@ type LinuxNetwork struct {
320320
Priorities []LinuxInterfacePriority `json:"priorities,omitempty"`
321321
}
322322

323+
// LinuxRdma for Linux cgroup 'rdma' resource management (Linux 4.11)
324+
type LinuxRdma struct {
325+
// Hca device name whose resources to be restricted
326+
HcaDevice string `json:"hca_device"`
327+
// Maximum number of HCA handles that can be opened. Default is "no limit".
328+
HcaHandles uint32 `json:"hca_handles"`
329+
// Maximum number of HCA objects that can be created. Default is "no limit".
330+
HcaObjects uint32 `json:"hca_objects"`
331+
}
332+
323333
// LinuxResources has container runtime resource constraints
324334
type LinuxResources struct {
325335
// Devices configures the device whitelist.
@@ -336,6 +346,8 @@ type LinuxResources struct {
336346
HugepageLimits []LinuxHugepageLimit `json:"hugepageLimits,omitempty"`
337347
// Network restriction configuration
338348
Network *LinuxNetwork `json:"network,omitempty"`
349+
// Rdma resource restriction configuration
350+
RdmaLimits []LinuxRdma `json:"rdmaLimits,omitempty"`
339351
}
340352

341353
// LinuxDevice represents the mknod information for a Linux special device file

0 commit comments

Comments
 (0)