Lines Matching refs:tp
415 void tcp_clear_retrans(struct tcp_sock *tp);
424 void tcp_disable_fack(struct tcp_sock *tp);
556 static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) in tcp_bound_to_half_wnd() argument
567 if (tp->max_window >= 512) in tcp_bound_to_half_wnd()
568 cutoff = (tp->max_window >> 1); in tcp_bound_to_half_wnd()
570 cutoff = tp->max_window; in tcp_bound_to_half_wnd()
573 return max_t(int, cutoff, 68U - tp->tcp_header_len); in tcp_bound_to_half_wnd()
600 static inline u32 __tcp_set_rto(const struct tcp_sock *tp) in __tcp_set_rto() argument
602 return usecs_to_jiffies((tp->srtt_us >> 3) + tp->rttvar_us); in __tcp_set_rto()
605 static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) in __tcp_fast_path_on() argument
607 tp->pred_flags = htonl((tp->tcp_header_len << 26) | in __tcp_fast_path_on()
612 static inline void tcp_fast_path_on(struct tcp_sock *tp) in tcp_fast_path_on() argument
614 __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale); in tcp_fast_path_on()
619 struct tcp_sock *tp = tcp_sk(sk); in tcp_fast_path_check() local
621 if (skb_queue_empty(&tp->out_of_order_queue) && in tcp_fast_path_check()
622 tp->rcv_wnd && in tcp_fast_path_check()
624 !tp->urg_data) in tcp_fast_path_check()
625 tcp_fast_path_on(tp); in tcp_fast_path_check()
653 static inline u32 tcp_receive_window(const struct tcp_sock *tp) in tcp_receive_window() argument
655 s32 win = tp->rcv_wup + tp->rcv_wnd - tp->rcv_nxt; in tcp_receive_window()
853 u32 tcp_slow_start(struct tcp_sock *tp, u32 acked);
854 void tcp_cong_avoid_ai(struct tcp_sock *tp, u32 w, u32 acked);
903 static inline int tcp_is_sack(const struct tcp_sock *tp) in tcp_is_sack() argument
905 return tp->rx_opt.sack_ok; in tcp_is_sack()
908 static inline bool tcp_is_reno(const struct tcp_sock *tp) in tcp_is_reno() argument
910 return !tcp_is_sack(tp); in tcp_is_reno()
913 static inline bool tcp_is_fack(const struct tcp_sock *tp) in tcp_is_fack() argument
915 return tp->rx_opt.sack_ok & TCP_FACK_ENABLED; in tcp_is_fack()
918 static inline void tcp_enable_fack(struct tcp_sock *tp) in tcp_enable_fack() argument
920 tp->rx_opt.sack_ok |= TCP_FACK_ENABLED; in tcp_enable_fack()
926 static inline void tcp_enable_early_retrans(struct tcp_sock *tp) in tcp_enable_early_retrans() argument
928 tp->do_early_retrans = sysctl_tcp_early_retrans && in tcp_enable_early_retrans()
933 static inline void tcp_disable_early_retrans(struct tcp_sock *tp) in tcp_disable_early_retrans() argument
935 tp->do_early_retrans = 0; in tcp_disable_early_retrans()
938 static inline unsigned int tcp_left_out(const struct tcp_sock *tp) in tcp_left_out() argument
940 return tp->sacked_out + tp->lost_out; in tcp_left_out()
957 static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp) in tcp_packets_in_flight() argument
959 return tp->packets_out - tcp_left_out(tp) + tp->retrans_out; in tcp_packets_in_flight()
964 static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp) in tcp_in_initial_slowstart() argument
966 return tp->snd_ssthresh >= TCP_INFINITE_SSTHRESH; in tcp_in_initial_slowstart()
981 const struct tcp_sock *tp = tcp_sk(sk); in tcp_current_ssthresh() local
984 return tp->snd_ssthresh; in tcp_current_ssthresh()
986 return max(tp->snd_ssthresh, in tcp_current_ssthresh()
987 ((tp->snd_cwnd >> 1) + in tcp_current_ssthresh()
988 (tp->snd_cwnd >> 2))); in tcp_current_ssthresh()
992 #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) argument
995 __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst);
1000 static inline __u32 tcp_max_tso_deferred_mss(const struct tcp_sock *tp) in tcp_max_tso_deferred_mss() argument
1011 static __inline__ __u32 tcp_max_burst(const struct tcp_sock *tp) in tcp_max_burst() argument
1013 return tp->reordering; in tcp_max_burst()
1017 static inline u32 tcp_wnd_end(const struct tcp_sock *tp) in tcp_wnd_end() argument
1019 return tp->snd_una + tp->snd_wnd; in tcp_wnd_end()
1037 const struct tcp_sock *tp = tcp_sk(sk); in tcp_is_cwnd_limited() local
1040 if (tp->snd_cwnd <= tp->snd_ssthresh) in tcp_is_cwnd_limited()
1041 return tp->snd_cwnd < 2 * tp->max_packets_out; in tcp_is_cwnd_limited()
1043 return tp->is_cwnd_limited; in tcp_is_cwnd_limited()
1048 const struct tcp_sock *tp = tcp_sk(sk); in tcp_check_probe_timer() local
1051 if (!tp->packets_out && !icsk->icsk_pending) in tcp_check_probe_timer()
1056 static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq) in tcp_init_wl() argument
1058 tp->snd_wl1 = seq; in tcp_init_wl()
1061 static inline void tcp_update_wl(struct tcp_sock *tp, u32 seq) in tcp_update_wl() argument
1063 tp->snd_wl1 = seq; in tcp_update_wl()
1088 static inline void tcp_prequeue_init(struct tcp_sock *tp) in tcp_prequeue_init() argument
1090 tp->ucopy.task = NULL; in tcp_prequeue_init()
1091 tp->ucopy.len = 0; in tcp_prequeue_init()
1092 tp->ucopy.memory = 0; in tcp_prequeue_init()
1093 skb_queue_head_init(&tp->ucopy.prequeue); in tcp_prequeue_init()
1148 static inline int keepalive_intvl_when(const struct tcp_sock *tp) in keepalive_intvl_when() argument
1150 return tp->keepalive_intvl ? : sysctl_tcp_keepalive_intvl; in keepalive_intvl_when()
1153 static inline int keepalive_time_when(const struct tcp_sock *tp) in keepalive_time_when() argument
1155 return tp->keepalive_time ? : sysctl_tcp_keepalive_time; in keepalive_time_when()
1158 static inline int keepalive_probes(const struct tcp_sock *tp) in keepalive_probes() argument
1160 return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes; in keepalive_probes()
1163 static inline u32 keepalive_time_elapsed(const struct tcp_sock *tp) in keepalive_time_elapsed() argument
1165 const struct inet_connection_sock *icsk = &tp->inet_conn; in keepalive_time_elapsed()
1168 tcp_time_stamp - tp->rcv_tstamp); in keepalive_time_elapsed()
1235 static inline void tcp_clear_retrans_hints_partial(struct tcp_sock *tp) in tcp_clear_retrans_hints_partial() argument
1237 tp->lost_skb_hint = NULL; in tcp_clear_retrans_hints_partial()
1240 static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp) in tcp_clear_all_retrans_hints() argument
1242 tcp_clear_retrans_hints_partial(tp); in tcp_clear_all_retrans_hints()
1243 tp->retransmit_skb_hint = NULL; in tcp_clear_all_retrans_hints()
1354 void tcp_free_fastopen_req(struct tcp_sock *tp);
1499 struct tcp_sock *tp = tcp_sk(sk); in tcp_push_pending_frames() local
1501 __tcp_push_pending_frames(sk, tcp_current_mss(sk), tp->nonagle); in tcp_push_pending_frames()
1509 static inline u32 tcp_highest_sack_seq(struct tcp_sock *tp) in tcp_highest_sack_seq() argument
1511 if (!tp->sacked_out) in tcp_highest_sack_seq()
1512 return tp->snd_una; in tcp_highest_sack_seq()
1514 if (tp->highest_sack == NULL) in tcp_highest_sack_seq()
1515 return tp->snd_nxt; in tcp_highest_sack_seq()
1517 return TCP_SKB_CB(tp->highest_sack)->seq; in tcp_highest_sack_seq()
1548 static inline bool tcp_stream_is_thin(struct tcp_sock *tp) in tcp_stream_is_thin() argument
1550 return tp->packets_out < 4 && !tcp_in_initial_slowstart(tp); in tcp_stream_is_thin()
1594 static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp) in tcp_notsent_lowat() argument
1596 return tp->notsent_lowat ?: sysctl_tcp_notsent_lowat; in tcp_notsent_lowat()
1601 const struct tcp_sock *tp = tcp_sk(sk); in tcp_stream_memory_free() local
1602 u32 notsent_bytes = tp->write_seq - tp->snd_nxt; in tcp_stream_memory_free()
1604 return notsent_bytes < tcp_notsent_lowat(tp); in tcp_stream_memory_free()