2023-06-19 09:33:16

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 1/3] [v2] sfc: add CONFIG_INET dependency for TC offload

From: Arnd Bergmann <[email protected]>

The driver now fails to link when CONFIG_INET is disabled, so
add an explicit Kconfig dependency:

ld.lld: error: undefined symbol: ip_route_output_flow
>>> referenced by tc_encap_actions.c
>>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_flower_create_encap_md) in archive vmlinux.a

ld.lld: error: undefined symbol: ip_send_check
>>> referenced by tc_encap_actions.c
>>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_gen_encap_header) in archive vmlinux.a
>>> referenced by tc_encap_actions.c
>>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_gen_encap_header) in archive vmlinux.a

ld.lld: error: undefined symbol: arp_tbl
>>> referenced by tc_encap_actions.c
>>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_netevent_event) in archive vmlinux.a
>>> referenced by tc_encap_actions.c
>>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_netevent_event) in archive vmlinux.a

Fixes: a1e82162af0b8 ("sfc: generate encap headers for TC offload")
Reviewed-by: Edward Cree <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Arnd Bergmann <[email protected]>
---
v2: add Fixes and Closes tags
---
drivers/net/ethernet/sfc/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/sfc/Kconfig b/drivers/net/ethernet/sfc/Kconfig
index 4af36ba8906ba..3eb55dcfa8a61 100644
--- a/drivers/net/ethernet/sfc/Kconfig
+++ b/drivers/net/ethernet/sfc/Kconfig
@@ -50,6 +50,7 @@ config SFC_MCDI_MON
config SFC_SRIOV
bool "Solarflare SFC9100-family SR-IOV support"
depends on SFC && PCI_IOV
+ depends on INET
default y
help
This enables support for the Single Root I/O Virtualization
--
2.39.2



2023-06-19 09:35:17

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 2/3] [v2] sfc: fix uninitialized variable use

From: Arnd Bergmann <[email protected]>

The new efx_bind_neigh() function contains a broken code path when IPV6 is
disabled:

