diff options
author | Amit Shah <amitshah@gmx.net> | 2008-02-29 13:54:50 +0300 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-03-17 14:58:20 +0300 |
commit | da74e89d40995600b3b07ac500084920247687ce (patch) | |
tree | ee38d53aa14ed15f0fc1474426210e8a89485ad0 /drivers/net/virtio_net.c | |
parent | bdc1681cdf1ab6a65fa935a2b3f8fc63b20c54ea (diff) | |
download | linux-da74e89d40995600b3b07ac500084920247687ce.tar.xz |
virtio: Enable netpoll interface for netconsole logging
Add a new poll_controller handler that the netpoll interface needs.
This enables netconsole logging from a kvm guest over the virtio
net interface.
Signed-off-by: Amit Shah <amitshah@gmx.net>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r-- | drivers/net/virtio_net.c | 12 |
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: return 0; } +#ifdef CONFIG_NET_POLL_CONTROLLER +static void virtnet_netpoll(struct net_device *dev) +{ + struct virtnet_info *vi = netdev_priv(dev); + + napi_schedule(&vi->napi); +} +#endif + static int virtnet_open(struct net_device *dev) { struct virtnet_info *vi = netdev_priv(dev); @@ -336,6 +345,9 @@ static int virtnet_probe(struct virtio_device *vdev) dev->stop = virtnet_close; dev->hard_start_xmit = start_xmit; dev->features = NETIF_F_HIGHDMA; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = virtnet_netpoll; +#endif SET_NETDEV_DEV(dev, &vdev->dev); /* Do we support "hardware" checksums? */ |