* [PATCH] virtio: document ENOSPC
@ 2025-05-27 14:27 Michael S. Tsirkin
2025-05-28 13:12 ` Stefan Hajnoczi
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2025-05-27 14:27 UTC (permalink / raw)
To: linux-kernel
Cc: Parav Pandit, Jason Wang, Xuan Zhuo, Eugenio Pérez, virtualization
drivers handle ENOSPC specially since it's an error one can
get from a working VQ. Document the semantics.
Reported-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
drivers/virtio/virtio_ring.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index b784aab66867..97ab0cce527d 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -2296,6 +2296,10 @@ static inline int virtqueue_add(struct virtqueue *_vq,
* at the same time (except where noted).
*
* Returns zero or a negative error (ie. ENOSPC, ENOMEM, EIO).
+ *
+ * NB: ENOSPC is a special code that is only returned on an attempt to add a
+ * buffer to a full VQ. It indicates that some buffers are outstanding and that
+ * the operation can be retried after some buffers have been used.
*/
int virtqueue_add_sgs(struct virtqueue *_vq,
struct scatterlist *sgs[],
--
MST
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] virtio: document ENOSPC
2025-05-27 14:27 [PATCH] virtio: document ENOSPC Michael S. Tsirkin
@ 2025-05-28 13:12 ` Stefan Hajnoczi
2025-05-29 6:02 ` Jason Wang
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2025-05-28 13:12 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: linux-kernel, Parav Pandit, Jason Wang, Xuan Zhuo,
Eugenio Pérez, virtualization
On Tue, May 27, 2025 at 10:28 AM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> drivers handle ENOSPC specially since it's an error one can
> get from a working VQ. Document the semantics.
>
> Reported-by: Parav Pandit <parav@nvidia.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/virtio/virtio_ring.c | 4 ++++
> 1 file changed, 4 insertions(+)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] virtio: document ENOSPC
2025-05-27 14:27 [PATCH] virtio: document ENOSPC Michael S. Tsirkin
2025-05-28 13:12 ` Stefan Hajnoczi
@ 2025-05-29 6:02 ` Jason Wang
2025-05-29 6:20 ` Parav Pandit
2025-06-13 1:53 ` Xuan Zhuo
3 siblings, 0 replies; 5+ messages in thread
From: Jason Wang @ 2025-05-29 6:02 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: linux-kernel, Parav Pandit, Xuan Zhuo, Eugenio Pérez,
virtualization
On Tue, May 27, 2025 at 10:27 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> drivers handle ENOSPC specially since it's an error one can
> get from a working VQ. Document the semantics.
>
> Reported-by: Parav Pandit <parav@nvidia.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/virtio/virtio_ring.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index b784aab66867..97ab0cce527d 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -2296,6 +2296,10 @@ static inline int virtqueue_add(struct virtqueue *_vq,
> * at the same time (except where noted).
> *
> * Returns zero or a negative error (ie. ENOSPC, ENOMEM, EIO).
> + *
> + * NB: ENOSPC is a special code that is only returned on an attempt to add a
> + * buffer to a full VQ. It indicates that some buffers are outstanding and that
> + * the operation can be retried after some buffers have been used.
> */
> int virtqueue_add_sgs(struct virtqueue *_vq,
> struct scatterlist *sgs[],
> --
> MST
>
Acked-by: Jason Wang <jasowang@redhat.com>
Thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] virtio: document ENOSPC
2025-05-27 14:27 [PATCH] virtio: document ENOSPC Michael S. Tsirkin
2025-05-28 13:12 ` Stefan Hajnoczi
2025-05-29 6:02 ` Jason Wang
@ 2025-05-29 6:20 ` Parav Pandit
2025-06-13 1:53 ` Xuan Zhuo
3 siblings, 0 replies; 5+ messages in thread
From: Parav Pandit @ 2025-05-29 6:20 UTC (permalink / raw)
To: Michael S. Tsirkin, linux-kernel
Cc: Jason Wang, Xuan Zhuo, Eugenio Pérez, virtualization
> From: Michael S. Tsirkin <mst@redhat.com>
> Sent: Tuesday, May 27, 2025 7:57 PM
> To: linux-kernel@vger.kernel.org
> Cc: Parav Pandit <parav@nvidia.com>; Jason Wang <jasowang@redhat.com>;
> Xuan Zhuo <xuanzhuo@linux.alibaba.com>; Eugenio Pérez
> <eperezma@redhat.com>; virtualization@lists.linux.dev
> Subject: [PATCH] virtio: document ENOSPC
>
> drivers handle ENOSPC specially since it's an error one can get from a
> working VQ. Document the semantics.
>
> Reported-by: Parav Pandit <parav@nvidia.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/virtio/virtio_ring.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index
> b784aab66867..97ab0cce527d 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -2296,6 +2296,10 @@ static inline int virtqueue_add(struct virtqueue
> *_vq,
> * at the same time (except where noted).
> *
> * Returns zero or a negative error (ie. ENOSPC, ENOMEM, EIO).
> + *
> + * NB: ENOSPC is a special code that is only returned on an attempt to
> + add a
> + * buffer to a full VQ. It indicates that some buffers are outstanding
> + and that
> + * the operation can be retried after some buffers have been used.
> */
> int virtqueue_add_sgs(struct virtqueue *_vq,
> struct scatterlist *sgs[],
> --
> MST
Reviewed-by: Parav Pandit <parav@nvidia.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] virtio: document ENOSPC
2025-05-27 14:27 [PATCH] virtio: document ENOSPC Michael S. Tsirkin
` (2 preceding siblings ...)
2025-05-29 6:20 ` Parav Pandit
@ 2025-06-13 1:53 ` Xuan Zhuo
3 siblings, 0 replies; 5+ messages in thread
From: Xuan Zhuo @ 2025-06-13 1:53 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Parav Pandit, Jason Wang, Eugenio Pérez, virtualization,
linux-kernel
On Tue, 27 May 2025 10:27:19 -0400, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> drivers handle ENOSPC specially since it's an error one can
> get from a working VQ. Document the semantics.
>
> Reported-by: Parav Pandit <parav@nvidia.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> ---
> drivers/virtio/virtio_ring.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index b784aab66867..97ab0cce527d 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -2296,6 +2296,10 @@ static inline int virtqueue_add(struct virtqueue *_vq,
> * at the same time (except where noted).
> *
> * Returns zero or a negative error (ie. ENOSPC, ENOMEM, EIO).
> + *
> + * NB: ENOSPC is a special code that is only returned on an attempt to add a
> + * buffer to a full VQ. It indicates that some buffers are outstanding and that
> + * the operation can be retried after some buffers have been used.
> */
> int virtqueue_add_sgs(struct virtqueue *_vq,
> struct scatterlist *sgs[],
> --
> MST
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-06-13 1:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-27 14:27 [PATCH] virtio: document ENOSPC Michael S. Tsirkin
2025-05-28 13:12 ` Stefan Hajnoczi
2025-05-29 6:02 ` Jason Wang
2025-05-29 6:20 ` Parav Pandit
2025-06-13 1:53 ` Xuan Zhuo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®