Skip to contentSkip to conversation

VIRTIO NET: Enable netpoll interface for netconsole logging

PATCH In review Amit Shah 2 participants 5 messages Feb 29, 2008 – Mar 3, 2008

Subsystems (3)
lore
Share & tools
lore

Amit Shah

author
#0 lore raw

PATCH 1/1 VIRTIO NET: 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.

---
 drivers/net/virtio_net.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
drivers/net/virtio_net.c +12 -0
index fdc2367..3f3d334 100644
@@ -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? */
Signature · 5 lines
1.5.2.5

-- 
Amit Shah
http://www.amitshah.net/
#1 lore raw
Quoted 6 lines · On Friday 29 February 2008 21:54:50 Amit Shah wrote:

Add a new poll_controller handler that the netpoll interface needs.

This enables netconsole logging from a kvm guest over the virtio net interface.

Wow, does this actually work?

If so, I'll apply it no problems...
Rusty.

#2 lore raw
In reply to Amit Shah
Quoted 6 lines · On Friday 29 February 2008 21:54:50 Amit Shah wrote:

Add a new poll_controller handler that the netpoll interface needs.

This enables netconsole logging from a kvm guest over the virtio net interface.

Wow, does this actually work?

If so, I'll apply it no problems...
Rusty.

author
#3 lore raw
Quoted 9 lines · Rusty Russell
Quoted 6 lines · On Friday 29 February 2008 21:54:50 Amit Shah wrote:

Add a new poll_controller handler that the netpoll interface needs.

This enables netconsole logging from a kvm guest over the virtio net interface.

Wow, does this actually work?

Yes, it does :-)

Quoted 2 lines

If so, I'll apply it no problems...
Rusty.

Thanks.
Amit.

Signature · 2 lines
Amit Shah
http://www.amitshah.net/
author
#4 lore raw
In reply to Rusty Russell
Quoted 9 lines · Rusty Russell
Quoted 6 lines · On Friday 29 February 2008 21:54:50 Amit Shah wrote:

Add a new poll_controller handler that the netpoll interface needs.

This enables netconsole logging from a kvm guest over the virtio net interface.

Wow, does this actually work?

Yes, it does :-)

Quoted 2 lines

If so, I'll apply it no problems...
Rusty.

Thanks.
Amit.

Signature · 2 lines
Amit Shah
http://www.amitshah.net/