aboutsummaryrefslogtreecommitdiffstats
path: root/common/iobuf.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/iobuf.h')
-rw-r--r--common/iobuf.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/common/iobuf.h b/common/iobuf.h
index a3d9bd547..f527fbf16 100644
--- a/common/iobuf.h
+++ b/common/iobuf.h
@@ -202,6 +202,26 @@ struct iobuf_struct
byte *buf;
} d;
+ /* A external drain buffer for reading/writting data skipping internal
+ draint buffer D.BUF. This allows zerocopy operation reducing
+ processing overhead across filter stack.
+
+ Used when by iobuf_read/iobuf_write when internal buffer has been
+ depleted and remaining external buffer length is large enough.
+ */
+ struct
+ {
+ /* The external buffer provided by iobuf_read/iobuf_write caller. */
+ byte *buf;
+ /* The number of bytes in the external buffer. */
+ size_t len;
+ /* The number of bytes that were consumed from the external buffer. */
+ size_t used;
+ /* Gives hint for processing that the external buffer is preferred and
+ that internal buffer should be consumed early. */
+ int preferred;
+ } e_d;
+
/* When FILTER is called to read some data, it may read some data
and then return EOF. We can't return the EOF immediately.
Instead, we note that we observed the EOF and when the buffer is