diff options
author | hselasky <hselasky@FreeBSD.org> | 2014-07-06 14:22:13 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2014-07-06 14:22:13 +0000 |
commit | 50128eff91eb1c5c189876dafec74a3b2e3c6fe3 (patch) | |
tree | 9f777c852bc9f45a5631b481edf21cddfc275b4a | |
parent | 050052b698b19d5c08ccea0678ebf90a7c2bec6f (diff) | |
download | FreeBSD-src-50128eff91eb1c5c189876dafec74a3b2e3c6fe3.zip FreeBSD-src-50128eff91eb1c5c189876dafec74a3b2e3c6fe3.tar.gz |
Fix OFED startup order: All SYSINIT()'s and modules should be loaded
prior to starting "/sbin/init" which will run all the "/etc/rc.d/xxx"
scripts. Else there can be a race configuring the interfaces via
"/etc/rc.conf".
MFC after: 4 weeks
Sponsored by: Mellanox Technologies
-rw-r--r-- | sys/ofed/drivers/infiniband/hw/mlx4/main.c | 2 | ||||
-rw-r--r-- | sys/ofed/drivers/net/mlx4/en_main.c | 2 | ||||
-rw-r--r-- | sys/ofed/drivers/net/mlx4/main.c | 2 | ||||
-rw-r--r-- | sys/ofed/include/linux/module.h | 11 |
4 files changed, 11 insertions, 6 deletions
diff --git a/sys/ofed/drivers/infiniband/hw/mlx4/main.c b/sys/ofed/drivers/infiniband/hw/mlx4/main.c index 056ed197..beef89e 100644 --- a/sys/ofed/drivers/infiniband/hw/mlx4/main.c +++ b/sys/ofed/drivers/infiniband/hw/mlx4/main.c @@ -2414,6 +2414,6 @@ static moduledata_t mlx4ib_mod = { .evhand = mlx4ib_evhand, }; -DECLARE_MODULE(mlx4ib, mlx4ib_mod, SI_SUB_SMP, SI_ORDER_ANY); +DECLARE_MODULE(mlx4ib, mlx4ib_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY); MODULE_DEPEND(mlx4ib, mlx4, 1, 1, 1); MODULE_DEPEND(mlx4ib, ibcore, 1, 1, 1); diff --git a/sys/ofed/drivers/net/mlx4/en_main.c b/sys/ofed/drivers/net/mlx4/en_main.c index b56766b..302be52 100644 --- a/sys/ofed/drivers/net/mlx4/en_main.c +++ b/sys/ofed/drivers/net/mlx4/en_main.c @@ -383,5 +383,5 @@ static moduledata_t mlxen_mod = { .name = "mlxen", .evhand = mlxen_evhand, }; -DECLARE_MODULE(mlxen, mlxen_mod, SI_SUB_SMP, SI_ORDER_ANY); +DECLARE_MODULE(mlxen, mlxen_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY); MODULE_DEPEND(mlxen, mlx4, 1, 1, 1); diff --git a/sys/ofed/drivers/net/mlx4/main.c b/sys/ofed/drivers/net/mlx4/main.c index 907e63e..c7388a0 100644 --- a/sys/ofed/drivers/net/mlx4/main.c +++ b/sys/ofed/drivers/net/mlx4/main.c @@ -2875,4 +2875,4 @@ static moduledata_t mlx4_mod = { .evhand = mlx4_evhand, }; MODULE_VERSION(mlx4, 1); -DECLARE_MODULE(mlx4, mlx4_mod, SI_SUB_SMP, SI_ORDER_ANY); +DECLARE_MODULE(mlx4, mlx4_mod, SI_SUB_OFED_PREINIT, SI_ORDER_ANY); diff --git a/sys/ofed/include/linux/module.h b/sys/ofed/include/linux/module.h index 8c83006..fc9d530 100644 --- a/sys/ofed/include/linux/module.h +++ b/sys/ofed/include/linux/module.h @@ -44,6 +44,11 @@ #define EXPORT_SYMBOL(name) #define EXPORT_SYMBOL_GPL(name) +/* OFED pre-module initialization */ +#define SI_SUB_OFED_PREINIT (SI_SUB_KTHREAD_INIT - 2) +/* OFED default module initialization */ +#define SI_SUB_OFED_MODINIT (SI_SUB_KTHREAD_INIT - 1) + #include <sys/linker.h> static inline void @@ -68,17 +73,17 @@ _module_run(void *arg) } #define module_init(fn) \ - SYSINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) + SYSINIT(fn, SI_SUB_OFED_MODINIT, SI_ORDER_FIRST, _module_run, (fn)) /* * XXX This is a freebsdism designed to work around not having a module * load order resolver built in. */ #define module_init_order(fn, order) \ - SYSINIT(fn, SI_SUB_LAST, (order), _module_run, (fn)) + SYSINIT(fn, SI_SUB_OFED_MODINIT, (order), _module_run, (fn)) #define module_exit(fn) \ - SYSUNINIT(fn, SI_SUB_LAST, SI_ORDER_FIRST, _module_run, (fn)) + SYSUNINIT(fn, SI_SUB_OFED_MODINIT, SI_ORDER_FIRST, _module_run, (fn)) #define module_get(module) #define module_put(module) |