Lines Matching refs:tp

386 static inline bool tcp_ecn_mode_any(const struct tcp_sock *tp)  in tcp_ecn_mode_any()  argument
388 return tp->ecn_flags & TCP_ECN_MODE_ANY; in tcp_ecn_mode_any()
391 static inline bool tcp_ecn_mode_rfc3168(const struct tcp_sock *tp) in tcp_ecn_mode_rfc3168() argument
393 return (tp->ecn_flags & TCP_ECN_MODE_ANY) == TCP_ECN_MODE_RFC3168; in tcp_ecn_mode_rfc3168()
396 static inline bool tcp_ecn_mode_accecn(const struct tcp_sock *tp) in tcp_ecn_mode_accecn() argument
398 return (tp->ecn_flags & TCP_ECN_MODE_ANY) == TCP_ECN_MODE_ACCECN; in tcp_ecn_mode_accecn()
401 static inline bool tcp_ecn_disabled(const struct tcp_sock *tp) in tcp_ecn_disabled() argument
403 return !tcp_ecn_mode_any(tp); in tcp_ecn_disabled()
406 static inline bool tcp_ecn_mode_pending(const struct tcp_sock *tp) in tcp_ecn_mode_pending() argument
408 return (tp->ecn_flags & TCP_ECN_MODE_PENDING) == TCP_ECN_MODE_PENDING; in tcp_ecn_mode_pending()
411 static inline void tcp_ecn_mode_set(struct tcp_sock *tp, u8 mode) in tcp_ecn_mode_set() argument
413 tp->ecn_flags &= ~TCP_ECN_MODE_ANY; in tcp_ecn_mode_set()
414 tp->ecn_flags |= mode; in tcp_ecn_mode_set()
438 void tcp_clear_retrans(struct tcp_sock *tp);
685 void tcp_mark_push(struct tcp_sock *tp, struct sk_buff *skb);
758 static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) in tcp_bound_to_half_wnd() argument
769 if (tp->max_window > TCP_MSS_DEFAULT) in tcp_bound_to_half_wnd()
770 cutoff = (tp->max_window >> 1); in tcp_bound_to_half_wnd()
772 cutoff = tp->max_window; in tcp_bound_to_half_wnd()
775 return max_t(int, cutoff, 68U - tp->tcp_header_len); in tcp_bound_to_half_wnd()
809 static inline u32 __tcp_set_rto(const struct tcp_sock *tp) in __tcp_set_rto() argument
811 return usecs_to_jiffies((tp->srtt_us >> 3) + tp->rttvar_us); in __tcp_set_rto()
814 static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) in __tcp_fast_path_on() argument
817 if (sk_is_mptcp((struct sock *)tp)) in __tcp_fast_path_on()
820 tp->pred_flags = htonl((tp->tcp_header_len << 26) | in __tcp_fast_path_on()
825 static inline void tcp_fast_path_on(struct tcp_sock *tp) in tcp_fast_path_on() argument
827 __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale); in tcp_fast_path_on()
832 struct tcp_sock *tp = tcp_sk(sk); in tcp_fast_path_check() local
834 if (RB_EMPTY_ROOT(&tp->out_of_order_queue) && in tcp_fast_path_check()
835 tp->rcv_wnd && in tcp_fast_path_check()
837 !tp->urg_data) in tcp_fast_path_check()
838 tcp_fast_path_on(tp); in tcp_fast_path_check()
865 static inline u32 tcp_min_rtt(const struct tcp_sock *tp) in tcp_min_rtt() argument
867 return minmax_get(&tp->rtt_min); in tcp_min_rtt()
874 static inline u32 tcp_receive_window(const struct tcp_sock *tp) in tcp_receive_window() argument
876 s32 win = tp->rcv_wup + tp->rcv_wnd - tp->rcv_nxt; in tcp_receive_window()
929 static inline u32 tcp_time_stamp_ms(const struct tcp_sock *tp) in tcp_time_stamp_ms() argument
931 return div_u64(tp->tcp_mstamp, USEC_PER_MSEC); in tcp_time_stamp_ms()
934 static inline u32 tcp_time_stamp_ts(const struct tcp_sock *tp) in tcp_time_stamp_ts() argument
936 if (tp->tcp_usec_ts) in tcp_time_stamp_ts()
937 return tp->tcp_mstamp; in tcp_time_stamp_ts()
938 return tcp_time_stamp_ms(tp); in tcp_time_stamp_ts()
941 void tcp_mstamp_refresh(struct tcp_sock *tp);
1288 u32 tcp_slow_start(struct tcp_sock *tp, u32 acked);
1289 void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w, u32 acked);
1346 static inline int tcp_is_sack(const struct tcp_sock *tp) in tcp_is_sack() argument
1348 return likely(tp->rx_opt.sack_ok); in tcp_is_sack()
1351 static inline bool tcp_is_reno(const struct tcp_sock *tp) in tcp_is_reno() argument
1353 return !tcp_is_sack(tp); in tcp_is_reno()
1356 static inline unsigned int tcp_left_out(const struct tcp_sock *tp) in tcp_left_out() argument
1358 return tp->sacked_out + tp->lost_out; in tcp_left_out()
1375 static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp) in tcp_packets_in_flight() argument
1377 return tp->packets_out - tcp_left_out(tp) + tp->retrans_out; in tcp_packets_in_flight()
1382 static inline u32 tcp_snd_cwnd(const struct tcp_sock *tp) in tcp_snd_cwnd() argument
1384 return tp->snd_cwnd; in tcp_snd_cwnd()
1387 static inline void tcp_snd_cwnd_set(struct tcp_sock *tp, u32 val) in tcp_snd_cwnd_set() argument
1390 tp->snd_cwnd = val; in tcp_snd_cwnd_set()
1393 static inline bool tcp_in_slow_start(const struct tcp_sock *tp) in tcp_in_slow_start() argument
1395 return tcp_snd_cwnd(tp) < tp->snd_ssthresh; in tcp_in_slow_start()
1398 static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp) in tcp_in_initial_slowstart() argument
1400 return tp->snd_ssthresh >= TCP_INFINITE_SSTHRESH; in tcp_in_initial_slowstart()
1415 const struct tcp_sock *tp = tcp_sk(sk); in tcp_current_ssthresh() local
1418 return tp->snd_ssthresh; in tcp_current_ssthresh()
1420 return max(tp->snd_ssthresh, in tcp_current_ssthresh()
1421 ((tcp_snd_cwnd(tp) >> 1) + in tcp_current_ssthresh()
1422 (tcp_snd_cwnd(tp) >> 2))); in tcp_current_ssthresh()
1426 #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) argument
1429 __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst);
1434 static inline __u32 tcp_max_tso_deferred_mss(const struct tcp_sock *tp) in tcp_max_tso_deferred_mss() argument
1440 static inline u32 tcp_wnd_end(const struct tcp_sock *tp) in tcp_wnd_end() argument
1442 return tp->snd_una + tp->snd_wnd; in tcp_wnd_end()
1460 const struct tcp_sock *tp = tcp_sk(sk); in tcp_is_cwnd_limited() local
1462 if (tp->is_cwnd_limited) in tcp_is_cwnd_limited()
1466 if (tcp_in_slow_start(tp)) in tcp_is_cwnd_limited()
1467 return tcp_snd_cwnd(tp) < 2 * tp->max_packets_out; in tcp_is_cwnd_limited()
1533 static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq) in tcp_init_wl() argument
1535 tp->snd_wl1 = seq; in tcp_init_wl()
1538 static inline void tcp_update_wl(struct tcp_sock *tp, u32 seq) in tcp_update_wl() argument
1540 tp->snd_wl1 = seq; in tcp_update_wl()
1578 struct tcp_sock *tp = tcp_sk(sk); in tcp_slow_start_after_idle_check() local
1582 tp->packets_out || ca_ops->cong_control) in tcp_slow_start_after_idle_check()
1584 delta = tcp_jiffies32 - tp->lsndtime; in tcp_slow_start_after_idle_check()
1647 struct tcp_sock *tp = tcp_sk(sk); in __tcp_adjust_rcv_ssthresh() local
1649 tp->rcv_ssthresh = min(tp->rcv_ssthresh, new_ssthresh); in __tcp_adjust_rcv_ssthresh()
1651 tp->rcv_ssthresh = max_t(u32, tp->rcv_ssthresh, in __tcp_adjust_rcv_ssthresh()
1684 const struct tcp_sock *tp = tcp_sk(sk); in tcp_epollin_ready() local
1685 int avail = READ_ONCE(tp->rcv_nxt) - READ_ONCE(tp->copied_seq); in tcp_epollin_ready()
1691 (tcp_receive_window(tp) <= inet_csk(sk)->icsk_ack.rcv_mss); in tcp_epollin_ready()
1701 static inline int keepalive_intvl_when(const struct tcp_sock *tp) in keepalive_intvl_when() argument
1703 struct net *net = sock_net((struct sock *)tp); in keepalive_intvl_when()
1709 val = READ_ONCE(tp->keepalive_intvl); in keepalive_intvl_when()
1714 static inline int keepalive_time_when(const struct tcp_sock *tp) in keepalive_time_when() argument
1716 struct net *net = sock_net((struct sock *)tp); in keepalive_time_when()
1720 val = READ_ONCE(tp->keepalive_time); in keepalive_time_when()
1725 static inline int keepalive_probes(const struct tcp_sock *tp) in keepalive_probes() argument
1727 struct net *net = sock_net((struct sock *)tp); in keepalive_probes()
1733 val = READ_ONCE(tp->keepalive_probes); in keepalive_probes()
1738 static inline u32 keepalive_time_elapsed(const struct tcp_sock *tp) in keepalive_time_elapsed() argument
1740 const struct inet_connection_sock *icsk = &tp->inet_conn; in keepalive_time_elapsed()
1743 tcp_jiffies32 - tp->rcv_tstamp); in keepalive_time_elapsed()
1813 static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp) in tcp_clear_all_retrans_hints() argument
1815 tp->retransmit_skb_hint = NULL; in tcp_clear_all_retrans_hints()
1974 void tcp_free_fastopen_req(struct tcp_sock *tp);
2107 const struct tcp_sock *tp = tcp_sk(sk); in tcp_write_queue_empty() local
2109 return tp->write_seq == tp->snd_nxt; in tcp_write_queue_empty()
2171 struct tcp_sock *tp = tcp_sk(sk); in tcp_push_pending_frames() local
2173 __tcp_push_pending_frames(sk, tcp_current_mss(sk), tp->nonagle); in tcp_push_pending_frames()
2181 static inline u32 tcp_highest_sack_seq(struct tcp_sock *tp) in tcp_highest_sack_seq() argument
2183 if (!tp->sacked_out) in tcp_highest_sack_seq()
2184 return tp->snd_una; in tcp_highest_sack_seq()
2186 if (tp->highest_sack == NULL) in tcp_highest_sack_seq()
2187 return tp->snd_nxt; in tcp_highest_sack_seq()
2189 return TCP_SKB_CB(tp->highest_sack)->seq; in tcp_highest_sack_seq()
2231 static inline bool tcp_stream_is_thin(struct tcp_sock *tp) in tcp_stream_is_thin() argument
2233 return tp->packets_out < 4 && !tcp_in_initial_slowstart(tp); in tcp_stream_is_thin()
2281 static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp) in tcp_notsent_lowat() argument
2283 struct net *net = sock_net((struct sock *)tp); in tcp_notsent_lowat()
2286 val = READ_ONCE(tp->notsent_lowat); in tcp_notsent_lowat()
2412 const struct tcp_sock *tp = tcp_sk(sk); in tcp_get_current_key() local
2419 ao = rcu_dereference_protected(tp->ao_info, in tcp_get_current_key()
2430 rcu_access_pointer(tp->md5sig_info)) { in tcp_get_current_key()
2431 out->md5_key = tp->af_specific->md5_lookup(sk, sk); in tcp_get_current_key()
2463 extern s32 tcp_rack_skb_timeout(struct tcp_sock *tp, struct sk_buff *skb,
2466 extern void tcp_rack_advance(struct tcp_sock *tp, u8 sacked, u32 end_seq,
2568 struct tcp_sock *tp = tcp_sk(sk); in tcp_inq() local
2574 !tp->urg_data || in tcp_inq()
2575 before(tp->urg_seq, tp->copied_seq) || in tcp_inq()
2576 !before(tp->urg_seq, tp->rcv_nxt)) { in tcp_inq()
2578 answ = tp->rcv_nxt - tp->copied_seq; in tcp_inq()
2584 answ = tp->urg_seq - tp->copied_seq; in tcp_inq()
2592 static inline void tcp_segs_in(struct tcp_sock *tp, const struct sk_buff *skb) in tcp_segs_in() argument
2601 WRITE_ONCE(tp->segs_in, tp->segs_in + segs_in); in tcp_segs_in()
2603 WRITE_ONCE(tp->data_segs_in, tp->data_segs_in + segs_in); in tcp_segs_in()
2812 void clean_acked_data_enable(struct tcp_sock *tp,
2814 void clean_acked_data_disable(struct tcp_sock *tp);
2820 const struct tcp_sock *tp) in tcp_add_tx_delay() argument
2823 skb->skb_mstamp_ns += (u64)tp->tcp_tx_delay * NSEC_PER_USEC; in tcp_add_tx_delay()