| 5870 | } |
| 5871 | |
| 5872 | static void |
| 5873 | rack_timer_cancel(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts, int line) |
| 5874 | { |
| 5875 | struct timeval tv; |
| 5876 | uint32_t us_cts, flags_on_entry; |
| 5877 | uint8_t hpts_removed = 0; |
| 5878 | |
| 5879 | flags_on_entry = rack->r_ctl.rc_hpts_flags; |
| 5880 | us_cts = tcp_get_usecs(&tv); |
| 5881 | if ((rack->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT) && |
| 5882 | ((TSTMP_GEQ(us_cts, rack->r_ctl.rc_last_output_to)) || |
| 5883 | ((tp->snd_max - tp->snd_una) == 0))) { |
| 5884 | tcp_hpts_remove(rack->rc_inp, HPTS_REMOVE_OUTPUT); |
| 5885 | hpts_removed = 1; |
| 5886 | /* If we were not delayed cancel out the flag. */ |
| 5887 | if ((tp->snd_max - tp->snd_una) == 0) |
| 5888 | rack->r_ctl.rc_hpts_flags &= ~PACE_PKT_OUTPUT; |
| 5889 | rack_log_to_cancel(rack, hpts_removed, line, us_cts, &tv, flags_on_entry); |
| 5890 | } |
| 5891 | if (rack->r_ctl.rc_hpts_flags & PACE_TMR_MASK) { |
| 5892 | rack->rc_tmr_stopped = rack->r_ctl.rc_hpts_flags & PACE_TMR_MASK; |
| 5893 | if (rack->rc_inp->inp_in_hpts && |
| 5894 | ((rack->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT) == 0)) { |
| 5895 | /* |
| 5896 | * Canceling timer's when we have no output being |
| 5897 | * paced. We also must remove ourselves from the |
| 5898 | * hpts. |
| 5899 | */ |
| 5900 | tcp_hpts_remove(rack->rc_inp, HPTS_REMOVE_OUTPUT); |
| 5901 | hpts_removed = 1; |
| 5902 | } |
| 5903 | rack->r_ctl.rc_hpts_flags &= ~(PACE_TMR_MASK); |
| 5904 | } |
| 5905 | if (hpts_removed == 0) |
| 5906 | rack_log_to_cancel(rack, hpts_removed, line, us_cts, &tv, flags_on_entry); |
| 5907 | } |
| 5908 | |
| 5909 | static void |
| 5910 | rack_timer_stop(struct tcpcb *tp, uint32_t timer_type) |
no test coverage detected