1
0
Fork 0
mirror of https://passt.top/passt synced 2025-05-28 12:25:34 +02:00

tcp: Replace TCP buffer structure by an iovec array

To be able to provide pointers to TCP headers and IP headers without
worrying about alignment in the structure, split the structure into
several arrays and point to each part of the frame using an iovec array.

Using iovec also allows us to simply ignore the first entry when the
vnet length header is not needed.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Laurent Vivier 2024-04-15 19:01:37 +02:00 committed by Stefano Brivio
parent 27f1c762b1
commit 95601237ef
2 changed files with 266 additions and 270 deletions

3
util.h
View file

@ -32,6 +32,9 @@
#ifndef ETH_MIN_MTU
#define ETH_MIN_MTU 68
#endif
#ifndef IP_MAX_MTU
#define IP_MAX_MTU USHRT_MAX
#endif
#ifndef MIN
#define MIN(x, y) (((x) < (y)) ? (x) : (y))