From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
linux-sctp@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Weiming Shi <bestswngs@gmail.com>
Subject: Re: [PATCH net] sctp: disable BH before calling udp_tunnel_xmit_skb()
Date: Mon, 13 Apr 2026 09:39:45 -0300 [thread overview]
Message-ID: <adzkEQ17BD546rXC@t14s.localdomain> (raw)
In-Reply-To: <c874a8548221dcd56ff03c65ba75a74e6cf99119.1776017727.git.lucien.xin@gmail.com>
On Sun, Apr 12, 2026 at 02:15:27PM -0400, Xin Long wrote:
> udp_tunnel_xmit_skb() / udp_tunnel6_xmit_skb() are expected to run with
> BH disabled. After commit 6f1a9140ecda ("add xmit recursion limit to
> tunnel xmit functions"), on the path:
>
> udp(6)_tunnel_xmit_skb() -> ip(6)tunnel_xmit()
>
> dev_xmit_recursion_inc()/dec() must stay balanced on the same CPU.
>
> Without local_bh_disable(), the context may move between CPUs, which can
> break the inc/dec pairing. This may lead to incorrect recursion level
> detection and cause packets to be dropped in ip(6)_tunnel_xmit() or
> __dev_queue_xmit().
>
> Fix it by disabling BH around both IPv4 and IPv6 SCTP UDP xmit paths.
>
> In my testing, after enabling the SCTP over UDP:
>
> # ip net exec ha sysctl -w net.sctp.udp_port=9899
> # ip net exec ha sysctl -w net.sctp.encap_port=9899
> # ip net exec hb sysctl -w net.sctp.udp_port=9899
> # ip net exec hb sysctl -w net.sctp.encap_port=9899
>
> # ip net exec ha iperf3 -s
>
> - without this patch:
>
> # ip net exec hb iperf3 -c 192.168.0.1 --sctp
> [ 5] 0.00-10.00 sec 37.2 MBytes 31.2 Mbits/sec sender
> [ 5] 0.00-10.00 sec 37.1 MBytes 31.1 Mbits/sec receiver
>
> - with this patch:
>
> # ip net exec hb iperf3 -c 192.168.0.1 --sctp
> [ 5] 0.00-10.00 sec 3.14 GBytes 2.69 Gbits/sec sender
> [ 5] 0.00-10.00 sec 3.14 GBytes 2.69 Gbits/sec receiver
>
> Fixes: 6f1a9140ecda ("add xmit recursion limit to tunnel xmit functions")
> Fixes: 046c052b475e ("sctp: enable udp tunneling socks")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Nice catch!
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
next prev parent reply other threads:[~2026-04-13 12:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-12 18:15 [PATCH net] sctp: disable BH before calling udp_tunnel_xmit_skb() Xin Long
2026-04-13 12:39 ` Marcelo Ricardo Leitner [this message]
2026-04-14 0:10 ` patchwork-bot+netdevbpf
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=adzkEQ17BD546rXC@t14s.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=bestswngs@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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