diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2016-05-19 10:12:31 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-05-24 14:40:13 -0400 |
commit | e3f20f02864f6da1509c523bfa1e928619e59095 (patch) | |
tree | ad2b79a9ba8c013cc11d0f1c78416d92edda5076 | |
parent | c16d2750a08c8ccaf98d65f287a8aec91bb9610d (diff) |
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: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/core/Makefile | 6 | ||||
-rw-r--r-- | drivers/infiniband/core/addr.c | 11 | ||||
-rw-r--r-- | drivers/infiniband/core/core_priv.h | 3 | ||||
-rw-r--r-- | drivers/infiniband/core/device.c | 9 |
4 files changed, 16 insertions, 13 deletions
diff --git a/drivers/infiniband/core/Makefile b/drivers/infiniband/core/Makefile index 26987d9d7e1c..209838d2114d 100644 --- a/drivers/infiniband/core/Makefile +++ b/drivers/infiniband/core/Makefile | |||
@@ -2,7 +2,7 @@ infiniband-$(CONFIG_INFINIBAND_ADDR_TRANS) := rdma_cm.o | |||
2 | user_access-$(CONFIG_INFINIBAND_ADDR_TRANS) := rdma_ucm.o | 2 | user_access-$(CONFIG_INFINIBAND_ADDR_TRANS) := rdma_ucm.o |
3 | 3 | ||
4 | obj-$(CONFIG_INFINIBAND) += ib_core.o ib_mad.o ib_sa.o \ | 4 | obj-$(CONFIG_INFINIBAND) += ib_core.o ib_mad.o ib_sa.o \ |
5 | ib_cm.o iw_cm.o ib_addr.o \ | 5 | ib_cm.o iw_cm.o \ |
6 | $(infiniband-y) | 6 | $(infiniband-y) |
7 | obj-$(CONFIG_INFINIBAND_USER_MAD) += ib_umad.o | 7 | obj-$(CONFIG_INFINIBAND_USER_MAD) += ib_umad.o |
8 | obj-$(CONFIG_INFINIBAND_USER_ACCESS) += ib_uverbs.o ib_ucm.o \ | 8 | 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 | 10 | ||
11 | ib_core-y := packer.o ud_header.o verbs.o cq.o rw.o sysfs.o \ | 11 | ib_core-y := packer.o ud_header.o verbs.o cq.o rw.o sysfs.o \ |
12 | device.o fmr_pool.o cache.o netlink.o \ | 12 | device.o fmr_pool.o cache.o netlink.o \ |
13 | roce_gid_mgmt.o mr_pool.o | 13 | roce_gid_mgmt.o mr_pool.o addr.o |
14 | ib_core-$(CONFIG_INFINIBAND_USER_MEM) += umem.o | 14 | ib_core-$(CONFIG_INFINIBAND_USER_MEM) += umem.o |
15 | ib_core-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += umem_odp.o umem_rbtree.o | 15 | ib_core-$(CONFIG_INFINIBAND_ON_DEMAND_PAGING) += umem_odp.o umem_rbtree.o |
16 | 16 | ||
@@ -28,8 +28,6 @@ rdma_cm-$(CONFIG_INFINIBAND_ADDR_TRANS_CONFIGFS) += cma_configfs.o | |||
28 | 28 | ||
29 | rdma_ucm-y := ucma.o | 29 | rdma_ucm-y := ucma.o |
30 | 30 | ||
31 | ib_addr-y := addr.o | ||
32 | |||
33 | ib_umad-y := user_mad.o | 31 | ib_umad-y := user_mad.o |
34 | 32 | ||
35 | ib_ucm-y := ucm.o | 33 | ib_ucm-y := ucm.o |
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c index 337353d86cfa..3a203ee08ced 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c | |||
@@ -47,10 +47,6 @@ | |||
47 | #include <rdma/ib_addr.h> | 47 | #include <rdma/ib_addr.h> |
48 | #include <rdma/ib.h> | 48 | #include <rdma/ib.h> |
49 | 49 | ||
50 | MODULE_AUTHOR("Sean Hefty"); | ||
51 | MODULE_DESCRIPTION("IB Address Translation"); | ||
52 | MODULE_LICENSE("Dual BSD/GPL"); | ||
53 | |||
54 | struct addr_req { | 50 | struct addr_req { |
55 | struct list_head list; | 51 | struct list_head list; |
56 | struct sockaddr_storage src_addr; | 52 | struct sockaddr_storage src_addr; |
@@ -634,7 +630,7 @@ static struct notifier_block nb = { | |||
634 | .notifier_call = netevent_callback | 630 | .notifier_call = netevent_callback |
635 | }; | 631 | }; |
636 | 632 | ||
637 | static int __init addr_init(void) | 633 | int addr_init(void) |
638 | { | 634 | { |
639 | addr_wq = create_singlethread_workqueue("ib_addr"); | 635 | addr_wq = create_singlethread_workqueue("ib_addr"); |
640 | if (!addr_wq) | 636 | if (!addr_wq) |
@@ -645,12 +641,9 @@ static int __init addr_init(void) | |||
645 | return 0; | 641 | return 0; |
646 | } | 642 | } |
647 | 643 | ||
648 | static void __exit addr_cleanup(void) | 644 | void addr_cleanup(void) |
649 | { | 645 | { |
650 | rdma_addr_unregister_client(&self); | 646 | rdma_addr_unregister_client(&self); |
651 | unregister_netevent_notifier(&nb); | 647 | unregister_netevent_notifier(&nb); |
652 | destroy_workqueue(addr_wq); | 648 | destroy_workqueue(addr_wq); |
653 | } | 649 | } |
654 | |||
655 | module_init(addr_init); | ||
656 | module_exit(addr_cleanup); | ||
diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h index eab32215756b..589f16ad7c72 100644 --- a/drivers/infiniband/core/core_priv.h +++ b/drivers/infiniband/core/core_priv.h | |||
@@ -137,4 +137,7 @@ static inline bool rdma_is_upper_dev_rcu(struct net_device *dev, | |||
137 | return _upper == upper; | 137 | return _upper == upper; |
138 | } | 138 | } |
139 | 139 | ||
140 | int addr_init(void); | ||
141 | void addr_cleanup(void); | ||
142 | |||
140 | #endif /* _CORE_PRIV_H */ | 143 | #endif /* _CORE_PRIV_H */ |
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 10979844026a..805d72d67db1 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c | |||
@@ -983,10 +983,18 @@ static int __init ib_core_init(void) | |||
983 | goto err_sysfs; | 983 | goto err_sysfs; |
984 | } | 984 | } |
985 | 985 | ||
986 | ret = addr_init(); | ||
987 | if (ret) { | ||
988 | pr_warn("Could't init IB address resolution\n"); | ||
989 | goto err_ibnl; | ||
990 | } | ||
991 | |||
986 | ib_cache_setup(); | 992 | ib_cache_setup(); |
987 | 993 | ||
988 | return 0; | 994 | return 0; |
989 | 995 | ||
996 | err_ibnl: | ||
997 | ibnl_cleanup(); | ||
990 | err_sysfs: | 998 | err_sysfs: |
991 | class_unregister(&ib_class); | 999 | class_unregister(&ib_class); |
992 | err_comp: | 1000 | err_comp: |
@@ -999,6 +1007,7 @@ err: | |||
999 | static void __exit ib_core_cleanup(void) | 1007 | static void __exit ib_core_cleanup(void) |
1000 | { | 1008 | { |
1001 | ib_cache_cleanup(); | 1009 | ib_cache_cleanup(); |
1010 | addr_cleanup(); | ||
1002 | ibnl_cleanup(); | 1011 | ibnl_cleanup(); |
1003 | class_unregister(&ib_class); | 1012 | class_unregister(&ib_class); |
1004 | destroy_workqueue(ib_comp_wq); | 1013 | destroy_workqueue(ib_comp_wq); |