From: Aaron Conole <aconole@redhat.com>
To: Ilya Maximets <i.maximets@ovn.org>
Cc: netdev@vger.kernel.org, Eelco Chaudron <echaudro@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Shuah Khan <shuah@kernel.org>, Yuan Tan <tanyuan98@outlook.com>,
Yang Yang <n05ec@lzu.edu.cn>,
dev@openvswitch.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net v2 1/2] openvswitch: vport: fix self-deadlock on release of tunnel ports
Date: Mon, 04 May 2026 11:57:54 -0400 [thread overview]
Message-ID: <f7tcxzbxj3x.fsf@redhat.com> (raw)
In-Reply-To: <20260430233848.440994-2-i.maximets@ovn.org> (Ilya Maximets's message of "Fri, 1 May 2026 01:38:37 +0200")
Ilya Maximets <i.maximets@ovn.org> writes:
> vports are used concurrently and protected by RCU, so netdev_put()
> must happen after the RCU grace period. So, either in an RCU call or
> after the synchronize_net(). The rtnl_delete_link() must happen under
> RTNL and so can't be executed in RCU context. Calling synchronize_net()
> while holding RTNL is not a good idea for performance and system
> stability under load in general, so calling netdev_put() in RCU call
> is the right solution here.
>
> However,
> when the device is deleted, rtnl_unlock() will call netdev_run_todo()
> and block until all the references are gone. In the current code this
> means that we never reach the call_rcu() and the vport is never freed
> and the reference is never released, causing a self-deadlock on device
> removal.
>
> Fix that by moving the rcu_call() before the rtnl_unlock(), so the
> scheduled RCU callback will be executed when synchronize_net() is
> called from the rtnl_unlock()->netdev_run_todo() while the RTNL itself
> is already released.
>
> Fixes: 6931d21f87bc ("openvswitch: defer tunnel netdev_put to RCU release")
> Cc: stable@vger.kernel.org
> Acked-by: Eelco Chaudron <echaudro@redhat.com>
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---
Acked-by: Aaron Conole <aconole@redhat.com>
next prev parent reply other threads:[~2026-05-04 15:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 23:38 [PATCH net v2 0/2] openvswitch: fix self-deadlock on release of tunnel vports Ilya Maximets
2026-04-30 23:38 ` [PATCH net v2 1/2] openvswitch: vport: fix self-deadlock on release of tunnel ports Ilya Maximets
2026-05-04 15:57 ` Aaron Conole [this message]
2026-04-30 23:38 ` [PATCH net v2 2/2] selftests: openvswitch: add tests for tunnel vport refcounting Ilya Maximets
2026-05-01 8:56 ` Eelco Chaudron
2026-05-04 15:57 ` Aaron Conole
2026-05-05 13:25 ` Paolo Abeni
2026-05-05 13:28 ` Ilya Maximets
2026-05-04 11:43 ` [PATCH net v2 0/2] openvswitch: fix self-deadlock on release of tunnel vports Ilya Maximets
2026-05-04 20:24 ` Aaron Conole
2026-05-05 13:30 ` 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=f7tcxzbxj3x.fsf@redhat.com \
--to=aconole@redhat.com \
--cc=davem@davemloft.net \
--cc=dev@openvswitch.org \
--cc=echaudro@redhat.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=i.maximets@ovn.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=n05ec@lzu.edu.cn \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tanyuan98@outlook.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