diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -4060,9 +4060,13 @@ int tcp_compute_pipe(struct tcpcb *tp) { - return (tp->snd_max - tp->snd_una + - tp->sackhint.sack_bytes_rexmit - - tp->sackhint.sacked_bytes); + if (tp->t_fb->tfb_compute_pipe == NULL) { + return (tp->snd_max - tp->snd_una + + tp->sackhint.sack_bytes_rexmit - + tp->sackhint.sacked_bytes); + } else { + return((*tp->t_fb->tfb_compute_pipe)(tp)); + } } uint32_t diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -9397,6 +9397,20 @@ return (was_tlp); } +static uint32_t +do_rack_compute_pipe(struct tcpcb *tp, struct tcp_rack *rack, uint32_t snd_una) +{ + return (((tp->snd_max - snd_una) - rack->r_ctl.rc_sacked) + rack->r_ctl.rc_holes_rxt); +} + +static int32_t +rack_compute_pipe(struct tcpcb *tp) +{ + return ((int32_t)do_rack_compute_pipe(tp, + (struct tcp_rack *)tp->t_fb_ptr, + tp->snd_una)); +} + static void rack_update_prr(struct tcpcb *tp, struct tcp_rack *rack, uint32_t changed, tcp_seq th_ack) { @@ -9421,7 +9435,7 @@ } else { snd_una = th_ack; } - pipe = ((tp->snd_max - snd_una) - rack->r_ctl.rc_sacked) + rack->r_ctl.rc_holes_rxt; + pipe = do_rack_compute_pipe(tp, rack, snd_una); if (pipe > tp->snd_ssthresh) { long sndcnt; @@ -20317,6 +20331,7 @@ .tfb_tcp_mtu_chg = rack_mtu_change, .tfb_pru_options = rack_pru_options, .tfb_hwtls_change = rack_hw_tls_change, + .tfb_compute_pipe = rack_compute_pipe, .tfb_flags = TCP_FUNC_OUTPUT_CANDROP, }; diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -375,6 +375,7 @@ void (*tfb_tcp_mtu_chg)(struct tcpcb *); int (*tfb_pru_options)(struct tcpcb *, int); void (*tfb_hwtls_change)(struct tcpcb *, int); + int (*tfb_compute_pipe)(struct tcpcb *tp); volatile uint32_t tfb_refcnt; uint32_t tfb_flags; uint8_t tfb_id;