Lines Matching refs:tp
268 struct tcp_sock *tp = tcp_sk(sk); in bbr_init_pacing_rate_from_rtt() local
273 if (tp->srtt_us) { /* any RTT sample yet? */ in bbr_init_pacing_rate_from_rtt()
274 rtt_us = max(tp->srtt_us >> 3, 1U); in bbr_init_pacing_rate_from_rtt()
279 bw = (u64)tcp_snd_cwnd(tp) * BW_UNIT; in bbr_init_pacing_rate_from_rtt()
288 struct tcp_sock *tp = tcp_sk(sk); in bbr_set_pacing_rate() local
292 if (unlikely(!bbr->has_seen_rtt && tp->srtt_us)) in bbr_set_pacing_rate()
306 struct tcp_sock *tp = tcp_sk(sk); in bbr_tso_segs_goal() local
315 segs = max_t(u32, bytes / tp->mss_cache, bbr_min_tso_segs(sk)); in bbr_tso_segs_goal()
323 struct tcp_sock *tp = tcp_sk(sk); in bbr_save_cwnd() local
327 bbr->prior_cwnd = tcp_snd_cwnd(tp); /* this cwnd is good enough */ in bbr_save_cwnd()
329 bbr->prior_cwnd = max(bbr->prior_cwnd, tcp_snd_cwnd(tp)); in bbr_save_cwnd()
334 struct tcp_sock *tp = tcp_sk(sk); in bbr_cwnd_event() local
337 if (event == CA_EVENT_TX_START && tp->app_limited) { in bbr_cwnd_event()
339 bbr->ack_epoch_mstamp = tp->tcp_mstamp; in bbr_cwnd_event()
439 struct tcp_sock *tp = tcp_sk(sk); in bbr_packets_in_net_at_edt() local
444 now_ns = tp->tcp_clock_cache; in bbr_packets_in_net_at_edt()
445 edt_ns = max(tp->tcp_wstamp_ns, now_ns); in bbr_packets_in_net_at_edt()
483 struct tcp_sock *tp = tcp_sk(sk); in bbr_set_cwnd_to_recover_or_restore() local
486 u32 cwnd = tcp_snd_cwnd(tp); in bbr_set_cwnd_to_recover_or_restore()
498 bbr->next_rtt_delivered = tp->delivered; /* start round now */ in bbr_set_cwnd_to_recover_or_restore()
500 cwnd = tcp_packets_in_flight(tp) + acked; in bbr_set_cwnd_to_recover_or_restore()
509 *new_cwnd = max(cwnd, tcp_packets_in_flight(tp) + acked); in bbr_set_cwnd_to_recover_or_restore()
522 struct tcp_sock *tp = tcp_sk(sk); in bbr_set_cwnd() local
524 u32 cwnd = tcp_snd_cwnd(tp), target_cwnd = 0; in bbr_set_cwnd()
543 else if (cwnd < target_cwnd || tp->delivered < TCP_INIT_CWND) in bbr_set_cwnd()
548 tcp_snd_cwnd_set(tp, min(cwnd, tp->snd_cwnd_clamp)); /* apply global cap */ in bbr_set_cwnd()
550 tcp_snd_cwnd_set(tp, min(tcp_snd_cwnd(tp), bbr_cwnd_min_target)); in bbr_set_cwnd()
557 struct tcp_sock *tp = tcp_sk(sk); in bbr_is_next_cycle_phase() local
560 tcp_stamp_us_delta(tp->delivered_mstamp, bbr->cycle_mstamp) > in bbr_is_next_cycle_phase()
593 struct tcp_sock *tp = tcp_sk(sk); in bbr_advance_cycle_phase() local
597 bbr->cycle_mstamp = tp->delivered_mstamp; in bbr_advance_cycle_phase()
637 struct tcp_sock *tp = tcp_sk(sk); in bbr_reset_lt_bw_sampling_interval() local
640 bbr->lt_last_stamp = div_u64(tp->delivered_mstamp, USEC_PER_MSEC); in bbr_reset_lt_bw_sampling_interval()
641 bbr->lt_last_delivered = tp->delivered; in bbr_reset_lt_bw_sampling_interval()
642 bbr->lt_last_lost = tp->lost; in bbr_reset_lt_bw_sampling_interval()
690 struct tcp_sock *tp = tcp_sk(sk); in bbr_lt_bw_sampling() local
739 lost = tp->lost - bbr->lt_last_lost; in bbr_lt_bw_sampling()
740 delivered = tp->delivered - bbr->lt_last_delivered; in bbr_lt_bw_sampling()
746 t = div_u64(tp->delivered_mstamp, USEC_PER_MSEC) - bbr->lt_last_stamp; in bbr_lt_bw_sampling()
763 struct tcp_sock *tp = tcp_sk(sk); in bbr_update_bw() local
773 bbr->next_rtt_delivered = tp->delivered; in bbr_update_bw()
822 struct tcp_sock *tp = tcp_sk(sk); in bbr_update_ack_aggregation() local
840 epoch_us = tcp_stamp_us_delta(tp->delivered_mstamp, in bbr_update_ack_aggregation()
852 bbr->ack_epoch_mstamp = tp->delivered_mstamp; in bbr_update_ack_aggregation()
860 extra_acked = min(extra_acked, tcp_snd_cwnd(tp)); in bbr_update_ack_aggregation()
910 struct tcp_sock *tp = tcp_sk(sk); in bbr_check_probe_rtt_done() local
918 tcp_snd_cwnd_set(tp, max(tcp_snd_cwnd(tp), bbr->prior_cwnd)); in bbr_check_probe_rtt_done()
943 struct tcp_sock *tp = tcp_sk(sk); in bbr_update_min_rtt() local
966 tp->app_limited = in bbr_update_min_rtt()
967 (tp->delivered + tcp_packets_in_flight(tp)) ? : 1; in bbr_update_min_rtt()
970 tcp_packets_in_flight(tp) <= bbr_cwnd_min_target) { in bbr_update_min_rtt()
974 bbr->next_rtt_delivered = tp->delivered; in bbr_update_min_rtt()
1041 struct tcp_sock *tp = tcp_sk(sk); in bbr_init() local
1045 tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; in bbr_init()
1047 bbr->next_rtt_delivered = tp->delivered; in bbr_init()
1053 bbr->min_rtt_us = tcp_min_rtt(tp); in bbr_init()
1071 bbr->ack_epoch_mstamp = tp->tcp_mstamp; in bbr_init()
1112 struct tcp_sock *tp = tcp_sk(sk); in bbr_get_info() local
1116 bw = bw * tp->mss_cache * USEC_PER_SEC >> BW_SCALE; in bbr_get_info()