From ee8f8e9564c5bd0ca25a9492e3102655d9ce0620 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 17 Nov 2022 16:58:46 +1100 Subject: tcp: Unify spliced and non-spliced connection tables Currently spliced and non-spliced connections are stored in completely separate tables, so there are completely independent limits on the number of spliced and non-spliced connections. This is a bit counter-intuitive. More importantly, the fact that the tables are separate prevents us from unifying some other logic between the two cases. So, merge these two tables into one, using the 'c.spliced' common field to distinguish between them when necessary. For now we keep a common limit of 128k connections, whether they're spliced or non-spliced, which means we save memory overall. If necessary we could increase this to a 256k or higher total, which would cost memory but give some more flexibility. For now, the code paths which need to step through all extant connections are still separate for the two cases, just skipping over entries which aren't for them. We'll improve that in later patches. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- tcp_conn.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tcp_conn.h') diff --git a/tcp_conn.h b/tcp_conn.h index 39d104a..4295f7d 100644 --- a/tcp_conn.h +++ b/tcp_conn.h @@ -195,4 +195,10 @@ union tcp_conn { struct tcp_splice_conn splice; }; +/* TCP connections */ +extern union tcp_conn tc[]; + +void tcp_splice_conn_update(struct ctx *c, struct tcp_splice_conn *new); +void tcp_table_compact(struct ctx *c, union tcp_conn *hole); + #endif /* TCP_CONN_H */ -- cgit v1.2.3