Skip to content

Commit f4b6bcc

Browse files
Jakub Kicinskidavem330
authored andcommitted
net: devlink: turn devlink into a built-in
Being able to build devlink as a module causes growing pains. First all drivers had to add a meta dependency to make sure they are not built in when devlink is built as a module. Now we are struggling to invoke ethtool compat code reliably. Make devlink code built-in, users can still not build it at all but the dynamically loadable module option is removed. Signed-off-by: Jakub Kicinski <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Acked-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d8cf757 commit f4b6bcc

File tree

13 files changed

+8
-39
lines changed

13 files changed

+8
-39
lines changed

drivers/infiniband/hw/bnxt_re/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
config INFINIBAND_BNXT_RE
22
tristate "Broadcom Netxtreme HCA support"
33
depends on ETHERNET && NETDEVICES && PCI && INET && DCB
4-
depends on MAY_USE_DEVLINK
54
select NET_VENDOR_BROADCOM
65
select BNXT
76
---help---

drivers/infiniband/hw/mlx4/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ config MLX4_INFINIBAND
22
tristate "Mellanox ConnectX HCA support"
33
depends on NETDEVICES && ETHERNET && PCI && INET
44
depends on INFINIBAND_USER_ACCESS || !INFINIBAND_USER_ACCESS
5-
depends on MAY_USE_DEVLINK
65
select NET_VENDOR_MELLANOX
76
select MLX4_CORE
87
---help---

drivers/net/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ source "drivers/net/hyperv/Kconfig"
505505
config NETDEVSIM
506506
tristate "Simulated networking device"
507507
depends on DEBUG_FS
508-
depends on MAY_USE_DEVLINK
509508
help
510509
This driver is a developer testing tool and software model that can
511510
be used to test various control path networking APIs, especially

drivers/net/ethernet/broadcom/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ config SYSTEMPORT
194194
config BNXT
195195
tristate "Broadcom NetXtreme-C/E support"
196196
depends on PCI
197-
depends on MAY_USE_DEVLINK
198197
select FW_LOADER
199198
select LIBCRC32C
200199
---help---

drivers/net/ethernet/cavium/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ config CAVIUM_PTP
6464
config LIQUIDIO
6565
tristate "Cavium LiquidIO support"
6666
depends on 64BIT && PCI
67-
depends on MAY_USE_DEVLINK
6867
depends on PCI
6968
imply PTP_1588_CLOCK
7069
select FW_LOADER

drivers/net/ethernet/mellanox/mlx4/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
config MLX4_EN
66
tristate "Mellanox Technologies 1/10/40Gbit Ethernet support"
7-
depends on MAY_USE_DEVLINK
87
depends on PCI && NETDEVICES && ETHERNET && INET
98
select MLX4_CORE
109
imply PTP_1588_CLOCK

drivers/net/ethernet/mellanox/mlx5/core/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
config MLX5_CORE
66
tristate "Mellanox 5th generation network adapters (ConnectX series) core driver"
7-
depends on MAY_USE_DEVLINK
87
depends on PCI
98
imply PTP_1588_CLOCK
109
imply VXLAN

drivers/net/ethernet/mellanox/mlxsw/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
config MLXSW_CORE
66
tristate "Mellanox Technologies Switch ASICs support"
7-
depends on MAY_USE_DEVLINK
87
---help---
98
This driver supports Mellanox Technologies Switch ASICs family.
109

drivers/net/ethernet/netronome/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ config NFP
1919
tristate "Netronome(R) NFP4000/NFP6000 NIC driver"
2020
depends on PCI && PCI_MSI
2121
depends on VXLAN || VXLAN=n
22-
depends on MAY_USE_DEVLINK
2322
---help---
2423
This driver supports the Netronome(R) NFP4000/NFP6000 based
2524
cards working as a advanced Ethernet NIC. It works with both

include/net/devlink.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,10 @@ devlink_health_reporter_priv(struct devlink_health_reporter *reporter);
707707
int devlink_health_report(struct devlink_health_reporter *reporter,
708708
const char *msg, void *priv_ctx);
709709

710+
void devlink_compat_running_version(struct net_device *dev,
711+
char *buf, size_t len);
712+
int devlink_compat_flash_update(struct net_device *dev, const char *file_name);
713+
710714
#else
711715

712716
static inline struct devlink *devlink_alloc(const struct devlink_ops *ops,
@@ -1190,13 +1194,7 @@ devlink_health_report(struct devlink_health_reporter *reporter,
11901194
{
11911195
return 0;
11921196
}
1193-
#endif
11941197

1195-
#if IS_REACHABLE(CONFIG_NET_DEVLINK)
1196-
void devlink_compat_running_version(struct net_device *dev,
1197-
char *buf, size_t len);
1198-
int devlink_compat_flash_update(struct net_device *dev, const char *file_name);
1199-
#else
12001198
static inline void
12011199
devlink_compat_running_version(struct net_device *dev, char *buf, size_t len)
12021200
{

net/Kconfig

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -429,21 +429,12 @@ config NET_SOCK_MSG
429429
with the help of BPF programs.
430430

431431
config NET_DEVLINK
432-
tristate "Network physical/parent device Netlink interface"
432+
bool "Network physical/parent device Netlink interface"
433433
help
434434
Network physical/parent device Netlink interface provides
435435
infrastructure to support access to physical chip-wide config and
436436
monitoring.
437437

438-
config MAY_USE_DEVLINK
439-
tristate
440-
default m if NET_DEVLINK=m
441-
default y if NET_DEVLINK=y || NET_DEVLINK=n
442-
help
443-
Drivers using the devlink infrastructure should have a dependency
444-
on MAY_USE_DEVLINK to ensure they do not cause link errors when
445-
devlink is a loadable module and the driver using it is built-in.
446-
447438
config PAGE_POOL
448439
bool
449440

net/core/devlink.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6482,20 +6482,9 @@ int devlink_compat_flash_update(struct net_device *dev, const char *file_name)
64826482
return -EOPNOTSUPP;
64836483
}
64846484

6485-
static int __init devlink_module_init(void)
6485+
static int __init devlink_init(void)
64866486
{
64876487
return genl_register_family(&devlink_nl_family);
64886488
}
64896489

6490-
static void __exit devlink_module_exit(void)
6491-
{
6492-
genl_unregister_family(&devlink_nl_family);
6493-
}
6494-
6495-
module_init(devlink_module_init);
6496-
module_exit(devlink_module_exit);
6497-
6498-
MODULE_LICENSE("GPL v2");
6499-
MODULE_AUTHOR("Jiri Pirko <[email protected]>");
6500-
MODULE_DESCRIPTION("Network physical device Netlink interface");
6501-
MODULE_ALIAS_GENL_FAMILY(DEVLINK_GENL_NAME);
6490+
subsys_initcall(devlink_init);

net/dsa/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ config HAVE_NET_DSA
66

77
config NET_DSA
88
tristate "Distributed Switch Architecture"
9-
depends on HAVE_NET_DSA && MAY_USE_DEVLINK
9+
depends on HAVE_NET_DSA
1010
depends on BRIDGE || BRIDGE=n
1111
select NET_SWITCHDEV
1212
select PHYLINK

0 commit comments

Comments
 (0)