Lines Matching refs:lp

77 struct lp {  struct
99 struct lp *lp = inet_csk_ca(sk); in tcp_lp_init() argument
101 lp->flag = 0; in tcp_lp_init()
102 lp->sowd = 0; in tcp_lp_init()
103 lp->owd_min = 0xffffffff; in tcp_lp_init()
104 lp->owd_max = 0; in tcp_lp_init()
105 lp->owd_max_rsv = 0; in tcp_lp_init()
106 lp->remote_hz = 0; in tcp_lp_init()
107 lp->remote_ref_time = 0; in tcp_lp_init()
108 lp->local_ref_time = 0; in tcp_lp_init()
109 lp->last_drop = 0; in tcp_lp_init()
110 lp->inference = 0; in tcp_lp_init()
123 struct lp *lp = inet_csk_ca(sk); in tcp_lp_cong_avoid() local
125 if (!(lp->flag & LP_WITHIN_INF)) in tcp_lp_cong_avoid()
140 struct lp *lp = inet_csk_ca(sk); in tcp_lp_remote_hz_estimator() local
141 s64 rhz = lp->remote_hz << 6; /* remote HZ << 6 */ in tcp_lp_remote_hz_estimator()
146 if (lp->remote_ref_time == 0 || lp->local_ref_time == 0) in tcp_lp_remote_hz_estimator()
150 if (tp->rx_opt.rcv_tsval == lp->remote_ref_time || in tcp_lp_remote_hz_estimator()
151 tp->rx_opt.rcv_tsecr == lp->local_ref_time) in tcp_lp_remote_hz_estimator()
155 (tp->rx_opt.rcv_tsval - lp->remote_ref_time) / in tcp_lp_remote_hz_estimator()
156 (tp->rx_opt.rcv_tsecr - lp->local_ref_time); in tcp_lp_remote_hz_estimator()
169 lp->flag |= LP_VALID_RHZ; in tcp_lp_remote_hz_estimator()
171 lp->flag &= ~LP_VALID_RHZ; in tcp_lp_remote_hz_estimator()
174 lp->remote_ref_time = tp->rx_opt.rcv_tsval; in tcp_lp_remote_hz_estimator()
175 lp->local_ref_time = tp->rx_opt.rcv_tsecr; in tcp_lp_remote_hz_estimator()
194 struct lp *lp = inet_csk_ca(sk); in tcp_lp_owd_calculator() local
197 lp->remote_hz = tcp_lp_remote_hz_estimator(sk); in tcp_lp_owd_calculator()
199 if (lp->flag & LP_VALID_RHZ) { in tcp_lp_owd_calculator()
201 tp->rx_opt.rcv_tsval * (LP_RESOL / lp->remote_hz) - in tcp_lp_owd_calculator()
208 lp->flag |= LP_VALID_OWD; in tcp_lp_owd_calculator()
210 lp->flag &= ~LP_VALID_OWD; in tcp_lp_owd_calculator()
229 struct lp *lp = inet_csk_ca(sk); in tcp_lp_rtt_sample() local
233 if (!(lp->flag & LP_VALID_RHZ) || !(lp->flag & LP_VALID_OWD)) in tcp_lp_rtt_sample()
237 if (mowd < lp->owd_min) in tcp_lp_rtt_sample()
238 lp->owd_min = mowd; in tcp_lp_rtt_sample()
242 if (mowd > lp->owd_max) { in tcp_lp_rtt_sample()
243 if (mowd > lp->owd_max_rsv) { in tcp_lp_rtt_sample()
244 if (lp->owd_max_rsv == 0) in tcp_lp_rtt_sample()
245 lp->owd_max = mowd; in tcp_lp_rtt_sample()
247 lp->owd_max = lp->owd_max_rsv; in tcp_lp_rtt_sample()
248 lp->owd_max_rsv = mowd; in tcp_lp_rtt_sample()
250 lp->owd_max = mowd; in tcp_lp_rtt_sample()
254 if (lp->sowd != 0) { in tcp_lp_rtt_sample()
255 mowd -= lp->sowd >> 3; /* m is now error in owd est */ in tcp_lp_rtt_sample()
256 lp->sowd += mowd; /* owd = 7/8 owd + 1/8 new */ in tcp_lp_rtt_sample()
258 lp->sowd = mowd << 3; /* take the measured time be owd */ in tcp_lp_rtt_sample()
274 struct lp *lp = inet_csk_ca(sk); in tcp_lp_pkts_acked() local
284 lp->inference = 3 * delta; in tcp_lp_pkts_acked()
287 if (lp->last_drop && (now - lp->last_drop < lp->inference)) in tcp_lp_pkts_acked()
288 lp->flag |= LP_WITHIN_INF; in tcp_lp_pkts_acked()
290 lp->flag &= ~LP_WITHIN_INF; in tcp_lp_pkts_acked()
293 if (lp->sowd >> 3 < in tcp_lp_pkts_acked()
294 lp->owd_min + 15 * (lp->owd_max - lp->owd_min) / 100) in tcp_lp_pkts_acked()
295 lp->flag |= LP_WITHIN_THR; in tcp_lp_pkts_acked()
297 lp->flag &= ~LP_WITHIN_THR; in tcp_lp_pkts_acked()
299 pr_debug("TCP-LP: %05o|%5u|%5u|%15u|%15u|%15u\n", lp->flag, in tcp_lp_pkts_acked()
300 tcp_snd_cwnd(tp), lp->remote_hz, lp->owd_min, lp->owd_max, in tcp_lp_pkts_acked()
301 lp->sowd >> 3); in tcp_lp_pkts_acked()
303 if (lp->flag & LP_WITHIN_THR) in tcp_lp_pkts_acked()
309 lp->owd_min = lp->sowd >> 3; in tcp_lp_pkts_acked()
310 lp->owd_max = lp->sowd >> 2; in tcp_lp_pkts_acked()
311 lp->owd_max_rsv = lp->sowd >> 2; in tcp_lp_pkts_acked()
315 if (lp->flag & LP_WITHIN_INF) in tcp_lp_pkts_acked()
324 lp->last_drop = now; in tcp_lp_pkts_acked()
340 BUILD_BUG_ON(sizeof(struct lp) > ICSK_CA_PRIV_SIZE); in tcp_lp_register()