Commit da74e89d authored by Amit Shah's avatar Amit Shah Committed by Rusty Russell

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: default avatarAmit Shah <amitshah@gmx.net>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent bdc1681c
...@@ -294,6 +294,15 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -294,6 +294,15 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev)
return 0; 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) static int virtnet_open(struct net_device *dev)
{ {
struct virtnet_info *vi = netdev_priv(dev); struct virtnet_info *vi = netdev_priv(dev);
...@@ -336,6 +345,9 @@ static int virtnet_probe(struct virtio_device *vdev) ...@@ -336,6 +345,9 @@ static int virtnet_probe(struct virtio_device *vdev)
dev->stop = virtnet_close; dev->stop = virtnet_close;
dev->hard_start_xmit = start_xmit; dev->hard_start_xmit = start_xmit;
dev->features = NETIF_F_HIGHDMA; dev->features = NETIF_F_HIGHDMA;
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = virtnet_netpoll;
#endif
SET_NETDEV_DEV(dev, &vdev->dev); SET_NETDEV_DEV(dev, &vdev->dev);
/* Do we support "hardware" checksums? */ /* Do we support "hardware" checksums? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment