Thread (10 messages) flat view 10 messages, 3 authors, 2023-11-23

Re: [PATCH net-next v4 4/4] virtio-net: support rx netdim

From: Heng Qi <hidden>
Date: 2023-11-23 08:34:45
Also in: virtualization


在 2023/11/22 下午5:29, Yinjun Zhang 写道:
On Mon, 20 Nov 2023 20:37:34 +0800, Heng Qi wrote:
<...>
quoted
@@ -2179,6 +2220,7 @@ static void virtnet_disable_queue_pair(struct virtnet_info *vi, int qp_index)
  	virtnet_napi_tx_disable(&vi->sq[qp_index].napi);
  	napi_disable(&vi->rq[qp_index].napi);
  	xdp_rxq_info_unreg(&vi->rq[qp_index].xdp_rxq);
+	cancel_work_sync(&vi->rq[qp_index].dim.work);
I'm not sure, but please check if here may cause deadlock:
  rtnl_lock held ->
  .ndo_stop ->
  virtnet_disable_queue_pair() ->
  cancel_work_sync() ->
  virtnet_rx_dim_work() ->
  rtnl_lock()
Good catch!

I tried using cancel_work() which solves the problem. Additionally I 
tested the
scenario of ctrl cmd/.remove/.ndo_stop()/dim_work when there is a lot of 
concurrency,
and this can work very well.

Thanks!
quoted
  }
  
  static int virtnet_enable_queue_pair(struct virtnet_info *vi, int qp_index)
<...>
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help