diff options
author | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | 2017-08-14 22:57:39 +0200 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-08-22 23:04:22 +0200 |
commit | e3bf14bdc17a8e917f337760cc7cacf3232d7dbc (patch) | |
tree | d3cadc75b4c94b80f41118358053541e97f2ed86 /include/rdma/rdma_netlink.h | |
parent | rdma: Allow demand loading of NETLINK_RDMA (diff) | |
download | linux-e3bf14bdc17a8e917f337760cc7cacf3232d7dbc.tar.xz linux-e3bf14bdc17a8e917f337760cc7cacf3232d7dbc.zip |
rdma: Autoload netlink client modules
If a message comes in and we do not have the client in the table, then
try to load the module supplying that client using MODULE_ALIAS to find
it.
This duplicates the scheme seen in other netlink muxes (eg nfnetlink).
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/rdma/rdma_netlink.h')
-rw-r--r-- | include/rdma/rdma_netlink.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h index e25bf1988846..2d878596b1e0 100644 --- a/include/rdma/rdma_netlink.h +++ b/include/rdma/rdma_netlink.h @@ -17,6 +17,18 @@ enum rdma_nl_flags { RDMA_NL_ADMIN_PERM = 1 << 0, }; +/* Define this module as providing netlink services for NETLINK_RDMA, with + * index _index. Since the client indexes were setup in a uapi header as an + * enum and we do no want to change that, the user must supply the expanded + * constant as well and the compiler checks they are the same. + */ +#define MODULE_ALIAS_RDMA_NETLINK(_index, _val) \ + static inline void __chk_##_index(void) \ + { \ + BUILD_BUG_ON(_index != _val); \ + } \ + MODULE_ALIAS("rdma-netlink-subsys-" __stringify(_val)) + /** * Register client in RDMA netlink. * @index: Index of the added client |