Skip to contentSkip to conversation

selftests/net: fix gro.c compilation failure due to non-existent opt_ipproto_off

PATCH Applied John Hubbard 3 participants 5 messages Jul 12, 2024 – Jul 15, 2024

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/net: fix gro.c compilation failure due to non-existent opt_ipproto_off

Linux 6.6 does not have an opt_ipproto_off variable in gro.c at all (it was added in later kernel versions), so attempting to initialize one breaks the build.

Fixes c80d53c484e8 ("selftests/net: fix uninitialized variables")
---
 tools/testing/selftests/net/gro.c | 3 ---
 1 file changed, 3 deletions(-)
tools/testing/selftests/net/gro.c +0 -3
index b204df4f3332..30024d0ed373 100644
@@ -113,9 +113,6 @@ static void setup_sock_filter(int fd)
 		next_off = offsetof(struct ipv6hdr, nexthdr);
 	ipproto_off = ETH_HLEN + next_off;
 
-	/* Overridden later if exthdrs are used: */
-	opt_ipproto_off = ipproto_off;
-
 	if (strcmp(testname, "ip") == 0) {
 		if (proto == PF_INET)
 			optlen = sizeof(struct ip_timestamp);

base-commit: 2ced7518a03d002284999ed8336ffac462a358ec

Signature · 1 line
2.45.2
#1 lore raw
Quoted 3 lines · John Hubbard

Linux 6.6 does not have an opt_ipproto_off variable in gro.c at all (it was added in later kernel versions), so attempting to initialize one breaks the build.

This is the first time I've tried to fix something in linux-stable, and I'm not sure that I've made it completely clear. This is only for linux-6.6.y in linux-stable.

thanks,

Signature · 2 lines
John Hubbard
NVIDIA
Quoted 26 lines
Fixes c80d53c484e8 ("selftests/net: fix uninitialized variables")
---
  tools/testing/selftests/net/gro.c | 3 ---
  1 file changed, 3 deletions(-)
tools/testing/selftests/net/gro.c +0 -3
index b204df4f3332..30024d0ed373 100644
@@ -113,9 +113,6 @@ static void setup_sock_filter(int fd)
  		next_off = offsetof(struct ipv6hdr, nexthdr);
  	ipproto_off = ETH_HLEN + next_off;
 
-	/* Overridden later if exthdrs are used: */
-	opt_ipproto_off = ipproto_off;
-
  	if (strcmp(testname, "ip") == 0) {
  		if (proto == PF_INET)
  			optlen = sizeof(struct ip_timestamp);

base-commit: 2ced7518a03d002284999ed8336ffac462a358ec

#2 lore raw
Quoted 8 lines · John Hubbard
Quoted 3 lines · John Hubbard

Linux 6.6 does not have an opt_ipproto_off variable in gro.c at all (it was added in later kernel versions), so attempting to initialize one breaks the build.

This is the first time I've tried to fix something in linux-stable, and I'm not sure that I've made it completely clear. This is only for linux-6.6.y in linux-stable.

This worked just fine, now queued up, thanks.

greg k-h

#3 lore raw
In reply to John Hubbard

Hi John,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/9915563597

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/2e3231d9f88c
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=870973

If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

https://github.com/multipath-tcp/mptcp-upstream-virtme-docker

Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

maintainer Applied
#4 lore raw

Patch "[PATCH] selftests/net: fix gro.c compilation failure due to non-existent opt_ipproto_off" has been added to the 6.6-stable tree

In reply to John Hubbard

This is a note to let you know that I've just added the patch titled

[PATCH] selftests/net: fix gro.c compilation failure due to non-existent opt_ipproto_off

to the 6.6-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
selftests-net-fix-gro.c-compilation-failure-due-to-non-existent-opt_ipproto_off.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From [email protected] Mon Jul 15 14:10:26 2024
From: John Hubbard <[email protected]>
Date: Fri, 12 Jul 2024 16:51:50 -0700
Subject: [PATCH] selftests/net: fix gro.c compilation failure due to non-existent opt_ipproto_off
To: Greg Kroah-Hartman <[email protected]>
Cc: "Shuah Khan" <[email protected]>, "David S . Miller" <[email protected]>, "Eric Dumazet" <[email protected]>, "Jakub Kicinski" <[email protected]>, "Paolo Abeni" <[email protected]>, "Steffen Klassert" <[email protected]>, "Herbert Xu" <[email protected]>, "Andreas Färber" <[email protected]>, "Manivannan Sadhasivam" <[email protected]>, "Matthieu Baerts" <[email protected]>, "Mat Martineau" <[email protected]>, "Geliang Tang" <[email protected]>, "Pravin B Shelar" <[email protected]>, "Willem de Bruijn" <[email protected]>, "Alexander Mikhalitsyn" <[email protected]>, zhujun2 <[email protected]>, "Petr Machata" <[email protected]>, "Ido Schimmel" <[email protected]>, "Hangbin Liu" <[email protected]>, "Nikolay Aleksandrov" <[email protected]>, "Benjamin Poirier" <[email protected]>, "Sebastian Andrzej Siewior" <[email protected]>, "Dmitry Safonov" <[email protected]>, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], LKML <[email protected]>, [email protected], "John Hubbard" <[email protected]>, [email protected], "Ignat Korchagin" <[email protected]>
Message-ID: <[email protected]>

From: John Hubbard <[email protected]>

Linux 6.6 does not have an opt_ipproto_off variable in gro.c at all (it was added in later kernel versions), so attempting to initialize one breaks the build.

Fixes c80d53c484e8 ("selftests/net: fix uninitialized variables")
---
 tools/testing/selftests/net/gro.c |    3 ---
 1 file changed, 3 deletions(-)
tools/testing/selftests/net/gro.c +0 -3
@@ -113,9 +113,6 @@ static void setup_sock_filter(int fd)
 		next_off = offsetof(struct ipv6hdr, nexthdr);
 	ipproto_off = ETH_HLEN + next_off;
 
-	/* Overridden later if exthdrs are used: */
-	opt_ipproto_off = ipproto_off;
-
 	if (strcmp(testname, "ip") == 0) {
 		if (proto == PF_INET)
 			optlen = sizeof(struct ip_timestamp);

Patches currently in stable-queue which might be from [email protected] are

queue-6.6/selftests-net-fix-gro.c-compilation-failure-due-to-non-existent-opt_ipproto_off.patch