aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-01-16 11:50:33 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-01-22 23:35:13 +0100
commiteebca1115fbdb0fc72af713171434b0adbf4e87b (patch)
tree7b7e4c7424eb46c21ceb6200f13de6d1d5e1d563 /tcp.c
parent8563e7c870e139baf14ef00b26cdc7db4884246c (diff)
downloadpasst-eebca1115fbdb0fc72af713171434b0adbf4e87b.tar
passt-eebca1115fbdb0fc72af713171434b0adbf4e87b.tar.gz
passt-eebca1115fbdb0fc72af713171434b0adbf4e87b.tar.bz2
passt-eebca1115fbdb0fc72af713171434b0adbf4e87b.tar.lz
passt-eebca1115fbdb0fc72af713171434b0adbf4e87b.tar.xz
passt-eebca1115fbdb0fc72af713171434b0adbf4e87b.tar.zst
passt-eebca1115fbdb0fc72af713171434b0adbf4e87b.zip
tcp, tcp_splice: Remove redundant handling from tcp_timer()
tcp_timer() scans the connection table, expiring "tap" connections and calling tcp_splice_timer() for "splice" connections. tcp_splice_timer() expires spliced connections and then does some other processing. However, tcp_timer() is always called shortly after tcp_defer_handler() (from post_handler()), which also scans the flow table expiring both tap and spliced connections. So remove the redundant handling, and only do the extra tcp_splice_timer() work from tcp_timer(). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.c')
-rw-r--r--tcp.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/tcp.c b/tcp.c
index dbf5509..1b29661 100644
--- a/tcp.c
+++ b/tcp.c
@@ -3201,20 +3201,9 @@ void tcp_timer(struct ctx *c, const struct timespec *now)
}
}
- for (flow = flowtab + c->flow_count - 1; flow >= flowtab; flow--) {
- switch (flow->f.type) {
- case FLOW_TCP:
- if (flow->tcp.events == CLOSED)
- tcp_conn_destroy(c, flow);
- break;
- case FLOW_TCP_SPLICE:
+ for (flow = flowtab + c->flow_count - 1; flow >= flowtab; flow--)
+ if (flow->f.type == FLOW_TCP_SPLICE)
tcp_splice_timer(c, flow);
- break;
- default:
- die("Unexpected %s in tcp_timer()",
- FLOW_TYPE(&flow->f));
- }
- }
tcp_sock_refill_init(c);
if (c->mode == MODE_PASTA)