Lines Matching refs:tp
386 void tcp_clear_retrans(struct tcp_sock *tp);
579 void tcp_mark_push(struct tcp_sock *tp, struct sk_buff *skb);
616 void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp, struct sk_buff *skb);
638 static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) in tcp_bound_to_half_wnd() argument
649 if (tp->max_window > TCP_MSS_DEFAULT) in tcp_bound_to_half_wnd()
650 cutoff = (tp->max_window >> 1); in tcp_bound_to_half_wnd()
652 cutoff = tp->max_window; in tcp_bound_to_half_wnd()
655 return max_t(int, cutoff, 68U - tp->tcp_header_len); in tcp_bound_to_half_wnd()
679 static inline u32 __tcp_set_rto(const struct tcp_sock *tp) in __tcp_set_rto() argument
681 return usecs_to_jiffies((tp->srtt_us >> 3) + tp->rttvar_us); in __tcp_set_rto()
684 static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) in __tcp_fast_path_on() argument
687 if (sk_is_mptcp((struct sock *)tp)) in __tcp_fast_path_on()
690 tp->pred_flags = htonl((tp->tcp_header_len << 26) | in __tcp_fast_path_on()
695 static inline void tcp_fast_path_on(struct tcp_sock *tp) in tcp_fast_path_on() argument
697 __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale); in tcp_fast_path_on()
702 struct tcp_sock *tp = tcp_sk(sk); in tcp_fast_path_check() local
704 if (RB_EMPTY_ROOT(&tp->out_of_order_queue) && in tcp_fast_path_check()
705 tp->rcv_wnd && in tcp_fast_path_check()
707 !tp->urg_data) in tcp_fast_path_check()
708 tcp_fast_path_on(tp); in tcp_fast_path_check()
733 static inline u32 tcp_min_rtt(const struct tcp_sock *tp) in tcp_min_rtt() argument
735 return minmax_get(&tp->rtt_min); in tcp_min_rtt()
742 static inline u32 tcp_receive_window(const struct tcp_sock *tp) in tcp_receive_window() argument
744 s32 win = tp->rcv_wup + tp->rcv_wnd - tp->rcv_nxt; in tcp_receive_window()
783 static inline u32 tcp_time_stamp(const struct tcp_sock *tp) in tcp_time_stamp() argument
785 return div_u64(tp->tcp_mstamp, USEC_PER_SEC / TCP_TS_HZ); in tcp_time_stamp()
800 void tcp_mstamp_refresh(struct tcp_sock *tp);
1108 u32 tcp_slow_start(struct tcp_sock *tp, u32 acked);
1109 void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w, u32 acked);
1172 static inline int tcp_is_sack(const struct tcp_sock *tp) in tcp_is_sack() argument
1174 return likely(tp->rx_opt.sack_ok); in tcp_is_sack()
1177 static inline bool tcp_is_reno(const struct tcp_sock *tp) in tcp_is_reno() argument
1179 return !tcp_is_sack(tp); in tcp_is_reno()
1182 static inline unsigned int tcp_left_out(const struct tcp_sock *tp) in tcp_left_out() argument
1184 return tp->sacked_out + tp->lost_out; in tcp_left_out()
1201 static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp) in tcp_packets_in_flight() argument
1203 return tp->packets_out - tcp_left_out(tp) + tp->retrans_out; in tcp_packets_in_flight()
1208 static inline u32 tcp_snd_cwnd(const struct tcp_sock *tp) in tcp_snd_cwnd() argument
1210 return tp->snd_cwnd; in tcp_snd_cwnd()
1213 static inline void tcp_snd_cwnd_set(struct tcp_sock *tp, u32 val) in tcp_snd_cwnd_set() argument
1216 tp->snd_cwnd = val; in tcp_snd_cwnd_set()
1219 static inline bool tcp_in_slow_start(const struct tcp_sock *tp) in tcp_in_slow_start() argument
1221 return tcp_snd_cwnd(tp) < tp->snd_ssthresh; in tcp_in_slow_start()
1224 static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp) in tcp_in_initial_slowstart() argument
1226 return tp->snd_ssthresh >= TCP_INFINITE_SSTHRESH; in tcp_in_initial_slowstart()
1241 const struct tcp_sock *tp = tcp_sk(sk); in tcp_current_ssthresh() local
1244 return tp->snd_ssthresh; in tcp_current_ssthresh()
1246 return max(tp->snd_ssthresh, in tcp_current_ssthresh()
1247 ((tcp_snd_cwnd(tp) >> 1) + in tcp_current_ssthresh()
1248 (tcp_snd_cwnd(tp) >> 2))); in tcp_current_ssthresh()
1252 #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) argument
1255 __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst);
1260 static inline __u32 tcp_max_tso_deferred_mss(const struct tcp_sock *tp) in tcp_max_tso_deferred_mss() argument
1266 static inline u32 tcp_wnd_end(const struct tcp_sock *tp) in tcp_wnd_end() argument
1268 return tp->snd_una + tp->snd_wnd; in tcp_wnd_end()
1286 const struct tcp_sock *tp = tcp_sk(sk); in tcp_is_cwnd_limited() local
1288 if (tp->is_cwnd_limited) in tcp_is_cwnd_limited()
1292 if (tcp_in_slow_start(tp)) in tcp_is_cwnd_limited()
1293 return tcp_snd_cwnd(tp) < 2 * tp->max_packets_out; in tcp_is_cwnd_limited()
1357 static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq) in tcp_init_wl() argument
1359 tp->snd_wl1 = seq; in tcp_init_wl()
1362 static inline void tcp_update_wl(struct tcp_sock *tp, u32 seq) in tcp_update_wl() argument
1364 tp->snd_wl1 = seq; in tcp_update_wl()
1399 struct tcp_sock *tp = tcp_sk(sk); in tcp_slow_start_after_idle_check() local
1403 tp->packets_out || ca_ops->cong_control) in tcp_slow_start_after_idle_check()
1405 delta = tcp_jiffies32 - tp->lsndtime; in tcp_slow_start_after_idle_check()
1460 const struct tcp_sock *tp = tcp_sk(sk); in tcp_epollin_ready() local
1461 int avail = READ_ONCE(tp->rcv_nxt) - READ_ONCE(tp->copied_seq); in tcp_epollin_ready()
1467 (tcp_receive_window(tp) <= inet_csk(sk)->icsk_ack.rcv_mss); in tcp_epollin_ready()
1477 static inline int keepalive_intvl_when(const struct tcp_sock *tp) in keepalive_intvl_when() argument
1479 struct net *net = sock_net((struct sock *)tp); in keepalive_intvl_when()
1485 val = READ_ONCE(tp->keepalive_intvl); in keepalive_intvl_when()
1490 static inline int keepalive_time_when(const struct tcp_sock *tp) in keepalive_time_when() argument
1492 struct net *net = sock_net((struct sock *)tp); in keepalive_time_when()
1496 val = READ_ONCE(tp->keepalive_time); in keepalive_time_when()
1501 static inline int keepalive_probes(const struct tcp_sock *tp) in keepalive_probes() argument
1503 struct net *net = sock_net((struct sock *)tp); in keepalive_probes()
1509 val = READ_ONCE(tp->keepalive_probes); in keepalive_probes()
1514 static inline u32 keepalive_time_elapsed(const struct tcp_sock *tp) in keepalive_time_elapsed() argument
1516 const struct inet_connection_sock *icsk = &tp->inet_conn; in keepalive_time_elapsed()
1519 tcp_jiffies32 - tp->rcv_tstamp); in keepalive_time_elapsed()
1589 static inline void tcp_clear_retrans_hints_partial(struct tcp_sock *tp) in tcp_clear_retrans_hints_partial() argument
1591 tp->lost_skb_hint = NULL; in tcp_clear_retrans_hints_partial()
1594 static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp) in tcp_clear_all_retrans_hints() argument
1596 tcp_clear_retrans_hints_partial(tp); in tcp_clear_all_retrans_hints()
1597 tp->retransmit_skb_hint = NULL; in tcp_clear_all_retrans_hints()
1719 void tcp_free_fastopen_req(struct tcp_sock *tp);
1857 const struct tcp_sock *tp = tcp_sk(sk); in tcp_write_queue_empty() local
1859 return tp->write_seq == tp->snd_nxt; in tcp_write_queue_empty()
1913 struct tcp_sock *tp = tcp_sk(sk); in tcp_push_pending_frames() local
1915 __tcp_push_pending_frames(sk, tcp_current_mss(sk), tp->nonagle); in tcp_push_pending_frames()
1923 static inline u32 tcp_highest_sack_seq(struct tcp_sock *tp) in tcp_highest_sack_seq() argument
1925 if (!tp->sacked_out) in tcp_highest_sack_seq()
1926 return tp->snd_una; in tcp_highest_sack_seq()
1928 if (tp->highest_sack == NULL) in tcp_highest_sack_seq()
1929 return tp->snd_nxt; in tcp_highest_sack_seq()
1931 return TCP_SKB_CB(tp->highest_sack)->seq; in tcp_highest_sack_seq()
1973 static inline bool tcp_stream_is_thin(struct tcp_sock *tp) in tcp_stream_is_thin() argument
1975 return tp->packets_out < 4 && !tcp_in_initial_slowstart(tp); in tcp_stream_is_thin()
2016 static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp) in tcp_notsent_lowat() argument
2018 struct net *net = sock_net((struct sock *)tp); in tcp_notsent_lowat()
2021 val = READ_ONCE(tp->notsent_lowat); in tcp_notsent_lowat()
2112 extern s32 tcp_rack_skb_timeout(struct tcp_sock *tp, struct sk_buff *skb,
2115 extern void tcp_rack_advance(struct tcp_sock *tp, u8 sacked, u32 end_seq,
2168 struct tcp_sock *tp = tcp_sk(sk); in tcp_inq() local
2174 !tp->urg_data || in tcp_inq()
2175 before(tp->urg_seq, tp->copied_seq) || in tcp_inq()
2176 !before(tp->urg_seq, tp->rcv_nxt)) { in tcp_inq()
2178 answ = tp->rcv_nxt - tp->copied_seq; in tcp_inq()
2184 answ = tp->urg_seq - tp->copied_seq; in tcp_inq()
2192 static inline void tcp_segs_in(struct tcp_sock *tp, const struct sk_buff *skb) in tcp_segs_in() argument
2197 tp->segs_in += segs_in; in tcp_segs_in()
2199 tp->data_segs_in += segs_in; in tcp_segs_in()
2403 const struct tcp_sock *tp) in tcp_add_tx_delay() argument
2406 skb->skb_mstamp_ns += (u64)tp->tcp_tx_delay * NSEC_PER_USEC; in tcp_add_tx_delay()