Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 19 additions & 27 deletions config-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,40 +457,32 @@ The following parameters can be specified to set up the controller:

### <a name="configLinuxRDMA" />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
}
}
```

## <a name="configLinuxIntelRdt" />IntelRdt
Expand Down
6 changes: 6 additions & 0 deletions schema/config-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@
}
}
}
},
"rdmaLimits": {
"type": "object",
"additionalProperties": {
"$ref": "defs-linux.json#/definitions/RdmaLimit"
}
}
}
},
Expand Down
11 changes: 11 additions & 0 deletions schema/defs-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
15 changes: 15 additions & 0 deletions schema/test/config/bad/linux-rdma.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"ociVersion": "1.0.0",
"root": {
"path": "rootfs"
},
"linux": {
"resources": {
"rdmaLimits": {
"mlx5_1": {
"hca_handles": "not a uint32"
}
}
}
}
}
22 changes: 22 additions & 0 deletions schema/test/config/good/linux-rdma.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
}
2 changes: 1 addition & 1 deletion specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down