Commit e3f20f02 authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Doug Ledford

IB/core: Integrate IB address resolution module into core

IB address resolution is declared as a module (ib_addr.ko) which loads
itself before IB core module (ib_core.ko).

It causes to the scenario where IB netlink which is initialized by IB
core can't be used by ib_addr.ko.

In order to solve it, we are converting ib_addr.ko to be part of
IB core module.
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarMark Bloch <markb@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent c16d2750
...@@ -2,7 +2,7 @@ infiniband-$(CONFIG_INFINIBAND_ADDR_TRANS) := rdma_cm.o ...@@ -2,7 +2,7 @@ infiniband-$(CONFIG_INFINIBAND_ADDR_TRANS) := rdma_cm.o
user_access-$(CONFIG_INFINIBAND_ADDR_TRANS) := rdma_ucm.o user_access-$(CONFIG_INFINIBAND_ADDR_TRANS) := rdma_ucm.o
obj-$(CONFIG_INFINIBAND) += ib_core.o ib_mad.o ib_sa.o \ obj-$(CONFIG_INFINIBAND) += ib_core.o ib_mad.o ib_sa.o \
ib_cm.o iw_cm.o ib_addr.o \ ib_cm.o iw_cm.o \
$(infiniband-y) $(infiniband-y)
obj-$(CONFIG_INFINIBAND_USER_MAD) += ib_umad.o obj-$(CONFIG_INFINIBAND_USER_MAD) += ib_umad.o
obj-$(CONFIG_INFINIBAND_USER_ACCESS) += ib_uverbs.o ib_ucm.o \ obj-$(CONFIG_INFINIBAND_USER_ACCESS) += ib_uverbs.o ib_ucm.o \
...@@ -10,7 +10,7 @@ obj-$(CONFIG_INFINIBAND_USER_ACCESS) += ib_uverbs.o ib_ucm.o \ ...@@ -10,7 +10,7 @@ obj-$(CONFIG_INFINIBAND_USER_ACCESS) += ib_uverbs.o ib_ucm.o \
ib_core-y := packer.o ud_header.o verbs.o cq.o rw.o sysfs.o \ ib_core-y := packer.o ud_header.o verbs.o cq.o rw.o sysfs.o \
device.o fmr_pool.o cache.o netlink.o \ device.o fmr_pool.o cache.o netlink.o \
roce_gid_mgmt.o mr_pool.o roce_gid_mgmt.o mr_pool.o addr.o
ib_core-$(CONFIG_INFINIBAND_USER_MEM) += umem.o ib_core-$(CONFIG_INFINIBAND_USER_MEM) += umem.o
ib_core-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += umem_odp.o umem_rbtree.o ib_core-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += umem_odp.o umem_rbtree.o
...@@ -28,8 +28,6 @@ rdma_cm-$(CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS) += cma_configfs.o ...@@ -28,8 +28,6 @@ rdma_cm-$(CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS) += cma_configfs.o
rdma_ucm-y := ucma.o rdma_ucm-y := ucma.o
ib_addr-y := addr.o
ib_umad-y := user_mad.o ib_umad-y := user_mad.o
ib_ucm-y := ucm.o ib_ucm-y := ucm.o
......
...@@ -47,10 +47,6 @@ ...@@ -47,10 +47,6 @@
#include <rdma/ib_addr.h> #include <rdma/ib_addr.h>
#include <rdma/ib.h> #include <rdma/ib.h>
MODULE_AUTHOR("Sean Hefty");
MODULE_DESCRIPTION("IB Address Translation");
MODULE_LICENSE("Dual BSD/GPL");
struct addr_req { struct addr_req {
struct list_head list; struct list_head list;
struct sockaddr_storage src_addr; struct sockaddr_storage src_addr;
...@@ -634,7 +630,7 @@ static struct notifier_block nb = { ...@@ -634,7 +630,7 @@ static struct notifier_block nb = {
.notifier_call = netevent_callback .notifier_call = netevent_callback
}; };
static int __init addr_init(void) int addr_init(void)
{ {
addr_wq = create_singlethread_workqueue("ib_addr"); addr_wq = create_singlethread_workqueue("ib_addr");
if (!addr_wq) if (!addr_wq)
...@@ -645,12 +641,9 @@ static int __init addr_init(void) ...@@ -645,12 +641,9 @@ static int __init addr_init(void)
return 0; return 0;
} }
static void __exit addr_cleanup(void) void addr_cleanup(void)
{ {
rdma_addr_unregister_client(&self); rdma_addr_unregister_client(&self);
unregister_netevent_notifier(&nb); unregister_netevent_notifier(&nb);
destroy_workqueue(addr_wq); destroy_workqueue(addr_wq);
} }
module_init(addr_init);
module_exit(addr_cleanup);
...@@ -137,4 +137,7 @@ static inline bool rdma_is_upper_dev_rcu(struct net_device *dev, ...@@ -137,4 +137,7 @@ static inline bool rdma_is_upper_dev_rcu(struct net_device *dev,
return _upper == upper; return _upper == upper;
} }
int addr_init(void);
void addr_cleanup(void);
#endif /* _CORE_PRIV_H */ #endif /* _CORE_PRIV_H */
...@@ -983,10 +983,18 @@ static int __init ib_core_init(void) ...@@ -983,10 +983,18 @@ static int __init ib_core_init(void)
goto err_sysfs; goto err_sysfs;
} }
ret = addr_init();
if (ret) {
pr_warn("Could't init IB address resolution\n");
goto err_ibnl;
}
ib_cache_setup(); ib_cache_setup();
return 0; return 0;
err_ibnl:
ibnl_cleanup();
err_sysfs: err_sysfs:
class_unregister(&ib_class); class_unregister(&ib_class);
err_comp: err_comp:
...@@ -999,6 +1007,7 @@ static int __init ib_core_init(void) ...@@ -999,6 +1007,7 @@ static int __init ib_core_init(void)
static void __exit ib_core_cleanup(void) static void __exit ib_core_cleanup(void)
{ {
ib_cache_cleanup(); ib_cache_cleanup();
addr_cleanup();
ibnl_cleanup(); ibnl_cleanup();
class_unregister(&ib_class); class_unregister(&ib_class);
destroy_workqueue(ib_comp_wq); destroy_workqueue(ib_comp_wq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment