Lines Matching refs:transport

110 	struct sctp_transport *transport;  in sctp_transport_new()  local
112 transport = kzalloc(sizeof(*transport), gfp); in sctp_transport_new()
113 if (!transport) in sctp_transport_new()
116 if (!sctp_transport_init(net, transport, addr, gfp)) in sctp_transport_new()
119 SCTP_DBG_OBJCNT_INC(transport); in sctp_transport_new()
121 return transport; in sctp_transport_new()
124 kfree(transport); in sctp_transport_new()
133 void sctp_transport_free(struct sctp_transport *transport) in sctp_transport_free() argument
135 transport->dead = 1; in sctp_transport_free()
138 if (del_timer(&transport->hb_timer)) in sctp_transport_free()
139 sctp_transport_put(transport); in sctp_transport_free()
146 if (del_timer(&transport->T3_rtx_timer)) in sctp_transport_free()
147 sctp_transport_put(transport); in sctp_transport_free()
150 if (del_timer(&transport->proto_unreach_timer)) in sctp_transport_free()
151 sctp_association_put(transport->asoc); in sctp_transport_free()
153 sctp_transport_put(transport); in sctp_transport_free()
158 struct sctp_transport *transport; in sctp_transport_destroy_rcu() local
160 transport = container_of(head, struct sctp_transport, rcu); in sctp_transport_destroy_rcu()
162 dst_release(transport->dst); in sctp_transport_destroy_rcu()
163 kfree(transport); in sctp_transport_destroy_rcu()
164 SCTP_DBG_OBJCNT_DEC(transport); in sctp_transport_destroy_rcu()
170 static void sctp_transport_destroy(struct sctp_transport *transport) in sctp_transport_destroy() argument
172 if (unlikely(!transport->dead)) { in sctp_transport_destroy()
173 WARN(1, "Attempt to destroy undead transport %p!\n", transport); in sctp_transport_destroy()
177 sctp_packet_free(&transport->packet); in sctp_transport_destroy()
179 if (transport->asoc) in sctp_transport_destroy()
180 sctp_association_put(transport->asoc); in sctp_transport_destroy()
182 call_rcu(&transport->rcu, sctp_transport_destroy_rcu); in sctp_transport_destroy()
188 void sctp_transport_reset_timers(struct sctp_transport *transport) in sctp_transport_reset_timers() argument
198 if (!timer_pending(&transport->T3_rtx_timer)) in sctp_transport_reset_timers()
199 if (!mod_timer(&transport->T3_rtx_timer, in sctp_transport_reset_timers()
200 jiffies + transport->rto)) in sctp_transport_reset_timers()
201 sctp_transport_hold(transport); in sctp_transport_reset_timers()
204 if (!mod_timer(&transport->hb_timer, in sctp_transport_reset_timers()
205 sctp_transport_timeout(transport))) in sctp_transport_reset_timers()
206 sctp_transport_hold(transport); in sctp_transport_reset_timers()
213 void sctp_transport_set_owner(struct sctp_transport *transport, in sctp_transport_set_owner() argument
216 transport->asoc = asoc; in sctp_transport_set_owner()
221 void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk) in sctp_transport_pmtu() argument
224 if (!transport->dst || transport->dst->obsolete) { in sctp_transport_pmtu()
225 dst_release(transport->dst); in sctp_transport_pmtu()
226 transport->af_specific->get_dst(transport, &transport->saddr, in sctp_transport_pmtu()
227 &transport->fl, sk); in sctp_transport_pmtu()
230 if (transport->dst) { in sctp_transport_pmtu()
231 transport->pathmtu = dst_mtu(transport->dst); in sctp_transport_pmtu()
233 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; in sctp_transport_pmtu()
268 void sctp_transport_route(struct sctp_transport *transport, in sctp_transport_route() argument
271 struct sctp_association *asoc = transport->asoc; in sctp_transport_route()
272 struct sctp_af *af = transport->af_specific; in sctp_transport_route()
274 af->get_dst(transport, saddr, &transport->fl, sctp_opt2sk(opt)); in sctp_transport_route()
277 memcpy(&transport->saddr, saddr, sizeof(union sctp_addr)); in sctp_transport_route()
279 af->get_saddr(opt, transport, &transport->fl); in sctp_transport_route()
281 if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) { in sctp_transport_route()
284 if (transport->dst) { in sctp_transport_route()
285 transport->pathmtu = dst_mtu(transport->dst); in sctp_transport_route()
291 (transport == asoc->peer.active_path))) in sctp_transport_route()
292 opt->pf->to_sk_saddr(&transport->saddr, in sctp_transport_route()
295 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; in sctp_transport_route()
299 void sctp_transport_hold(struct sctp_transport *transport) in sctp_transport_hold() argument
301 atomic_inc(&transport->refcnt); in sctp_transport_hold()
307 void sctp_transport_put(struct sctp_transport *transport) in sctp_transport_put() argument
309 if (atomic_dec_and_test(&transport->refcnt)) in sctp_transport_put()
310 sctp_transport_destroy(transport); in sctp_transport_put()
381 void sctp_transport_raise_cwnd(struct sctp_transport *transport, in sctp_transport_raise_cwnd() argument
384 struct sctp_association *asoc = transport->asoc; in sctp_transport_raise_cwnd()
387 cwnd = transport->cwnd; in sctp_transport_raise_cwnd()
388 flight_size = transport->flight_size; in sctp_transport_raise_cwnd()
399 if (TSN_lte(sack_ctsn, transport->asoc->ctsn_ack_point) || in sctp_transport_raise_cwnd()
403 ssthresh = transport->ssthresh; in sctp_transport_raise_cwnd()
404 pba = transport->partial_bytes_acked; in sctp_transport_raise_cwnd()
405 pmtu = transport->asoc->pathmtu; in sctp_transport_raise_cwnd()
432 __func__, transport, bytes_acked, cwnd, ssthresh, in sctp_transport_raise_cwnd()
458 transport, bytes_acked, cwnd, ssthresh, in sctp_transport_raise_cwnd()
462 transport->cwnd = cwnd; in sctp_transport_raise_cwnd()
463 transport->partial_bytes_acked = pba; in sctp_transport_raise_cwnd()
469 void sctp_transport_lower_cwnd(struct sctp_transport *transport, in sctp_transport_lower_cwnd() argument
472 struct sctp_association *asoc = transport->asoc; in sctp_transport_lower_cwnd()
483 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
485 transport->cwnd = asoc->pathmtu; in sctp_transport_lower_cwnd()
511 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
513 transport->cwnd = transport->ssthresh; in sctp_transport_lower_cwnd()
529 if (time_after(jiffies, transport->last_time_ecne_reduced + in sctp_transport_lower_cwnd()
530 transport->rtt)) { in sctp_transport_lower_cwnd()
531 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
533 transport->cwnd = transport->ssthresh; in sctp_transport_lower_cwnd()
534 transport->last_time_ecne_reduced = jiffies; in sctp_transport_lower_cwnd()
547 transport->cwnd = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
552 transport->partial_bytes_acked = 0; in sctp_transport_lower_cwnd()
555 __func__, transport, reason, transport->cwnd, in sctp_transport_lower_cwnd()
556 transport->ssthresh); in sctp_transport_lower_cwnd()