<html>
<head>
<base href="https://bugs.dpdk.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8" class="bz_new_table">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - net/netvsc deadlock during VF hot add when setting MTU"
href="https://bugs.dpdk.org/show_bug.cgi?id=1484">1484</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>net/netvsc deadlock during VF hot add when setting MTU
</td>
</tr>
<tr>
<th>Product</th>
<td>DPDK
</td>
</tr>
<tr>
<th>Version</th>
<td>23.11
</td>
</tr>
<tr>
<th>Hardware</th>
<td>x86
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>Normal
</td>
</tr>
<tr>
<th>Component</th>
<td>ethdev
</td>
</tr>
<tr>
<th>Assignee</th>
<td>dev@dpdk.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>joshua.knight@netscout.com
</td>
</tr>
<tr>
<th>Target Milestone</th>
<td>---
</td>
</tr></table>
<p>
<div class="bz_comment_block">
<pre class="bz_comment_text">Created <span class=""><a href="attachment.cgi?id=284&action=diff" name="attach_284" title="netvsc deadlock patch">attachment 284</a> <a href="attachment.cgi?id=284&action=edit" title="netvsc deadlock patch">[details]</a></span>
netvsc deadlock patch
This issue is seen on DPDK 23.11.1 running on Ubuntu 22.04 in Micrsoft Azure.
During VF hot add, there is a deadlock that occurs when the MTU is being set.
The hn_vf_add function takes the VF write lock, then proceeds to call
hn_vf_mtu_set which attempts to take the read lock, causing deadlock.
We originally found this while cherrypicking this commit
"0479315ce9636e43affc6d24d39c63bbd1f44d5a net/netvsc: support MTU set" to
22.11, but we are able to reproduce it in 23.11.1
I've attached a patch we are using to work around this issue, by not
additionally locking while setting MTU.
You can reproduce this easily with the testpmd on Ubuntu.
In 22.11 when the hn_vf_attach function is called it eventually ends in the VF
port being started
hn_vf_attach(): Couldn't find port for VF
hn_vf_add(): RNDIS reports VF but device not found, retrying
hn_vf_attach(): Couldn't find port for VF
hn_vf_add(): RNDIS reports VF but device not found, retrying
netvsc_hotplug_retry(): Found matching MAC address, adding device 997f:00:02.0
network name enP39295s2
EAL: Probe PCI driver: mlx5_pci (15b3:1016) device: 997f:00:02.0 (socket 0)
mlx5_net: No available register for sampler.
Port 0: link state change event
hn_vf_attach(): found matching VF port 0
hn_vf_add(): configuring VF port 0
hn_vf_add(): Starting VF port 0
In 23.11.1 however, it never gets past configuring the port stage. Attempting
to exit testpmd with 'quit' hangs as well, waiting for lcores to finish which
never happens.
hn_vf_attach(): Couldn't find port for VF
hn_vf_add(): RNDIS reports VF but device not found, retrying
hn_vf_attach(): Couldn't find port for VF
hn_vf_add(): RNDIS reports VF but device not found, retrying
netvsc_hotplug_retry(): Found matching MAC address, adding device 997f:00:02.0
network name enP39295s2
EAL: Probe PCI driver: mlx5_pci (15b3:1016) device: 997f:00:02.0 (socket 0)
mlx5_net: No available register for sampler.
Port 0: link state change event
hn_vf_attach(): found matching VF port 0
hn_vf_add(): configuring VF port 0
</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://bugs.dpdk.org/show_bug.cgi?id=1484">
<meta itemprop="name" content="View bug">
</div>
<meta itemprop="description" content="Bugzilla bug update notification">
</div>
</body>
</html>