diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-02-28 22:25:10 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-02-29 09:48:01 +0100 |
commit | 0f938c3b9a9dbc854c1d2e33fab5af41b4a660c8 (patch) | |
tree | 787aef747d60b8aacb3e1d472aeac8b69994ad8c /tcp_splice.h | |
parent | d0550f97cd2f38c74806c10904341584f0c0a2ad (diff) | |
download | passt-0f938c3b9a9dbc854c1d2e33fab5af41b4a660c8.tar passt-0f938c3b9a9dbc854c1d2e33fab5af41b4a660c8.tar.gz passt-0f938c3b9a9dbc854c1d2e33fab5af41b4a660c8.tar.bz2 passt-0f938c3b9a9dbc854c1d2e33fab5af41b4a660c8.tar.lz passt-0f938c3b9a9dbc854c1d2e33fab5af41b4a660c8.tar.xz passt-0f938c3b9a9dbc854c1d2e33fab5af41b4a660c8.tar.zst passt-0f938c3b9a9dbc854c1d2e33fab5af41b4a660c8.zip |
flow: Clarify flow entry life cycle, introduce uniform logging
Our allocation scheme for flow entries means there are some
non-obvious constraints on when what things can be done with an entry.
Add a big doc comment explaining the life cycle.
In addition, make a FLOW_START() macro to mark one of the important
transitions. This encourages correct usage, by making it natural to
only access the flow type specific structure after calling it. It
also logs that a new flow has been created, which is useful for
debugging.
We also add logging when a flow's lifecycle ends. This doesn't need a
new helper, because it can only happen either from flow_alloc_cancel()
or from the flow deferred handler.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_splice.h')
-rw-r--r-- | tcp_splice.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tcp_splice.h b/tcp_splice.h index 20f41b3..5a471af 100644 --- a/tcp_splice.h +++ b/tcp_splice.h @@ -12,9 +12,8 @@ union sockaddr_inany; void tcp_splice_sock_handler(struct ctx *c, union epoll_ref ref, uint32_t events); bool tcp_splice_conn_from_sock(const struct ctx *c, - union tcp_listen_epoll_ref ref, - struct tcp_splice_conn *conn, int s, - const union sockaddr_inany *sa); + union tcp_listen_epoll_ref ref, union flow *flow, + int s, const union sockaddr_inany *sa); void tcp_splice_init(struct ctx *c); #endif /* TCP_SPLICE_H */ |