Lines Matching refs:t
261 bool sctp_transport_pl_send(struct sctp_transport *t) in sctp_transport_pl_send() argument
263 if (t->pl.probe_count < SCTP_MAX_PROBES) in sctp_transport_pl_send()
266 t->pl.last_rtx_chunks = t->asoc->rtx_data_chunks; in sctp_transport_pl_send()
267 t->pl.probe_count = 0; in sctp_transport_pl_send()
268 if (t->pl.state == SCTP_PL_BASE) { in sctp_transport_pl_send()
269 if (t->pl.probe_size == SCTP_BASE_PLPMTU) { /* BASE_PLPMTU Confirmation Failed */ in sctp_transport_pl_send()
270 t->pl.state = SCTP_PL_ERROR; /* Base -> Error */ in sctp_transport_pl_send()
272 t->pl.pmtu = SCTP_BASE_PLPMTU; in sctp_transport_pl_send()
273 t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); in sctp_transport_pl_send()
274 sctp_assoc_sync_pmtu(t->asoc); in sctp_transport_pl_send()
276 } else if (t->pl.state == SCTP_PL_SEARCH) { in sctp_transport_pl_send()
277 if (t->pl.pmtu == t->pl.probe_size) { /* Black Hole Detected */ in sctp_transport_pl_send()
278 t->pl.state = SCTP_PL_BASE; /* Search -> Base */ in sctp_transport_pl_send()
279 t->pl.probe_size = SCTP_BASE_PLPMTU; in sctp_transport_pl_send()
280 t->pl.probe_high = 0; in sctp_transport_pl_send()
282 t->pl.pmtu = SCTP_BASE_PLPMTU; in sctp_transport_pl_send()
283 t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); in sctp_transport_pl_send()
284 sctp_assoc_sync_pmtu(t->asoc); in sctp_transport_pl_send()
286 t->pl.probe_high = t->pl.probe_size; in sctp_transport_pl_send()
287 t->pl.probe_size = t->pl.pmtu; in sctp_transport_pl_send()
289 } else if (t->pl.state == SCTP_PL_COMPLETE) { in sctp_transport_pl_send()
290 if (t->pl.pmtu == t->pl.probe_size) { /* Black Hole Detected */ in sctp_transport_pl_send()
291 t->pl.state = SCTP_PL_BASE; /* Search Complete -> Base */ in sctp_transport_pl_send()
292 t->pl.probe_size = SCTP_BASE_PLPMTU; in sctp_transport_pl_send()
294 t->pl.pmtu = SCTP_BASE_PLPMTU; in sctp_transport_pl_send()
295 t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); in sctp_transport_pl_send()
296 sctp_assoc_sync_pmtu(t->asoc); in sctp_transport_pl_send()
301 if (t->pl.state == SCTP_PL_COMPLETE && t->pl.raise_count < 30 && in sctp_transport_pl_send()
302 !t->pl.probe_count && t->pl.last_rtx_chunks == t->asoc->rtx_data_chunks) { in sctp_transport_pl_send()
303 t->pl.raise_count++; in sctp_transport_pl_send()
308 __func__, t, t->pl.state, t->pl.pmtu, t->pl.probe_size, t->pl.probe_high); in sctp_transport_pl_send()
310 t->pl.probe_count++; in sctp_transport_pl_send()
314 bool sctp_transport_pl_recv(struct sctp_transport *t) in sctp_transport_pl_recv() argument
317 __func__, t, t->pl.state, t->pl.pmtu, t->pl.probe_size, t->pl.probe_high); in sctp_transport_pl_recv()
319 t->pl.last_rtx_chunks = t->asoc->rtx_data_chunks; in sctp_transport_pl_recv()
320 t->pl.pmtu = t->pl.probe_size; in sctp_transport_pl_recv()
321 t->pl.probe_count = 0; in sctp_transport_pl_recv()
322 if (t->pl.state == SCTP_PL_BASE) { in sctp_transport_pl_recv()
323 t->pl.state = SCTP_PL_SEARCH; /* Base -> Search */ in sctp_transport_pl_recv()
324 t->pl.probe_size += SCTP_PL_BIG_STEP; in sctp_transport_pl_recv()
325 } else if (t->pl.state == SCTP_PL_ERROR) { in sctp_transport_pl_recv()
326 t->pl.state = SCTP_PL_SEARCH; /* Error -> Search */ in sctp_transport_pl_recv()
328 t->pl.pmtu = t->pl.probe_size; in sctp_transport_pl_recv()
329 t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); in sctp_transport_pl_recv()
330 sctp_assoc_sync_pmtu(t->asoc); in sctp_transport_pl_recv()
331 t->pl.probe_size += SCTP_PL_BIG_STEP; in sctp_transport_pl_recv()
332 } else if (t->pl.state == SCTP_PL_SEARCH) { in sctp_transport_pl_recv()
333 if (!t->pl.probe_high) { in sctp_transport_pl_recv()
334 if (t->pl.probe_size < SCTP_MAX_PLPMTU) { in sctp_transport_pl_recv()
335 t->pl.probe_size = min(t->pl.probe_size + SCTP_PL_BIG_STEP, in sctp_transport_pl_recv()
339 t->pl.probe_high = SCTP_MAX_PLPMTU; in sctp_transport_pl_recv()
341 t->pl.probe_size += SCTP_PL_MIN_STEP; in sctp_transport_pl_recv()
342 if (t->pl.probe_size >= t->pl.probe_high) { in sctp_transport_pl_recv()
343 t->pl.probe_high = 0; in sctp_transport_pl_recv()
344 t->pl.raise_count = 0; in sctp_transport_pl_recv()
345 t->pl.state = SCTP_PL_COMPLETE; /* Search -> Search Complete */ in sctp_transport_pl_recv()
347 t->pl.probe_size = t->pl.pmtu; in sctp_transport_pl_recv()
348 t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); in sctp_transport_pl_recv()
349 sctp_assoc_sync_pmtu(t->asoc); in sctp_transport_pl_recv()
351 } else if (t->pl.state == SCTP_PL_COMPLETE && t->pl.raise_count == 30) { in sctp_transport_pl_recv()
353 t->pl.state = SCTP_PL_SEARCH; /* Search Complete -> Search */ in sctp_transport_pl_recv()
354 t->pl.probe_size = min(t->pl.probe_size + SCTP_PL_MIN_STEP, SCTP_MAX_PLPMTU); in sctp_transport_pl_recv()
357 return t->pl.state == SCTP_PL_COMPLETE; in sctp_transport_pl_recv()
360 static bool sctp_transport_pl_toobig(struct sctp_transport *t, u32 pmtu) in sctp_transport_pl_toobig() argument
363 __func__, t, t->pl.state, t->pl.pmtu, t->pl.probe_size, pmtu); in sctp_transport_pl_toobig()
365 if (pmtu < SCTP_MIN_PLPMTU || pmtu >= t->pl.probe_size) in sctp_transport_pl_toobig()
368 if (t->pl.state == SCTP_PL_BASE) { in sctp_transport_pl_toobig()
370 t->pl.state = SCTP_PL_ERROR; /* Base -> Error */ in sctp_transport_pl_toobig()
372 t->pl.pmtu = SCTP_BASE_PLPMTU; in sctp_transport_pl_toobig()
373 t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); in sctp_transport_pl_toobig()
376 } else if (t->pl.state == SCTP_PL_SEARCH) { in sctp_transport_pl_toobig()
377 if (pmtu >= SCTP_BASE_PLPMTU && pmtu < t->pl.pmtu) { in sctp_transport_pl_toobig()
378 t->pl.state = SCTP_PL_BASE; /* Search -> Base */ in sctp_transport_pl_toobig()
379 t->pl.probe_size = SCTP_BASE_PLPMTU; in sctp_transport_pl_toobig()
380 t->pl.probe_count = 0; in sctp_transport_pl_toobig()
382 t->pl.probe_high = 0; in sctp_transport_pl_toobig()
383 t->pl.pmtu = SCTP_BASE_PLPMTU; in sctp_transport_pl_toobig()
384 t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); in sctp_transport_pl_toobig()
386 } else if (pmtu > t->pl.pmtu && pmtu < t->pl.probe_size) { in sctp_transport_pl_toobig()
387 t->pl.probe_size = pmtu; in sctp_transport_pl_toobig()
388 t->pl.probe_count = 0; in sctp_transport_pl_toobig()
390 } else if (t->pl.state == SCTP_PL_COMPLETE) { in sctp_transport_pl_toobig()
391 if (pmtu >= SCTP_BASE_PLPMTU && pmtu < t->pl.pmtu) { in sctp_transport_pl_toobig()
392 t->pl.state = SCTP_PL_BASE; /* Complete -> Base */ in sctp_transport_pl_toobig()
393 t->pl.probe_size = SCTP_BASE_PLPMTU; in sctp_transport_pl_toobig()
394 t->pl.probe_count = 0; in sctp_transport_pl_toobig()
396 t->pl.probe_high = 0; in sctp_transport_pl_toobig()
397 t->pl.pmtu = SCTP_BASE_PLPMTU; in sctp_transport_pl_toobig()
398 t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); in sctp_transport_pl_toobig()
406 bool sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu) in sctp_transport_update_pmtu() argument
408 struct sock *sk = t->asoc->base.sk; in sctp_transport_update_pmtu()
420 if (sctp_transport_pl_enabled(t)) in sctp_transport_update_pmtu()
421 return sctp_transport_pl_toobig(t, pmtu - sctp_transport_pl_hlen(t)); in sctp_transport_update_pmtu()
423 dst = sctp_transport_dst_check(t); in sctp_transport_update_pmtu()
429 pf->to_sk_daddr(&t->ipaddr, sk); in sctp_transport_update_pmtu()
433 dst = sctp_transport_dst_check(t); in sctp_transport_update_pmtu()
437 t->af_specific->get_dst(t, &t->saddr, &t->fl, sk); in sctp_transport_update_pmtu()
438 dst = t->dst; in sctp_transport_update_pmtu()
444 change = t->pathmtu != pmtu; in sctp_transport_update_pmtu()
446 t->pathmtu = pmtu; in sctp_transport_update_pmtu()
761 void sctp_transport_burst_limited(struct sctp_transport *t) in sctp_transport_burst_limited() argument
763 struct sctp_association *asoc = t->asoc; in sctp_transport_burst_limited()
764 u32 old_cwnd = t->cwnd; in sctp_transport_burst_limited()
767 if (t->burst_limited || asoc->max_burst == 0) in sctp_transport_burst_limited()
770 max_burst_bytes = t->flight_size + (asoc->max_burst * asoc->pathmtu); in sctp_transport_burst_limited()
772 t->cwnd = max_burst_bytes; in sctp_transport_burst_limited()
773 t->burst_limited = old_cwnd; in sctp_transport_burst_limited()
780 void sctp_transport_burst_reset(struct sctp_transport *t) in sctp_transport_burst_reset() argument
782 if (t->burst_limited) { in sctp_transport_burst_reset()
783 t->cwnd = t->burst_limited; in sctp_transport_burst_reset()
784 t->burst_limited = 0; in sctp_transport_burst_reset()
802 void sctp_transport_reset(struct sctp_transport *t) in sctp_transport_reset() argument
804 struct sctp_association *asoc = t->asoc; in sctp_transport_reset()
811 t->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380)); in sctp_transport_reset()
812 t->burst_limited = 0; in sctp_transport_reset()
813 t->ssthresh = asoc->peer.i.a_rwnd; in sctp_transport_reset()
814 t->rto = asoc->rto_initial; in sctp_transport_reset()
815 sctp_max_rto(asoc, t); in sctp_transport_reset()
816 t->rtt = 0; in sctp_transport_reset()
817 t->srtt = 0; in sctp_transport_reset()
818 t->rttvar = 0; in sctp_transport_reset()
821 t->partial_bytes_acked = 0; in sctp_transport_reset()
822 t->flight_size = 0; in sctp_transport_reset()
823 t->error_count = 0; in sctp_transport_reset()
824 t->rto_pending = 0; in sctp_transport_reset()
825 t->hb_sent = 0; in sctp_transport_reset()
828 t->cacc.changeover_active = 0; in sctp_transport_reset()
829 t->cacc.cycling_changeover = 0; in sctp_transport_reset()
830 t->cacc.next_tsn_at_change = 0; in sctp_transport_reset()
831 t->cacc.cacc_saw_newack = 0; in sctp_transport_reset()
835 void sctp_transport_immediate_rtx(struct sctp_transport *t) in sctp_transport_immediate_rtx() argument
838 if (del_timer(&t->T3_rtx_timer)) in sctp_transport_immediate_rtx()
839 sctp_transport_put(t); in sctp_transport_immediate_rtx()
841 sctp_retransmit(&t->asoc->outqueue, t, SCTP_RTXR_T3_RTX); in sctp_transport_immediate_rtx()
842 if (!timer_pending(&t->T3_rtx_timer)) { in sctp_transport_immediate_rtx()
843 if (!mod_timer(&t->T3_rtx_timer, jiffies + t->rto)) in sctp_transport_immediate_rtx()
844 sctp_transport_hold(t); in sctp_transport_immediate_rtx()
849 void sctp_transport_dst_release(struct sctp_transport *t) in sctp_transport_dst_release() argument
851 dst_release(t->dst); in sctp_transport_dst_release()
852 t->dst = NULL; in sctp_transport_dst_release()
853 t->dst_pending_confirm = 0; in sctp_transport_dst_release()
857 void sctp_transport_dst_confirm(struct sctp_transport *t) in sctp_transport_dst_confirm() argument
859 t->dst_pending_confirm = 1; in sctp_transport_dst_confirm()