aboutgitcodebugslistschat
path: root/tcp_internal.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-07-18 15:26:29 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-07-19 18:32:41 +0200
commitf9fe212b1f2bc105939bd2603991dbcd0e6a3b5f (patch)
treef9fe0c6fbf4951691aac2f644c96236808535628 /tcp_internal.h
parent4e2d36e83fb1ff86c2e7f6d0832827d59f829934 (diff)
downloadpasst-f9fe212b1f2bc105939bd2603991dbcd0e6a3b5f.tar
passt-f9fe212b1f2bc105939bd2603991dbcd0e6a3b5f.tar.gz
passt-f9fe212b1f2bc105939bd2603991dbcd0e6a3b5f.tar.bz2
passt-f9fe212b1f2bc105939bd2603991dbcd0e6a3b5f.tar.lz
passt-f9fe212b1f2bc105939bd2603991dbcd0e6a3b5f.tar.xz
passt-f9fe212b1f2bc105939bd2603991dbcd0e6a3b5f.tar.zst
passt-f9fe212b1f2bc105939bd2603991dbcd0e6a3b5f.zip
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 <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_internal.h')
-rw-r--r--tcp_internal.h6
1 files changed, 5 insertions, 1 deletions
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))
/*