net: drop_monitor: make drop_monitor built-in
Subsystems (4)
PATCH 1/1 net: drop_monitor: make drop_monitor built-in
In net/Kconfig, NET_DEVLINK implies NET_DROP_MONITOR.
The original behavior of the 'imply' keyword prevents NET_DROP_MONITOR from being 'm' when NET_DEVLINK=y.
With the planned Kconfig change that relaxes the 'imply', the combination of NET_DEVLINK=y and NET_DROP_MONITOR=m would be allowed, causing a link error of vmlinux.
As far as I see the mainline code, NET_DROP_MONITOR=m does not provide any useful case.
The call-site of net_dm_hw_report() only exists in net/core/devlink.c, which is always built-in since NET_DEVLINK is a bool type option.
So, NET_DROP_MONITOR=m causes a build error, or creates an unused module at best.
Make NET_DROP_MONITOR a bool option, and remove the module exit code. I also unexported net_dm_hw_report because I see no other call-site in upstream.
---
This build error was reported in linux-next.
https://lkml.org/lkml/2020/3/10/1936
A less invasive change would be to change IS_ENABLED(CONFIG_NET_DROP_MONITOR) in include/net/drop_monitor.h to IS_REACHABLE(CONFIG_NET_DROP_MONITOR).
If you want to keep this modular, it is fine too.
If this patch is acceptable,
I'd like to get Ack from the maintainers,
and insert this patch before my Kconfig change.
include/net/drop_monitor.h | 2 +- net/Kconfig | 2 +- net/core/drop_monitor.c | 56 ++------------------------------------ 3 files changed, 4 insertions(+), 56 deletions(-)
include/net/drop_monitor.h +1 -1
@@ -19,7 +19,7 @@ struct net_dm_hw_metadata {struct net_device *input_dev; }; -#if IS_ENABLED (CONFIG_NET_DROP_MONITOR ) +#ifdef CONFIG_NET_DROP_MONITOR void net_dm_hw_report (struct sk_buff *skb,const struct net_dm_hw_metadata *hw_metadata);#else
net/Kconfig +1 -1
@@ -347,7 +347,7 @@ config NET_PKTGEN module will be called pktgen. config NET_DROP_MONITOR - tristate "Network packet drop alerting service" + bool "Network packet drop alerting service" depends on INET && TRACEPOINTS ---help--- This feature provides an alerting service to userspace in the
net/core/drop_monitor.c +2 -54
95 lines not on this page · raw message
Signature · 1 line
2.17.1
Quoted 19 lines · Masahiro Yamada
In net/Kconfig,
NET_DEVLINKimpliesNET_DROP_MONITOR.The original behavior of the 'imply' keyword prevents
NET_DROP_MONITORfrom being 'm' when NET_DEVLINK=y.With the planned
Kconfigchange that relaxes the 'imply', the combination of NET_DEVLINK=y and NET_DROP_MONITOR=m would be allowed, causing a link error of vmlinux.As far as I see the mainline code, NET_DROP_MONITOR=m does not provide any useful case.
The call-site of
net_dm_hw_report()only exists innet/core/devlink.c, which is always built-in sinceNET_DEVLINKis a bool type option.So, NET_DROP_MONITOR=m causes a build error, or creates an unused module at best.
Quoted 6 lines
Make
NET_DROP_MONITORa bool option, and remove the module exit code. I also unexportednet_dm_hw_reportbecause I see no other call-site in upstream.Reported-by Stephen Rothwell <[email protected]>Signed-off-by Masahiro Yamada <[email protected]>
Sorry, I take this back.
This is probably not the right fix.
I just sent an alternative patch.
( Replace IS_ENABLE with IS_REACHABLE )
Signature · 2 lines
Best Regards Masahiro Yamada