Thread (41 messages) 41 messages, 6 authors, 2021-04-23

Re: [dpdk-dev] [PATCH 1/2] kni: fix kernel deadlock when using mlx devices

From: Ferruh Yigit <hidden>
Date: 2021-03-15 17:17:31

On 2/25/2021 2:32 PM, Elad Nachman wrote:
This first part of v4 of the patch re-introduces Stephen Hemminger's
patch 64106 . This part changes the parameter kni_net_process_request()
gets and introduces the initial rtnl unlocking mechanism.

Signed-off-by: Elad Nachman <redacted>
---
v4:
* for if down case, send asynchronously with rtnl locked and without
   wait, returning immediately to avoid both kernel race conditions
   and deadlock in user-space
v3:
* Include original patch and new patch as a series of patch, added a
   comment to the new patch
v2:
* rebuild the patch as increment from patch 64106
* fix comment and blank lines
<...>
  
+	/* Since we need to wait and RTNL mutex is held
+	 * drop the mutex and hold reference to keep device
+	 */
+	dev_hold(dev);
+	rtnl_unlock();
+
  	ret_val = wait_event_interruptible_timeout(kni->wq,
  			kni_fifo_count(kni->resp_q), 3 * HZ);
+	rtnl_lock();
+	dev_put(dev);
+
Hi Elad,

Let's drop rtnl lock/unlock form this patch, it will be changed in next patch 
already, and make this patch only function parameter change, as preparation to 
actual change.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help