From ba38e67cf405c5fd4c0fc043af453fa23a55fb35 Mon Sep 17 00:00:00 2001 From: Jon Maloy Date: Mon, 28 Oct 2024 22:14:00 -0400 Subject: tcp: unify l2 TCPv4 and TCPv6 queues and structures Following the preparations in the previous commit, we can now remove the payload and flag queues dedicated for TCPv6 and TCPv4 and move all traffic into common queues handling both protocol types. Apart from reducing code and memory footprint, this change reduces a potential risk for TCPv4 traffic starving out TCPv6 traffic. Since we always flush out the TCPv4 frame queue before the TCPv6 queue, the latter will never be handled if the former fails to send all its frames. Tests with iperf3 shows no measurable change in performance after this change. Signed-off-by: Jon Maloy Reviewed-by: David Gibson Signed-off-by: Stefano Brivio --- tcp.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'tcp.c') diff --git a/tcp.c b/tcp.c index 0569dc6..10ad06a 100644 --- a/tcp.c +++ b/tcp.c @@ -2611,11 +2611,7 @@ int tcp_init(struct ctx *c) { ASSERT(!c->no_tcp); - if (c->ifi4) - tcp_sock4_iov_init(c); - - if (c->ifi6) - tcp_sock6_iov_init(c); + tcp_sock_iov_init(c); memset(init_sock_pool4, 0xff, sizeof(init_sock_pool4)); memset(init_sock_pool6, 0xff, sizeof(init_sock_pool6)); -- cgit v1.2.3