diff --git a/config-linux.md b/config-linux.md
index 5d4c268a9..f1685f9ad 100644
--- a/config-linux.md
+++ b/config-linux.md
@@ -457,40 +457,32 @@ The following parameters can be specified to set up the controller:
### RDMA
-**`rdma`** (object, OPTIONAL) represents the cgroup subsystem `rdma`.
+**`rdmaLimits`** (object, OPTIONAL) represents the cgroup subsystem `rdma`.
For more information, see the kernel cgroups documentation about [rdma][cgroup-v1-rdma].
-The following parameters can be specified to set up the controller:
+The name of the device to limit is the entry key.
+Entry values are objects with the following properties:
+
+* **`hca_handles`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_objects in the cgroup
+* **`hca_objects`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_handles in the cgroup
-* **`rdmaLimits`** *(list of objects, OPTIONAL)* - specifies a list of limit objects applicable to processes in the group.
-Limit object is a key value pair that defines limits of a device.
- * **`hca_device`** *(string, REQUIRED)* - specifies the device name whose resources limit to be configured
- The following parameters can be specified per-device:
- * **`hca_handles`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_objects in the cgroup
- * **`hca_objects`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_handles in the cgroup
- You MUST specify at least one of the `hca_handles` or `hca_objects` in a given entry, and MAY specify both.
+You MUST specify at least one of the `hca_handles` or `hca_objects` in a given entry, and MAY specify both.
#### Example
```json
- "rdma": [
- {
- "mlx5_1": {
- "hca_handles": 3,
- "hca_objects": 10000
- }
- },
- {
- "mlx4_0": {
- "hca_objects": 1000
- }
- },
- {
- "rxe3": {
- "hca_objects": 10000
- }
- }
- ]
+"rdmaLimits": {
+ "mlx5_1": {
+ "hca_handles": 3,
+ "hca_objects": 10000
+ },
+ "mlx4_0": {
+ "hca_objects": 1000
+ },
+ "rxe3": {
+ "hca_objects": 10000
+ }
+}
```
## IntelRdt
diff --git a/schema/config-linux.json b/schema/config-linux.json
index 83a562677..619884ab3 100644
--- a/schema/config-linux.json
+++ b/schema/config-linux.json
@@ -212,6 +212,12 @@
}
}
}
+ },
+ "rdmaLimits": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "defs-linux.json#/definitions/RdmaLimit"
+ }
}
}
},
diff --git a/schema/defs-linux.json b/schema/defs-linux.json
index 4d9620a4a..ead4c1dc2 100644
--- a/schema/defs-linux.json
+++ b/schema/defs-linux.json
@@ -240,6 +240,17 @@
"priority"
]
},
+ "RdmaLimit": {
+ "type": "object",
+ "properties": {
+ "hca_handles": {
+ "$ref": "defs.json#/definitions/uint32"
+ },
+ "hca_objects": {
+ "$ref": "defs.json#/definitions/uint32"
+ }
+ }
+ },
"NamespaceType": {
"type": "string",
"enum": [
diff --git a/schema/test/config/bad/linux-rdma.json b/schema/test/config/bad/linux-rdma.json
new file mode 100644
index 000000000..c041f460a
--- /dev/null
+++ b/schema/test/config/bad/linux-rdma.json
@@ -0,0 +1,15 @@
+{
+ "ociVersion": "1.0.0",
+ "root": {
+ "path": "rootfs"
+ },
+ "linux": {
+ "resources": {
+ "rdmaLimits": {
+ "mlx5_1": {
+ "hca_handles": "not a uint32"
+ }
+ }
+ }
+ }
+}
diff --git a/schema/test/config/good/linux-rdma.json b/schema/test/config/good/linux-rdma.json
new file mode 100644
index 000000000..1a91577b0
--- /dev/null
+++ b/schema/test/config/good/linux-rdma.json
@@ -0,0 +1,22 @@
+{
+ "ociVersion": "1.0.0",
+ "root": {
+ "path": "rootfs"
+ },
+ "linux": {
+ "resources": {
+ "rdmaLimits": {
+ "mlx5_1": {
+ "hca_handles": 3,
+ "hca_objects": 10000
+ },
+ "mlx4_0": {
+ "hca_objects": 1000
+ },
+ "rxe3": {
+ "hca_objects": 10000
+ }
+ }
+ }
+ }
+}
diff --git a/specs-go/config.go b/specs-go/config.go
index be509bf85..942649bff 100644
--- a/specs-go/config.go
+++ b/specs-go/config.go
@@ -344,7 +344,7 @@ type LinuxResources struct {
HugepageLimits []LinuxHugepageLimit `json:"hugepageLimits,omitempty"`
// Network restriction configuration
Network *LinuxNetwork `json:"network,omitempty"`
- // Rdma resource restriction configuration
+ // RdmaLimits resource restriction configuration.
// Limits are a set of key value pairs that define RDMA resource limits,
// where the key is device name and value is resource limits.
RdmaLimits map[string]LinuxRdmaLimit `json:"rdmaLimits,omitempty"`