aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/bnxt_re/Kconfig1
-rw-r--r--drivers/infiniband/hw/mlx4/Kconfig1
-rw-r--r--drivers/net/Kconfig1
-rw-r--r--drivers/net/ethernet/broadcom/Kconfig1
-rw-r--r--drivers/net/ethernet/cavium/Kconfig1
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/Kconfig1
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/Kconfig1
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/Kconfig1
-rw-r--r--drivers/net/ethernet/netronome/Kconfig1
-rw-r--r--include/net/devlink.h10
-rw-r--r--net/Kconfig11
-rw-r--r--net/core/devlink.c15
-rw-r--r--net/dsa/Kconfig2
13 files changed, 8 insertions, 39 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/Kconfig b/drivers/infiniband/hw/bnxt_re/Kconfig
index 18f5ed082f41..19982a4a9bba 100644
--- a/drivers/infiniband/hw/bnxt_re/Kconfig
+++ b/drivers/infiniband/hw/bnxt_re/Kconfig
@@ -1,7 +1,6 @@
1config INFINIBAND_BNXT_RE 1config INFINIBAND_BNXT_RE
2 tristate "Broadcom Netxtreme HCA support" 2 tristate "Broadcom Netxtreme HCA support"
3 depends on ETHERNET && NETDEVICES && PCI && INET && DCB 3 depends on ETHERNET && NETDEVICES && PCI && INET && DCB
4 depends on MAY_USE_DEVLINK
5 select NET_VENDOR_BROADCOM 4 select NET_VENDOR_BROADCOM
6 select BNXT 5 select BNXT
7 ---help--- 6 ---help---
diff --git a/drivers/infiniband/hw/mlx4/Kconfig b/drivers/infiniband/hw/mlx4/Kconfig
index d1de3285fd88..4e9936731867 100644
--- a/drivers/infiniband/hw/mlx4/Kconfig
+++ b/drivers/infiniband/hw/mlx4/Kconfig
@@ -2,7 +2,6 @@ config MLX4_INFINIBAND
2 tristate "Mellanox ConnectX HCA support" 2 tristate "Mellanox ConnectX HCA support"
3 depends on NETDEVICES && ETHERNET && PCI && INET 3 depends on NETDEVICES && ETHERNET && PCI && INET
4 depends on INFINIBAND_USER_ACCESS || !INFINIBAND_USER_ACCESS 4 depends on INFINIBAND_USER_ACCESS || !INFINIBAND_USER_ACCESS
5 depends on MAY_USE_DEVLINK
6 select NET_VENDOR_MELLANOX 5 select NET_VENDOR_MELLANOX
7 select MLX4_CORE 6 select MLX4_CORE
8 ---help--- 7 ---help---
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 6210757772ed..5e4ca082cfcd 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -505,7 +505,6 @@ source "drivers/net/hyperv/Kconfig"
505config NETDEVSIM 505config NETDEVSIM
506 tristate "Simulated networking device" 506 tristate "Simulated networking device"
507 depends on DEBUG_FS 507 depends on DEBUG_FS
508 depends on MAY_USE_DEVLINK
509 help 508 help
510 This driver is a developer testing tool and software model that can 509 This driver is a developer testing tool and software model that can
511 be used to test various control path networking APIs, especially 510 be used to test various control path networking APIs, especially
diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig
index c1d3ee9baf7e..716bfbba59cf 100644
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -194,7 +194,6 @@ config SYSTEMPORT
194config BNXT 194config BNXT
195 tristate "Broadcom NetXtreme-C/E support" 195 tristate "Broadcom NetXtreme-C/E support"
196 depends on PCI 196 depends on PCI
197 depends on MAY_USE_DEVLINK
198 select FW_LOADER 197 select FW_LOADER
199 select LIBCRC32C 198 select LIBCRC32C
200 ---help--- 199 ---help---
diff --git a/drivers/net/ethernet/cavium/Kconfig b/drivers/net/ethernet/cavium/Kconfig
index 05f4a3b21e29..6650e2a5f171 100644
--- a/drivers/net/ethernet/cavium/Kconfig
+++ b/drivers/net/ethernet/cavium/Kconfig
@@ -64,7 +64,6 @@ config CAVIUM_PTP
64config LIQUIDIO 64config LIQUIDIO
65 tristate "Cavium LiquidIO support" 65 tristate "Cavium LiquidIO support"
66 depends on 64BIT && PCI 66 depends on 64BIT && PCI
67 depends on MAY_USE_DEVLINK
68 depends on PCI 67 depends on PCI
69 imply PTP_1588_CLOCK 68 imply PTP_1588_CLOCK
70 select FW_LOADER 69 select FW_LOADER
diff --git a/drivers/net/ethernet/mellanox/mlx4/Kconfig b/drivers/net/ethernet/mellanox/mlx4/Kconfig
index f200b8c420d5..ff8057ed97ee 100644
--- a/drivers/net/ethernet/mellanox/mlx4/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx4/Kconfig
@@ -4,7 +4,6 @@
4 4
5config MLX4_EN 5config MLX4_EN
6 tristate "Mellanox Technologies 1/10/40Gbit Ethernet support" 6 tristate "Mellanox Technologies 1/10/40Gbit Ethernet support"
7 depends on MAY_USE_DEVLINK
8 depends on PCI && NETDEVICES && ETHERNET && INET 7 depends on PCI && NETDEVICES && ETHERNET && INET
9 select MLX4_CORE 8 select MLX4_CORE
10 imply PTP_1588_CLOCK 9 imply PTP_1588_CLOCK
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
index 37a551436e4a..6debffb8336b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
@@ -4,7 +4,6 @@
4 4
5config MLX5_CORE 5config MLX5_CORE
6 tristate "Mellanox 5th generation network adapters (ConnectX series) core driver" 6 tristate "Mellanox 5th generation network adapters (ConnectX series) core driver"
7 depends on MAY_USE_DEVLINK
8 depends on PCI 7 depends on PCI
9 imply PTP_1588_CLOCK 8 imply PTP_1588_CLOCK
10 imply VXLAN 9 imply VXLAN
diff --git a/drivers/net/ethernet/mellanox/mlxsw/Kconfig b/drivers/net/ethernet/mellanox/mlxsw/Kconfig
index b9a25aed5d11..9c195dfed031 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlxsw/Kconfig
@@ -4,7 +4,6 @@
4 4
5config MLXSW_CORE 5config MLXSW_CORE
6 tristate "Mellanox Technologies Switch ASICs support" 6 tristate "Mellanox Technologies Switch ASICs support"
7 depends on MAY_USE_DEVLINK
8 ---help--- 7 ---help---
9 This driver supports Mellanox Technologies Switch ASICs family. 8 This driver supports Mellanox Technologies Switch ASICs family.
10 9
diff --git a/drivers/net/ethernet/netronome/Kconfig b/drivers/net/ethernet/netronome/Kconfig
index 66f15b05b65e..549898d5d450 100644
--- a/drivers/net/ethernet/netronome/Kconfig
+++ b/drivers/net/ethernet/netronome/Kconfig
@@ -19,7 +19,6 @@ config NFP
19 tristate "Netronome(R) NFP4000/NFP6000 NIC driver" 19 tristate "Netronome(R) NFP4000/NFP6000 NIC driver"
20 depends on PCI && PCI_MSI 20 depends on PCI && PCI_MSI
21 depends on VXLAN || VXLAN=n 21 depends on VXLAN || VXLAN=n
22 depends on MAY_USE_DEVLINK
23 ---help--- 22 ---help---
24 This driver supports the Netronome(R) NFP4000/NFP6000 based 23 This driver supports the Netronome(R) NFP4000/NFP6000 based
25 cards working as a advanced Ethernet NIC. It works with both 24 cards working as a advanced Ethernet NIC. It works with both
diff --git a/include/net/devlink.h b/include/net/devlink.h
index a2da49dd9147..f9f7fe974652 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -707,6 +707,10 @@ devlink_health_reporter_priv(struct devlink_health_reporter *reporter);
707int devlink_health_report(struct devlink_health_reporter *reporter, 707int devlink_health_report(struct devlink_health_reporter *reporter,
708 const char *msg, void *priv_ctx); 708 const char *msg, void *priv_ctx);
709 709
710void devlink_compat_running_version(struct net_device *dev,
711 char *buf, size_t len);
712int devlink_compat_flash_update(struct net_device *dev, const char *file_name);
713
710#else 714#else
711 715
712static inline struct devlink *devlink_alloc(const struct devlink_ops *ops, 716static inline struct devlink *devlink_alloc(const struct devlink_ops *ops,
@@ -1190,13 +1194,7 @@ devlink_health_report(struct devlink_health_reporter *reporter,
1190{ 1194{
1191 return 0; 1195 return 0;
1192} 1196}
1193#endif
1194 1197
1195#if IS_REACHABLE(CONFIG_NET_DEVLINK)
1196void devlink_compat_running_version(struct net_device *dev,
1197 char *buf, size_t len);
1198int devlink_compat_flash_update(struct net_device *dev, const char *file_name);
1199#else
1200static inline void 1198static inline void
1201devlink_compat_running_version(struct net_device *dev, char *buf, size_t len) 1199devlink_compat_running_version(struct net_device *dev, char *buf, size_t len)
1202{ 1200{
diff --git a/net/Kconfig b/net/Kconfig
index 62da6148e9f8..1efe1f9ee492 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -429,21 +429,12 @@ config NET_SOCK_MSG
429 with the help of BPF programs. 429 with the help of BPF programs.
430 430
431config NET_DEVLINK 431config NET_DEVLINK
432 tristate "Network physical/parent device Netlink interface" 432 bool "Network physical/parent device Netlink interface"
433 help 433 help
434 Network physical/parent device Netlink interface provides 434 Network physical/parent device Netlink interface provides
435 infrastructure to support access to physical chip-wide config and 435 infrastructure to support access to physical chip-wide config and
436 monitoring. 436 monitoring.
437 437
438config 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
447config PAGE_POOL 438config PAGE_POOL
448 bool 439 bool
449 440
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 4f31ddc883e7..05e04ea0a5c7 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -6482,20 +6482,9 @@ int devlink_compat_flash_update(struct net_device *dev, const char *file_name)
6482 return -EOPNOTSUPP; 6482 return -EOPNOTSUPP;
6483} 6483}
6484 6484
6485static int __init devlink_module_init(void) 6485static int __init devlink_init(void)
6486{ 6486{
6487 return genl_register_family(&devlink_nl_family); 6487 return genl_register_family(&devlink_nl_family);
6488} 6488}
6489 6489
6490static void __exit devlink_module_exit(void) 6490subsys_initcall(devlink_init);
6491{
6492 genl_unregister_family(&devlink_nl_family);
6493}
6494
6495module_init(devlink_module_init);
6496module_exit(devlink_module_exit);
6497
6498MODULE_LICENSE("GPL v2");
6499MODULE_AUTHOR("Jiri Pirko <jiri@mellanox.com>");
6500MODULE_DESCRIPTION("Network physical device Netlink interface");
6501MODULE_ALIAS_GENL_FAMILY(DEVLINK_GENL_NAME);
diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
index 91e52973ee13..fab49132345f 100644
--- a/net/dsa/Kconfig
+++ b/net/dsa/Kconfig
@@ -6,7 +6,7 @@ config HAVE_NET_DSA
6 6
7config NET_DSA 7config NET_DSA
8 tristate "Distributed Switch Architecture" 8 tristate "Distributed Switch Architecture"
9 depends on HAVE_NET_DSA && MAY_USE_DEVLINK 9 depends on HAVE_NET_DSA
10 depends on BRIDGE || BRIDGE=n 10 depends on BRIDGE || BRIDGE=n
11 select NET_SWITCHDEV 11 select NET_SWITCHDEV
12 select PHYLINK 12 select PHYLINK