History

RDMA/netlink: Add netlink device definitions to UAPI

Introduce new defines to rdma_netlink.h, so the RDMA configuration tool will be able to communicate with RDMA subsystem by using the shared defines. The addition of new client (NLDEV) revealed the fact that we exposed by mistake the RDMA_NL_I40IW define which is not backed by any RDMA netlink by now and it won't be exposed in the future too. So this patch reuses the value and deletes the old defines. The NLDEV operates with objects. The struct ib_device has two straightforward objects: device itself and ports of that device. This brings us to propose the following commands to work on those objects: * RDMA_NLDEV_CMD_{GET,SET,NEW,DEL} - works on ib_device itself * RDMA_NLDEV_CMD_PORT_{GET,SET,NEW,DEL} - works on ports of specific ib_device Those commands receive/return the device index (RDMA_NLDEV_ATTR_DEV_INDEX) and port index (RDMA_NLDEV_ATTR_PORT_INDEX). For device object accesses, the RDMA_NLDEV_ATTR_PORT_INDEX will return the maximum number of ports for specific ib_device and for port access the actual port index. The port index starts from 1 to follow RDMA/core internal semantics and the sysfs exposed knobs.

Leon Romanovsky committed 9 years ago

Commit 1a6e7c31 parent 8bc67412 files · +39 −2Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/rdma/rdma_netlink.h+38−1
@@ -8,7 +8,7 @@ enum { · 7 unmodified lines
88 RDMA_NL_IWCM,
99 RDMA_NL_RSVD,
1010 RDMA_NL_LS, /* RDMA Local Services */
11− RDMA_NL_I40IW,
11+ RDMA_NL_NLDEV, /* RDMA device interface */
1212 RDMA_NL_NUM_CLIENTS
1313 };
1414
@@ -222,4 +222,41 @@ struct rdma_nla_ls_gid { · 207 unmodified lines
222222 __u8 gid[16];
223223 };
224224
225+enum rdma_nldev_command {
226+ RDMA_NLDEV_CMD_UNSPEC,
227+
228+ RDMA_NLDEV_CMD_GET, /* can dump */
229+ RDMA_NLDEV_CMD_SET,
230+ RDMA_NLDEV_CMD_NEW,
231+ RDMA_NLDEV_CMD_DEL,
232+
233+ RDMA_NLDEV_CMD_PORT_GET, /* can dump */
234+ RDMA_NLDEV_CMD_PORT_SET,
235+ RDMA_NLDEV_CMD_PORT_NEW,
236+ RDMA_NLDEV_CMD_PORT_DEL,
237+
238+ RDMA_NLDEV_NUM_OPS
239+};
240+
241+enum rdma_nldev_attr {
242+ /* don't change the order or add anything between, this is ABI! */
243+ RDMA_NLDEV_ATTR_UNSPEC,
244+
245+ /* Identifier for ib_device */
246+ RDMA_NLDEV_ATTR_DEV_INDEX, /* u32 */
247+
248+ RDMA_NLDEV_ATTR_DEV_NAME, /* string */
249+ /*
250+ * Device index together with port index are identifiers
251+ * for port/link properties.
252+ *
253+ * For RDMA_NLDEV_CMD_GET commamnd, port index will return number
254+ * of available ports in ib_device, while for port specific operations,
255+ * it will be real port index as it appears in sysfs. Port index follows
256+ * sysfs notation and starts from 1 for the first port.
257+ */
258+ RDMA_NLDEV_ATTR_PORT_INDEX, /* u32 */
259+
260+ RDMA_NLDEV_ATTR_MAX
261+};
225262 #endif /* _UAPI_RDMA_NETLINK_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t