Lines Matching refs:transport
95 struct sctp_transport *transport; in sctp_transport_new() local
97 transport = kzalloc(sizeof(*transport), gfp); in sctp_transport_new()
98 if (!transport) in sctp_transport_new()
101 if (!sctp_transport_init(net, transport, addr, gfp)) in sctp_transport_new()
104 SCTP_DBG_OBJCNT_INC(transport); in sctp_transport_new()
106 return transport; in sctp_transport_new()
109 kfree(transport); in sctp_transport_new()
118 void sctp_transport_free(struct sctp_transport *transport) in sctp_transport_free() argument
121 if (del_timer(&transport->hb_timer)) in sctp_transport_free()
122 sctp_transport_put(transport); in sctp_transport_free()
129 if (del_timer(&transport->T3_rtx_timer)) in sctp_transport_free()
130 sctp_transport_put(transport); in sctp_transport_free()
132 if (del_timer(&transport->reconf_timer)) in sctp_transport_free()
133 sctp_transport_put(transport); in sctp_transport_free()
135 if (del_timer(&transport->probe_timer)) in sctp_transport_free()
136 sctp_transport_put(transport); in sctp_transport_free()
139 if (del_timer(&transport->proto_unreach_timer)) in sctp_transport_free()
140 sctp_transport_put(transport); in sctp_transport_free()
142 sctp_transport_put(transport); in sctp_transport_free()
147 struct sctp_transport *transport; in sctp_transport_destroy_rcu() local
149 transport = container_of(head, struct sctp_transport, rcu); in sctp_transport_destroy_rcu()
151 dst_release(transport->dst); in sctp_transport_destroy_rcu()
152 kfree(transport); in sctp_transport_destroy_rcu()
153 SCTP_DBG_OBJCNT_DEC(transport); in sctp_transport_destroy_rcu()
159 static void sctp_transport_destroy(struct sctp_transport *transport) in sctp_transport_destroy() argument
161 if (unlikely(refcount_read(&transport->refcnt))) { in sctp_transport_destroy()
162 WARN(1, "Attempt to destroy undead transport %p!\n", transport); in sctp_transport_destroy()
166 sctp_packet_free(&transport->packet); in sctp_transport_destroy()
168 if (transport->asoc) in sctp_transport_destroy()
169 sctp_association_put(transport->asoc); in sctp_transport_destroy()
171 call_rcu(&transport->rcu, sctp_transport_destroy_rcu); in sctp_transport_destroy()
177 void sctp_transport_reset_t3_rtx(struct sctp_transport *transport) in sctp_transport_reset_t3_rtx() argument
187 if (!timer_pending(&transport->T3_rtx_timer)) in sctp_transport_reset_t3_rtx()
188 if (!mod_timer(&transport->T3_rtx_timer, in sctp_transport_reset_t3_rtx()
189 jiffies + transport->rto)) in sctp_transport_reset_t3_rtx()
190 sctp_transport_hold(transport); in sctp_transport_reset_t3_rtx()
193 void sctp_transport_reset_hb_timer(struct sctp_transport *transport) in sctp_transport_reset_hb_timer() argument
198 expires = jiffies + sctp_transport_timeout(transport); in sctp_transport_reset_hb_timer()
199 if (!mod_timer(&transport->hb_timer, in sctp_transport_reset_hb_timer()
200 expires + get_random_u32_below(transport->rto))) in sctp_transport_reset_hb_timer()
201 sctp_transport_hold(transport); in sctp_transport_reset_hb_timer()
204 void sctp_transport_reset_reconf_timer(struct sctp_transport *transport) in sctp_transport_reset_reconf_timer() argument
206 if (!timer_pending(&transport->reconf_timer)) in sctp_transport_reset_reconf_timer()
207 if (!mod_timer(&transport->reconf_timer, in sctp_transport_reset_reconf_timer()
208 jiffies + transport->rto)) in sctp_transport_reset_reconf_timer()
209 sctp_transport_hold(transport); in sctp_transport_reset_reconf_timer()
212 void sctp_transport_reset_probe_timer(struct sctp_transport *transport) in sctp_transport_reset_probe_timer() argument
214 if (!mod_timer(&transport->probe_timer, in sctp_transport_reset_probe_timer()
215 jiffies + transport->probe_interval)) in sctp_transport_reset_probe_timer()
216 sctp_transport_hold(transport); in sctp_transport_reset_probe_timer()
219 void sctp_transport_reset_raise_timer(struct sctp_transport *transport) in sctp_transport_reset_raise_timer() argument
221 if (!mod_timer(&transport->probe_timer, in sctp_transport_reset_raise_timer()
222 jiffies + transport->probe_interval * 30)) in sctp_transport_reset_raise_timer()
223 sctp_transport_hold(transport); in sctp_transport_reset_raise_timer()
230 void sctp_transport_set_owner(struct sctp_transport *transport, in sctp_transport_set_owner() argument
233 transport->asoc = asoc; in sctp_transport_set_owner()
238 void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk) in sctp_transport_pmtu() argument
241 if (!transport->dst || transport->dst->obsolete) { in sctp_transport_pmtu()
242 sctp_transport_dst_release(transport); in sctp_transport_pmtu()
243 transport->af_specific->get_dst(transport, &transport->saddr, in sctp_transport_pmtu()
244 &transport->fl, sk); in sctp_transport_pmtu()
247 if (transport->param_flags & SPP_PMTUD_DISABLE) { in sctp_transport_pmtu()
248 struct sctp_association *asoc = transport->asoc; in sctp_transport_pmtu()
250 if (!transport->pathmtu && asoc && asoc->pathmtu) in sctp_transport_pmtu()
251 transport->pathmtu = asoc->pathmtu; in sctp_transport_pmtu()
252 if (transport->pathmtu) in sctp_transport_pmtu()
256 if (transport->dst) in sctp_transport_pmtu()
257 transport->pathmtu = sctp_dst_mtu(transport->dst); in sctp_transport_pmtu()
259 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; in sctp_transport_pmtu()
261 sctp_transport_pl_update(transport); in sctp_transport_pmtu()
445 void sctp_transport_route(struct sctp_transport *transport, in sctp_transport_route() argument
448 struct sctp_association *asoc = transport->asoc; in sctp_transport_route()
449 struct sctp_af *af = transport->af_specific; in sctp_transport_route()
451 sctp_transport_dst_release(transport); in sctp_transport_route()
452 af->get_dst(transport, saddr, &transport->fl, sctp_opt2sk(opt)); in sctp_transport_route()
455 memcpy(&transport->saddr, saddr, sizeof(union sctp_addr)); in sctp_transport_route()
457 af->get_saddr(opt, transport, &transport->fl); in sctp_transport_route()
459 sctp_transport_pmtu(transport, sctp_opt2sk(opt)); in sctp_transport_route()
464 if (transport->dst && asoc && in sctp_transport_route()
465 (!asoc->peer.primary_path || transport == asoc->peer.active_path)) in sctp_transport_route()
466 opt->pf->to_sk_saddr(&transport->saddr, asoc->base.sk); in sctp_transport_route()
470 int sctp_transport_hold(struct sctp_transport *transport) in sctp_transport_hold() argument
472 return refcount_inc_not_zero(&transport->refcnt); in sctp_transport_hold()
478 void sctp_transport_put(struct sctp_transport *transport) in sctp_transport_put() argument
480 if (refcount_dec_and_test(&transport->refcnt)) in sctp_transport_put()
481 sctp_transport_destroy(transport); in sctp_transport_put()
552 void sctp_transport_raise_cwnd(struct sctp_transport *transport, in sctp_transport_raise_cwnd() argument
555 struct sctp_association *asoc = transport->asoc; in sctp_transport_raise_cwnd()
558 cwnd = transport->cwnd; in sctp_transport_raise_cwnd()
559 flight_size = transport->flight_size; in sctp_transport_raise_cwnd()
566 ssthresh = transport->ssthresh; in sctp_transport_raise_cwnd()
567 pba = transport->partial_bytes_acked; in sctp_transport_raise_cwnd()
568 pmtu = transport->asoc->pathmtu; in sctp_transport_raise_cwnd()
603 __func__, transport, bytes_acked, cwnd, ssthresh, in sctp_transport_raise_cwnd()
639 transport, bytes_acked, cwnd, ssthresh, in sctp_transport_raise_cwnd()
643 transport->cwnd = cwnd; in sctp_transport_raise_cwnd()
644 transport->partial_bytes_acked = pba; in sctp_transport_raise_cwnd()
650 void sctp_transport_lower_cwnd(struct sctp_transport *transport, in sctp_transport_lower_cwnd() argument
653 struct sctp_association *asoc = transport->asoc; in sctp_transport_lower_cwnd()
664 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
666 transport->cwnd = asoc->pathmtu; in sctp_transport_lower_cwnd()
692 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
694 transport->cwnd = transport->ssthresh; in sctp_transport_lower_cwnd()
710 if (time_after(jiffies, transport->last_time_ecne_reduced + in sctp_transport_lower_cwnd()
711 transport->rtt)) { in sctp_transport_lower_cwnd()
712 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
714 transport->cwnd = transport->ssthresh; in sctp_transport_lower_cwnd()
715 transport->last_time_ecne_reduced = jiffies; in sctp_transport_lower_cwnd()
728 transport->cwnd = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
731 transport->ssthresh = transport->cwnd; in sctp_transport_lower_cwnd()
735 transport->partial_bytes_acked = 0; in sctp_transport_lower_cwnd()
738 __func__, transport, reason, transport->cwnd, in sctp_transport_lower_cwnd()
739 transport->ssthresh); in sctp_transport_lower_cwnd()