dev_warn(&dev->dev, "Failed to kill VLAN ID %d.\n", vid);
 }
 
+static void virtnet_get_ringparam(struct net_device *dev,
+                               struct ethtool_ringparam *ring)
+{
+       struct virtnet_info *vi = netdev_priv(dev);
+
+       ring->rx_max_pending = virtqueue_get_vring_size(vi->rvq);
+       ring->tx_max_pending = virtqueue_get_vring_size(vi->svq);
+       ring->rx_pending = ring->rx_max_pending;
+       ring->tx_pending = ring->tx_max_pending;
+
+}
+
 static const struct ethtool_ops virtnet_ethtool_ops = {
        .get_link = ethtool_op_get_link,
+       .get_ringparam = virtnet_get_ringparam,
 };
 
 #define MIN_MTU 68
 
 }
 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");
 
  * virtqueue_detach_unused_buf: detach first unused buffer
  *     vq: the struct virtqueue we're talking about.
  *     Returns NULL or the "data" token handed to add_buf
+ * virtqueue_get_vring_size: return the size of the virtqueue's vring
+ *     vq: the struct virtqueue containing the vring of interest.
+ *     Returns the size of the vring.
  *
  * Locking rules are straightforward: the driver is responsible for
  * locking.  No two operations may be invoked simultaneously, with the exception
 
 void *virtqueue_detach_unused_buf(struct virtqueue *vq);
 
+unsigned int virtqueue_get_vring_size(struct virtqueue *vq);
+
 /**
  * virtio_device - representation of a device using virtio
  * @index: unique position on the virtio bus