From 1f7cf04d343f185f9e044fdca70a1d0252492aed Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 22 Apr 2021 13:39:36 +0200 Subject: passt: Introduce packet batching mechanism Receive packets in batches from AF_UNIX, check if they can be sent with a single syscall, and batch them up with sendmmsg() in case. A bit rudimentary, currently only implemented for UDP, but it seems to work. Signed-off-by: Stefano Brivio --- passt.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'passt.h') diff --git a/passt.h b/passt.h index 9844858..87d91e5 100644 --- a/passt.h +++ b/passt.h @@ -1,5 +1,19 @@ #define UNIX_SOCK_PATH "/tmp/passt.socket" +/** + * struct tap_msg - Generic message descriptor for arrays of messages + * @start: Pointer to message start + * @l4_start: Pointer to L4 header + * @len: Message length, with L2 headers + * @l4_len: Message length, with L4 headers + */ +struct tap_msg { + char *start; + char *l4h; + size_t len; + size_t l4_len; +}; + #include "icmp.h" #include "tcp.h" -- cgit v1.2.3