2023-09-20 19:23:25

by Alexander Lobakin

[permalink] [raw]
Subject: [PATCH net-next 3/3] idpf: fix undefined reference to tcp_gro_complete() when !CONFIG_INET

When CONFIG_INET is not set, tcp_gro_complete is not compiled, although
the drivers using it may still be compiled (spotted by Randy):

aarch64-linux-ld: drivers/net/ethernet/intel/idpf/idpf_txrx.o:
in function `idpf_rx_rsc.isra.0':
drivers/net/ethernet/intel/idpf/idpf_txrx.c:2909:(.text+0x40cc):
undefined reference to `tcp_gro_complete'

The drivers need to guard the calls to it manually.
Return early from the RSC completion function if !CONFIG_INET, it won't
work properly either way. This effectively makes it be compiled-out
almost entirely on such builds.

Fixes: 3a8845af66ed ("idpf: add RX splitq napi poll support")
Reported-by: Randy Dunlap <[email protected]>
Closes: https://lore.kernel.org/linux-next/[email protected]
Signed-off-by: Alexander Lobakin <[email protected]>
---
drivers/net/ethernet/intel/idpf/idpf_txrx.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
index 6fa79898c42c..aa45afeb6496 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
@@ -2876,6 +2876,9 @@ static int idpf_rx_rsc(struct idpf_queue *rxq, struct sk_buff *skb,
if (unlikely(!(ipv4 ^ ipv6)))
return -EINVAL;

+ if (!IS_ENABLED(CONFIG_INET))
+ return 0;
+
rsc_segments = DIV_ROUND_UP(skb->data_len, rsc_seg_len);
if (unlikely(rsc_segments == 1))
return 0;
--
2.41.0


2023-09-21 01:51:09

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH net-next 3/3] idpf: fix undefined reference to tcp_gro_complete() when !CONFIG_INET



On 9/20/23 11:07, Alexander Lobakin wrote:
> When CONFIG_INET is not set, tcp_gro_complete is not compiled, although
> the drivers using it may still be compiled (spotted by Randy):
>
> aarch64-linux-ld: drivers/net/ethernet/intel/idpf/idpf_txrx.o:
> in function `idpf_rx_rsc.isra.0':
> drivers/net/ethernet/intel/idpf/idpf_txrx.c:2909:(.text+0x40cc):
> undefined reference to `tcp_gro_complete'
>
> The drivers need to guard the calls to it manually.
> Return early from the RSC completion function if !CONFIG_INET, it won't
> work properly either way. This effectively makes it be compiled-out
> almost entirely on such builds.
>
> Fixes: 3a8845af66ed ("idpf: add RX splitq napi poll support")
> Reported-by: Randy Dunlap <[email protected]>
> Closes: https://lore.kernel.org/linux-next/[email protected]
> Signed-off-by: Alexander Lobakin <[email protected]>

That builds for me. Thanks.

Tested-by: Randy Dunlap <[email protected]>

I hope that these patches can be merged into the v6.6 instead of
v6.7 kernel at some point (i.e., [PATCH net] instead of net-next).


> ---
> drivers/net/ethernet/intel/idpf/idpf_txrx.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
> index 6fa79898c42c..aa45afeb6496 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
> +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
> @@ -2876,6 +2876,9 @@ static int idpf_rx_rsc(struct idpf_queue *rxq, struct sk_buff *skb,
> if (unlikely(!(ipv4 ^ ipv6)))
> return -EINVAL;
>
> + if (!IS_ENABLED(CONFIG_INET))
> + return 0;
> +
> rsc_segments = DIV_ROUND_UP(skb->data_len, rsc_seg_len);
> if (unlikely(rsc_segments == 1))
> return 0;

--
~Randy

2023-09-21 08:28:35

by Jacob Keller

[permalink] [raw]
Subject: Re: [Intel-wired-lan] [PATCH net-next 3/3] idpf: fix undefined reference to tcp_gro_complete() when !CONFIG_INET



On 9/20/2023 2:30 PM, Randy Dunlap wrote:
>
>
> On 9/20/23 11:07, Alexander Lobakin wrote:
>> When CONFIG_INET is not set, tcp_gro_complete is not compiled, although
>> the drivers using it may still be compiled (spotted by Randy):
>>
>> aarch64-linux-ld: drivers/net/ethernet/intel/idpf/idpf_txrx.o:
>> in function `idpf_rx_rsc.isra.0':
>> drivers/net/ethernet/intel/idpf/idpf_txrx.c:2909:(.text+0x40cc):
>> undefined reference to `tcp_gro_complete'
>>
>> The drivers need to guard the calls to it manually.
>> Return early from the RSC completion function if !CONFIG_INET, it won't
>> work properly either way. This effectively makes it be compiled-out
>> almost entirely on such builds.
>>
>> Fixes: 3a8845af66ed ("idpf: add RX splitq napi poll support")
>> Reported-by: Randy Dunlap <[email protected]>
>> Closes: https://lore.kernel.org/linux-next/[email protected]
>> Signed-off-by: Alexander Lobakin <[email protected]>
>
> That builds for me. Thanks.
>
> Tested-by: Randy Dunlap <[email protected]>
>
> I hope that these patches can be merged into the v6.6 instead of
> v6.7 kernel at some point (i.e., [PATCH net] instead of net-next).
>

Did any of the offending code make it into 6.6? I thought all of this
was from recent merges after 6.6 closed.

Thanks,
Jake

>
>> ---
>> drivers/net/ethernet/intel/idpf/idpf_txrx.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
>> index 6fa79898c42c..aa45afeb6496 100644
>> --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
>> +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
>> @@ -2876,6 +2876,9 @@ static int idpf_rx_rsc(struct idpf_queue *rxq, struct sk_buff *skb,
>> if (unlikely(!(ipv4 ^ ipv6)))
>> return -EINVAL;
>>
>> + if (!IS_ENABLED(CONFIG_INET))
>> + return 0;
>> +
>> rsc_segments = DIV_ROUND_UP(skb->data_len, rsc_seg_len);
>> if (unlikely(rsc_segments == 1))
>> return 0;
>