From fe27ebce5c59c7fc684c5affa6ce27fdc32d362d Mon Sep 17 00:00:00 2001 From: David Gibson Date: Mon, 19 Feb 2024 18:56:50 +1100 Subject: tcp, tcp_splice: Helpers for getting sockets from the pools We maintain pools of ready-to-connect sockets in both the original and (for pasta) guest namespace to reduce latency when starting new TCP connections. If we exhaust those pools we have to take a higher latency path to get a new socket. Currently we open-code that fallback in the places we need it. To improve clarity encapsulate that into helper functions. While we're at it, give those helpers clearer error reporting. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- tcp_conn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tcp_conn.h') diff --git a/tcp_conn.h b/tcp_conn.h index 92d4807..d280b22 100644 --- a/tcp_conn.h +++ b/tcp_conn.h @@ -159,7 +159,7 @@ bool tcp_flow_defer(union flow *flow); bool tcp_splice_flow_defer(union flow *flow); void tcp_splice_timer(const struct ctx *c, union flow *flow); int tcp_conn_pool_sock(int pool[]); -int tcp_conn_new_sock(const struct ctx *c, sa_family_t af); +int tcp_conn_sock(const struct ctx *c, sa_family_t af); int tcp_sock_refill_pool(const struct ctx *c, int pool[], sa_family_t af); void tcp_splice_refill(const struct ctx *c); -- cgit v1.2.3