[PATCH v5 2/3] io: add a write flag for partial flushing during a zerocopy write

Tejus GK posted 3 patches 1 month ago
Maintainers: "Daniel P. Berrangé" <berrange@redhat.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>
There is a newer version of this series
[PATCH v5 2/3] io: add a write flag for partial flushing during a zerocopy write
Posted by Tejus GK 1 month ago
While doing a sendmsg() on a socket with MSG_ZEROCOPY enabled, one might
encounter an ENOBUFS, due to the socket error queue being full. To get
around this, the caller can pass the QIO_CHANNEL_WRITE_FLAG_ZERO_COPY
flag, which will try partially flushing the socket error queue once, and
retry the sendmsg().

Signed-off-by: Tejus GK <tejus.gk@nutanix.com>
---
 include/io/channel.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/io/channel.h b/include/io/channel.h
index 0f25ae0069..41b903d104 100644
--- a/include/io/channel.h
+++ b/include/io/channel.h
@@ -33,6 +33,7 @@ OBJECT_DECLARE_TYPE(QIOChannel, QIOChannelClass,
 #define QIO_CHANNEL_ERR_BLOCK -2
 
 #define QIO_CHANNEL_WRITE_FLAG_ZERO_COPY 0x1
+#define QIO_CHANNEL_WRITE_FLAG_ZERO_COPY_FLUSH_ONCE 0x2
 
 #define QIO_CHANNEL_READ_FLAG_MSG_PEEK 0x1
 #define QIO_CHANNEL_READ_FLAG_RELAXED_EOF 0x2
-- 
2.43.7