diff options
author | Xuan Zhuo <xuanzhuo@linux.alibaba.com> | 2022-08-01 14:38:21 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2022-08-11 04:06:38 -0400 |
commit | da802961832f9852886304290135457519815497 (patch) | |
tree | 15d1e1ab7b0387b95bfc5931a98f3ff12e77f9fc /include/linux | |
parent | 0b6fd46ec5f5720b76cbb01300ed9f7b7c6365c4 (diff) | |
download | linux-stable-da802961832f9852886304290135457519815497.tar.gz linux-stable-da802961832f9852886304290135457519815497.tar.bz2 linux-stable-da802961832f9852886304290135457519815497.zip |
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 <xuanzhuo@linux.alibaba.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20220801063902.129329-2-xuanzhuo@linux.alibaba.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/virtio.h | 2 |
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; }; |