From 8f9f4668b37bcc877156dd525a856055735c8d24 Mon Sep 17 00:00:00 2001 From: Rick Jones Date: Wed, 19 Oct 2011 08:10:59 +0000 Subject: Add ethtool -g support to virtio_net Add support for reporting ring sizes via ethtool -g to the virtio_net driver. Signed-off-by: Rick Jones Acked-by: Rusty Russell Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller --- drivers/virtio/virtio_ring.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/virtio/virtio_ring.c') diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 68b9136847a..4acf88884f9 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -529,4 +529,14 @@ void vring_transport_features(struct virtio_device *vdev) } EXPORT_SYMBOL_GPL(vring_transport_features); +/* return the size of the vring within the virtqueue */ +unsigned int virtqueue_get_vring_size(struct virtqueue *_vq) +{ + + struct vring_virtqueue *vq = to_vvq(_vq); + + return vq->vring.num; +} +EXPORT_SYMBOL_GPL(virtqueue_get_vring_size); + MODULE_LICENSE("GPL"); -- cgit v1.2.3-70-g09d2