public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: mmietus97@yahoo.com
Cc: Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, sd@queasysnail.net, Jason@zx2c4.com
Subject: Re: [net-next,v5,03/11] net: tunnel: convert udp_tunnel{6,}_xmit_skb to noref
Date: Sat, 17 Jan 2026 16:36:09 -0800	[thread overview]
Message-ID: <20260118003609.1042309-1-kuba@kernel.org> (raw)
In-Reply-To: <20260113162954.5948-4-mmietus97@yahoo.com>

This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.

For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net: tunnel: convert udp_tunnel{6,}_xmit_skb to noref

This commit changes udp_tunnel{6,}_xmit_skb to use noref dst handling,
removing the requirement that callers take a reference on the dst.
The key change is replacing skb_dst_set() with skb_dst_set_noref() in
udp_tunnel6_xmit_skb().

> diff --git a/net/ipv6/ip6_udp_tunnel.c b/net/ipv6/ip6_udp_tunnel.c
> index cef3e0210744..d58815db8182 100644
> --- a/net/ipv6/ip6_udp_tunnel.c
> +++ b/net/ipv6/ip6_udp_tunnel.c
> @@ -95,7 +95,7 @@ void udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
>
>  	uh->len = htons(skb->len);
>
> -	skb_dst_set(skb, dst);
> +	skb_dst_set_noref(skb, dst);

skb_dst_set_noref() contains a WARN_ON check:

    WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held());

Does this create an issue for the SCTP UDP encapsulation path?

Looking at sctp_v6_xmit() in net/sctp/ipv6.c, when SCTP sends via UDP
encapsulation, it calls:

    udp_tunnel6_xmit_skb(dst, sk, skb, NULL, &fl6->saddr, &fl6->daddr,
                         tclass, ip6_dst_hoplimit(dst), label,
                         sctp_sk(sk)->udp_port, t->encap_port, false, 0);

This call path can originate from user context via sendmsg():

    sctp_sendmsg()
      -> sctp_primitive_SEND()  [uses GFP_KERNEL - process context]
           -> sctp_do_sm()
                -> sctp_packet_transmit()
                     -> sctp_v6_xmit()

Unlike the network device transmit path (which runs under rcu_read_lock_bh()
from __dev_queue_xmit()), SCTP's control plane transmit path runs in process
context without RCU-BH protection.

Will this trigger the WARN_ON in skb_dst_set_noref() when SCTP sends UDP
encapsulated packets from process context?

>
>  	udp6_set_csum(nocheck, skb, saddr, daddr, skb->len);

[ ... ]
-- 
pw-bot: cr

  reply	other threads:[~2026-01-18  0:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260113162954.5948-1-mmietus97.ref@yahoo.com>
2026-01-13 16:29 ` [PATCH net-next v5 00/11] net: tunnel: introduce noref xmit flows for tunnels Marek Mietus
2026-01-13 16:29   ` [PATCH net-next v5 01/11] net: dst_cache: add noref versions for dst_cache Marek Mietus
2026-01-13 16:29   ` [PATCH net-next v5 02/11] net: tunnel: convert iptunnel_xmit to noref Marek Mietus
2026-01-13 16:29   ` [PATCH net-next v5 03/11] net: tunnel: convert udp_tunnel{6,}_xmit_skb " Marek Mietus
2026-01-18  0:36     ` Jakub Kicinski [this message]
2026-01-20 13:25       ` [net-next,v5,03/11] " Marek Mietus
2026-01-13 16:29   ` [PATCH net-next v5 04/11] net: tunnel: allow noref dsts in udp_tunnel{,6}_dst_lookup Marek Mietus
2026-01-13 16:29   ` [PATCH net-next v5 05/11] net: ovpn: convert ovpn_udp{4,6}_output to use a noref dst Marek Mietus
2026-01-13 16:29   ` [PATCH net-next v5 06/11] wireguard: socket: convert send{4,6} to use a noref dst when possible Marek Mietus
2026-01-13 16:29   ` [PATCH net-next v5 07/11] net: tunnel: convert ip_md_tunnel_xmit " Marek Mietus
2026-01-13 16:29   ` [PATCH net-next v5 08/11] net: tunnel: convert ip_tunnel_xmit " Marek Mietus
2026-01-13 16:36   ` [PATCH net-next v5 09/11] net: sctp: convert sctp_v{4,6}_xmit " Marek Mietus
2026-01-18  0:36     ` [net-next,v5,09/11] " Jakub Kicinski
2026-01-13 16:36   ` [PATCH net-next v5 10/11] net: sit: convert ipip6_tunnel_xmit to use a noref dst Marek Mietus
2026-01-18  0:36     ` [net-next,v5,10/11] " Jakub Kicinski
2026-01-13 16:36   ` [PATCH net-next v5 11/11] net: tipc: convert tipc_udp_xmit " Marek Mietus
2026-03-17 11:02   ` [PATCH net-next v5 00/11] net: tunnel: introduce noref xmit flows for tunnels Paolo Abeni
2026-03-17 11:28     ` Sabrina Dubroca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260118003609.1042309-1-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=mmietus97@yahoo.com \
    --cc=netdev@vger.kernel.org \
    --cc=sd@queasysnail.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox