Message ID | 1444253266-22012-4-git-send-email-paul.gortmaker@windriver.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
On Wed, Oct 7, 2015 at 2:27 PM, Paul Gortmaker <paul.gortmaker@windriver.com> wrote: > The Kconfig currently controlling compilation of this code is: > > net/sched/Kconfig:menuconfig NET_SCHED > net/sched/Kconfig: bool "QoS and/or fair queueing" > > ...meaning that it currently is not being built as a module by anyone. Is there any reason why sch_blackhole can't be a module like other qdisc's? If not, I'd rather making it be a module. It is small but not often used. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[Re: [PATCH-next v2 3/4] net/sched: make sch_blackhole.c explicitly non-modular] On 07/10/2015 (Wed 14:47) Cong Wang wrote: > On Wed, Oct 7, 2015 at 2:27 PM, Paul Gortmaker > <paul.gortmaker@windriver.com> wrote: > > The Kconfig currently controlling compilation of this code is: > > > > net/sched/Kconfig:menuconfig NET_SCHED > > net/sched/Kconfig: bool "QoS and/or fair queueing" > > > > ...meaning that it currently is not being built as a module by anyone. > > Is there any reason why sch_blackhole can't be a module like > other qdisc's? > > If not, I'd rather making it be a module. It is small but not often used. As I've said in other similar threads, there are some 300+ places where code that can't ever be modular uses modular calls and/or introduces dead module remove code. Hence here I am making the code consistent with its current limitations. I'm not looking to extend functionality in code that I don't know intimately. I can't do that and do it reliably and guarantee it works as a module when it has never been used as such before in 300+ places all across the kernel. If there are interested users who want their code tristate and can vouch that their code works OK as such, I can drop the patch(es) here ; this is what happened with 4 of the patches I originally had in v1 of this very series. But a good number of the 300+ instances have been this way since before git history began (2005) and so I wonder the value in say extending instances like old ISA drivers from bool to tristate... Paul. -- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/sched/sch_blackhole.c b/net/sched/sch_blackhole.c index 094a874b48bc..3fee70d9814f 100644 --- a/net/sched/sch_blackhole.c +++ b/net/sched/sch_blackhole.c @@ -11,7 +11,7 @@ * Note: Quantum tunneling is not supported. */ -#include <linux/module.h> +#include <linux/init.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/skbuff.h> @@ -37,17 +37,8 @@ static struct Qdisc_ops blackhole_qdisc_ops __read_mostly = { .owner = THIS_MODULE, }; -static int __init blackhole_module_init(void) +static int __init blackhole_init(void) { return register_qdisc(&blackhole_qdisc_ops); } - -static void __exit blackhole_module_exit(void) -{ - unregister_qdisc(&blackhole_qdisc_ops); -} - -module_init(blackhole_module_init) -module_exit(blackhole_module_exit) - -MODULE_LICENSE("GPL"); +device_initcall(blackhole_init)
The Kconfig currently controlling compilation of this code is: net/sched/Kconfig:menuconfig NET_SCHED net/sched/Kconfig: bool "QoS and/or fair queueing" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We can change to one of the other priority initcalls (subsys?) at any later date, if desired. We also delete the MODULE_LICENSE tag since all that information is already contained at the top of the file in the comments. Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: netdev@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> --- net/sched/sch_blackhole.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)