https://bugs.dpdk.org/show_bug.cgi?id=1484 Bug ID: 1484 Summary: net/netvsc deadlock during VF hot add when setting MTU Product: DPDK Version: 23.11 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: Normal Component: ethdev Assignee: dev@dpdk.org Reporter: joshua.knight@netscout.com Target Milestone: --- Created attachment 284 --> https://bugs.dpdk.org/attachment.cgi?id=284&action=edit 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 -- You are receiving this mail because: You are the assignee for the bug.