<div dir="auto">Hi Li and Stephen,<div dir="auto"><br></div><div dir="auto">We have a common DPDK application for all the PMD's, in which we are seeing issue for this Netvsc PMD only.</div><div dir="auto">I mean, for KVM hypervisor with Intel or Mellanox NICs we did not see such sync issues. Also, with failsafe PMD on hyper-v did not seen such sync issues.</div><div dir="auto"><br></div><div dir="auto">So, i thought this would be better to fix at PMD level using spinlock.</div><div dir="auto"><br></div><div dir="auto"><span class="gmail_chip gmail_plusreply" dir="auto"><a href="mailto:stephen@networkplumber.org" style="color:#15c;text-decoration:underline">@Stephen Hemminger</a></span><span> , yes we can store the device info get details after probe and reuse it later.</span></div><div dir="auto"><span>For Link-status get with multiple threads we can go with retry mechanism.</span></div><div dir="auto"><br></div><div dir="auto">However, w.r.t all other PMD's this device info get and Link-status get has issues in multi threaded application.</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto">Madhuker.</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, 20 Dec, 2025, 23:55 Stephen Hemminger, <<a href="mailto:stephen@networkplumber.org">stephen@networkplumber.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, 19 Dec 2025 17:35:33 +0000<br>
Long Li <<a href="mailto:longli@microsoft.com" target="_blank" rel="noreferrer">longli@microsoft.com</a>> wrote:<br>
<br>
> > When multiple processes issue command requests(like: device info get and<br>
> > link-status) at same-time, then we could see the command request failures,<br>
> > due to race-condition of common function execution.  <br>
> <br>
> Hi Madhuker,<br>
> <br>
> I'm not sure if we should use a lock in the driver for this. It's not clear in DPDK documents but in general the calls to query device status are not thread safe.<br>
> <br>
> Is it possible that the application uses a lock to sync calling to this?<br>
> <br>
<br>
I do not know of any restrictions about threads calling query operations.<br>
<br>
For info_get() the transaction is in rndis_get_offload().<br>
There are couple of ways to handle this better. One would to do<br>
the query during probe and remember the result. The hypervisor is<br>
not going to change supported offload. The other and simpler way<br>
would be to just have hardcoded offload values. The code for query<br>
got compute offloads is inherited for BSD and unless someone was trying<br>
to run on Windows 2012 or earlier version of Hyper-V it would never change.<br>
<br>
Link status is a little more complex. Does the hyper-visor ever report<br>
that the software path is down? And reading through the hn_rdis_exec code<br>
it looks like if multiple operations are in process the second one<br>
should return -EBUSY. Application could retry in that case.<br>
</blockquote></div>