History

RDMA/core: Add a netlink command to change net namespace of rdma device

Provide an option to change the net namespace of a rdma device through a netlink command. When multiple rdma devices exists in a system, and when containers are used, this will limit rdma device visibility to a specified net namespace. An example command to change net namespace of mlx5_1 device to the previously created net namespace 'foo' is: $ ip netns add foo $ rdma dev set mlx5_1 netns foo

Parav Pandit committed 7 years ago

Commit 2e5b8a01 parent decbc7a4 files · +70 −7Browse files

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

Unified · Split

include/uapi/rdma/rdma_netlink.h+5−1
@@ -469,12 +469,16 @@ enum rdma_nldev_attr { · 468 unmodified lines
469 * either shared or exclusive among multiple net namespaces.469 * either shared or exclusive among multiple net namespaces.
470 */470 */
471 RDMA_NLDEV_SYS_ATTR_NETNS_MODE, /* u8 */471 RDMA_NLDEV_SYS_ATTR_NETNS_MODE, /* u8 */
472
473 /*472 /*
474 * Device protocol, e.g. ib, iw, usnic, roce and opa473 * Device protocol, e.g. ib, iw, usnic, roce and opa
475 */474 */
476 RDMA_NLDEV_ATTR_DEV_PROTOCOL, /* string */475 RDMA_NLDEV_ATTR_DEV_PROTOCOL, /* string */
477 476
477 /*
478 * File descriptor handle of the net namespace object
479 */
480 RDMA_NLDEV_NET_NS_FD, /* u32 */
481
478 /*482 /*
479 * Always the end483 * Always the end
480 */484 */