mirror of
https://passt.top/passt
synced 2025-06-18 13:05:35 +02:00
tcp: Refactor to use events instead of states, split out spliced implementation
Using events and flags instead of states makes the implementation much more straightforward: actions are mostly centered on events that occurred on the connection rather than states. An example is given by the ESTABLISHED_SOCK_FIN_SENT and FIN_WAIT_1_SOCK_FIN abominations: we don't actually care about which side started closing the connection to handle closing of connection halves. Split out the spliced implementation, as it has very little in common with the "regular" TCP path. Refactor things here and there to improve clarity. Add helpers to trace where resets and flag settings come from. No functional changes intended. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
de0961c01c
commit
e5eefe7743
7 changed files with 1760 additions and 1506 deletions
4
passt.c
4
passt.c
|
@ -119,12 +119,12 @@ static void post_handler(struct ctx *c, struct timespec *now)
|
|||
#define CALL_PROTO_HANDLER(c, now, lc, uc) \
|
||||
do { \
|
||||
extern void \
|
||||
lc ## _defer_handler (struct ctx *c) \
|
||||
lc ## _defer_handler (struct ctx *, struct timespec *) \
|
||||
__attribute__ ((weak)); \
|
||||
\
|
||||
if (!c->no_ ## lc) { \
|
||||
if (lc ## _defer_handler) \
|
||||
lc ## _defer_handler(c); \
|
||||
lc ## _defer_handler(c, now); \
|
||||
\
|
||||
if (timespec_diff_ms((now), &c->lc.timer_run) \
|
||||
>= uc ## _TIMER_INTERVAL) { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue