提交 a48bd8f6 编写于 作者: R Rusty Russell

virtio: flush buffers on open

Fix bug found by Christian Borntraeger: if the other side fills all
the registered network buffers before we enable NAPI, we will never
get an interrupt.  The simplest fix is to process the input queue once
on open.
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
上级 e70f2f1b
......@@ -283,6 +283,13 @@ static int virtnet_open(struct net_device *dev)
struct virtnet_info *vi = netdev_priv(dev);
napi_enable(&vi->napi);
/* If all buffers were filled by other side before we napi_enabled, we
* won't get another interrupt, so process any outstanding packets
* now. virtnet_poll wants re-enable the queue, so we disable here. */
vi->rvq->vq_ops->disable_cb(vi->rvq);
netif_rx_schedule(vi->dev, &vi->napi);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册