@@ -2665,28 +2665,41 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
2665
2665
return NETDEV_TX_OK ;
2666
2666
}
2667
2667
2668
- static int virtnet_rx_resize (struct virtnet_info * vi ,
2669
- struct receive_queue * rq , u32 ring_num )
2668
+ static void virtnet_rx_pause (struct virtnet_info * vi , struct receive_queue * rq )
2670
2669
{
2671
2670
bool running = netif_running (vi -> dev );
2672
- int err , qindex ;
2673
-
2674
- qindex = rq - vi -> rq ;
2675
2671
2676
2672
if (running ) {
2677
2673
napi_disable (& rq -> napi );
2678
2674
virtnet_cancel_dim (vi , & rq -> dim );
2679
2675
}
2676
+ }
2680
2677
2681
- err = virtqueue_resize ( rq -> vq , ring_num , virtnet_rq_unmap_free_buf );
2682
- if ( err )
2683
- netdev_err (vi -> dev , "resize rx fail: rx queue index: %d err: %d\n" , qindex , err );
2678
+ static void virtnet_rx_resume ( struct virtnet_info * vi , struct receive_queue * rq )
2679
+ {
2680
+ bool running = netif_running (vi -> dev );
2684
2681
2685
2682
if (!try_fill_recv (vi , rq , GFP_KERNEL ))
2686
2683
schedule_delayed_work (& vi -> refill , 0 );
2687
2684
2688
2685
if (running )
2689
2686
virtnet_napi_enable (rq -> vq , & rq -> napi );
2687
+ }
2688
+
2689
+ static int virtnet_rx_resize (struct virtnet_info * vi ,
2690
+ struct receive_queue * rq , u32 ring_num )
2691
+ {
2692
+ int err , qindex ;
2693
+
2694
+ qindex = rq - vi -> rq ;
2695
+
2696
+ virtnet_rx_pause (vi , rq );
2697
+
2698
+ err = virtqueue_resize (rq -> vq , ring_num , virtnet_rq_unmap_free_buf );
2699
+ if (err )
2700
+ netdev_err (vi -> dev , "resize rx fail: rx queue index: %d err: %d\n" , qindex , err );
2701
+
2702
+ virtnet_rx_resume (vi , rq );
2690
2703
return err ;
2691
2704
}
2692
2705
0 commit comments