drivers/net/ethernet/sfc/tc_encap_actions.c:144:7: error: variable 'n' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (encap->type & EFX_ENCAP_FLAG_IPV6) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/sfc/tc_encap_actions.c:184:8: note: uninitialized use occurs here
if (!n) {
^
drivers/net/ethernet/sfc/tc_encap_actions.c:144:3: note: remove the 'if' if its condition is always false
if (encap->type & EFX_ENCAP_FLAG_IPV6) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/sfc/tc_encap_actions.c:141:22: note: initialize the variable 'n' to silence this warning
struct neighbour *n;
^
= NULL

Change it to use the existing error handling path here.

Fixes: 7e5e7d800011a ("sfc: neighbour lookup for TC encap action offload")
Suggested-by: Edward Cree <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
---
v2: use 'goto' instead of incorrectly entering another error path
---
drivers/net/ethernet/sfc/tc_encap_actions.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/sfc/tc_encap_actions.c b/drivers/net/ethernet/sfc/tc_encap_actions.c
index aac259528e73e..7e8bcdb222ad1 100644
--- a/drivers/net/ethernet/sfc/tc_encap_actions.c
+++ b/drivers/net/ethernet/sfc/tc_encap_actions.c
@@ -164,6 +164,7 @@ static int efx_bind_neigh(struct efx_nic *efx,
*/
rc = -EOPNOTSUPP;
NL_SET_ERR_MSG_MOD(extack, "No IPv6 support (neigh bind)");
+ goto out_free;
#endif
} else {
rt = ip_route_output_key(net, &flow4);
--
2.39.2


2023-06-19 10:18:45

by Edward Cree

[permalink] [raw]
Subject: Re: [PATCH 2/3] [v2] sfc: fix uninitialized variable use

On 19/06/2023 10:12, Arnd Bergmann wrote:
> From: Arnd Bergmann <[email protected]>
>
> The new efx_bind_neigh() function contains a broken code path when IPV6 is
> disabled:
>
> drivers/net/ethernet/sfc/tc_encap_actions.c:144:7: error: variable 'n' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
> if (encap->type & EFX_ENCAP_FLAG_IPV6) {
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/sfc/tc_encap_actions.c:184:8: note: uninitialized use occurs here
> if (!n) {
> ^
> drivers/net/ethernet/sfc/tc_encap_actions.c:144:3: note: remove the 'if' if its condition is always false
> if (encap->type & EFX_ENCAP_FLAG_IPV6) {
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/sfc/tc_encap_actions.c:141:22: note: initialize the variable 'n' to silence this warning
> struct neighbour *n;
> ^
> = NULL
>
> Change it to use the existing error handling path here.
>
> Fixes: 7e5e7d800011a ("sfc: neighbour lookup for TC encap action offload")
> Suggested-by: Edward Cree <[email protected]>
> Signed-off-by: Arnd Bergmann <[email protected]>

Reviewed-by: Edward Cree <[email protected]>

> ---
> v2: use 'goto' instead of incorrectly entering another error path
> ---
> drivers/net/ethernet/sfc/tc_encap_actions.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/sfc/tc_encap_actions.c b/drivers/net/ethernet/sfc/tc_encap_actions.c
> index aac259528e73e..7e8bcdb222ad1 100644
> --- a/drivers/net/ethernet/sfc/tc_encap_actions.c
> +++ b/drivers/net/ethernet/sfc/tc_encap_actions.c
> @@ -164,6 +164,7 @@ static int efx_bind_neigh(struct efx_nic *efx,
> */
> rc = -EOPNOTSUPP;
> NL_SET_ERR_MSG_MOD(extack, "No IPv6 support (neigh bind)");
> + goto out_free;
> #endif
> } else {
> rt = ip_route_output_key(net, &flow4);
>


2023-06-19 10:33:37

by Edward Cree

[permalink] [raw]
Subject: Re: [PATCH 1/3] [v2] sfc: add CONFIG_INET dependency for TC offload

On 19/06/2023 10:12, Arnd Bergmann wrote:
> From: Arnd Bergmann <[email protected]>
>
> The driver now fails to link when CONFIG_INET is disabled, so
> add an explicit Kconfig dependency:
>
> ld.lld: error: undefined symbol: ip_route_output_flow
>>>> referenced by tc_encap_actions.c
>>>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_flower_create_encap_md) in archive vmlinux.a
>
> ld.lld: error: undefined symbol: ip_send_check
>>>> referenced by tc_encap_actions.c
>>>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_gen_encap_header) in archive vmlinux.a
>>>> referenced by tc_encap_actions.c
>>>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_gen_encap_header) in archive vmlinux.a
>
> ld.lld: error: undefined symbol: arp_tbl
>>>> referenced by tc_encap_actions.c
>>>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_netevent_event) in archive vmlinux.a
>>>> referenced by tc_encap_actions.c
>>>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_netevent_event) in archive vmlinux.a
>
> Fixes: a1e82162af0b8 ("sfc: generate encap headers for TC offload")
> Reviewed-by: Edward Cree <[email protected]>
> Reviewed-by: Simon Horman <[email protected]>
> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> Signed-off-by: Arnd Bergmann <[email protected]>

Additionally
Fixes: 7e5e7d800011 ("sfc: neighbour lookup for TC encap action offload")

The subject line doesn't specify a target tree; this should be for net-next.

> ---
> v2: add Fixes and Closes tags
> ---
> drivers/net/ethernet/sfc/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/sfc/Kconfig b/drivers/net/ethernet/sfc/Kconfig
> index 4af36ba8906ba..3eb55dcfa8a61 100644
> --- a/drivers/net/ethernet/sfc/Kconfig
> +++ b/drivers/net/ethernet/sfc/Kconfig
> @@ -50,6 +50,7 @@ config SFC_MCDI_MON
> config SFC_SRIOV
> bool "Solarflare SFC9100-family SR-IOV support"
> depends on SFC && PCI_IOV
> + depends on INET
> default y
> help
> This enables support for the Single Root I/O Virtualization
>


2023-06-21 04:02:03

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH 1/3] [v2] sfc: add CONFIG_INET dependency for TC offload

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <[email protected]>:

On Mon, 19 Jun 2023 11:12:09 +0200 you wrote:
> From: Arnd Bergmann <[email protected]>
>
> The driver now fails to link when CONFIG_INET is disabled, so
> add an explicit Kconfig dependency:
>
> ld.lld: error: undefined symbol: ip_route_output_flow
> >>> referenced by tc_encap_actions.c
> >>> drivers/net/ethernet/sfc/tc_encap_actions.o:(efx_tc_flower_create_encap_md) in archive vmlinux.a
>
> [...]

Here is the summary with links:
- [1/3,v2] sfc: add CONFIG_INET dependency for TC offload
https://git.kernel.org/netdev/net-next/c/40cba83370c2
- [2/3,v2] sfc: fix uninitialized variable use
https://git.kernel.org/netdev/net-next/c/f61d2d5cf142
- [3/3] sfc: selftest: fix struct packing
(no matching commit)

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html