diff options
author | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | 2017-08-14 16:57:39 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-08-22 17:04:22 -0400 |
commit | e3bf14bdc17a8e917f337760cc7cacf3232d7dbc (patch) | |
tree | d3cadc75b4c94b80f41118358053541e97f2ed86 /drivers/infiniband/core/netlink.c | |
parent | 1eb5be0ec79a7b21cd6b5b73d9de294dc1809e0f (diff) |
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 'drivers/infiniband/core/netlink.c')
-rw-r--r-- | drivers/infiniband/core/netlink.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c index f782697cf4d8..e685148dd3e6 100644 --- a/drivers/infiniband/core/netlink.c +++ b/drivers/infiniband/core/netlink.c | |||
@@ -84,6 +84,15 @@ static bool is_nl_valid(unsigned int type, unsigned int op) | |||
84 | return false; | 84 | return false; |
85 | 85 | ||
86 | cb_table = rdma_nl_types[type].cb_table; | 86 | cb_table = rdma_nl_types[type].cb_table; |
87 | #ifdef CONFIG_MODULES | ||
88 | if (!cb_table) { | ||
89 | mutex_unlock(&rdma_nl_mutex); | ||
90 | request_module("rdma-netlink-subsys-%d", type); | ||
91 | mutex_lock(&rdma_nl_mutex); | ||
92 | cb_table = rdma_nl_types[type].cb_table; | ||
93 | } | ||
94 | #endif | ||
95 | |||
87 | if (!cb_table || (!cb_table[op].dump && !cb_table[op].doit)) | 96 | if (!cb_table || (!cb_table[op].dump && !cb_table[op].doit)) |
88 | return false; | 97 | return false; |
89 | return true; | 98 | return true; |