aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorXuan Zhuo <[email protected]>2022-08-01 14:38:21 +0800
committerMichael S. Tsirkin <[email protected]>2022-08-11 04:06:38 -0400
commitda802961832f9852886304290135457519815497 (patch)
tree15d1e1ab7b0387b95bfc5931a98f3ff12e77f9fc /include/linux
parent0b6fd46ec5f5720b76cbb01300ed9f7b7c6365c4 (diff)
virtio: record the maximum queue num supported by the device.
virtio-net can display the maximum (supported by hardware) ring size in ethtool -g eth0. When the subsequent patch implements vring reset, it can judge whether the ring size passed by the driver is legal based on this. Signed-off-by: Xuan Zhuo <[email protected]> Acked-by: Jason Wang <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/virtio.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index d8fdf170637c..129bde7521e3 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -19,6 +19,7 @@
* @priv: a pointer for the virtqueue implementation to use.
* @index: the zero-based ordinal number for this queue.
* @num_free: number of elements we expect to be able to fit.
+ * @num_max: the maximum number of elements supported by the device.
*
* A note on @num_free: with indirect buffers, each buffer needs one
* element in the queue, otherwise a buffer will need one element per
@@ -31,6 +32,7 @@ struct virtqueue {
struct virtio_device *vdev;
unsigned int index;
unsigned int num_free;
+ unsigned int num_max;
void *priv;
};