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
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -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 opa | 473 | * 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 end | 483 | * Always the end |
| 480 | */ | 484 | */ |