* Re: [PATCH 5/6] net: Change CONFIG_INET to CONFIG_LEGACY_IP for IPv4-only code
From: bot+bpf-ci @ 2026-04-01 9:01 UTC (permalink / raw)
To: dwmw2, saeedm, leon, tariqt, mbloch, andrew+netdev, davem,
edumazet, kuba, pabeni, horms, razor, idosch, martin.lau, daniel,
john.fastabend, sdf, ast, andrii, eddyz87, song, yonghong.song,
kpsingh, haoluo, jolsa, kuniyu, willemb, dsahern, ncardwell,
johannes, pablo, fw, phil, gnault, dwmw, kees, alazar, gal, paul,
netdev, linux-rdma, linux-kernel, oss-drivers, bridge, bpf,
linux-wireless, netfilter-devel, coreteam, torvalds,
jon.maddog.hall
Cc: ast, andrii, daniel, martin.lau, eddyz87, yonghong.song, clm,
ihor.solodrai
In-Reply-To: <20260401074509.1897527-6-dwmw2@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]
> diff --git a/net/core/filter.c b/net/core/filter.c
> index ad71ceefcb5e..ef99bd9fddd6 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
[ ... ]
> @@ -6095,7 +6095,7 @@ static int bpf_fib_set_fwd_params(struct bpf_fib_lookup *params, u32 mtu)
> }
> #endif
>
> -#if IS_ENABLED(CONFIG_INET)
> +#if IS_ENABLED(CONFIG_LEGACY_IP)
> static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params,
> u32 flags, bool check_mtu)
bpf_fib_set_fwd_params() above this hunk is still guarded by
CONFIG_INET, and its only two callers are bpf_ipv4_fib_lookup()
(now CONFIG_LEGACY_IP) and bpf_ipv6_fib_lookup() (CONFIG_IPV6).
When CONFIG_INET=y with both CONFIG_LEGACY_IP=n and CONFIG_IPV6=n,
bpf_fib_set_fwd_params() becomes an unused static function, which
will produce a -Wunused-function warning and break CONFIG_WERROR
builds.
Should the guard on bpf_fib_set_fwd_params() be changed to
something like:
#if IS_ENABLED(CONFIG_LEGACY_IP) || IS_ENABLED(CONFIG_IPV6)
to match its actual callers?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/23838411859
^ permalink raw reply
* Re: [PATCH 2/6] net: Add CONFIG_LEGACY_IP option
From: bot+bpf-ci @ 2026-04-01 9:01 UTC (permalink / raw)
To: dwmw2, saeedm, leon, tariqt, mbloch, andrew+netdev, davem,
edumazet, kuba, pabeni, horms, razor, idosch, martin.lau, daniel,
john.fastabend, sdf, ast, andrii, eddyz87, song, yonghong.song,
kpsingh, haoluo, jolsa, kuniyu, willemb, dsahern, ncardwell,
johannes, pablo, fw, phil, gnault, dwmw, kees, alazar, gal, paul,
netdev, linux-rdma, linux-kernel, oss-drivers, bridge, bpf,
linux-wireless, netfilter-devel, coreteam, torvalds,
jon.maddog.hall
Cc: ast, andrii, daniel, martin.lau, eddyz87, yonghong.song, clm,
ihor.solodrai
In-Reply-To: <20260401074509.1897527-3-dwmw2@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 1848 bytes --]
> This is the first step toward making Legacy IP optional. The option
> defaults to y and currently has no effect — subsequent patches will use
> it to guard IPv4 entry points.
The commit message says "The option defaults to y", but the Kconfig
entry has no "default y" line. A bool without an explicit default
is n in Kconfig, so LEGACY_IP will be disabled on any fresh config
built with make defconfig or make olddefconfig.
Later patches in this series (be2f051150f9, f04a0717c27d) add
"depends on LEGACY_IP" to all IPv4-specific Kconfig symbols and guard
IPv4 entry points in C code. With LEGACY_IP defaulting to n, those
patches will silently disable IPv4 networking for any newly generated
kernel configuration.
Should the Kconfig entry include "default y" to match the stated
intent?
> diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
> index df922f9f5289..aef2c5349e62 100644
> --- a/net/ipv4/Kconfig
> +++ b/net/ipv4/Kconfig
> @@ -2,6 +2,17 @@
> #
> # IP configuration
> #
> +config LEGACY_IP
> + bool "The IPv4 protocol (Legacy IP)"
> + help
> + Support for IP version 4 (IPv4).
> +
> + Legacy IP is the protocol used by the early ARPANET, before IPv6
> + was standardised in the final decade of the 1900s. It should only
> + be necessary these days to interoperate with legacy networks.
> +
> + If unsure, say N.
The help text says "If unsure, say N." Combined with the missing
default, this guides users to disable IPv4. If the intent is a
backward-compatible introduction where IPv4 stays enabled unless
explicitly turned off, this should probably be "If unsure, say Y."
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/23838411859
^ permalink raw reply
* Re: [PATCH 4/6] net: Make IPv4-only Kconfig options depend on LEGACY_IP
From: bot+bpf-ci @ 2026-04-01 8:36 UTC (permalink / raw)
To: dwmw2, saeedm, leon, tariqt, mbloch, andrew+netdev, davem,
edumazet, kuba, pabeni, horms, razor, idosch, martin.lau, daniel,
john.fastabend, sdf, ast, andrii, eddyz87, song, yonghong.song,
kpsingh, haoluo, jolsa, kuniyu, willemb, dsahern, ncardwell,
johannes, pablo, fw, phil, gnault, dwmw, kees, alazar, gal, paul,
netdev, linux-rdma, linux-kernel, oss-drivers, bridge, bpf,
linux-wireless, netfilter-devel, coreteam, torvalds,
jon.maddog.hall
Cc: ast, andrii, daniel, martin.lau, eddyz87, yonghong.song, clm,
ihor.solodrai
In-Reply-To: <20260401074509.1897527-5-dwmw2@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 2543 bytes --]
> diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
> index aef2c5349e62..03b5ba75c3cf 100644
> --- a/net/ipv4/Kconfig
> +++ b/net/ipv4/Kconfig
[ ... ]
> @@ -113,9 +119,11 @@ config IP_ROUTE_VERBOSE
>
> config IP_ROUTE_CLASSID
> bool
> + depends on LEGACY_IP
IP_ROUTE_CLASSID is selected by NETFILTER_XT_MATCH_REALM in
net/netfilter/Kconfig and by NET_CLS_ROUTE4 in net/sched/Kconfig,
neither of which depends on LEGACY_IP.
Would this produce unmet direct dependency warnings when either of
those options is enabled with LEGACY_IP=n?
> @@ -190,6 +199,7 @@ config NET_IPIP
>
> config NET_IPGRE_DEMUX
> tristate "IP: GRE demultiplexer"
> + depends on LEGACY_IP
> help
> This is helper module to demultiplex GRE packets on GRE version field criteria.
> Required by ip_gre and pptp modules.
IPV6_GRE in net/ipv6/Kconfig has 'depends on NET_IPGRE_DEMUX'.
ip6_gre.c uses gre_parse_header() from the GRE demux module.
Gating NET_IPGRE_DEMUX on LEGACY_IP silently makes IPv6 GRE tunneling
unavailable on IPv6-only systems. Should this option be left ungated,
similar to NET_IP_TUNNEL?
[ ... ]
> @@ -226,10 +238,12 @@ config NET_IPGRE_BROADCAST
>
> config IP_MROUTE_COMMON
> bool
> + depends on LEGACY_IP
> depends on IP_MROUTE || IPV6_MROUTE
IP_MROUTE_COMMON is shared infrastructure between IPv4 and IPv6
multicast routing. ipmr_base.c describes itself as "Common logic
shared by IPv4 [ipmr] and IPv6 [ip6mr] implementation".
IPV6_MROUTE in net/ipv6/Kconfig does 'select IP_MROUTE_COMMON'
without depending on LEGACY_IP. When LEGACY_IP=n and IPV6_MROUTE=y,
this will produce an unmet dependency warning.
Should IP_MROUTE_COMMON be left ungated, like NET_IP_TUNNEL and the
other shared options listed in the commit message?
[ ... ]
> @@ -425,11 +449,13 @@ config INET_TABLE_PERTURB_ORDER
>
> config INET_XFRM_TUNNEL
> tristate
> + depends on LEGACY_IP
> select INET_TUNNEL
> default n
>
> config INET_TUNNEL
> tristate
> + depends on LEGACY_IP
> default n
IPV6_SIT in net/ipv6/Kconfig does 'select INET_TUNNEL' without
depending on LEGACY_IP. When LEGACY_IP=n and IPV6_SIT is enabled,
this will produce an unmet dependency warning for INET_TUNNEL.
SIT is inherently IPv4-dependent (IPv6-in-IPv4 tunneling), so perhaps
IPV6_SIT also needs 'depends on LEGACY_IP'?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/23838411859
^ permalink raw reply
* Re: [PATCH 0/6] Deprecate Legacy IP
From: David Woodhouse @ 2026-04-01 8:25 UTC (permalink / raw)
To: Fernando Fernandez Mancera, Saeed Mahameed, Leon Romanovsky,
Tariq Toukan, Mark Bloch, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Nikolay Aleksandrov, Ido Schimmel, Martin KaFai Lau,
Daniel Borkmann, John Fastabend, Stanislav Fomichev,
Alexei Starovoitov, Andrii Nakryiko, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Hao Luo, Jiri Olsa, Kuniyuki Iwashima,
Willem de Bruijn, David Ahern, Neal Cardwell, Johannes Berg,
Pablo Neira Ayuso, Florian Westphal, Phil Sutter, Guillaume Nault,
Kees Cook, Alexei Lazar, Gal Pressman, Paul Moore, netdev,
linux-rdma, linux-kernel, oss-drivers, bridge, bpf,
linux-wireless, netfilter-devel, coreteam, torvalds,
jon.maddog.hall
In-Reply-To: <42caa438-3854-449c-b0ee-4f40772e5c1b@suse.de>
[-- Attachment #1: Type: text/plain, Size: 745 bytes --]
On Wed, 2026-04-01 at 10:07 +0200, Fernando Fernandez Mancera wrote:
>
>
> Dammit, you've beaten me to it! This was my next step for 7.2.
>
> Fully-endorsed-by: Fernando Fernandez Mancera <fmancera@suse.de>
Yeah. The date notwithstanding, I do actually think we should do most
of this for real.
Maybe we don't get away with the actual deprecation and the warnings on
use *just* yet, and *maybe* we won't even get away with calling the
config option CONFIG_LEGACY_IP, although I would genuinely like to see
us moving consistently towards saying "Legacy IP" instead of "IPv4"
everywhere.
But we *should* clean up the separation of CONFIG_INET and
CONFIG_IPV[64] and make it possible to build with either protocol
alone.
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 0/6] Deprecate Legacy IP
From: Fernando Fernandez Mancera @ 2026-04-01 8:07 UTC (permalink / raw)
To: David Woodhouse, Saeed Mahameed, Leon Romanovsky, Tariq Toukan,
Mark Bloch, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Nikolay Aleksandrov,
Ido Schimmel, Martin KaFai Lau, Daniel Borkmann, John Fastabend,
Stanislav Fomichev, Alexei Starovoitov, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh, Hao Luo,
Jiri Olsa, Kuniyuki Iwashima, Willem de Bruijn, David Ahern,
Neal Cardwell, Johannes Berg, Pablo Neira Ayuso, Florian Westphal,
Phil Sutter, Guillaume Nault, David Woodhouse, Kees Cook,
Alexei Lazar, Gal Pressman, Paul Moore, netdev, linux-rdma,
linux-kernel, oss-drivers, bridge, bpf, linux-wireless,
netfilter-devel, coreteam, torvalds, jon.maddog.hall
In-Reply-To: <20260401074509.1897527-1-dwmw2@infradead.org>
On 4/1/26 9:44 AM, David Woodhouse wrote:
> RFC1883, the IPv6 standard, was published in the final decade of the 1900s.
> That's closer in time to the Apollo 11 moon landing than it was to today.
>
> Even our esteemed Maddog has worked with computers for longer in the IPv6
> era, than he ever did before it.
>
> Yet Linux still can't even be *built* with only IPv6 support and without
> support for Legacy IP. This long overdue patch series fixes that, and
> immediately marks Legacy IP for deprecation.
>
> It also cleans up a few tautological "INET && IPV6" and "INET || IPV6"
> checks, since IPV6 (and now LEGACY_IP) cannot be selected without the
> overall CONFIG_INET option.
>
> For now, we only add a warning when a process *listens* on a Legacy IP
> socket (since you can listen on IPv6 and still accept connections which
> have come through a timewarp from the 20th century. Adding warnings for
> making outbound connections or *accepting* on Legacy IP can come later.
>
> 'I would be happy if "Legacy IP" ceased to be the "industry standard"
> and IPv6 be the default, even if I had to beat IPv6 into the head of
> every single network administrator's head with a shovel.' said Jon
> 'maddog' Hall, ancient supporter of Free and Open Source Software.
>
Dammit, you've beaten me to it! This was my next step for 7.2.
Fully-endorsed-by: Fernando Fernandez Mancera <fmancera@suse.de>
^ permalink raw reply
* [PATCH 3/6] net: Guard Legacy IP entry points with CONFIG_LEGACY_IP
From: David Woodhouse @ 2026-04-01 7:44 UTC (permalink / raw)
To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Nikolay Aleksandrov, Ido Schimmel,
Martin KaFai Lau, Daniel Borkmann, John Fastabend,
Stanislav Fomichev, Alexei Starovoitov, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh, Hao Luo,
Jiri Olsa, Kuniyuki Iwashima, Willem de Bruijn, David Ahern,
Neal Cardwell, Johannes Berg, Pablo Neira Ayuso, Florian Westphal,
Phil Sutter, Guillaume Nault, David Woodhouse, Kees Cook,
Alexei Lazar, Gal Pressman, Paul Moore, netdev, linux-rdma,
linux-kernel, oss-drivers, bridge, bpf, linux-wireless,
netfilter-devel, coreteam, torvalds, jon.maddog.hall
In-Reply-To: <20260401074509.1897527-1-dwmw2@infradead.org>
From: David Woodhouse <dwmw@amazon.co.uk>
Wrap the IPv4-specific registrations in inet_init() with
CONFIG_LEGACY_IP guards. When LEGACY_IP is disabled, the kernel
will not:
- Register the AF_INET socket family
- Register the ETH_P_IP packet handler (ip_rcv)
- Initialize ARP, ICMP, IGMP, or IPv4 routing
- Register IPv4 protocol handlers (TCP/UDP/ICMP over IPv4)
- Initialize IPv4 multicast routing, proc entries, or fragmentation
The shared INET infrastructure (tcp_prot, udp_prot, tcp_init, etc.)
remains initialized for use by IPv6.
Also update INDIRECT_CALL_INET to not use ip_rcv/ip_list_rcv as
direct call targets when LEGACY_IP is disabled, avoiding a link-time
reference to functions that will eventually be compiled out.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
include/linux/indirect_call_wrapper.h | 4 +++-
net/ipv4/af_inet.c | 20 +++++++++++++-----
net/ipv4/devinet.c | 2 ++
net/ipv4/route.c | 1 -
net/ipv4/tcp_ipv4.c | 30 ++++++++++++++-------------
5 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/include/linux/indirect_call_wrapper.h b/include/linux/indirect_call_wrapper.h
index dc272b514a01..25a3873da462 100644
--- a/include/linux/indirect_call_wrapper.h
+++ b/include/linux/indirect_call_wrapper.h
@@ -57,9 +57,11 @@
* builtin, this macro simplify dealing with indirect calls with only ipv4/ipv6
* alternatives
*/
-#if IS_BUILTIN(CONFIG_IPV6)
+#if IS_BUILTIN(CONFIG_IPV6) && IS_ENABLED(CONFIG_LEGACY_IP)
#define INDIRECT_CALL_INET(f, f2, f1, ...) \
INDIRECT_CALL_2(f, f2, f1, __VA_ARGS__)
+#elif IS_BUILTIN(CONFIG_IPV6)
+#define INDIRECT_CALL_INET(f, f2, f1, ...) INDIRECT_CALL_1(f, f2, __VA_ARGS__)
#elif IS_ENABLED(CONFIG_INET)
#define INDIRECT_CALL_INET(f, f2, f1, ...) INDIRECT_CALL_1(f, f1, __VA_ARGS__)
#else
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index c7731e300a44..dc358faa1647 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1922,7 +1922,15 @@ static int __init inet_init(void)
/*
* Tell SOCKET that we are alive...
*/
+ /* Initialize the socket-side protocol switch tables. */
+ for (r = &inetsw[0]; r < &inetsw[SOCK_MAX]; ++r)
+ INIT_LIST_HEAD(r);
+
+#ifdef CONFIG_XFRM
+ xfrm_init();
+#endif
+#ifdef CONFIG_LEGACY_IP
(void)sock_register(&inet_family_ops);
#ifdef CONFIG_SYSCTL
@@ -1957,10 +1965,6 @@ static int __init inet_init(void)
pr_crit("%s: Cannot add IGMP protocol\n", __func__);
#endif
- /* Register the socket-side information for inet_create. */
- for (r = &inetsw[0]; r < &inetsw[SOCK_MAX]; ++r)
- INIT_LIST_HEAD(r);
-
for (q = inetsw_array; q < &inetsw_array[INETSW_ARRAY_LEN]; ++q)
inet_register_protosw(q);
@@ -1975,6 +1979,7 @@ static int __init inet_init(void)
*/
ip_init();
+#endif /* CONFIG_LEGACY_IP */
/* Initialise per-cpu ipv4 mibs */
if (init_ipv4_mibs())
@@ -1987,7 +1992,8 @@ static int __init inet_init(void)
udp_init();
/* Add UDP-Lite (RFC 3828) */
- udplite4_register();
+ if (IS_ENABLED(CONFIG_LEGACY_IP))
+ udplite4_register();
raw_init();
@@ -1997,6 +2003,7 @@ static int __init inet_init(void)
* Set the ICMP layer up
*/
+#ifdef CONFIG_LEGACY_IP
if (icmp_init() < 0)
panic("Failed to create the ICMP control socket.\n");
@@ -2007,10 +2014,12 @@ static int __init inet_init(void)
if (ip_mr_init())
pr_crit("%s: Cannot init ipv4 mroute\n", __func__);
#endif
+#endif /* CONFIG_LEGACY_IP */
if (init_inet_pernet_ops())
pr_crit("%s: Cannot init ipv4 inet pernet ops\n", __func__);
+#ifdef CONFIG_LEGACY_IP
ipv4_proc_init();
ipfrag_init();
@@ -2018,6 +2027,7 @@ static int __init inet_init(void)
dev_add_pack(&ip_packet_type);
ip_tunnel_core_init();
+#endif /* CONFIG_LEGACY_IP */
rc = 0;
out:
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 537bb6c315d2..9b9db10e5db2 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -348,7 +348,9 @@ static int __init inet_blackhole_dev_init(void)
return PTR_ERR_OR_ZERO(in_dev);
}
+#ifdef CONFIG_LEGACY_IP
late_initcall(inet_blackhole_dev_init);
+#endif
int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b)
{
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 463236e0dc2d..125614f552c7 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -3773,7 +3773,6 @@ int __init ip_rt_init(void)
if (ip_rt_proc_init())
pr_err("Unable to create route proc files\n");
#ifdef CONFIG_XFRM
- xfrm_init();
xfrm4_init();
#endif
rtnl_register_many(ip_rt_rtnl_msg_handlers);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index c7b2463c2e25..7660bd45aac7 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -3717,25 +3717,27 @@ static void __init bpf_iter_register(void)
void __init tcp_v4_init(void)
{
- int cpu, res;
+ if (IS_ENABLED(CONFIG_LEGACY_IP)) {
+ int cpu, res;
- for_each_possible_cpu(cpu) {
- struct sock *sk;
+ for_each_possible_cpu(cpu) {
+ struct sock *sk;
- res = inet_ctl_sock_create(&sk, PF_INET, SOCK_RAW,
- IPPROTO_TCP, &init_net);
- if (res)
- panic("Failed to create the TCP control socket.\n");
- sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
+ res = inet_ctl_sock_create(&sk, PF_INET, SOCK_RAW,
+ IPPROTO_TCP, &init_net);
+ if (res)
+ panic("Failed to create the TCP control socket.\n");
+ sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
- /* Please enforce IP_DF and IPID==0 for RST and
- * ACK sent in SYN-RECV and TIME-WAIT state.
- */
- inet_sk(sk)->pmtudisc = IP_PMTUDISC_DO;
+ /* Please enforce IP_DF and IPID==0 for RST and
+ * ACK sent in SYN-RECV and TIME-WAIT state.
+ */
+ inet_sk(sk)->pmtudisc = IP_PMTUDISC_DO;
- sk->sk_clockid = CLOCK_MONOTONIC;
+ sk->sk_clockid = CLOCK_MONOTONIC;
- per_cpu(ipv4_tcp_sk.sock, cpu) = sk;
+ per_cpu(ipv4_tcp_sk.sock, cpu) = sk;
+ }
}
if (register_pernet_subsys(&tcp_sk_ops))
panic("Failed to create the TCP control socket.\n");
--
2.51.0
^ permalink raw reply related
* [PATCH 5/6] net: Change CONFIG_INET to CONFIG_LEGACY_IP for IPv4-only code
From: David Woodhouse @ 2026-04-01 7:44 UTC (permalink / raw)
To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Nikolay Aleksandrov, Ido Schimmel,
Martin KaFai Lau, Daniel Borkmann, John Fastabend,
Stanislav Fomichev, Alexei Starovoitov, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh, Hao Luo,
Jiri Olsa, Kuniyuki Iwashima, Willem de Bruijn, David Ahern,
Neal Cardwell, Johannes Berg, Pablo Neira Ayuso, Florian Westphal,
Phil Sutter, Guillaume Nault, David Woodhouse, Kees Cook,
Alexei Lazar, Gal Pressman, Paul Moore, netdev, linux-rdma,
linux-kernel, oss-drivers, bridge, bpf, linux-wireless,
netfilter-devel, coreteam, torvalds, jon.maddog.hall
In-Reply-To: <20260401074509.1897527-1-dwmw2@infradead.org>
From: David Woodhouse <dwmw@amazon.co.uk>
Several functions guarded by CONFIG_INET are actually IPv4-specific
and should be gated by CONFIG_LEGACY_IP instead:
- bpf_out_neigh_v4(): BPF IPv4 neighbour output helper
- bpf_ipv4_fib_lookup(): BPF IPv4 FIB lookup
- case AF_INET in bpf_xdp_fib_lookup/bpf_skb_fib_lookup switch
- br_arp_send(): bridge ARP proxy (ARP is IPv4-only)
This allows the compiler to eliminate these functions when
LEGACY_IP=n.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
net/bridge/br_arp_nd_proxy.c | 2 +-
net/bridge/br_private.h | 8 ++++++++
net/core/filter.c | 10 +++++-----
net/core/sock.c | 2 +-
net/mac80211/main.c | 10 +++++-----
net/netfilter/nfnetlink_queue.c | 2 +-
6 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/net/bridge/br_arp_nd_proxy.c b/net/bridge/br_arp_nd_proxy.c
index 1e2b51769eec..e056fa0cd1fe 100644
--- a/net/bridge/br_arp_nd_proxy.c
+++ b/net/bridge/br_arp_nd_proxy.c
@@ -39,7 +39,7 @@ void br_recalculate_neigh_suppress_enabled(struct net_bridge *br)
br_opt_toggle(br, BROPT_NEIGH_SUPPRESS_ENABLED, neigh_suppress);
}
-#if IS_ENABLED(CONFIG_INET)
+#if IS_ENABLED(CONFIG_LEGACY_IP)
static void br_arp_send(struct net_bridge *br, struct net_bridge_port *p,
struct net_device *dev, __be32 dest_ip, __be32 src_ip,
const unsigned char *dest_hw,
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 9b55d38ea9ed..28131fa0a7c5 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -2347,8 +2347,16 @@ static inline void br_switchdev_init(struct net_bridge *br)
/* br_arp_nd_proxy.c */
void br_recalculate_neigh_suppress_enabled(struct net_bridge *br);
+#if IS_ENABLED(CONFIG_LEGACY_IP)
void br_do_proxy_suppress_arp(struct sk_buff *skb, struct net_bridge *br,
u16 vid, struct net_bridge_port *p);
+#else
+static inline void br_do_proxy_suppress_arp(struct sk_buff *skb,
+ struct net_bridge *br,
+ u16 vid, struct net_bridge_port *p)
+{
+}
+#endif
void br_do_suppress_nd(struct sk_buff *skb, struct net_bridge *br,
u16 vid, struct net_bridge_port *p, struct nd_msg *msg);
struct nd_msg *br_is_nd_neigh_msg(const struct sk_buff *skb, struct nd_msg *m);
diff --git a/net/core/filter.c b/net/core/filter.c
index ad71ceefcb5e..ef99bd9fddd6 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2310,7 +2310,7 @@ static int __bpf_redirect_neigh_v6(struct sk_buff *skb, struct net_device *dev,
}
#endif /* CONFIG_IPV6 */
-#if IS_ENABLED(CONFIG_INET)
+#if IS_ENABLED(CONFIG_LEGACY_IP)
static int bpf_out_neigh_v4(struct net *net, struct sk_buff *skb,
struct net_device *dev, struct bpf_nh_params *nh)
{
@@ -2419,7 +2419,7 @@ static int __bpf_redirect_neigh_v4(struct sk_buff *skb, struct net_device *dev,
kfree_skb(skb);
return NET_XMIT_DROP;
}
-#endif /* CONFIG_INET */
+#endif /* CONFIG_LEGACY_IP */
static int __bpf_redirect_neigh(struct sk_buff *skb, struct net_device *dev,
struct bpf_nh_params *nh)
@@ -6095,7 +6095,7 @@ static int bpf_fib_set_fwd_params(struct bpf_fib_lookup *params, u32 mtu)
}
#endif
-#if IS_ENABLED(CONFIG_INET)
+#if IS_ENABLED(CONFIG_LEGACY_IP)
static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params,
u32 flags, bool check_mtu)
{
@@ -6390,7 +6390,7 @@ BPF_CALL_4(bpf_xdp_fib_lookup, struct xdp_buff *, ctx,
return -EINVAL;
switch (params->family) {
-#if IS_ENABLED(CONFIG_INET)
+#if IS_ENABLED(CONFIG_LEGACY_IP)
case AF_INET:
return bpf_ipv4_fib_lookup(dev_net(ctx->rxq->dev), params,
flags, true);
@@ -6431,7 +6431,7 @@ BPF_CALL_4(bpf_skb_fib_lookup, struct sk_buff *, skb,
check_mtu = true;
switch (params->family) {
-#if IS_ENABLED(CONFIG_INET)
+#if IS_ENABLED(CONFIG_LEGACY_IP)
case AF_INET:
rc = bpf_ipv4_fib_lookup(net, params, flags, check_mtu);
break;
diff --git a/net/core/sock.c b/net/core/sock.c
index 5976100a9d55..6b2914702a38 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -4267,7 +4267,7 @@ int sock_load_diag_module(int family, int protocol)
NETLINK_SOCK_DIAG, family);
}
-#ifdef CONFIG_INET
+#ifdef CONFIG_LEGACY_IP
if (family == AF_INET &&
protocol != IPPROTO_RAW &&
protocol < MAX_INET_PROTOS &&
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 616f86b1a7e4..7c1bbbb2c5c7 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -558,7 +558,7 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw)
}
EXPORT_SYMBOL(ieee80211_restart_hw);
-#ifdef CONFIG_INET
+#ifdef CONFIG_LEGACY_IP
static int ieee80211_ifa_changed(struct notifier_block *nb,
unsigned long data, void *arg)
{
@@ -1624,7 +1624,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
wiphy_unlock(hw->wiphy);
rtnl_unlock();
-#ifdef CONFIG_INET
+#ifdef CONFIG_LEGACY_IP
local->ifa_notifier.notifier_call = ieee80211_ifa_changed;
result = register_inetaddr_notifier(&local->ifa_notifier);
if (result)
@@ -1642,11 +1642,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
#if IS_ENABLED(CONFIG_IPV6)
fail_ifa6:
-#ifdef CONFIG_INET
+#ifdef CONFIG_LEGACY_IP
unregister_inetaddr_notifier(&local->ifa_notifier);
#endif
#endif
-#if defined(CONFIG_INET) || defined(CONFIG_IPV6)
+#if defined(CONFIG_LEGACY_IP) || defined(CONFIG_IPV6)
fail_ifa:
#endif
wiphy_unregister(local->hw.wiphy);
@@ -1673,7 +1673,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
tasklet_kill(&local->tx_pending_tasklet);
tasklet_kill(&local->tasklet);
-#ifdef CONFIG_INET
+#ifdef CONFIG_LEGACY_IP
unregister_inetaddr_notifier(&local->ifa_notifier);
#endif
#if IS_ENABLED(CONFIG_IPV6)
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 47f7f62906e2..e453fdb2254c 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -339,7 +339,7 @@ static struct nf_hook_entries *nf_hook_entries_head(const struct net *net, u8 pf
static int nf_ip_reroute(struct sk_buff *skb, const struct nf_queue_entry *entry)
{
-#ifdef CONFIG_INET
+#ifdef CONFIG_LEGACY_IP
const struct ip_rt_info *rt_info = nf_queue_entry_reroute(entry);
if (entry->state.hook == NF_INET_LOCAL_OUT) {
--
2.51.0
^ permalink raw reply related
* [PATCH 4/6] net: Make IPv4-only Kconfig options depend on LEGACY_IP
From: David Woodhouse @ 2026-04-01 7:44 UTC (permalink / raw)
To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Nikolay Aleksandrov, Ido Schimmel,
Martin KaFai Lau, Daniel Borkmann, John Fastabend,
Stanislav Fomichev, Alexei Starovoitov, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh, Hao Luo,
Jiri Olsa, Kuniyuki Iwashima, Willem de Bruijn, David Ahern,
Neal Cardwell, Johannes Berg, Pablo Neira Ayuso, Florian Westphal,
Phil Sutter, Guillaume Nault, David Woodhouse, Kees Cook,
Alexei Lazar, Gal Pressman, Paul Moore, netdev, linux-rdma,
linux-kernel, oss-drivers, bridge, bpf, linux-wireless,
netfilter-devel, coreteam, torvalds, jon.maddog.hall
In-Reply-To: <20260401074509.1897527-1-dwmw2@infradead.org>
From: David Woodhouse <dwmw@amazon.co.uk>
Add 'depends on LEGACY_IP' to Kconfig options that are purely
IPv4-specific, so they are automatically disabled when LEGACY_IP=n.
IPv4-only options gated:
- IP_MULTICAST, IP_ADVANCED_ROUTER, IP_FIB_TRIE_STATS,
IP_MULTIPLE_TABLES, IP_ROUTE_MULTIPATH, IP_ROUTE_VERBOSE,
IP_ROUTE_CLASSID — IPv4 routing features
- IP_PNP (and children DHCP/BOOTP/RARP) — IPv4 autoconfiguration
- NET_IPIP, NET_IPGRE_DEMUX, NET_IPGRE, NET_IPGRE_BROADCAST — IPv4
tunnels
- IP_MROUTE_COMMON, IP_MROUTE, IP_MROUTE_MULTIPLE_TABLES,
IP_PIMSM_V1, IP_PIMSM_V2 — IPv4 multicast routing
- NET_IPVTI, NET_FOU_IP_TUNNELS — IPv4 VTI and FOU tunnels
- INET_AH, INET_ESP, INET_ESP_OFFLOAD, INET_ESPINTCP,
INET_IPCOMP — IPv4 IPsec (IPv6 has separate INET6_* options)
- INET_XFRM_TUNNEL, INET_TUNNEL — IPv4 tunnel infrastructure
Options intentionally left ungated (shared with IPv6):
- SYN_COOKIES, NET_IP_TUNNEL, NET_UDP_TUNNEL, NET_FOU
- INET_TABLE_PERTURB_ORDER, INET_DIAG and children
- TCP_CONG_*, DEFAULT_TCP_CONG, TCP_SIGPOOL, TCP_AO, TCP_MD5SIG
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
net/ipv4/Kconfig | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
index aef2c5349e62..03b5ba75c3cf 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -15,6 +15,7 @@ config LEGACY_IP
config IP_MULTICAST
bool "IP: multicasting"
+ depends on LEGACY_IP
help
This is code for addressing several networked computers at once,
enlarging your kernel by about 2 KB. You need multicasting if you
@@ -25,6 +26,7 @@ config IP_MULTICAST
config IP_ADVANCED_ROUTER
bool "IP: advanced router"
+ depends on LEGACY_IP
help
If you intend to run your Linux box mostly as a router, i.e. as a
computer that forwards and redistributes network packets, say Y; you
@@ -66,6 +68,7 @@ config IP_ADVANCED_ROUTER
config IP_FIB_TRIE_STATS
bool "FIB TRIE statistics"
+ depends on LEGACY_IP
depends on IP_ADVANCED_ROUTER
help
Keep track of statistics on structure of FIB TRIE table.
@@ -73,6 +76,7 @@ config IP_FIB_TRIE_STATS
config IP_MULTIPLE_TABLES
bool "IP: policy routing"
+ depends on LEGACY_IP
depends on IP_ADVANCED_ROUTER
select FIB_RULES
help
@@ -90,6 +94,7 @@ config IP_MULTIPLE_TABLES
config IP_ROUTE_MULTIPATH
bool "IP: equal cost multipath"
+ depends on LEGACY_IP
depends on IP_ADVANCED_ROUTER
help
Normally, the routing tables specify a single action to be taken in
@@ -102,6 +107,7 @@ config IP_ROUTE_MULTIPATH
config IP_ROUTE_VERBOSE
bool "IP: verbose route monitoring"
+ depends on LEGACY_IP
depends on IP_ADVANCED_ROUTER
help
If you say Y here, which is recommended, then the kernel will print
@@ -113,9 +119,11 @@ config IP_ROUTE_VERBOSE
config IP_ROUTE_CLASSID
bool
+ depends on LEGACY_IP
config IP_PNP
bool "IP: kernel level autoconfiguration"
+ depends on LEGACY_IP
help
This enables automatic configuration of IP addresses of devices and
of the routing table during kernel boot, based on either information
@@ -172,6 +180,7 @@ config IP_PNP_RARP
config NET_IPIP
tristate "IP: tunneling"
+ depends on LEGACY_IP
select INET_TUNNEL
select NET_IP_TUNNEL
help
@@ -190,6 +199,7 @@ config NET_IPIP
config NET_IPGRE_DEMUX
tristate "IP: GRE demultiplexer"
+ depends on LEGACY_IP
help
This is helper module to demultiplex GRE packets on GRE version field criteria.
Required by ip_gre and pptp modules.
@@ -202,6 +212,7 @@ config NET_IP_TUNNEL
config NET_IPGRE
tristate "IP: GRE tunnels over IP"
+ depends on LEGACY_IP
depends on (IPV6 || IPV6=n) && NET_IPGRE_DEMUX
select NET_IP_TUNNEL
help
@@ -217,6 +228,7 @@ config NET_IPGRE
config NET_IPGRE_BROADCAST
bool "IP: broadcast GRE over IP"
+ depends on LEGACY_IP
depends on IP_MULTICAST && NET_IPGRE
help
One application of GRE/IP is to construct a broadcast WAN (Wide Area
@@ -226,10 +238,12 @@ config NET_IPGRE_BROADCAST
config IP_MROUTE_COMMON
bool
+ depends on LEGACY_IP
depends on IP_MROUTE || IPV6_MROUTE
config IP_MROUTE
bool "IP: multicast routing"
+ depends on LEGACY_IP
depends on IP_MULTICAST
select IP_MROUTE_COMMON
help
@@ -242,6 +256,7 @@ config IP_MROUTE
config IP_MROUTE_MULTIPLE_TABLES
bool "IP: multicast policy routing"
+ depends on LEGACY_IP
depends on IP_MROUTE && IP_ADVANCED_ROUTER
select FIB_RULES
help
@@ -256,6 +271,7 @@ config IP_MROUTE_MULTIPLE_TABLES
config IP_PIMSM_V1
bool "IP: PIM-SM version 1 support"
+ depends on LEGACY_IP
depends on IP_MROUTE
help
Kernel side support for Sparse Mode PIM (Protocol Independent
@@ -269,6 +285,7 @@ config IP_PIMSM_V1
config IP_PIMSM_V2
bool "IP: PIM-SM version 2 support"
+ depends on LEGACY_IP
depends on IP_MROUTE
help
Kernel side support for Sparse Mode PIM version 2. In order to use
@@ -314,6 +331,7 @@ config SYN_COOKIES
config NET_IPVTI
tristate "Virtual (secure) IP: tunneling"
+ depends on LEGACY_IP
depends on IPV6 || IPV6=n
select INET_TUNNEL
select NET_IP_TUNNEL
@@ -341,6 +359,7 @@ config NET_FOU
config NET_FOU_IP_TUNNELS
bool "IP: FOU encapsulation of IP tunnels"
+ depends on LEGACY_IP
depends on NET_IPIP || NET_IPGRE || IPV6_SIT
select NET_FOU
help
@@ -350,6 +369,7 @@ config NET_FOU_IP_TUNNELS
config INET_AH
tristate "IP: AH transformation"
+ depends on LEGACY_IP
select XFRM_AH
help
Support for IPsec AH (Authentication Header).
@@ -365,6 +385,7 @@ config INET_AH
config INET_ESP
tristate "IP: ESP transformation"
+ depends on LEGACY_IP
select XFRM_ESP
help
Support for IPsec ESP (Encapsulating Security Payload).
@@ -380,6 +401,7 @@ config INET_ESP
config INET_ESP_OFFLOAD
tristate "IP: ESP transformation offload"
+ depends on LEGACY_IP
depends on INET_ESP
select XFRM_OFFLOAD
default n
@@ -393,6 +415,7 @@ config INET_ESP_OFFLOAD
config INET_ESPINTCP
bool "IP: ESP in TCP encapsulation (RFC 8229)"
+ depends on LEGACY_IP
depends on XFRM && INET_ESP
select STREAM_PARSER
select NET_SOCK_MSG
@@ -405,6 +428,7 @@ config INET_ESPINTCP
config INET_IPCOMP
tristate "IP: IPComp transformation"
+ depends on LEGACY_IP
select INET_XFRM_TUNNEL
select XFRM_IPCOMP
help
@@ -425,11 +449,13 @@ config INET_TABLE_PERTURB_ORDER
config INET_XFRM_TUNNEL
tristate
+ depends on LEGACY_IP
select INET_TUNNEL
default n
config INET_TUNNEL
tristate
+ depends on LEGACY_IP
default n
config INET_DIAG
--
2.51.0
^ permalink raw reply related
* [PATCH 2/6] net: Add CONFIG_LEGACY_IP option
From: David Woodhouse @ 2026-04-01 7:44 UTC (permalink / raw)
To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Nikolay Aleksandrov, Ido Schimmel,
Martin KaFai Lau, Daniel Borkmann, John Fastabend,
Stanislav Fomichev, Alexei Starovoitov, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh, Hao Luo,
Jiri Olsa, Kuniyuki Iwashima, Willem de Bruijn, David Ahern,
Neal Cardwell, Johannes Berg, Pablo Neira Ayuso, Florian Westphal,
Phil Sutter, Guillaume Nault, David Woodhouse, Kees Cook,
Alexei Lazar, Gal Pressman, Paul Moore, netdev, linux-rdma,
linux-kernel, oss-drivers, bridge, bpf, linux-wireless,
netfilter-devel, coreteam, torvalds, jon.maddog.hall
In-Reply-To: <20260401074509.1897527-1-dwmw2@infradead.org>
From: David Woodhouse <dwmw@amazon.co.uk>
Add a new CONFIG_LEGACY_IP boolean option under CONFIG_INET that will
gate Legacy IP functionality. When disabled, the kernel will not
register the AF_INET socket family, IPv4 packet handler, ARP, or IPv4
routing, while the shared TCP/UDP/INET socket infrastructure remains
available for IPv6.
This is the first step toward making Legacy IP optional. The option
defaults to y and currently has no effect — subsequent patches will use
it to guard IPv4 entry points.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
net/ipv4/Kconfig | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
index df922f9f5289..aef2c5349e62 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -2,6 +2,17 @@
#
# IP configuration
#
+config LEGACY_IP
+ bool "The IPv4 protocol (Legacy IP)"
+ help
+ Support for IP version 4 (IPv4).
+
+ Legacy IP is the protocol used by the early ARPANET, before IPv6
+ was standardised in the final decade of the 1900s. It should only
+ be necessary these days to interoperate with legacy networks.
+
+ If unsure, say N.
+
config IP_MULTICAST
bool "IP: multicasting"
help
--
2.51.0
^ permalink raw reply related
* [PATCH 6/6] net: Warn when processes listen on AF_INET sockets
From: David Woodhouse @ 2026-04-01 7:44 UTC (permalink / raw)
To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Nikolay Aleksandrov, Ido Schimmel,
Martin KaFai Lau, Daniel Borkmann, John Fastabend,
Stanislav Fomichev, Alexei Starovoitov, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh, Hao Luo,
Jiri Olsa, Kuniyuki Iwashima, Willem de Bruijn, David Ahern,
Neal Cardwell, Johannes Berg, Pablo Neira Ayuso, Florian Westphal,
Phil Sutter, Guillaume Nault, David Woodhouse, Kees Cook,
Alexei Lazar, Gal Pressman, Paul Moore, netdev, linux-rdma,
linux-kernel, oss-drivers, bridge, bpf, linux-wireless,
netfilter-devel, coreteam, torvalds, jon.maddog.hall
In-Reply-To: <20260401074509.1897527-1-dwmw2@infradead.org>
From: David Woodhouse <dwmw@amazon.co.uk>
There is no need to listen on AF_INET sockets; a modern application can
listen on IPv6 (without IPV6_V6ONLY) and will accept connections from
the 20th century via IPv4-mapped addresses (::ffff:x.x.x.x) on the IPv6
socket.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
net/ipv4/af_inet.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index dc358faa1647..3838782a8437 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -240,6 +240,9 @@ int inet_listen(struct socket *sock, int backlog)
struct sock *sk = sock->sk;
int err = -EINVAL;
+ pr_warn_once("process '%s' (pid %d) is listening on an AF_INET socket. Consider using AF_INET6 with IPV6_V6ONLY=0 instead.\n",
+ current->comm, task_pid_nr(current));
+
lock_sock(sk);
if (sock->state != SS_UNCONNECTED || sock->type != SOCK_STREAM)
--
2.51.0
^ permalink raw reply related
* [PATCH 1/6] net: Simplify tautological CONFIG_INET/CONFIG_IPV6 guards
From: David Woodhouse @ 2026-04-01 7:44 UTC (permalink / raw)
To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Nikolay Aleksandrov, Ido Schimmel,
Martin KaFai Lau, Daniel Borkmann, John Fastabend,
Stanislav Fomichev, Alexei Starovoitov, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh, Hao Luo,
Jiri Olsa, Kuniyuki Iwashima, Willem de Bruijn, David Ahern,
Neal Cardwell, Johannes Berg, Pablo Neira Ayuso, Florian Westphal,
Phil Sutter, Guillaume Nault, David Woodhouse, Kees Cook,
Alexei Lazar, Gal Pressman, Paul Moore, netdev, linux-rdma,
linux-kernel, oss-drivers, bridge, bpf, linux-wireless,
netfilter-devel, coreteam, torvalds, jon.maddog.hall
In-Reply-To: <20260401074509.1897527-1-dwmw2@infradead.org>
From: David Woodhouse <dwmw@amazon.co.uk>
CONFIG_IPV6 depends on CONFIG_INET, so:
- 'IS_ENABLED(CONFIG_INET) && IS_ENABLED(CONFIG_IPV6)' simplifies
to just 'IS_ENABLED(CONFIG_IPV6)'
- 'IS_ENABLED(CONFIG_INET) || IS_ENABLED(CONFIG_IPV6)' simplifies
to just 'IS_ENABLED(CONFIG_INET)'
No functional change.
Signed-off-by: David Woodhouse (Kiro) <dwmw@amazon.co.uk>
---
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 6 +++---
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c | 2 +-
drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c | 2 +-
net/core/filter.c | 2 +-
net/core/secure_seq.c | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
index a14f216048cd..889dc1785772 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
@@ -439,7 +439,7 @@ int mlx5e_tc_tun_update_header_ipv4(struct mlx5e_priv *priv,
return err;
}
-#if IS_ENABLED(CONFIG_INET) && IS_ENABLED(CONFIG_IPV6)
+#if IS_ENABLED(CONFIG_IPV6)
static int mlx5e_route_lookup_ipv6_get(struct mlx5e_priv *priv,
struct net_device *dev,
struct mlx5e_tc_tun_route_attr *attr)
@@ -727,7 +727,7 @@ int mlx5e_tc_tun_route_lookup(struct mlx5e_priv *priv,
attr.fl.fl4.daddr = esw_attr->rx_tun_attr->src_ip.v4;
err = mlx5e_route_lookup_ipv4_get(priv, filter_dev, &attr);
}
-#if IS_ENABLED(CONFIG_INET) && IS_ENABLED(CONFIG_IPV6)
+#if IS_ENABLED(CONFIG_IPV6)
else if (flow_attr->tun_ip_version == 6) {
/* Addresses are swapped for decap */
attr.fl.fl6.saddr = esw_attr->rx_tun_attr->dst_ip.v6;
@@ -762,7 +762,7 @@ int mlx5e_tc_tun_route_lookup(struct mlx5e_priv *priv,
out:
if (flow_attr->tun_ip_version == 4)
mlx5e_route_lookup_ipv4_put(&attr);
-#if IS_ENABLED(CONFIG_INET) && IS_ENABLED(CONFIG_IPV6)
+#if IS_ENABLED(CONFIG_IPV6)
else if (flow_attr->tun_ip_version == 6)
mlx5e_route_lookup_ipv6_put(&attr);
#endif
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
index 6873c1201803..f3c0e2d0f388 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.h
@@ -73,7 +73,7 @@ int mlx5e_tc_tun_update_header_ipv4(struct mlx5e_priv *priv,
struct net_device *mirred_dev,
struct mlx5e_encap_entry *e);
-#if IS_ENABLED(CONFIG_INET) && IS_ENABLED(CONFIG_IPV6)
+#if IS_ENABLED(CONFIG_IPV6)
int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv,
struct net_device *mirred_dev,
struct mlx5e_encap_entry *e);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c
index bfd401bee9e8..b2973e8a7df8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c
@@ -104,7 +104,7 @@ int mlx5e_tc_set_attr_rx_tun(struct mlx5e_tc_flow *flow,
if (!tun_attr->dst_ip.v4 || !tun_attr->src_ip.v4)
return 0;
}
-#if IS_ENABLED(CONFIG_INET) && IS_ENABLED(CONFIG_IPV6)
+#if IS_ENABLED(CONFIG_IPV6)
else if (ip_version == 6) {
int ipv6_size = MLX5_FLD_SZ_BYTES(ipv6_layout, ipv6);
diff --git a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c
index 0cef0e2b85d0..5eb47e1a8d5e 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c
@@ -814,7 +814,7 @@ void nfp_tunnel_request_route_v6(struct nfp_app *app, struct sk_buff *skb)
flow.daddr = payload->ipv6_addr;
flow.flowi6_proto = IPPROTO_UDP;
-#if IS_ENABLED(CONFIG_INET) && IS_ENABLED(CONFIG_IPV6)
+#if IS_ENABLED(CONFIG_IPV6)
dst = ipv6_stub->ipv6_dst_lookup_flow(dev_net(netdev), NULL, &flow,
NULL);
if (IS_ERR(dst))
diff --git a/net/core/filter.c b/net/core/filter.c
index 78b548158fb0..ad71ceefcb5e 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6083,7 +6083,7 @@ static const struct bpf_func_proto bpf_skb_get_xfrm_state_proto = {
};
#endif
-#if IS_ENABLED(CONFIG_INET) || IS_ENABLED(CONFIG_IPV6)
+#if IS_ENABLED(CONFIG_INET)
static int bpf_fib_set_fwd_params(struct bpf_fib_lookup *params, u32 mtu)
{
params->h_vlan_TCI = 0;
diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c
index 6a6f2cda5aae..4de049635db0 100644
--- a/net/core/secure_seq.c
+++ b/net/core/secure_seq.c
@@ -15,7 +15,7 @@
#include <linux/siphash.h>
#include <net/secure_seq.h>
-#if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_INET)
+#if IS_ENABLED(CONFIG_INET)
#include <linux/in6.h>
#include <net/tcp.h>
--
2.51.0
^ permalink raw reply related
* [PATCH 0/6] Deprecate Legacy IP
From: David Woodhouse @ 2026-04-01 7:44 UTC (permalink / raw)
To: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Nikolay Aleksandrov, Ido Schimmel,
Martin KaFai Lau, Daniel Borkmann, John Fastabend,
Stanislav Fomichev, Alexei Starovoitov, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh, Hao Luo,
Jiri Olsa, Kuniyuki Iwashima, Willem de Bruijn, David Ahern,
Neal Cardwell, Johannes Berg, Pablo Neira Ayuso, Florian Westphal,
Phil Sutter, Guillaume Nault, David Woodhouse, Kees Cook,
Alexei Lazar, Gal Pressman, Paul Moore, netdev, linux-rdma,
linux-kernel, oss-drivers, bridge, bpf, linux-wireless,
netfilter-devel, coreteam, torvalds, jon.maddog.hall
RFC1883, the IPv6 standard, was published in the final decade of the 1900s.
That's closer in time to the Apollo 11 moon landing than it was to today.
Even our esteemed Maddog has worked with computers for longer in the IPv6
era, than he ever did before it.
Yet Linux still can't even be *built* with only IPv6 support and without
support for Legacy IP. This long overdue patch series fixes that, and
immediately marks Legacy IP for deprecation.
It also cleans up a few tautological "INET && IPV6" and "INET || IPV6"
checks, since IPV6 (and now LEGACY_IP) cannot be selected without the
overall CONFIG_INET option.
For now, we only add a warning when a process *listens* on a Legacy IP
socket (since you can listen on IPv6 and still accept connections which
have come through a timewarp from the 20th century. Adding warnings for
making outbound connections or *accepting* on Legacy IP can come later.
'I would be happy if "Legacy IP" ceased to be the "industry standard"
and IPv6 be the default, even if I had to beat IPv6 into the head of
every single network administrator's head with a shovel.' said Jon
'maddog' Hall, ancient supporter of Free and Open Source Software.
David Woodhouse (6):
net: Simplify tautological CONFIG_INET/CONFIG_IPV6 guards
net: Add CONFIG_LEGACY_IP option
net: Guard Legacy IP entry points with CONFIG_LEGACY_IP
net: Make IPv4-only Kconfig options depend on LEGACY_IP
net: Change CONFIG_INET to CONFIG_LEGACY_IP for IPv4-only code
net: Warn when processes listen on AF_INET sockets
.../net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 6 ++--
.../net/ethernet/mellanox/mlx5/core/en/tc_tun.h | 2 +-
.../ethernet/mellanox/mlx5/core/en/tc_tun_encap.c | 2 +-
.../ethernet/netronome/nfp/flower/tunnel_conf.c | 2 +-
include/linux/indirect_call_wrapper.h | 4 ++-
net/bridge/br_arp_nd_proxy.c | 2 +-
net/bridge/br_private.h | 8 +++++
net/core/filter.c | 12 +++----
net/core/secure_seq.c | 2 +-
net/core/sock.c | 2 +-
net/ipv4/Kconfig | 37 ++++++++++++++++++++++
net/ipv4/af_inet.c | 23 +++++++++++---
net/ipv4/devinet.c | 2 ++
net/ipv4/route.c | 1 -
net/ipv4/tcp_ipv4.c | 30 ++++++++++--------
net/mac80211/main.c | 10 +++---
net/netfilter/nfnetlink_queue.c | 2 +-
17 files changed, 105 insertions(+), 42 deletions(-)
^ permalink raw reply
* [syzbot] Monthly wireless report (Apr 2026)
From: syzbot @ 2026-04-01 7:42 UTC (permalink / raw)
To: linux-kernel, linux-wireless, netdev, syzkaller-bugs
Hello wireless maintainers/developers,
This is a 31-day syzbot report for the wireless subsystem.
All related reports/information can be found at:
https://syzkaller.appspot.com/upstream/s/wireless
During the period, 2 new issues were detected and 2 were fixed.
In total, 51 issues are still open and 174 have already been fixed.
Some of the still happening issues:
Ref Crashes Repro Title
<1> 28045 Yes WARNING in rate_control_rate_init (3)
https://syzkaller.appspot.com/bug?extid=9bdc0c5998ab45b05030
<2> 14590 No WARNING in kcov_remote_start (6)
https://syzkaller.appspot.com/bug?extid=3f51ad7ac3ae57a6fdcc
<3> 10607 Yes WARNING in __rate_control_send_low (3)
https://syzkaller.appspot.com/bug?extid=34463a129786910405dd
<4> 6950 Yes WARNING in __cfg80211_ibss_joined (2)
https://syzkaller.appspot.com/bug?extid=7f064ba1704c2466e36d
<5> 1226 Yes WARNING in ieee80211_start_next_roc
https://syzkaller.appspot.com/bug?extid=c3a167b5615df4ccd7fb
<6> 872 Yes INFO: task hung in reg_check_chans_work (7)
https://syzkaller.appspot.com/bug?extid=a2de4763f84f61499210
<7> 810 Yes INFO: rcu detected stall in ieee80211_handle_queued_frames
https://syzkaller.appspot.com/bug?extid=1c991592da3ef18957c0
<8> 790 No INFO: task hung in netdev_run_todo (4)
https://syzkaller.appspot.com/bug?extid=894cca71fa925aabfdb2
<9> 719 Yes WARNING in ieee80211_tx_h_rate_ctrl
https://syzkaller.appspot.com/bug?extid=0d516b33238bd97ee864
<10> 619 Yes INFO: task hung in crda_timeout_work (8)
https://syzkaller.appspot.com/bug?extid=d41f74db64598e0b5016
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
To disable reminders for individual bugs, reply with the following command:
#syz set <Ref> no-reminders
To change bug's subsystems, reply with:
#syz set <Ref> subsystems: new-subsystem
You may send multiple commands in a single email message.
^ permalink raw reply
* Re: [PATCH v2] wifi: ath11k: apply existing PM quirk to ThinkPad P14s Gen 5 AMD
From: Kyle Farnung @ 2026-04-01 3:48 UTC (permalink / raw)
To: Baochen Qiang
Cc: Jeff Johnson, Baochen Qiang, Jeff Johnson, linux-wireless, ath11k,
linux-kernel, stable
In-Reply-To: <082b3d13-6fb1-4041-a187-fddec3b013e4@oss.qualcomm.com>
On Tue, Mar 31, 2026 at 7:08 PM Baochen Qiang
<baochen.qiang@oss.qualcomm.com> wrote:
>
>
>
> On 3/31/2026 2:32 PM, Kyle Farnung via B4 Relay wrote:
> > From: Kyle Farnung <kfarnung@gmail.com>
> >
> > Some ThinkPad P14s Gen 5 AMD systems experience suspend/resume
> > reliability issues similar to those reported in [1]. These platforms
>
> how similar it is? can you describe the issue in details?
The issue is that intermittently after suspend my WiFi adapter connects
successfully for a few minutes and then drops. It will then keep trying to
reconnect in a loop but never succeed. A reboot will fix it, but eventually
I found that reloading the module also resolves the issue
(modprobe -r ath11k_pci && modprobe ath11k_pci). Based on some searching, I
did try adding "ath11k_pci.disable_idle_ps=1" to my kernel arguments. At
first it looked like maybe it worked, but then I hit the same problem
again. At that point I decided to try building a custom module with the
ATH11K_PM_WOW override and so far I'm two days and 10 suspends in without
issue.
Looking through kernel logs, the issue appears to have started with kernel
version 6.17.4. It looks like my Fedora install jumped from 6.16.10 to
6.17.4 on October 22, 2025 and I started seeing the issue two days later.
Here are the logs from the most recent occurrence (filtered for brevity):
Mar 29 15:26:24 kjfp14sg5 kernel: PM: suspend exit
Mar 29 15:26:24 kjfp14sg5 kernel: ath11k_pci 0000:02:00.0: chip_id
0x12 chip_family 0xb board_id 0xff soc_id 0x400c1211
Mar 29 15:26:24 kjfp14sg5 kernel: ath11k_pci 0000:02:00.0: fw_version
0x11088c35 fw_build_timestamp 2024-04-17 08:34 fw_build_id
WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41
Mar 29 15:26:30 kjfp14sg5 wpa_supplicant[2373]: wlp2s0:
CTRL-EVENT-REGDOM-CHANGE init=DRIVER type=COUNTRY alpha2=US
Mar 29 15:26:30 kjfp14sg5 wpa_supplicant[2373]: wlp2s0:
CTRL-EVENT-REGDOM-CHANGE init=DRIVER type=COUNTRY alpha2=US
Mar 29 15:26:30 kjfp14sg5 wpa_supplicant[2373]: wlp2s0:
CTRL-EVENT-REGDOM-CHANGE init=DRIVER type=COUNTRY alpha2=US
Mar 29 15:26:35 kjfp14sg5 wpa_supplicant[2373]: wlp2s0:
CTRL-EVENT-CONNECTED - Connection to 68:d7:9a:2a:94:f8 completed [id=0
id_str=]
Mar 29 15:26:49 kjfp14sg5 wpa_supplicant[2373]: wlp2s0: CTRL-EVENT-BEACON-LOSS
Mar 29 15:26:55 kjfp14sg5 kernel: ath11k_pci 0000:02:00.0: failed to
flush transmit queue, data pkts pending 9
Mar 29 15:26:55 kjfp14sg5 wpa_supplicant[2373]: wlp2s0:
CTRL-EVENT-DISCONNECTED bssid=68:d7:9a:2a:94:f8 reason=4
locally_generated=1
Mar 29 15:27:00 kjfp14sg5 wpa_supplicant[2373]: wlp2s0:
CTRL-EVENT-DISCONNECTED bssid=80:2a:a8:98:26:3e reason=6
Mar 29 15:27:05 kjfp14sg5 wpa_supplicant[2373]: wlp2s0:
CTRL-EVENT-DISCONNECTED bssid=74:ac:b9:df:54:36 reason=6
Mar 29 15:27:09 kjfp14sg5 wpa_supplicant[2373]: wlp2s0:
CTRL-EVENT-DISCONNECTED bssid=68:d7:9a:2a:94:f8 reason=2
Mar 29 15:27:09 kjfp14sg5 wpa_supplicant[2373]: wlp2s0:
CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="Batman" auth_failures=1
duration=10 reason=CONN_FAILED
>
> > were not previously included in the ath11k PM quirk table.
> >
> > Add DMI matches for product IDs 21ME and 21MF to apply the existing
> > ATH11K_PM_WOW override, improving suspend/resume behavior on these
> > systems.
> >
> > Tested on a ThinkPad P14s Gen 5 AMD (21ME) running 6.19.9.
> >
> > [1] https://bugzilla.kernel.org/show_bug.cgi?id=219196
> > [2] https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-p-series-laptops/thinkpad-p14s-gen-5-type-21me-21mf/
> >
> > Fixes: ce8669a27016 ("wifi: ath11k: determine PM policy based on machine model")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Kyle Farnung <kfarnung@gmail.com>
> > ---
> > Changes in v2:
> > - Fix missing mailing list recipients (linux-wireless, ath11k, linux-kernel)
> > - Link to v1: https://lore.kernel.org/r/20260330-p14s-pm-quirk-v1-1-cf2fa39cc2d5@gmail.com
> > ---
> > drivers/net/wireless/ath/ath11k/core.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
> > index 3f6f4db5b7ee1aba79fd7526e5d59d068e0f4a2e..21d366224e75904feeae6cb9c93d9ef692d127fe 100644
> > --- a/drivers/net/wireless/ath/ath11k/core.c
> > +++ b/drivers/net/wireless/ath/ath11k/core.c
> > @@ -1041,6 +1041,20 @@ static const struct dmi_system_id ath11k_pm_quirk_table[] = {
> > DMI_MATCH(DMI_PRODUCT_NAME, "21D5"),
> > },
> > },
> > + {
> > + .driver_data = (void *)ATH11K_PM_WOW,
> > + .matches = { /* P14s G5 AMD #1 */
> > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
> > + DMI_MATCH(DMI_PRODUCT_NAME, "21ME"),
> > + },
> > + },
> > + {
> > + .driver_data = (void *)ATH11K_PM_WOW,
> > + .matches = { /* P14s G5 AMD #2 */
> > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
> > + DMI_MATCH(DMI_PRODUCT_NAME, "21MF"),
> > + },
> > + },
> > {}
> > };
> >
> >
> > ---
> > base-commit: dbd94b9831bc52a1efb7ff3de841ffc3457428ce
> > change-id: 20260330-p14s-pm-quirk-0a51ba19235f
> >
> > Best regards,
>
^ permalink raw reply
* [PATCH v2] iwlwifi: dvm: add missing cleaup for on error path
From: Haoxiang Li @ 2026-04-01 3:05 UTC (permalink / raw)
To: miriam.rachel.korenblit, johannes.berg
Cc: linux-wireless, linux-kernel, Haoxiang Li
In iwlagn_tx_agg_start(), call iwlagn_dealloc_agg_txq()
to clear bit on error path.
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
---
Changes in v2:
- remove an unnecessary error handling. Thanks, Miriam!
---
drivers/net/wireless/intel/iwlwifi/dvm/tx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/tx.c b/drivers/net/wireless/intel/iwlwifi/dvm/tx.c
index a7806776a51e..1a0167f67c7b 100644
--- a/drivers/net/wireless/intel/iwlwifi/dvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/dvm/tx.c
@@ -604,8 +604,10 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
}
ret = iwl_sta_tx_modify_enable_tid(priv, sta_id, tid);
- if (ret)
+ if (ret) {
+ iwlagn_dealloc_agg_txq(priv, txq_id);
return ret;
+ }
spin_lock_bh(&priv->sta_lock);
tid_data = &priv->tid_data[sta_id][tid];
--
2.25.1
^ permalink raw reply related
* Re: [PATCH v2] wifi: ath11k: apply existing PM quirk to ThinkPad P14s Gen 5 AMD
From: Baochen Qiang @ 2026-04-01 2:08 UTC (permalink / raw)
To: kfarnung, Jeff Johnson, Baochen Qiang
Cc: Jeff Johnson, linux-wireless, ath11k, linux-kernel, stable
In-Reply-To: <20260330-p14s-pm-quirk-v2-1-ef18ce07996b@gmail.com>
On 3/31/2026 2:32 PM, Kyle Farnung via B4 Relay wrote:
> From: Kyle Farnung <kfarnung@gmail.com>
>
> Some ThinkPad P14s Gen 5 AMD systems experience suspend/resume
> reliability issues similar to those reported in [1]. These platforms
how similar it is? can you describe the issue in details?
> were not previously included in the ath11k PM quirk table.
>
> Add DMI matches for product IDs 21ME and 21MF to apply the existing
> ATH11K_PM_WOW override, improving suspend/resume behavior on these
> systems.
>
> Tested on a ThinkPad P14s Gen 5 AMD (21ME) running 6.19.9.
>
> [1] https://bugzilla.kernel.org/show_bug.cgi?id=219196
> [2] https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-p-series-laptops/thinkpad-p14s-gen-5-type-21me-21mf/
>
> Fixes: ce8669a27016 ("wifi: ath11k: determine PM policy based on machine model")
> Cc: stable@vger.kernel.org
> Signed-off-by: Kyle Farnung <kfarnung@gmail.com>
> ---
> Changes in v2:
> - Fix missing mailing list recipients (linux-wireless, ath11k, linux-kernel)
> - Link to v1: https://lore.kernel.org/r/20260330-p14s-pm-quirk-v1-1-cf2fa39cc2d5@gmail.com
> ---
> drivers/net/wireless/ath/ath11k/core.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
> index 3f6f4db5b7ee1aba79fd7526e5d59d068e0f4a2e..21d366224e75904feeae6cb9c93d9ef692d127fe 100644
> --- a/drivers/net/wireless/ath/ath11k/core.c
> +++ b/drivers/net/wireless/ath/ath11k/core.c
> @@ -1041,6 +1041,20 @@ static const struct dmi_system_id ath11k_pm_quirk_table[] = {
> DMI_MATCH(DMI_PRODUCT_NAME, "21D5"),
> },
> },
> + {
> + .driver_data = (void *)ATH11K_PM_WOW,
> + .matches = { /* P14s G5 AMD #1 */
> + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "21ME"),
> + },
> + },
> + {
> + .driver_data = (void *)ATH11K_PM_WOW,
> + .matches = { /* P14s G5 AMD #2 */
> + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "21MF"),
> + },
> + },
> {}
> };
>
>
> ---
> base-commit: dbd94b9831bc52a1efb7ff3de841ffc3457428ce
> change-id: 20260330-p14s-pm-quirk-0a51ba19235f
>
> Best regards,
^ permalink raw reply
* [PATCH wireless-next] wifi: brcm80211: change current_bss to a FAM
From: Rosen Penev @ 2026-03-31 23:32 UTC (permalink / raw)
To: linux-wireless
Cc: Arend van Spriel,
open list:BROADCOM BRCM80211 IEEE802.11 WIRELESS DRIVERS,
open list:BROADCOM BRCM80211 IEEE802.11 WIRELESS DRIVERS,
open list
Change to a single allocation with kzalloc_flex and remove some
boilerplate.
Done as a FAM instead of value to keep -> usage in codebase.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
.../broadcom/brcm80211/brcmsmac/main.c | 32 ++-----------------
.../broadcom/brcm80211/brcmsmac/main.h | 2 +-
2 files changed, 3 insertions(+), 31 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
index c7eaf160e1fa..4f57d64b1dd3 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
@@ -418,21 +418,12 @@ static int brcms_chspec_bw(u16 chanspec)
return BRCMS_10_MHZ;
}
-static void brcms_c_bsscfg_mfree(struct brcms_bss_cfg *cfg)
-{
- if (cfg == NULL)
- return;
-
- kfree(cfg->current_bss);
- kfree(cfg);
-}
-
static void brcms_c_detach_mfree(struct brcms_c_info *wlc)
{
if (wlc == NULL)
return;
- brcms_c_bsscfg_mfree(wlc->bsscfg);
+ kfree(wlc->bsscfg);
kfree(wlc->pub);
kfree(wlc->modulecb);
kfree(wlc->default_bss);
@@ -453,25 +444,6 @@ static void brcms_c_detach_mfree(struct brcms_c_info *wlc)
kfree(wlc);
}
-static struct brcms_bss_cfg *brcms_c_bsscfg_malloc(uint unit)
-{
- struct brcms_bss_cfg *cfg;
-
- cfg = kzalloc_obj(*cfg, GFP_ATOMIC);
- if (cfg == NULL)
- goto fail;
-
- cfg->current_bss = kzalloc_obj(*cfg->current_bss, GFP_ATOMIC);
- if (cfg->current_bss == NULL)
- goto fail;
-
- return cfg;
-
- fail:
- brcms_c_bsscfg_mfree(cfg);
- return NULL;
-}
-
static struct brcms_c_info *
brcms_c_attach_malloc(uint unit, uint *err, uint devid)
{
@@ -527,7 +499,7 @@ brcms_c_attach_malloc(uint unit, uint *err, uint devid)
goto fail;
}
- wlc->bsscfg = brcms_c_bsscfg_malloc(unit);
+ wlc->bsscfg = kzalloc_flex(*wlc->bsscfg, current_bss, 1, GFP_ATOMIC);
if (wlc->bsscfg == NULL) {
*err = 1011;
goto fail;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h
index b7ca0d9891c4..e9cbb95a5a17 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h
@@ -614,7 +614,7 @@ struct brcms_bss_cfg {
u8 SSID_len;
u8 SSID[IEEE80211_MAX_SSID_LEN];
u8 BSSID[ETH_ALEN];
- struct brcms_bss_info *current_bss;
+ struct brcms_bss_info current_bss[];
};
int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, struct sk_buff *p);
--
2.53.0
^ permalink raw reply related
* [PATCH] wifi: mt76: fix argument to ieee80211_is_first_frag()
From: Bjoern A. Zeeb @ 2026-03-31 22:05 UTC (permalink / raw)
To: linux-wireless
Cc: Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Shayne Chen,
Sean Wang
ieee80211_is_first_frag() operates on the seq_ctrl not the frame_control
header field. Pass the correct one in; otherwise the results may vary.
Fixes: 30ce7f4456ae4 ("mt76: validate rx CCMP PN")
Link: https://cgit.freebsd.org/src/commit/sys/contrib/dev/mediatek/mt76/mac80211.c?id=c67fd35e58c6ee1e19877a7fe5998885683abedc
Sponsored-by: The FreeBSD Foundation
Signed-off-by: Bjoern A. Zeeb <bz@FreeBSD.org>
---
drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 75772979f438..76b93326a997 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -1316,7 +1316,7 @@ mt76_check_ccmp_pn(struct sk_buff *skb)
* All further fragments will be validated by mac80211 only.
*/
if (ieee80211_is_frag(hdr) &&
- !ieee80211_is_first_frag(hdr->frame_control))
+ !ieee80211_is_first_frag(hdr->seq_ctrl))
return;
}
--
2.51.2
^ permalink raw reply related
* [PATCH v2 07/16] carl9170: main: add exponential restart backoff
From: Masi Osmani @ 2026-03-31 20:32 UTC (permalink / raw)
To: Christian Lamparter; +Cc: linux-wireless, ath9k-devel
When the AR9170 enters a bad state (firmware errors, command
timeouts, TX queue stalls), the driver can trigger rapid-fire
restarts that prevent the device from ever stabilizing.
Add exponential backoff to carl9170_restart(): if a restart
request arrives before the current backoff window has elapsed,
the request is throttled. The backoff starts at 500 ms and
doubles on each restart, capping at 30 seconds. A successful
restart resets the backoff to zero.
Additionally, use named constants for the firmware error
threshold (CARL9170_FW_ERROR_THRESHOLD) instead of a magic
number, and add a window-based counting approach to avoid
accumulating sporadic errors over long uptimes.
Signed-off-by: Masi Osmani <mas-i@hotmail.de>
---
Changes in v2:
- Remove CARL9170_FW_ERROR_WINDOW_MS: defined but never referenced in
any expression (dead constant).
- Change CARL9170_FW_ERROR_THRESHOLD from 3 to 4: the check uses >=,
so threshold 3 triggers on the 3rd error. The original intent
(visible in pre-patch code using > 3) was to trigger on the 4th.
drivers/net/wireless/ath/carl9170/carl9170.h | 2 ++
drivers/net/wireless/ath/carl9170/main.c | 38 ++++++++++++++++++++
drivers/net/wireless/ath/carl9170/rx.c | 4 ++-
3 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h b/drivers/net/wireless/ath/carl9170/carl9170.h
index b13685e22..ed0b4b26a 100644
--- a/drivers/net/wireless/ath/carl9170/carl9170.h
+++ b/drivers/net/wireless/ath/carl9170/carl9170.h
@@ -301,6 +301,8 @@ struct ar9170 {
bool needs_full_reset;
bool force_usb_reset;
atomic_t pending_restarts;
+ unsigned long last_restart_jiffies;
+ unsigned int restart_backoff_ms;
/* interface mode settings */
struct list_head vif_list;
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index f665cccc2..252ebe14a 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -474,6 +474,7 @@ static void carl9170_restart_work(struct work_struct *work)
struct ar9170 *ar = container_of(work, struct ar9170,
restart_work);
int err = -EIO;
+ unsigned long flags;
ar->usedkeys = 0;
ar->filter_state = 0;
@@ -495,6 +496,9 @@ static void carl9170_restart_work(struct work_struct *work)
if (!err && !ar->force_usb_reset) {
ar->restart_counter++;
atomic_set(&ar->pending_restarts, 0);
+ spin_lock_irqsave(&ar->state_lock, flags);
+ ar->restart_backoff_ms = 0;
+ spin_unlock_irqrestore(&ar->state_lock, flags);
ieee80211_restart_hw(ar->hw);
} else {
@@ -508,8 +512,13 @@ static void carl9170_restart_work(struct work_struct *work)
}
}
+#define CARL9170_RESTART_BACKOFF_INIT_MS 500
+#define CARL9170_RESTART_BACKOFF_MAX_MS 30000
+
void carl9170_restart(struct ar9170 *ar, const enum carl9170_restart_reasons r)
{
+ unsigned long flags;
+
carl9170_set_state_when(ar, CARL9170_STARTED, CARL9170_IDLE);
/*
@@ -522,6 +531,35 @@ void carl9170_restart(struct ar9170 *ar, const enum carl9170_restart_reasons r)
return;
}
+ /*
+ * Exponential backoff: if restarts are happening too frequently,
+ * increase the delay before accepting the next one. This prevents
+ * restart storms when the device is in a bad state.
+ *
+ * last_restart_jiffies and restart_backoff_ms are read-modify-written
+ * under state_lock to prevent races on SMP.
+ */
+ spin_lock_irqsave(&ar->state_lock, flags);
+ if (ar->last_restart_jiffies &&
+ time_before(jiffies, ar->last_restart_jiffies +
+ msecs_to_jiffies(ar->restart_backoff_ms))) {
+ spin_unlock_irqrestore(&ar->state_lock, flags);
+ dev_warn(&ar->udev->dev,
+ "restart (%d) throttled (backoff %u ms)\n",
+ r, ar->restart_backoff_ms);
+ atomic_dec(&ar->pending_restarts);
+ return;
+ }
+
+ ar->last_restart_jiffies = jiffies;
+ if (ar->restart_backoff_ms == 0)
+ ar->restart_backoff_ms = CARL9170_RESTART_BACKOFF_INIT_MS;
+ else
+ ar->restart_backoff_ms = min(ar->restart_backoff_ms * 2,
+ (unsigned int)
+ CARL9170_RESTART_BACKOFF_MAX_MS);
+ spin_unlock_irqrestore(&ar->state_lock, flags);
+
ieee80211_stop_queues(ar->hw);
dev_err(&ar->udev->dev, "restart device (%d)\n", r);
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index 4714ee8b6..b12bc508d 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
@@ -46,6 +46,8 @@
#include "hw.h"
#include "cmd.h"
+#define CARL9170_FW_ERROR_THRESHOLD 4
+
static void carl9170_dbg_message(struct ar9170 *ar, const char *buf, u32 len)
{
bool restart = false;
@@ -54,7 +56,7 @@ static void carl9170_dbg_message(struct ar9170 *ar, const char *buf, u32 len)
if (len > 3) {
if (memcmp(buf, CARL9170_ERR_MAGIC, 3) == 0) {
ar->fw.err_counter++;
- if (ar->fw.err_counter > 3) {
+ if (ar->fw.err_counter >= CARL9170_FW_ERROR_THRESHOLD) {
restart = true;
reason = CARL9170_RR_TOO_MANY_FIRMWARE_ERRORS;
}
--
2.53.0
^ permalink raw reply related
* [PATCH v2 04/16] carl9170: rx: remove stale TODO comment in carl9170_rx_mac_status
From: Masi Osmani @ 2026-03-12 1:04 UTC (permalink / raw)
To: Christian Lamparter; +Cc: linux-wireless, ath9k-devel
The TODO asked to update netdevice RX dropped statistics for frames
dropped due to unrecognised MAC error flags. The rx_dropped counter
is already incremented by the caller carl9170_rx_untie_data() at the
drop: label for all frames that carl9170_rx_mac_status() rejects with
a non-zero return code. Remove the stale comment.
Wiring ar->rx_dropped into netdev stats (get_stats) is handled by a
separate bugfix patch.
Signed-off-by: Masi Osmani <mas-i@hotmail.de>
---
Changes in v2:
- Change from replacing the TODO comment with ar->rx_dropped++ to a
pure deletion of the comment. The drop counter is already
incremented by the caller carl9170_rx_untie_data() at its drop:
label, which covers all error paths through carl9170_rx_mac_status().
Adding a second increment here would double-count dropped frames.
drivers/net/wireless/ath/carl9170/rx.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index 683343013..4714ee8b6 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
@@ -340,8 +340,6 @@ static int carl9170_rx_mac_status(struct ar9170 *ar,
/* drop any other error frames */
if (unlikely(error)) {
- /* TODO: update netdevice's RX dropped/errors statistics */
-
if (net_ratelimit())
wiphy_dbg(ar->hw->wiphy, "received frame with "
"suspicious error code (%#x).\n", error);
--
2.53.0
^ permalink raw reply related
* [PATCH v2 02/16] carl9170: mac80211: advertise RX STBC capability
From: Masi Osmani @ 2026-03-12 1:03 UTC (permalink / raw)
To: Christian Lamparter; +Cc: linux-wireless, ath9k-devel
The AR9170 has two physical RX chains (rx_mask == 3 in EEPROM), which
is sufficient for STBC 1-stream reception per the 802.11n specification.
The capability was not advertised, causing peers to never use STBC when
transmitting to us.
Enabling RX STBC improves receive diversity in multipath environments.
The capability has been verified working on Fritz!WLAN N (AR9170) hardware
over several weeks of operation without errors or instability.
Signed-off-by: Masi Osmani <mas-i@hotmail.de>
---
Changes in v2:
- Remove erroneous reference to ath9k's AR_SREV_9280_20_OR_LATER in
commit message. The 2-antenna capability is confirmed by EEPROM
rx_mask == 3 on tested hardware (Fritz!WLAN N), not by a silicon
revision gate.
drivers/net/wireless/ath/carl9170/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index af632418f..8a77345fd 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -155,7 +155,8 @@ static struct ieee80211_channel carl9170_5ghz_chantable[] = {
IEEE80211_HT_CAP_SUP_WIDTH_20_40 | \
IEEE80211_HT_CAP_SGI_40 | \
IEEE80211_HT_CAP_DSSSCCK40 | \
- IEEE80211_HT_CAP_SM_PS, \
+ IEEE80211_HT_CAP_SM_PS | \
+ (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT), \
.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K, \
.ampdu_density = IEEE80211_HT_MPDU_DENSITY_8, \
.mcs = { \
--
2.53.0
^ permalink raw reply related
* [PATCH v2 01/16] carl9170: mac80211: enable Short Guard Interval for 20 MHz (experimental)
From: Masi Osmani @ 2026-03-12 1:03 UTC (permalink / raw)
To: Christian Lamparter; +Cc: linux-wireless, ath9k-devel
The AR9170 hardware uses an OFDM baseband inherited from the AR9285/AR9287
family which supports 400 ns Guard Interval on both 20 MHz and 40 MHz
channels. SGI_40 was already advertised; SGI_20 was not.
Enabling SGI_20 reduces the OFDM symbol duration from 800 ns to 400 ns
on 20 MHz channels, increasing the maximum PHY rate from 130 Mbps to
144.4 Mbps (MCS 15, 2SS).
The capability has been verified on Fritz!WLAN N (AR9170) hardware with
no stability issues over several weeks of operation. It is gated behind
the sgi_20 module parameter (default N) to allow opt-in until broader
hardware validation is available.
The ath9k SGI_20 gate (AR_SREV_9287_11_OR_LATER / AR_SREV_9271) is a
MAC silicon revision check specific to the ath9k PCI driver and does not
apply to the AR9170's ZyDAS USB MAC.
Signed-off-by: Masi Osmani <mas-i@hotmail.de>
---
Changes in v2:
- Move IEEE80211_HT_CAP_SGI_20 from the static CARL9170_HT_CAP macro
to a module_param (modparam_sgi_20, bool, 0444) with conditional
dynamic setting. The AR9170 uses a ZyDAS MAC with no silicon
revision register â cannot gate the capability at compile time as
ath9k does with AR_SREV_9287_11_OR_LATER. Approach mirrors
modparam_noht already used in main.c.
drivers/net/wireless/ath/carl9170/main.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index af632418f..41a9f931f 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -55,6 +55,10 @@ int modparam_noht;
module_param_named(noht, modparam_noht, int, 0444);
MODULE_PARM_DESC(noht, "Disable MPDU aggregation.");
+static bool modparam_sgi_20;
+module_param_named(sgi_20, modparam_sgi_20, bool, 0444);
+MODULE_PARM_DESC(sgi_20, "Enable Short Guard Interval for 20 MHz (experimental).");
+
#define RATE(_bitrate, _hw_rate, _txpidx, _flags) { \
.bitrate = (_bitrate), \
.flags = (_flags), \
@@ -1972,6 +1976,11 @@ int carl9170_register(struct ar9170 *ar)
carl9170_band_5GHz.ht_cap.ht_supported = false;
}
+ if (modparam_sgi_20) {
+ carl9170_band_2GHz.ht_cap.cap |= IEEE80211_HT_CAP_SGI_20;
+ carl9170_band_5GHz.ht_cap.cap |= IEEE80211_HT_CAP_SGI_20;
+ }
+
for (i = 0; i < ar->fw.vif_num; i++) {
ar->vif_priv[i].id = i;
ar->vif_priv[i].vif = NULL;
--
2.53.0
^ permalink raw reply related
* [PATCH] carl9170: rx: discard spurious firmware response during probe init
From: Masi Osmani @ 2026-03-31 10:04 UTC (permalink / raw)
To: Christian Lamparter; +Cc: linux-wireless, ath9k-devel
The AR9170 SH-2 processor retains its internal command queue state
across USB disconnect/reconnect when power is not fully cut (dirty
disconnect). On the next probe the firmware delivers the stale echo
test response from the previous session BEFORE the new echo test is
sent. carl9170_cmd_callback() sees:
ar->readlen == 0 (no command pending yet, cmd_seq still -2)
response len == 4 (stale echo payload)
and logs:
received invalid command response: got 4, instead of 0
carl9170 cmd: 04 02 00 00 ef be ad de
carl9170 rsp: 04 02 0e 00 ef be ad de
restart device (9)
This cascades into probe failure -115.
BUG-015 (0015) drains the USB bulk IN endpoint before URBs are
attached, but cannot catch responses that arrive after URB submission
begins. Add a second line of defence inside carl9170_cmd_callback():
when cmd_seq is still -2 (init phase, before the command sequence
counter is synchronised) a length mismatch is treated as a stale
response from a prior session and discarded at dev_dbg level without
triggering a restart.
Signed-off-by: Masi Osmani <mas-i@hotmail.de>
---
drivers/net/wireless/ath/carl9170/rx.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index XXXXXXX..YYYYYYY 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
@@ -142,6 +142,18 @@
* So we only check if we provided enough space for the data.
*/
if (unlikely(ar->readlen != (len - 4))) {
+ if (ar->cmd_seq == -2) {
+ /*
+ * Firmware retained a stale response from a previous
+ * probe's echo test across USB reconnect (SH-2 retains
+ * state if power is not fully cut). The real echo test
+ * has not been sent yet -- discard silently.
+ */
+ dev_dbg(&ar->udev->dev,
+ "discarding stale init response (len %d)\n",
+ len - 4);
+ return;
+ }
dev_warn(&ar->udev->dev, "received invalid command response:"
"got %d, instead of %d\n", len - 4, ar->readlen);
print_hex_dump_bytes("carl9170 cmd:", DUMP_PREFIX_OFFSET,
--
Regards,
Masi Osmani
^ permalink raw reply
* [PATCH] carl9170: main: track sw_scan state and suppress transient channel-change errors
From: Masi Osmani @ 2026-03-31 10:03 UTC (permalink / raw)
To: Christian Lamparter; +Cc: linux-wireless, ath9k-devel
During mac80211 software scan, carl9170_set_channel() can return -EIO
if the firmware is busy (TX queue draining, AGC calibration timeout).
This error propagates back to mac80211 via carl9170_op_config(), which
then aborts the entire scan rather than advancing to the next channel.
Add sw_scan_start/sw_scan_complete callbacks to track the scanning
state in a new 'bool scanning' field in struct ar9170. When a channel
change fails during an active scan, log the failure at wiphy_dbg level
and return 0 so mac80211 advances to the next scan channel instead of
aborting. Channel-change failures outside of a scan continue to
propagate the error normally.
Signed-off-by: Masi Osmani <mas-i@hotmail.de>
---
drivers/net/wireless/ath/carl9170/carl9170.h | 1 +
drivers/net/wireless/ath/carl9170/main.c | 35 +++++++++++++++++++
2 files changed, 36 insertions(+)
--- a/drivers/net/wireless/ath/carl9170/carl9170.h
+++ b/drivers/net/wireless/ath/carl9170/carl9170.h
@@ -335,6 +335,7 @@
/* PHY */
struct ieee80211_channel *channel;
unsigned int num_channels;
+ bool scanning;
int noise[4];
unsigned int chan_fail;
unsigned int total_chan_fail;
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -989,8 +989,16 @@
err = carl9170_set_channel(ar, hw->conf.chandef.chan,
channel_type);
- if (err)
+ if (err) {
+ if (ar->scanning) {
+ wiphy_dbg(ar->hw->wiphy,
+ "scan: skip channel %d MHz, change failed (%d)\n",
+ hw->conf.chandef.chan->center_freq,
+ err);
+ err = 0;
+ }
goto out;
+ }
err = carl9170_update_survey(ar, false, true);
if (err)
@@ -1016,6 +1024,27 @@
return err;
}
+static void carl9170_op_sw_scan_start(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif,
+ const u8 *mac_addr)
+{
+ struct ar9170 *ar = hw->priv;
+
+ mutex_lock(&ar->mutex);
+ ar->scanning = true;
+ mutex_unlock(&ar->mutex);
+}
+
+static void carl9170_op_sw_scan_complete(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
+{
+ struct ar9170 *ar = hw->priv;
+
+ mutex_lock(&ar->mutex);
+ ar->scanning = false;
+ mutex_unlock(&ar->mutex);
+}
+
static u64 carl9170_op_prepare_multicast(struct ieee80211_hw *hw,
struct netdev_hw_addr_list *mc_list)
{
@@ -1836,6 +1865,8 @@
.add_interface = carl9170_op_add_interface,
.remove_interface = carl9170_op_remove_interface,
.config = carl9170_op_config,
+ .sw_scan_start = carl9170_op_sw_scan_start,
+ .sw_scan_complete = carl9170_op_sw_scan_complete,
.prepare_multicast = carl9170_op_prepare_multicast,
.configure_filter = carl9170_op_configure_filter,
.conf_tx = carl9170_op_conf_tx,
--
Regards,
Masi Osmani
^ permalink raw reply
* [PATCH] carl9170: main: guard op_stop() against non-STARTED state
From: Masi Osmani @ 2026-03-31 10:02 UTC (permalink / raw)
To: Christian Lamparter; +Cc: linux-wireless, ath9k-devel
When carl9170_op_start() fails partway through (e.g. after
carl9170_usb_open() but before carl9170_set_state_when() transitions
to CARL9170_STARTED), the device state remains CARL9170_IDLE.
mac80211 may still call carl9170_op_stop() in this case as part of
error cleanup.
IS_ACCEPTING_CMD() checks state >= CARL9170_IDLE, so the existing
guard in op_stop() does not prevent register writes when op_start()
never completed. Sending USB commands to hardware that was never
fully initialized causes unnecessary command timeouts and misleading
error messages in dmesg.
Capture IS_STARTED() into a local variable before
carl9170_set_state_when() transitions CARL9170_STARTED -> IDLE.
Gate the register write block on both was_started and IS_ACCEPTING_CMD()
so that teardown register writes only occur when op_start() fully
succeeded. carl9170_zap_queues() and carl9170_cancel_worker() are
safe to call regardless of state and remain ungated.
Signed-off-by: Masi Osmani <mas-i@hotmail.de>
---
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -442,11 +442,12 @@ static void carl9170_op_stop(struct ieee80211_hw *hw, bool suspend)
{
struct ar9170 *ar = hw->priv;
+ bool was_started = IS_STARTED(ar);
carl9170_set_state_when(ar, CARL9170_STARTED, CARL9170_IDLE);
ieee80211_stop_queues(ar->hw);
mutex_lock(&ar->mutex);
- if (IS_ACCEPTING_CMD(ar)) {
+ if (was_started && IS_ACCEPTING_CMD(ar)) {
RCU_INIT_POINTER(ar->beacon_iter, NULL);
carl9170_led_set_state(ar, 0);
--
Regards,
Masi Osmani
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox