aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/virtio_net.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 19fd4cb0ddf8..e575df83e5c2 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -294,6 +294,15 @@ again:
294 return 0; 294 return 0;
295} 295}
296 296
297#ifdef CONFIG_NET_POLL_CONTROLLER
298static void virtnet_netpoll(struct net_device *dev)
299{
300 struct virtnet_info *vi = netdev_priv(dev);
301
302 napi_schedule(&vi->napi);
303}
304#endif
305
297static int virtnet_open(struct net_device *dev) 306static int virtnet_open(struct net_device *dev)
298{ 307{
299 struct virtnet_info *vi = netdev_priv(dev); 308 struct virtnet_info *vi = netdev_priv(dev);
@@ -336,6 +345,9 @@ static int virtnet_probe(struct virtio_device *vdev)
336 dev->stop = virtnet_close; 345 dev->stop = virtnet_close;
337 dev->hard_start_xmit = start_xmit; 346 dev->hard_start_xmit = start_xmit;
338 dev->features = NETIF_F_HIGHDMA; 347 dev->features = NETIF_F_HIGHDMA;
348#ifdef CONFIG_NET_POLL_CONTROLLER
349 dev->poll_controller = virtnet_netpoll;
350#endif
339 SET_NETDEV_DEV(dev, &vdev->dev); 351 SET_NETDEV_DEV(dev, &vdev->dev);
340 352
341 /* Do we support "hardware" checksums? */ 353 /* Do we support "hardware" checksums? */