diff mbox series

[RFC,2/2] net/mlx5: Kconfig: Use "uses" instead of "imply"

Message ID 20200417011146.83973-2-saeedm@mellanox.com (mailing list archive)
State New, archived
Headers show
Series [RFC,1/2] Kconfig: Introduce "uses" keyword | expand

Commit Message

Saeed Mahameed April 17, 2020, 1:11 a.m. UTC
mlx5 uses the imply keyword to force weak dependencies on the implied
modules, to make sure they are always reachable by mlx5.

"imply" doesn't work this way any more, and it was wrong to use it in
first place.

The right solution is to use: "depends on symbol || !symbol", which is
exactly what the uses keyword is there for.

Use the new "uses" keyword to replace all mlx5 implied dependencies.

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Arnd Bergmann April 17, 2020, 8:08 a.m. UTC | #1
On Fri, Apr 17, 2020 at 3:12 AM Saeed Mahameed <saeedm@mellanox.com> wrote:

> @@ -7,10 +7,10 @@ config MLX5_CORE
>         tristate "Mellanox 5th generation network adapters (ConnectX series) core driver"
>         depends on PCI
>         select NET_DEVLINK
> -       imply PTP_1588_CLOCK
> -       imply VXLAN
> -       imply MLXFW
> -       imply PCI_HYPERV_INTERFACE
> +       uses PTP_1588_CLOCK
> +       uses VXLAN
> +       uses MLXFW
> +       uses PCI_HYPERV_INTERFACE

I have confirmed in the meantime that changing the PCI_HYPERV_INTERFACE
dependency is indeed required, in addition to PTP_1588_CLOCK and VXLAN
that the randconfig tests found earlier:

x86_64-linux-ld: drivers/net/ethernet/mellanox/mlx5/core/main.o: in
function `mlx5_unload':
main.c:(.text+0x325): undefined reference to `mlx5_hv_vhca_cleanup'

I also checked that there is no link failure with MLX5_CORE=y and MLXFW=m,
but only because of an IS_REACHABLE() check in mlxfw/mlxfw.h.
I suppose that should be changed back to IS_ENABLED() now along with
the Kconfig check.

      Arnd
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
index 312e0a1ad43d..4e07179217e8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
@@ -7,10 +7,10 @@  config MLX5_CORE
 	tristate "Mellanox 5th generation network adapters (ConnectX series) core driver"
 	depends on PCI
 	select NET_DEVLINK
-	imply PTP_1588_CLOCK
-	imply VXLAN
-	imply MLXFW
-	imply PCI_HYPERV_INTERFACE
+	uses PTP_1588_CLOCK
+	uses VXLAN
+	uses MLXFW
+	uses PCI_HYPERV_INTERFACE
 	default n
 	---help---
 	  Core driver for low level functionality of the ConnectX-4 and