net/mlx5e: fix ip6_dst_lookup link failure
Subsystems (4)
PATCH 1/1 net/mlx5e: fix ip6_dst_lookup link failure
From: Arnd Bergmann <[email protected]>
Changing mlx5 to call ip6_dst_lookup() means it now fails to link when IPv6 is a loadable module but ipsec support is built-in:
ipsec.c:(.text+0x1061): undefined reference to `ip6_dst_lookup'
Add a Kconfig dependency that removes avoids this configuration.
--- drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/mellanox/mlx5/core/Kconfig +1 -0
@@ -154,6 +154,7 @@ config MLX5_EN_IPSEC depends on MLX5_CORE_EN depends on XFRM_OFFLOAD depends on INET_ESP_OFFLOAD || INET6_ESP_OFFLOAD + depends on IPV6!=m || MLX5_CORE=m help Build support for IPsec cryptography-offload acceleration in the NIC.
Signature · 1 line
2.39.5
Jakub Kicinski
maintainerThis is an AI-generated review of your patch. The human sending this email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net/mlx5e: fix ip6_dst_lookup link failure
This commit adds a Kconfig dependency to prevent a link failure when IPv6 is a loadable module but mlx5 ipsec support is built-in.
Quoted 1 line
Add a
Kconfigdependency that removes avoids this configuration.
This isn't a bug, but "removes avoids" appears to be an editing artifact where two verbs were left in place of one.
Signature · 1 line
pw-bot: cr
Quoted 20 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Changing mlx5 to call
ip6_dst_lookup()means it now fails to link when IPv6 is a loadable module but ipsec support is built-in:ipsec.c:(.text+0x1061): undefined reference to `ip6_dst_lookup'
Add a
Kconfigdependency that removes avoids this configuration.Fixes e35d7da8dd9e ("net/mlx5e: Use ip6_dst_lookup instead of ipv6_dst_lookup_flow for MAC init")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/net/ethernet/mellanox/mlx5/core/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/net/ethernet/mellanox/mlx5/core/Kconfig +0
-0
drivers/net/ethernet/mellanox/mlx5/core/Kconfig config MLX5_EN_IPSEC · line 157
Quoted 4 lines
drivers/net/ethernet/mellanox/mlx5/core/Kconfig +1
-0@@ -154,6 +154,7 @@ config MLX5_EN_IPSEC depends on MLX5_CORE_EN depends on XFRM_OFFLOAD depends on INET_ESP_OFFLOAD || INET6_ESP_OFFLOAD + depends on IPV6!=m || MLX5_CORE=m
Thanks for the fix.
I received a report for this same error here: https://lore.kernel.org/oe-kbuild-all/[email protected]/
We were about to send a fix ourselves, it is to simply add:
depends on IPV6 || !IPV6
Is there a specific reason to prefer "depends on IPV6!=m || MLX5_CORE=m"? To me, the IPV6 || !IPV6 syntax seems a bit cleaner.
Thanks!
Jianbo
Quoted 3 lines
drivers/net/ethernet/mellanox/mlx5/core/Kconfig +0
-0help Build support for IPsec cryptography-offload acceleration in the NIC.
Quoted 15 lines · Jianbo Liu
drivers/net/ethernet/mellanox/mlx5/core/Kconfig config MLX5_EN_IPSEC · line 157
Quoted 9 lines · Arnd Bergmann
drivers/net/ethernet/mellanox/mlx5/core/Kconfig +1
-0@@ -154,6 +154,7 @@ config MLX5_EN_IPSEC depends on MLX5_CORE_EN depends on XFRM_OFFLOAD depends on INET_ESP_OFFLOAD || INET6_ESP_OFFLOAD + depends on IPV6!=m || MLX5_CORE=mThanks for the fix.
I received a report for this same error here:
https://lore.kernel.org/oe-kbuild-all/[email protected]/
Quoted 4 lines
We were about to send a fix ourselves, it is to simply add:
depends on IPV6 || !IPV6Is there a specific reason to prefer "depends on IPV6!=m || MLX5_CORE=m"? To me, the IPV6 || !IPV6 syntax seems a bit cleaner.
MLX5_EN_IPSEC needs the dependency, but this is a 'bool' symbols.
The "IPV6 || !IPV6" syntax only works on tristate symbols, so you'd have to put it into CONFIG_MLX5_CORE itself, but MLX5_CORE does not actually have the IPV6 dependency unless MLX5_EN_IPSEC is enabled.
Arnd
Jianbo Liu
Acked-byQuoted 21 lines · Arnd Bergmann
Quoted 15 lines · Jianbo Liu
drivers/net/ethernet/mellanox/mlx5/core/Kconfig config MLX5_EN_IPSEC · line 157
Quoted 9 lines · Arnd Bergmann
drivers/net/ethernet/mellanox/mlx5/core/Kconfig +1
-0@@ -154,6 +154,7 @@ config MLX5_EN_IPSEC depends on MLX5_CORE_EN depends on XFRM_OFFLOAD depends on INET_ESP_OFFLOAD || INET6_ESP_OFFLOAD + depends on IPV6!=m || MLX5_CORE=mThanks for the fix.
I received a report for this same error here:
https://lore.kernel.org/oe-kbuild-all/[email protected]/Quoted 4 lines
We were about to send a fix ourselves, it is to simply add:
depends on IPV6 || !IPV6Is there a specific reason to prefer "depends on IPV6!=m || MLX5_CORE=m"? To me, the IPV6 || !IPV6 syntax seems a bit cleaner.
Quoted 7 lines
MLX5_EN_IPSECneeds the dependency, but this is a 'bool' symbols.The "IPV6 || !IPV6" syntax only works on tristate symbols, so you'd have to put it into
CONFIG_MLX5_COREitself, butMLX5_COREdoes not actually have the IPV6 dependency unlessMLX5_EN_IPSECis enabled.
Right, I meant moving the dependency to CONFIG_MLX5_CORE.
Your patch restricts only MLX5_EN_IPSEC, which causes the link error, even if it silently disables IPsec in that specific config.
Quoted 1 line
Arnd