* [PATCH v2 0/2] Autoloading for RDMA netlink modules
@ 2017-08-14 20:57 Jason Gunthorpe
[not found] ` <1502744259-16966-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Jason Gunthorpe @ 2017-08-14 20:57 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky, Doug Ledford
v2 is rebased/retested against Leon's major changes to the RDMA netlink code.
The module alias name was changed to "rdma-netlink-subsys-%d" for greater
consistency with other examples.
This allows all of RDMA netlink related things to autoload, for instance, on a
system with no module loaded running iwpmd will autoload ib_core.ko and iw_cm.ko,
which are required for iwpmd to run.
The end result is several new items in the modules.alias file related to
RDMA:
alias net-pf-16-proto-20 ib_core
alias rdma-netlink-subsys-1 rdma_cm
alias rdma-netlink-subsys-2 iw_cm
alias rdma-netlink-subsys-4 ib_core
alias rdma-netlink-subsys-5 ib_core
Jason Gunthorpe (2):
rdma: Allow demand loading of NETLINK_RDMA
rdma: Autoload netlink client modules
drivers/infiniband/core/cma.c | 2 ++
drivers/infiniband/core/device.c | 2 ++
drivers/infiniband/core/iwcm.c | 2 ++
drivers/infiniband/core/netlink.c | 12 ++++++++++++
drivers/infiniband/core/nldev.c | 3 +++
include/rdma/rdma_netlink.h | 12 ++++++++++++
6 files changed, 33 insertions(+)
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread[parent not found: <1502744259-16966-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>]
* [PATCH v2 1/2] rdma: Allow demand loading of NETLINK_RDMA [not found] ` <1502744259-16966-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> @ 2017-08-14 20:57 ` Jason Gunthorpe [not found] ` <1502744259-16966-2-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> 2017-08-14 20:57 ` [PATCH v2 2/2] rdma: Autoload netlink client modules Jason Gunthorpe 2017-08-22 21:07 ` [PATCH v2 0/2] Autoloading for RDMA netlink modules Doug Ledford 2 siblings, 1 reply; 12+ messages in thread From: Jason Gunthorpe @ 2017-08-14 20:57 UTC (permalink / raw) To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky, Doug Ledford Provide a module alias so that if userspace opens a netlink socket for RDMA the kernel support is loaded automatically. Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> --- drivers/infiniband/core/netlink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c index 27352a35277011..f782697cf4d819 100644 --- a/drivers/infiniband/core/netlink.c +++ b/drivers/infiniband/core/netlink.c @@ -38,6 +38,7 @@ #include <net/net_namespace.h> #include <net/sock.h> #include <rdma/rdma_netlink.h> +#include <linux/module.h> #include "core_priv.h" #include "core_priv.h" @@ -290,3 +291,5 @@ void rdma_nl_exit(void) netlink_kernel_release(nls); } + +MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_RDMA); -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 12+ messages in thread
[parent not found: <1502744259-16966-2-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>]
* Re: [PATCH v2 1/2] rdma: Allow demand loading of NETLINK_RDMA [not found] ` <1502744259-16966-2-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> @ 2017-08-15 9:20 ` Leon Romanovsky 0 siblings, 0 replies; 12+ messages in thread From: Leon Romanovsky @ 2017-08-15 9:20 UTC (permalink / raw) To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford [-- Attachment #1: Type: text/plain, Size: 462 bytes --] On Mon, Aug 14, 2017 at 02:57:38PM -0600, Jason Gunthorpe wrote: > Provide a module alias so that if userspace opens a netlink > socket for RDMA the kernel support is loaded automatically. > > Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> > --- > drivers/infiniband/core/netlink.c | 3 +++ > 1 file changed, 3 insertions(+) > Thanks, Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 2/2] rdma: Autoload netlink client modules [not found] ` <1502744259-16966-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> 2017-08-14 20:57 ` [PATCH v2 1/2] rdma: Allow demand loading of NETLINK_RDMA Jason Gunthorpe @ 2017-08-14 20:57 ` Jason Gunthorpe [not found] ` <1502744259-16966-3-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> 2017-08-22 21:07 ` [PATCH v2 0/2] Autoloading for RDMA netlink modules Doug Ledford 2 siblings, 1 reply; 12+ messages in thread From: Jason Gunthorpe @ 2017-08-14 20:57 UTC (permalink / raw) To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky, Doug Ledford 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-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> --- drivers/infiniband/core/cma.c | 2 ++ drivers/infiniband/core/device.c | 2 ++ drivers/infiniband/core/iwcm.c | 2 ++ drivers/infiniband/core/netlink.c | 9 +++++++++ drivers/infiniband/core/nldev.c | 3 +++ include/rdma/rdma_netlink.h | 12 ++++++++++++ 6 files changed, 30 insertions(+) diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index d8edd8b11561ae..b76de2e2b20950 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -4537,5 +4537,7 @@ static void __exit cma_cleanup(void) destroy_workqueue(cma_wq); } +MODULE_ALIAS_RDMA_NETLINK(RDMA_NL_RDMA_CM, 1); + module_init(cma_init); module_exit(cma_cleanup); diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index fbc92c649be85d..5f9d4ae5eda8eb 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -1251,5 +1251,7 @@ static void __exit ib_core_cleanup(void) destroy_workqueue(ib_wq); } +MODULE_ALIAS_RDMA_NETLINK(RDMA_NL_LS, 4); + module_init(ib_core_init); module_exit(ib_core_cleanup); diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c index 452a3115e3e6ba..af6015a7a8f361 100644 --- a/drivers/infiniband/core/iwcm.c +++ b/drivers/infiniband/core/iwcm.c @@ -1200,5 +1200,7 @@ static void __exit iw_cm_cleanup(void) iwpm_exit(RDMA_NL_IWCM); } +MODULE_ALIAS_RDMA_NETLINK(RDMA_NL_IWCM, 2); + module_init(iw_cm_init); module_exit(iw_cm_cleanup); diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c index f782697cf4d819..e685148dd3e6c2 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) return false; cb_table = rdma_nl_types[type].cb_table; +#ifdef CONFIG_MODULES + if (!cb_table) { + mutex_unlock(&rdma_nl_mutex); + request_module("rdma-netlink-subsys-%d", type); + mutex_lock(&rdma_nl_mutex); + cb_table = rdma_nl_types[type].cb_table; + } +#endif + if (!cb_table || (!cb_table[op].dump && !cb_table[op].doit)) return false; return true; diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c index 474022274e09cd..3ba24c428c3bda 100644 --- a/drivers/infiniband/core/nldev.c +++ b/drivers/infiniband/core/nldev.c @@ -30,6 +30,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include <linux/module.h> #include <net/netlink.h> #include <rdma/rdma_netlink.h> @@ -320,3 +321,5 @@ void __exit nldev_exit(void) { rdma_nl_unregister(RDMA_NL_NLDEV); } + +MODULE_ALIAS_RDMA_NETLINK(RDMA_NL_NLDEV, 5); diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h index e25bf1988846df..2d878596b1e07a 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 -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 12+ messages in thread
[parent not found: <1502744259-16966-3-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>]
* Re: [PATCH v2 2/2] rdma: Autoload netlink client modules [not found] ` <1502744259-16966-3-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> @ 2017-08-15 9:56 ` Leon Romanovsky [not found] ` <20170815095651.GQ24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> 0 siblings, 1 reply; 12+ messages in thread From: Leon Romanovsky @ 2017-08-15 9:56 UTC (permalink / raw) To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford [-- Attachment #1: Type: text/plain, Size: 4534 bytes --] On Mon, Aug 14, 2017 at 02:57:39PM -0600, Jason Gunthorpe wrote: > 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-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> > --- > drivers/infiniband/core/cma.c | 2 ++ > drivers/infiniband/core/device.c | 2 ++ > drivers/infiniband/core/iwcm.c | 2 ++ > drivers/infiniband/core/netlink.c | 9 +++++++++ > drivers/infiniband/core/nldev.c | 3 +++ > include/rdma/rdma_netlink.h | 12 ++++++++++++ > 6 files changed, 30 insertions(+) > > diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c > index d8edd8b11561ae..b76de2e2b20950 100644 > --- a/drivers/infiniband/core/cma.c > +++ b/drivers/infiniband/core/cma.c > @@ -4537,5 +4537,7 @@ static void __exit cma_cleanup(void) > destroy_workqueue(cma_wq); > } > > +MODULE_ALIAS_RDMA_NETLINK(RDMA_NL_RDMA_CM, 1); > + > module_init(cma_init); > module_exit(cma_cleanup); > diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c > index fbc92c649be85d..5f9d4ae5eda8eb 100644 > --- a/drivers/infiniband/core/device.c > +++ b/drivers/infiniband/core/device.c > @@ -1251,5 +1251,7 @@ static void __exit ib_core_cleanup(void) > destroy_workqueue(ib_wq); > } > > +MODULE_ALIAS_RDMA_NETLINK(RDMA_NL_LS, 4); > + > module_init(ib_core_init); > module_exit(ib_core_cleanup); > diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c > index 452a3115e3e6ba..af6015a7a8f361 100644 > --- a/drivers/infiniband/core/iwcm.c > +++ b/drivers/infiniband/core/iwcm.c > @@ -1200,5 +1200,7 @@ static void __exit iw_cm_cleanup(void) > iwpm_exit(RDMA_NL_IWCM); > } > > +MODULE_ALIAS_RDMA_NETLINK(RDMA_NL_IWCM, 2); > + > module_init(iw_cm_init); > module_exit(iw_cm_cleanup); > diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c > index f782697cf4d819..e685148dd3e6c2 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) > return false; > > cb_table = rdma_nl_types[type].cb_table; > +#ifdef CONFIG_MODULES > + if (!cb_table) { > + mutex_unlock(&rdma_nl_mutex); > + request_module("rdma-netlink-subsys-%d", type); > + mutex_lock(&rdma_nl_mutex); > + cb_table = rdma_nl_types[type].cb_table; > + } > +#endif > + > if (!cb_table || (!cb_table[op].dump && !cb_table[op].doit)) > return false; > return true; > diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c > index 474022274e09cd..3ba24c428c3bda 100644 > --- a/drivers/infiniband/core/nldev.c > +++ b/drivers/infiniband/core/nldev.c > @@ -30,6 +30,7 @@ > * POSSIBILITY OF SUCH DAMAGE. > */ > > +#include <linux/module.h> > #include <net/netlink.h> > #include <rdma/rdma_netlink.h> > > @@ -320,3 +321,5 @@ void __exit nldev_exit(void) > { > rdma_nl_unregister(RDMA_NL_NLDEV); > } > + > +MODULE_ALIAS_RDMA_NETLINK(RDMA_NL_NLDEV, 5); > diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h > index e25bf1988846df..2d878596b1e07a 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)) > + Can it be something like that (untested)? #define MODULE_ALIAS_RDMA_NETLINK(_index) \ { \ char str[32];\ strncpy(str, 32, "rdma-netlink-subsys-%d", __index);\ MODULE_ALIAS(str)\ } > /** > * Register client in RDMA netlink. > * @index: Index of the added client > -- > 2.7.4 > [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <20170815095651.GQ24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>]
* Re: [PATCH v2 2/2] rdma: Autoload netlink client modules [not found] ` <20170815095651.GQ24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> @ 2017-08-15 15:35 ` Jason Gunthorpe [not found] ` <20170815153523.GA14623-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> 0 siblings, 1 reply; 12+ messages in thread From: Jason Gunthorpe @ 2017-08-15 15:35 UTC (permalink / raw) To: Leon Romanovsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford On Tue, Aug 15, 2017 at 12:56:51PM +0300, Leon Romanovsky wrote: > Can it be something like that (untested)? > #define MODULE_ALIAS_RDMA_NETLINK(_index) No, MODULE_ALIAS does something like static const char __UNIQUE_ID(name)[] __used __attribute__((section(".modinfo"), unused, aligned(1))) = __stringify(tag) "=" info; So it must accept a string produced by the pre-processor, not by code. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <20170815153523.GA14623-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>]
* Re: [PATCH v2 2/2] rdma: Autoload netlink client modules [not found] ` <20170815153523.GA14623-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> @ 2017-08-15 15:58 ` Leon Romanovsky [not found] ` <20170815155843.GT24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> 0 siblings, 1 reply; 12+ messages in thread From: Leon Romanovsky @ 2017-08-15 15:58 UTC (permalink / raw) To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford [-- Attachment #1: Type: text/plain, Size: 591 bytes --] On Tue, Aug 15, 2017 at 09:35:23AM -0600, Jason Gunthorpe wrote: > On Tue, Aug 15, 2017 at 12:56:51PM +0300, Leon Romanovsky wrote: > > > Can it be something like that (untested)? > > #define MODULE_ALIAS_RDMA_NETLINK(_index) > > No, MODULE_ALIAS does something like > > static const char __UNIQUE_ID(name)[] > __used __attribute__((section(".modinfo"), unused, aligned(1))) = __stringify(tag) "=" info; > > So it must accept a string produced by the pre-processor, not by code. But the netlink indexes were defined as anonymous enum, can we safely convert them to be defines? > > Jason [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <20170815155843.GT24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>]
* Re: [PATCH v2 2/2] rdma: Autoload netlink client modules [not found] ` <20170815155843.GT24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> @ 2017-08-15 16:57 ` Jason Gunthorpe [not found] ` <20170815165737.GB15171-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> 0 siblings, 1 reply; 12+ messages in thread From: Jason Gunthorpe @ 2017-08-15 16:57 UTC (permalink / raw) To: Leon Romanovsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford On Tue, Aug 15, 2017 at 06:58:43PM +0300, Leon Romanovsky wrote: > On Tue, Aug 15, 2017 at 09:35:23AM -0600, Jason Gunthorpe wrote: > > On Tue, Aug 15, 2017 at 12:56:51PM +0300, Leon Romanovsky wrote: > > > > > Can it be something like that (untested)? > > > #define MODULE_ALIAS_RDMA_NETLINK(_index) > > > > No, MODULE_ALIAS does something like > > > > static const char __UNIQUE_ID(name)[] > > __used __attribute__((section(".modinfo"), unused, aligned(1))) = __stringify(tag) "=" info; > > > > So it must accept a string produced by the pre-processor, not by code. > > But the netlink indexes were defined as anonymous enum, can we safely > convert them to be defines? Technically no, we shouldn't, the difference could break things.. But due to the limited use of the header we probably could change to defines. Either way doesn't really matter.. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <20170815165737.GB15171-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>]
* Re: [PATCH v2 2/2] rdma: Autoload netlink client modules [not found] ` <20170815165737.GB15171-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> @ 2017-08-15 17:40 ` Leon Romanovsky [not found] ` <20170815174058.GW24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> 0 siblings, 1 reply; 12+ messages in thread From: Leon Romanovsky @ 2017-08-15 17:40 UTC (permalink / raw) To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford [-- Attachment #1: Type: text/plain, Size: 1313 bytes --] On Tue, Aug 15, 2017 at 10:57:37AM -0600, Jason Gunthorpe wrote: > On Tue, Aug 15, 2017 at 06:58:43PM +0300, Leon Romanovsky wrote: > > On Tue, Aug 15, 2017 at 09:35:23AM -0600, Jason Gunthorpe wrote: > > > On Tue, Aug 15, 2017 at 12:56:51PM +0300, Leon Romanovsky wrote: > > > > > > > Can it be something like that (untested)? > > > > #define MODULE_ALIAS_RDMA_NETLINK(_index) > > > > > > No, MODULE_ALIAS does something like > > > > > > static const char __UNIQUE_ID(name)[] > > > __used __attribute__((section(".modinfo"), unused, aligned(1))) = __stringify(tag) "=" info; > > > > > > So it must accept a string produced by the pre-processor, not by code. > > > > But the netlink indexes were defined as anonymous enum, can we safely > > convert them to be defines? > > Technically no, we shouldn't, the difference could break things.. But > due to the limited use of the header we probably could change to > defines. > > Either way doesn't really matter.. Can this be a solution? http://elixir.free-electrons.com/linux/latest/source/include/uapi/linux/in.h#L27 Thanks > > Jason > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <20170815174058.GW24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>]
* Re: [PATCH v2 2/2] rdma: Autoload netlink client modules [not found] ` <20170815174058.GW24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> @ 2017-08-16 15:36 ` Jason Gunthorpe [not found] ` <20170816153620.GA22584-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> 0 siblings, 1 reply; 12+ messages in thread From: Jason Gunthorpe @ 2017-08-16 15:36 UTC (permalink / raw) To: Leon Romanovsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford On Tue, Aug 15, 2017 at 08:40:58PM +0300, Leon Romanovsky wrote: > Can this be a solution? > http://elixir.free-electrons.com/linux/latest/source/include/uapi/linux/in.h#L27 No, that is going the other way - continuing to provide compat #defines while using an enum underlying, the preprocessor still cannot see the value to build the string. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <20170816153620.GA22584-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>]
* Re: [PATCH v2 2/2] rdma: Autoload netlink client modules [not found] ` <20170816153620.GA22584-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> @ 2017-08-16 15:59 ` Leon Romanovsky 0 siblings, 0 replies; 12+ messages in thread From: Leon Romanovsky @ 2017-08-16 15:59 UTC (permalink / raw) To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Doug Ledford [-- Attachment #1: Type: text/plain, Size: 578 bytes --] On Wed, Aug 16, 2017 at 09:36:20AM -0600, Jason Gunthorpe wrote: > On Tue, Aug 15, 2017 at 08:40:58PM +0300, Leon Romanovsky wrote: > > > Can this be a solution? > > http://elixir.free-electrons.com/linux/latest/source/include/uapi/linux/in.h#L27 > > No, that is going the other way - continuing to provide compat > #defines while using an enum underlying, the preprocessor still cannot > see the value to build the string. ok, I see. Anyway, if we find better solution, we will update it. Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> Thanks [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 0/2] Autoloading for RDMA netlink modules [not found] ` <1502744259-16966-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> 2017-08-14 20:57 ` [PATCH v2 1/2] rdma: Allow demand loading of NETLINK_RDMA Jason Gunthorpe 2017-08-14 20:57 ` [PATCH v2 2/2] rdma: Autoload netlink client modules Jason Gunthorpe @ 2017-08-22 21:07 ` Doug Ledford 2 siblings, 0 replies; 12+ messages in thread From: Doug Ledford @ 2017-08-22 21:07 UTC (permalink / raw) To: Jason Gunthorpe, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky On Mon, 2017-08-14 at 14:57 -0600, Jason Gunthorpe wrote: > v2 is rebased/retested against Leon's major changes to the RDMA > netlink code. > > The module alias name was changed to "rdma-netlink-subsys-%d" for > greater > consistency with other examples. > > This allows all of RDMA netlink related things to autoload, for > instance, on a > system with no module loaded running iwpmd will autoload ib_core.ko > and iw_cm.ko, > which are required for iwpmd to run. > > The end result is several new items in the modules.alias file related > to > RDMA: > > alias net-pf-16-proto-20 ib_core > alias rdma-netlink-subsys-1 rdma_cm > alias rdma-netlink-subsys-2 iw_cm > alias rdma-netlink-subsys-4 ib_core > alias rdma-netlink-subsys-5 ib_core > > Jason Gunthorpe (2): > rdma: Allow demand loading of NETLINK_RDMA > rdma: Autoload netlink client modules > > drivers/infiniband/core/cma.c | 2 ++ > drivers/infiniband/core/device.c | 2 ++ > drivers/infiniband/core/iwcm.c | 2 ++ > drivers/infiniband/core/netlink.c | 12 ++++++++++++ > drivers/infiniband/core/nldev.c | 3 +++ > include/rdma/rdma_netlink.h | 12 ++++++++++++ > 6 files changed, 33 insertions(+) Thanks, series applied. -- Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2017-08-22 21:07 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-14 20:57 [PATCH v2 0/2] Autoloading for RDMA netlink modules Jason Gunthorpe
[not found] ` <1502744259-16966-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-14 20:57 ` [PATCH v2 1/2] rdma: Allow demand loading of NETLINK_RDMA Jason Gunthorpe
[not found] ` <1502744259-16966-2-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-15 9:20 ` Leon Romanovsky
2017-08-14 20:57 ` [PATCH v2 2/2] rdma: Autoload netlink client modules Jason Gunthorpe
[not found] ` <1502744259-16966-3-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-15 9:56 ` Leon Romanovsky
[not found] ` <20170815095651.GQ24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-15 15:35 ` Jason Gunthorpe
[not found] ` <20170815153523.GA14623-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-15 15:58 ` Leon Romanovsky
[not found] ` <20170815155843.GT24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-15 16:57 ` Jason Gunthorpe
[not found] ` <20170815165737.GB15171-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-15 17:40 ` Leon Romanovsky
[not found] ` <20170815174058.GW24282-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-16 15:36 ` Jason Gunthorpe
[not found] ` <20170816153620.GA22584-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-16 15:59 ` Leon Romanovsky
2017-08-22 21:07 ` [PATCH v2 0/2] Autoloading for RDMA netlink modules Doug Ledford
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox