mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [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

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®