RDMA¶
RDMA (Remote Direct Memory Access) device and link management — covers InfiniBand and RoCE adapters. Used for NVMe-oF RDMA transport and RDMA-capable storage network testing.
sts.rdma
¶
RDMA device discovery and configuration via sysfs (InfiniBand, RoCE, iWARP).
NetDev
pydantic-model
¶
Bases: _SysfsModel
Network interface associated with an RDMA device.
Show JSON schema:
{
"additionalProperties": false,
"description": "Network interface associated with an RDMA device.",
"properties": {
"path": {
"format": "path",
"title": "Path",
"type": "string"
},
"sysfs_attrs": {
"additionalProperties": {
"type": "string"
},
"title": "Sysfs Attrs",
"type": "object"
},
"dev_port": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Dev Port"
}
},
"required": [
"path"
],
"title": "NetDev",
"type": "object"
}
Fields:
-
path(Path) -
sysfs_attrs(dict[str, str]) -
dev_port(str | None)
Source code in sts_libs/src/sts/rdma.py
126 127 128 129 130 131 132 133 134 | |
discover()
¶
Read network device attributes from sysfs.
Source code in sts_libs/src/sts/rdma.py
131 132 133 134 | |
Port
pydantic-model
¶
Bases: _SysfsModel
RDMA port with link rate, state, and physical state parsed from sysfs.
Show JSON schema:
{
"additionalProperties": false,
"description": "RDMA port with link rate, state, and physical state parsed from sysfs.",
"properties": {
"path": {
"format": "path",
"title": "Path",
"type": "string"
},
"sysfs_attrs": {
"additionalProperties": {
"type": "string"
},
"title": "Sysfs Attrs",
"type": "object"
},
"rate": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rate"
},
"state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "State"
},
"phys_state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Phys State"
},
"rate_speed": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rate Speed"
},
"rate_unit": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rate Unit"
},
"rate_info": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Rate Info"
},
"state_num": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "State Num"
},
"state_str": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "State Str"
},
"phys_state_num": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Phys State Num"
},
"phys_state_str": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Phys State Str"
}
},
"required": [
"path"
],
"title": "Port",
"type": "object"
}
Fields:
-
path(Path) -
sysfs_attrs(dict[str, str]) -
rate(str | None) -
state(str | None) -
phys_state(str | None) -
rate_speed(str | None) -
rate_unit(str | None) -
rate_info(str | None) -
state_num(str | None) -
state_str(str | None) -
phys_state_num(str | None) -
phys_state_str(str | None)
Source code in sts_libs/src/sts/rdma.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
name
property
¶
Port name, derived from the sysfs path.
discover()
¶
Read and parse port attributes from sysfs.
Source code in sts_libs/src/sts/rdma.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
Power
pydantic-model
¶
Bases: _SysfsModel
RDMA power management attributes from sysfs.
Show JSON schema:
{
"additionalProperties": false,
"description": "RDMA power management attributes from sysfs.",
"properties": {
"path": {
"format": "path",
"title": "Path",
"type": "string"
},
"sysfs_attrs": {
"additionalProperties": {
"type": "string"
},
"title": "Sysfs Attrs",
"type": "object"
}
},
"required": [
"path"
],
"title": "Power",
"type": "object"
}
Fields:
-
path(Path) -
sysfs_attrs(dict[str, str])
Source code in sts_libs/src/sts/rdma.py
115 116 117 118 119 120 121 122 123 | |
discover()
¶
Read power attributes from sysfs.
Source code in sts_libs/src/sts/rdma.py
118 119 120 121 122 123 | |
RdmaDevice
pydantic-model
¶
Bases: Device
RDMA device with ports, network interfaces, SR-IOV, and power management.
Attributes:
| Name | Type | Description |
|---|---|---|
ibdev |
str
|
Device ID (e.g., 'mlx5_0') |
Show JSON schema:
{
"additionalProperties": false,
"description": "RDMA device with ports, network interfaces, SR-IOV, and power management.\n\nAttributes:\n ibdev: Device ID (e.g., 'mlx5_0')",
"properties": {
"path": {
"anyOf": [
{
"type": "string"
},
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Path"
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Name"
},
"ibdev": {
"title": "Ibdev",
"type": "string"
},
"ports_path": {
"anyOf": [
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Ports Path"
},
"device_path": {
"anyOf": [
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Device Path"
},
"net_path": {
"anyOf": [
{
"format": "path",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Net Path"
},
"ports": {
"items": {
"format": "path",
"type": "string"
},
"title": "Ports",
"type": "array"
},
"port_numbers": {
"items": {
"type": "string"
},
"title": "Port Numbers",
"type": "array"
},
"is_sriov_capable": {
"default": false,
"title": "Is Sriov Capable",
"type": "boolean"
},
"sysfs_attrs": {
"additionalProperties": {
"type": "string"
},
"title": "Sysfs Attrs",
"type": "object"
}
},
"required": [
"ibdev"
],
"title": "RdmaDevice",
"type": "object"
}
Fields:
-
path(PathOrStr | None) -
name(str | None) -
ibdev(str) -
ports_path(Path | None) -
device_path(Path | None) -
net_path(Path | None) -
ports(list[Path]) -
port_numbers(list[str]) -
is_sriov_capable(bool) -
sysfs_attrs(dict[str, str])
Validators:
-
_derive_fields
Source code in sts_libs/src/sts/rdma.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | |
discover()
¶
Load device state from sysfs (paths, ports, SR-IOV capability).
Source code in sts_libs/src/sts/rdma.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
get_netdev(port_id)
¶
Get network device by port ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port_id
|
str
|
Port number (1-based, converted internally to 0-based dev_port) |
required |
Source code in sts_libs/src/sts/rdma.py
224 225 226 227 228 229 230 231 232 233 | |
get_netdevs()
¶
Get all associated network interfaces.
Source code in sts_libs/src/sts/rdma.py
219 220 221 222 | |
get_port(port)
¶
Get port by number.
Source code in sts_libs/src/sts/rdma.py
239 240 241 242 243 | |
get_ports()
¶
Get all ports.
Source code in sts_libs/src/sts/rdma.py
235 236 237 | |
get_power()
¶
Get power management interface.
Source code in sts_libs/src/sts/rdma.py
245 246 247 248 | |
get_sriov()
¶
Get SR-IOV configuration interface, or None if device lacks SR-IOV.
Source code in sts_libs/src/sts/rdma.py
250 251 252 253 | |
Sriov
pydantic-model
¶
Bases: _SysfsModel
SR-IOV (Single Root I/O Virtualization) configuration via sysfs.
Show JSON schema:
{
"additionalProperties": false,
"description": "SR-IOV (Single Root I/O Virtualization) configuration via sysfs.",
"properties": {
"path": {
"format": "path",
"title": "Path",
"type": "string"
},
"sysfs_attrs": {
"additionalProperties": {
"type": "string"
},
"title": "Sysfs Attrs",
"type": "object"
},
"sriov_numvfs": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Sriov Numvfs"
},
"sriov_totalvfs": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Sriov Totalvfs"
}
},
"required": [
"path"
],
"title": "Sriov",
"type": "object"
}
Fields:
-
path(Path) -
sysfs_attrs(dict[str, str]) -
sriov_numvfs(str | None) -
sriov_totalvfs(str | None)
Source code in sts_libs/src/sts/rdma.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
sriov_numvfs_path
property
¶
Path to the numvfs control file, derived from path.
discover()
¶
Read SR-IOV attributes from sysfs.
Source code in sts_libs/src/sts/rdma.py
149 150 151 152 153 | |
read_numvfs()
¶
Read current number of Virtual Functions.
Source code in sts_libs/src/sts/rdma.py
165 166 167 | |
set_numvfs(num='1')
¶
Set number of Virtual Functions.
Resets existing VFs before allocating the new count.
Source code in sts_libs/src/sts/rdma.py
155 156 157 158 159 160 161 162 163 | |
exists_device(ibdev)
¶
Check whether specific RDMA device exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ibdev
|
str
|
RDMA device ID (e.g., 'mlx5_0') |
required |
Source code in sts_libs/src/sts/rdma.py
25 26 27 28 29 30 31 | |
exists_rdma()
¶
Check whether system has RDMA devices.
Source code in sts_libs/src/sts/rdma.py
20 21 22 | |