From: Stephen Hemminger <stephen@networkplumber.org>
To: madhukar.mythri@gmail.com
Cc: longli@microsoft.com, dev@dpdk.org, stable@dpdk.org
Subject: Re: [PATCH v2] net/netvsc: fix race condition in RNDIS command execution
Date: Sat, 28 Mar 2026 16:53:31 -0700 [thread overview]
Message-ID: <20260328165331.571e1d85@phoenix.local> (raw)
In-Reply-To: <20260113101820.60611-1-madhukar.mythri@gmail.com>
On Tue, 13 Jan 2026 15:48:20 +0530
madhukar.mythri@gmail.com wrote:
> From: Madhuker Mythri <madhukar.mythri@gmail.com>
>
> When multiple threads issue RNDIS command requests (such as device
> info queries and link status checks) simultaneously, command failures
> can occur due to concurrent access to shared resources in the RNDIS
> execution path.
>
> Add a spinlock to serialize RNDIS command execution and prevent
> data corruption.
>
> Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
> Cc: stable@dpdk.org
>
> Signed-off-by: Madhuker Mythri <madhukar.mythri@gmail.com>
> ---
As Long (and AI review) observed this patch needs more work.
There are two issues:
1. The introduced spin lock only protects query, it does not protect
around cases where a query races with some thing else calling rndis_set.
Lock should go inside hn_rndis_execute().
2. The lock is held while spinning, and it could take several
seconds to complete, holding spinlock that long burns CPU and any
other thread trying to do operation would queue up and block.
Maybe a pthread_mutex (which sleeps) or use trylock in the
query path and return EBUSY?
prev parent reply other threads:[~2026-03-28 23:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 10:18 [PATCH v2] net/netvsc: fix race condition in RNDIS command execution madhukar.mythri
2026-01-13 16:58 ` [RFT 0/2] net/netvsc: fix race conditions Stephen Hemminger
2026-01-13 16:58 ` [RFT 1/2] net/netvsc: fix RNDIS command concurrency issue Stephen Hemminger
2026-01-13 16:58 ` [RFT 2/2] net/netvsc: fix link status " Stephen Hemminger
2026-01-16 23:10 ` [EXTERNAL] [PATCH v2] net/netvsc: fix race condition in RNDIS command execution Long Li
2026-03-28 23:53 ` Stephen Hemminger [this message]
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=20260328165331.571e1d85@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=longli@microsoft.com \
--cc=madhukar.mythri@gmail.com \
--cc=stable@dpdk.org \
/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