Lines Matching +full:fail +full:- +full:fast

2  * Copyright (c) 1999-2000 Cisco, Inc.
3 * Copyright (c) 1999-2001 Motorola, Inc.
4 * Copyright (c) 2001-2003 International Business Machines Corp.
28 * the Free Software Foundation, 59 Temple Place - Suite 330,
29 * Boston, MA 02111-1307, USA.
33 * lksctp developers <lksctp-developers@lists.sourceforge.net>
67 peer->ipaddr = *addr; in sctp_transport_init()
68 peer->af_specific = sctp_get_af_specific(addr->sa.sa_family); in sctp_transport_init()
69 memset(&peer->saddr, 0, sizeof(union sctp_addr)); in sctp_transport_init()
77 peer->rto = msecs_to_jiffies(sctp_rto_initial); in sctp_transport_init()
79 peer->last_time_heard = jiffies; in sctp_transport_init()
80 peer->last_time_ecne_reduced = jiffies; in sctp_transport_init()
82 peer->param_flags = SPP_HB_DISABLE | in sctp_transport_init()
87 peer->pathmaxrxt = sctp_max_retrans_path; in sctp_transport_init()
89 INIT_LIST_HEAD(&peer->transmitted); in sctp_transport_init()
90 INIT_LIST_HEAD(&peer->send_ready); in sctp_transport_init()
91 INIT_LIST_HEAD(&peer->transports); in sctp_transport_init()
93 setup_timer(&peer->T3_rtx_timer, sctp_generate_t3_rtx_event, in sctp_transport_init()
95 setup_timer(&peer->hb_timer, sctp_generate_heartbeat_event, in sctp_transport_init()
97 setup_timer(&peer->proto_unreach_timer, in sctp_transport_init()
100 /* Initialize the 64-bit random nonce sent with heartbeat. */ in sctp_transport_init()
101 get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce)); in sctp_transport_init()
103 atomic_set(&peer->refcnt, 1); in sctp_transport_init()
116 goto fail; in sctp_transport_new()
121 transport->malloced = 1; in sctp_transport_new()
129 fail: in sctp_transport_new()
138 transport->dead = 1; in sctp_transport_free()
141 if (del_timer(&transport->hb_timer)) in sctp_transport_free()
149 if (timer_pending(&transport->T3_rtx_timer) && in sctp_transport_free()
150 del_timer(&transport->T3_rtx_timer)) in sctp_transport_free()
154 if (timer_pending(&transport->proto_unreach_timer) && in sctp_transport_free()
155 del_timer(&transport->proto_unreach_timer)) in sctp_transport_free()
156 sctp_association_put(transport->asoc); in sctp_transport_free()
166 SCTP_ASSERT(transport->dead, "Transport is not dead", return); in sctp_transport_destroy()
168 if (transport->asoc) in sctp_transport_destroy()
169 sctp_association_put(transport->asoc); in sctp_transport_destroy()
171 sctp_packet_free(&transport->packet); in sctp_transport_destroy()
173 dst_release(transport->dst); in sctp_transport_destroy()
186 * retransmission), if the T3-rtx timer of that address is not running in sctp_transport_reset_timers()
191 if (!timer_pending(&transport->T3_rtx_timer)) in sctp_transport_reset_timers()
192 if (!mod_timer(&transport->T3_rtx_timer, in sctp_transport_reset_timers()
193 jiffies + transport->rto)) in sctp_transport_reset_timers()
197 if (!mod_timer(&transport->hb_timer, in sctp_transport_reset_timers()
209 transport->asoc = asoc; in sctp_transport_set_owner()
217 if (!transport->dst || transport->dst->obsolete > 1) { in sctp_transport_pmtu()
218 dst_release(transport->dst); in sctp_transport_pmtu()
219 transport->af_specific->get_dst(transport, &transport->saddr, in sctp_transport_pmtu()
220 &transport->fl, sk); in sctp_transport_pmtu()
223 if (transport->dst) { in sctp_transport_pmtu()
224 transport->pathmtu = dst_mtu(transport->dst); in sctp_transport_pmtu()
226 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; in sctp_transport_pmtu()
229 /* this is a complete rip-off from __sk_dst_check
235 struct dst_entry *dst = t->dst; in sctp_transport_dst_check()
237 if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) { in sctp_transport_dst_check()
238 dst_release(t->dst); in sctp_transport_dst_check()
239 t->dst = NULL; in sctp_transport_dst_check()
257 t->pathmtu = SCTP_DEFAULT_MINSEGMENT; in sctp_transport_update_pmtu()
259 t->pathmtu = pmtu; in sctp_transport_update_pmtu()
264 dst->ops->update_pmtu(dst, pmtu); in sctp_transport_update_pmtu()
273 struct sctp_association *asoc = transport->asoc; in sctp_transport_route()
274 struct sctp_af *af = transport->af_specific; in sctp_transport_route()
276 af->get_dst(transport, saddr, &transport->fl, sctp_opt2sk(opt)); in sctp_transport_route()
279 memcpy(&transport->saddr, saddr, sizeof(union sctp_addr)); in sctp_transport_route()
281 af->get_saddr(opt, transport, &transport->fl); in sctp_transport_route()
283 if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) { in sctp_transport_route()
286 if (transport->dst) { in sctp_transport_route()
287 transport->pathmtu = dst_mtu(transport->dst); in sctp_transport_route()
289 /* Initialize sk->sk_rcv_saddr, if the transport is the in sctp_transport_route()
292 if (asoc && (!asoc->peer.primary_path || in sctp_transport_route()
293 (transport == asoc->peer.active_path))) in sctp_transport_route()
294 opt->pf->af->to_sk_saddr(&transport->saddr, in sctp_transport_route()
295 asoc->base.sk); in sctp_transport_route()
297 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; in sctp_transport_route()
303 atomic_inc(&transport->refcnt); in sctp_transport_hold()
311 if (atomic_dec_and_test(&transport->refcnt)) in sctp_transport_put()
322 SCTP_ASSERT(tp->rto_pending, "rto_pending not set", return); in sctp_transport_update_rto()
324 if (tp->rttvar || tp->srtt) { in sctp_transport_update_rto()
326 * RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'| in sctp_transport_update_rto()
327 * SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R' in sctp_transport_update_rto()
336 tp->rttvar = tp->rttvar - (tp->rttvar >> sctp_rto_beta) in sctp_transport_update_rto()
337 + ((abs(tp->srtt - rtt)) >> sctp_rto_beta); in sctp_transport_update_rto()
338 tp->srtt = tp->srtt - (tp->srtt >> sctp_rto_alpha) in sctp_transport_update_rto()
342 * SRTT <- R, RTTVAR <- R/2. in sctp_transport_update_rto()
344 tp->srtt = rtt; in sctp_transport_update_rto()
345 tp->rttvar = rtt >> 1; in sctp_transport_update_rto()
349 * adjust RTTVAR <- G, where G is the CLOCK GRANULARITY. in sctp_transport_update_rto()
351 if (tp->rttvar == 0) in sctp_transport_update_rto()
352 tp->rttvar = SCTP_CLOCK_GRANULARITY; in sctp_transport_update_rto()
354 /* 6.3.1 C3) After the computation, update RTO <- SRTT + 4 * RTTVAR. */ in sctp_transport_update_rto()
355 tp->rto = tp->srtt + (tp->rttvar << 2); in sctp_transport_update_rto()
360 if (tp->rto < tp->asoc->rto_min) in sctp_transport_update_rto()
361 tp->rto = tp->asoc->rto_min; in sctp_transport_update_rto()
366 if (tp->rto > tp->asoc->rto_max) in sctp_transport_update_rto()
367 tp->rto = tp->asoc->rto_max; in sctp_transport_update_rto()
369 tp->rtt = rtt; in sctp_transport_update_rto()
374 tp->rto_pending = 0; in sctp_transport_update_rto()
378 tp, rtt, tp->srtt, tp->rttvar, tp->rto); in sctp_transport_update_rto()
387 struct sctp_association *asoc = transport->asoc; in sctp_transport_raise_cwnd()
390 cwnd = transport->cwnd; in sctp_transport_raise_cwnd()
391 flight_size = transport->flight_size; in sctp_transport_raise_cwnd()
393 /* See if we need to exit Fast Recovery first */ in sctp_transport_raise_cwnd()
394 if (asoc->fast_recovery && in sctp_transport_raise_cwnd()
395 TSN_lte(asoc->fast_recovery_exit, sack_ctsn)) in sctp_transport_raise_cwnd()
396 asoc->fast_recovery = 0; in sctp_transport_raise_cwnd()
402 if (TSN_lte(sack_ctsn, transport->asoc->ctsn_ack_point) || in sctp_transport_raise_cwnd()
406 ssthresh = transport->ssthresh; in sctp_transport_raise_cwnd()
407 pba = transport->partial_bytes_acked; in sctp_transport_raise_cwnd()
408 pmtu = transport->asoc->pathmtu; in sctp_transport_raise_cwnd()
413 * endpoint MUST use the slow-start algorithm to increase in sctp_transport_raise_cwnd()
416 * Ack Point, and the data sender is not in Fast Recovery. in sctp_transport_raise_cwnd()
423 * against the ACK-Splitting attack outlined in [SAVAGE99]. in sctp_transport_raise_cwnd()
425 if (asoc->fast_recovery) in sctp_transport_raise_cwnd()
451 * (partial_bytes_acked - cwnd). in sctp_transport_raise_cwnd()
456 pba = ((cwnd < pba) ? (pba - cwnd) : 0); in sctp_transport_raise_cwnd()
466 transport->cwnd = cwnd; in sctp_transport_raise_cwnd()
467 transport->partial_bytes_acked = pba; in sctp_transport_raise_cwnd()
476 struct sctp_association *asoc = transport->asoc; in sctp_transport_lower_cwnd()
481 * When the T3-rtx timer expires on an address, SCTP should in sctp_transport_lower_cwnd()
487 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
488 4*asoc->pathmtu); in sctp_transport_lower_cwnd()
489 transport->cwnd = asoc->pathmtu; in sctp_transport_lower_cwnd()
491 /* T3-rtx also clears fast recovery */ in sctp_transport_lower_cwnd()
492 asoc->fast_recovery = 0; in sctp_transport_lower_cwnd()
508 if (asoc->fast_recovery) in sctp_transport_lower_cwnd()
511 /* Mark Fast recovery */ in sctp_transport_lower_cwnd()
512 asoc->fast_recovery = 1; in sctp_transport_lower_cwnd()
513 asoc->fast_recovery_exit = asoc->next_tsn - 1; in sctp_transport_lower_cwnd()
515 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
516 4*asoc->pathmtu); in sctp_transport_lower_cwnd()
517 transport->cwnd = transport->ssthresh; in sctp_transport_lower_cwnd()
522 * If the sender receives an ECN-Echo ACK packet in sctp_transport_lower_cwnd()
526 * congestion loss in non-ECN Capable TCP. That is, the TCP in sctp_transport_lower_cwnd()
531 * data (or more loosely more than once every round-trip time). in sctp_transport_lower_cwnd()
533 if (time_after(jiffies, transport->last_time_ecne_reduced + in sctp_transport_lower_cwnd()
534 transport->rtt)) { in sctp_transport_lower_cwnd()
535 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
536 4*asoc->pathmtu); in sctp_transport_lower_cwnd()
537 transport->cwnd = transport->ssthresh; in sctp_transport_lower_cwnd()
538 transport->last_time_ecne_reduced = jiffies; in sctp_transport_lower_cwnd()
551 transport->cwnd = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
552 4*asoc->pathmtu); in sctp_transport_lower_cwnd()
556 transport->partial_bytes_acked = 0; in sctp_transport_lower_cwnd()
560 transport->cwnd, transport->ssthresh); in sctp_transport_lower_cwnd()
564 * sctpimpguide-05 2.14.2
575 struct sctp_association *asoc = t->asoc; in sctp_transport_burst_limited()
576 u32 old_cwnd = t->cwnd; in sctp_transport_burst_limited()
579 if (t->burst_limited) in sctp_transport_burst_limited()
582 max_burst_bytes = t->flight_size + (asoc->max_burst * asoc->pathmtu); in sctp_transport_burst_limited()
584 t->cwnd = max_burst_bytes; in sctp_transport_burst_limited()
585 t->burst_limited = old_cwnd; in sctp_transport_burst_limited()
594 if (t->burst_limited) { in sctp_transport_burst_reset()
595 t->cwnd = t->burst_limited; in sctp_transport_burst_reset()
596 t->burst_limited = 0; in sctp_transport_burst_reset()
604 timeout = t->rto + sctp_jitter(t->rto); in sctp_transport_timeout()
605 if (t->state != SCTP_UNCONFIRMED) in sctp_transport_timeout()
606 timeout += t->hbinterval; in sctp_transport_timeout()
614 struct sctp_association *asoc = t->asoc; in sctp_transport_reset()
621 t->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380)); in sctp_transport_reset()
622 t->burst_limited = 0; in sctp_transport_reset()
623 t->ssthresh = asoc->peer.i.a_rwnd; in sctp_transport_reset()
624 t->rto = asoc->rto_initial; in sctp_transport_reset()
625 t->rtt = 0; in sctp_transport_reset()
626 t->srtt = 0; in sctp_transport_reset()
627 t->rttvar = 0; in sctp_transport_reset()
632 t->partial_bytes_acked = 0; in sctp_transport_reset()
633 t->flight_size = 0; in sctp_transport_reset()
634 t->error_count = 0; in sctp_transport_reset()
635 t->rto_pending = 0; in sctp_transport_reset()
636 t->hb_sent = 0; in sctp_transport_reset()
638 /* Initialize the state information for SFR-CACC */ in sctp_transport_reset()
639 t->cacc.changeover_active = 0; in sctp_transport_reset()
640 t->cacc.cycling_changeover = 0; in sctp_transport_reset()
641 t->cacc.next_tsn_at_change = 0; in sctp_transport_reset()
642 t->cacc.cacc_saw_newack = 0; in sctp_transport_reset()
649 if (timer_pending(&t->T3_rtx_timer)) { in sctp_transport_immediate_rtx()
650 (void)del_timer(&t->T3_rtx_timer); in sctp_transport_immediate_rtx()
653 sctp_retransmit(&t->asoc->outqueue, t, SCTP_RTXR_T3_RTX); in sctp_transport_immediate_rtx()
654 if (!timer_pending(&t->T3_rtx_timer)) { in sctp_transport_immediate_rtx()
655 if (!mod_timer(&t->T3_rtx_timer, jiffies + t->rto)) in sctp_transport_immediate_rtx()