1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-14 11:35:33 +02:00

udp, passt: Introduce socket packet buffer, avoid getsockname() for UDP

This is in preparation for scatter-gather IO on the UDP receive path:
save a getsockname() syscall by setting a flag if we get the numbering
of all bound sockets in a strict sequence (expected, in practice) and
repurpose the tap buffer to be also a socket receive buffer, passing
it down to protocol handlers.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-04-30 14:52:18 +02:00
parent 605af213c5
commit e07f539ae0
10 changed files with 103 additions and 34 deletions

1
util.h
View file

@ -23,6 +23,7 @@ void debug(const char *format, ...);
} while (0)
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#define IN_INTERVAL(a, b, x) ((x) >= (a) && (x) <= (b))