diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2024-12-16 14:52:06 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2024-12-16 14:52:06 +0000 |
commit | 3604a050eedbf5af3fd0beca8342cb3779342007 (patch) | |
tree | c80e29ebea4c2b244ac990b5f4905169da06a667 | |
parent | 2ef97d8b7564c5d3e62248b49f9ebbbae5dc02f3 (diff) |
tcp_hpts: refactor the per tcpcb call to either input/output method
Either input or output return unlocked on failure. Should be no
functional change.
Reviewed by: rrs
Differential Revision: https://reviews.freebsd.org/D47925
-rw-r--r-- | sys/netinet/tcp_hpts.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 0c7338eb222b..5b39c94e0e58 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -1374,24 +1374,20 @@ again: * cause a call to output if it is needed so we do * not need a second call to tcp_output(). So we do * one or the other but not both. + * + * XXXGL: some KPI abuse here. tfb_do_queued_segments + * returns unlocked with positive error (always 1) and + * tcp_output returns unlocked with negative error. */ tp->t_flags2 |= TF2_HPTS_CALLS; if ((tp->t_flags2 & TF2_SUPPORTS_MBUFQ) && - !STAILQ_EMPTY(&tp->t_inqueue)) { - error = (*tp->t_fb->tfb_do_queued_segments)(tp, 0); - /* - * A non-zero return for input queue processing - * is the lock is released and most likely the - * inp is gone. - */ - if (error) - goto skip_pacing; - } else + !STAILQ_EMPTY(&tp->t_inqueue)) + error = -(*tp->t_fb->tfb_do_queued_segments)(tp, + 0); + else error = tcp_output(tp); - if (error < 0) - goto skip_pacing; - INP_WUNLOCK(inp); - skip_pacing: + if (__predict_true(error >= 0)) + INP_WUNLOCK(inp); CURVNET_RESTORE(); } if (seen_endpoint) { |