From f9fe212b1f2bc105939bd2603991dbcd0e6a3b5f Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 18 Jul 2024 15:26:29 +1000 Subject: tcp, flow: Remove redundant information, repack connection structures Some information we explicitly store in the TCP connection is now duplicated in the common flow structure. Access it from there instead, and remove it from the TCP specific structure. With that done we can reorder both the "tap" and "splice" TCP structures a bit to get better packing for the new combined flow table entries. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- tcp_internal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tcp_internal.h') diff --git a/tcp_internal.h b/tcp_internal.h index 51aaa16..4f61e5c 100644 --- a/tcp_internal.h +++ b/tcp_internal.h @@ -39,7 +39,11 @@ #define OPT_SACKP 4 #define OPT_SACK 5 #define OPT_TS 8 -#define CONN_V4(conn) (!!inany_v4(&(conn)->faddr)) + +#define TAPSIDE(conn_) ((conn_)->f.pif[1] == PIF_TAP) +#define TAPFLOW(conn_) (&((conn_)->f.side[TAPSIDE(conn_)])) + +#define CONN_V4(conn) (!!inany_v4(&TAPFLOW(conn)->faddr)) #define CONN_V6(conn) (!CONN_V4(conn)) /* -- cgit v1.2.3