Skip to content

Commit ff6d8ab

Browse files
committed
fixup! config-linux: Refined JSON definitions for RDMA limits
additionalProperties is defined for the JSON Schema draft-04 in [1] with clearer documentation in draft-07 [2]. It is supportd by gojsonschema since xeipuuv/gojsonschema@0572d9d (added additionalProperties with inner schema, 2013-06-21). [1]: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.4.4 [2]: https://tools.ietf.org/html/draft-handrews-json-schema-validation-00#section-6.5.6 Signed-off-by: W. Trevor King <[email protected]>
1 parent 60c82b2 commit ff6d8ab

File tree

6 files changed

+74
-28
lines changed

6 files changed

+74
-28
lines changed

config-linux.md

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -457,40 +457,32 @@ The following parameters can be specified to set up the controller:
457457

458458
### <a name="configLinuxRDMA" />RDMA
459459

460-
**`rdma`** (object, OPTIONAL) represents the cgroup subsystem `rdma`.
460+
**`rdmaLimits`** (object, OPTIONAL) represents the cgroup subsystem `rdma`.
461461
For more information, see the kernel cgroups documentation about [rdma][cgroup-v1-rdma].
462462

463-
The following parameters can be specified to set up the controller:
463+
The name of the device to limit is the entry key.
464+
Entry values are objects with the following properties:
465+
466+
* **`hca_handles`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_objects in the cgroup
467+
* **`hca_objects`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_handles in the cgroup
464468

465-
* **`rdmaLimits`** *(list of objects, OPTIONAL)* - specifies a list of limit objects applicable to processes in the group.
466-
Limit object is a key value pair that defines limits of a device.
467-
* **`hca_device`** *(string, REQUIRED)* - specifies the device name whose resources limit to be configured
468-
The following parameters can be specified per-device:
469-
* **`hca_handles`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_objects in the cgroup
470-
* **`hca_objects`** *(uint32, OPTIONAL)* - specifies the maximum number of hca_handles in the cgroup
471-
You MUST specify at least one of the `hca_handles` or `hca_objects` in a given entry, and MAY specify both.
469+
You MUST specify at least one of the `hca_handles` or `hca_objects` in a given entry, and MAY specify both.
472470

473471
#### Example
474472

475473
```json
476-
"rdma": [
477-
{
478-
"mlx5_1": {
479-
"hca_handles": 3,
480-
"hca_objects": 10000
481-
}
482-
},
483-
{
484-
"mlx4_0": {
485-
"hca_objects": 1000
486-
}
487-
},
488-
{
489-
"rxe3": {
490-
"hca_objects": 10000
491-
}
492-
}
493-
]
474+
"rdmaLimits": {
475+
"mlx5_1": {
476+
"hca_handles": 3,
477+
"hca_objects": 10000
478+
},
479+
"mlx4_0": {
480+
"hca_objects": 1000
481+
},
482+
"rxe3": {
483+
"hca_objects": 10000
484+
}
485+
}
494486
```
495487

496488
## <a name="configLinuxIntelRdt" />IntelRdt

schema/config-linux.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@
212212
}
213213
}
214214
}
215+
},
216+
"rdmaLimits": {
217+
"type": "object",
218+
"additionalProperties": {
219+
"$ref": "defs-linux.json#/definitions/RdmaLimit"
220+
}
215221
}
216222
}
217223
},

schema/defs-linux.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,17 @@
240240
"priority"
241241
]
242242
},
243+
"RdmaLimit": {
244+
"type": "object",
245+
"properties": {
246+
"hca_handles": {
247+
"$ref": "defs.json#/definitions/uint32"
248+
},
249+
"hca_objects": {
250+
"$ref": "defs.json#/definitions/uint32"
251+
}
252+
}
253+
},
243254
"NamespaceType": {
244255
"type": "string",
245256
"enum": [
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"ociVersion": "1.0.0",
3+
"root": {
4+
"path": "rootfs"
5+
},
6+
"linux": {
7+
"resources": {
8+
"rdmaLimits": {
9+
"mlx5_1": {
10+
"hca_handles": "not a uint32"
11+
}
12+
}
13+
}
14+
}
15+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"ociVersion": "1.0.0",
3+
"root": {
4+
"path": "rootfs"
5+
},
6+
"linux": {
7+
"resources": {
8+
"rdmaLimits": {
9+
"mlx5_1": {
10+
"hca_handles": 3,
11+
"hca_objects": 10000
12+
},
13+
"mlx4_0": {
14+
"hca_objects": 1000
15+
},
16+
"rxe3": {
17+
"hca_objects": 10000
18+
}
19+
}
20+
}
21+
}
22+
}

specs-go/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ type LinuxResources struct {
344344
HugepageLimits []LinuxHugepageLimit `json:"hugepageLimits,omitempty"`
345345
// Network restriction configuration
346346
Network *LinuxNetwork `json:"network,omitempty"`
347-
// Rdma resource restriction configuration
347+
// RdmaLimits resource restriction configuration.
348348
// Limits are a set of key value pairs that define RDMA resource limits,
349349
// where the key is device name and value is resource limits.
350350
RdmaLimits map[string]LinuxRdmaLimit `json:"rdmaLimits,omitempty"`

0 commit comments

Comments
 (0)