summaryrefslogtreecommitdiffstats
path: root/drivers/virtio/virtio_ring.c
diff options
context:
space:
mode:
authorRick Jones <rick.jones2@hp.com>2011-10-19 10:10:59 +0200
committerDavid S. Miller <davem@davemloft.net>2011-10-24 08:07:21 +0200
commit8f9f4668b37bcc877156dd525a856055735c8d24 (patch)
treea9d0a7cc6729884564f5d2bfb8edbdcc678b3f1c /drivers/virtio/virtio_ring.c
parenttcp: md5: dont write skb head in tcp_md5_hash_header() (diff)
downloadlinux-8f9f4668b37bcc877156dd525a856055735c8d24.tar.xz
linux-8f9f4668b37bcc877156dd525a856055735c8d24.zip
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 <rick.jones2@hp.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/virtio/virtio_ring.c')
-rw-r--r--drivers/virtio/virtio_ring.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 68b9136847af..4acf88884f9b 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");