Lines Matching refs:transport
94 struct sctp_transport *transport; in sctp_transport_new() local
96 transport = kzalloc(sizeof(*transport), gfp); in sctp_transport_new()
97 if (!transport) in sctp_transport_new()
100 if (!sctp_transport_init(net, transport, addr, gfp)) in sctp_transport_new()
103 SCTP_DBG_OBJCNT_INC(transport); in sctp_transport_new()
105 return transport; in sctp_transport_new()
108 kfree(transport); in sctp_transport_new()
117 void sctp_transport_free(struct sctp_transport *transport) in sctp_transport_free() argument
120 if (del_timer(&transport->hb_timer)) in sctp_transport_free()
121 sctp_transport_put(transport); in sctp_transport_free()
128 if (del_timer(&transport->T3_rtx_timer)) in sctp_transport_free()
129 sctp_transport_put(transport); in sctp_transport_free()
131 if (del_timer(&transport->reconf_timer)) in sctp_transport_free()
132 sctp_transport_put(transport); in sctp_transport_free()
135 if (del_timer(&transport->proto_unreach_timer)) in sctp_transport_free()
136 sctp_transport_put(transport); in sctp_transport_free()
138 sctp_transport_put(transport); in sctp_transport_free()
143 struct sctp_transport *transport; in sctp_transport_destroy_rcu() local
145 transport = container_of(head, struct sctp_transport, rcu); in sctp_transport_destroy_rcu()
147 dst_release(transport->dst); in sctp_transport_destroy_rcu()
148 kfree(transport); in sctp_transport_destroy_rcu()
149 SCTP_DBG_OBJCNT_DEC(transport); in sctp_transport_destroy_rcu()
155 static void sctp_transport_destroy(struct sctp_transport *transport) in sctp_transport_destroy() argument
157 if (unlikely(refcount_read(&transport->refcnt))) { in sctp_transport_destroy()
158 WARN(1, "Attempt to destroy undead transport %p!\n", transport); in sctp_transport_destroy()
162 sctp_packet_free(&transport->packet); in sctp_transport_destroy()
164 if (transport->asoc) in sctp_transport_destroy()
165 sctp_association_put(transport->asoc); in sctp_transport_destroy()
167 call_rcu(&transport->rcu, sctp_transport_destroy_rcu); in sctp_transport_destroy()
173 void sctp_transport_reset_t3_rtx(struct sctp_transport *transport) in sctp_transport_reset_t3_rtx() argument
183 if (!timer_pending(&transport->T3_rtx_timer)) in sctp_transport_reset_t3_rtx()
184 if (!mod_timer(&transport->T3_rtx_timer, in sctp_transport_reset_t3_rtx()
185 jiffies + transport->rto)) in sctp_transport_reset_t3_rtx()
186 sctp_transport_hold(transport); in sctp_transport_reset_t3_rtx()
189 void sctp_transport_reset_hb_timer(struct sctp_transport *transport) in sctp_transport_reset_hb_timer() argument
194 expires = jiffies + sctp_transport_timeout(transport); in sctp_transport_reset_hb_timer()
195 if ((time_before(transport->hb_timer.expires, expires) || in sctp_transport_reset_hb_timer()
196 !timer_pending(&transport->hb_timer)) && in sctp_transport_reset_hb_timer()
197 !mod_timer(&transport->hb_timer, in sctp_transport_reset_hb_timer()
198 expires + prandom_u32_max(transport->rto))) in sctp_transport_reset_hb_timer()
199 sctp_transport_hold(transport); in sctp_transport_reset_hb_timer()
202 void sctp_transport_reset_reconf_timer(struct sctp_transport *transport) in sctp_transport_reset_reconf_timer() argument
204 if (!timer_pending(&transport->reconf_timer)) in sctp_transport_reset_reconf_timer()
205 if (!mod_timer(&transport->reconf_timer, in sctp_transport_reset_reconf_timer()
206 jiffies + transport->rto)) in sctp_transport_reset_reconf_timer()
207 sctp_transport_hold(transport); in sctp_transport_reset_reconf_timer()
214 void sctp_transport_set_owner(struct sctp_transport *transport, in sctp_transport_set_owner() argument
217 transport->asoc = asoc; in sctp_transport_set_owner()
222 void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk) in sctp_transport_pmtu() argument
225 if (!transport->dst || transport->dst->obsolete) { in sctp_transport_pmtu()
226 sctp_transport_dst_release(transport); in sctp_transport_pmtu()
227 transport->af_specific->get_dst(transport, &transport->saddr, in sctp_transport_pmtu()
228 &transport->fl, sk); in sctp_transport_pmtu()
231 if (transport->param_flags & SPP_PMTUD_DISABLE) { in sctp_transport_pmtu()
232 struct sctp_association *asoc = transport->asoc; in sctp_transport_pmtu()
234 if (!transport->pathmtu && asoc && asoc->pathmtu) in sctp_transport_pmtu()
235 transport->pathmtu = asoc->pathmtu; in sctp_transport_pmtu()
236 if (transport->pathmtu) in sctp_transport_pmtu()
240 if (transport->dst) in sctp_transport_pmtu()
241 transport->pathmtu = sctp_dst_mtu(transport->dst); in sctp_transport_pmtu()
243 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; in sctp_transport_pmtu()
290 void sctp_transport_route(struct sctp_transport *transport, in sctp_transport_route() argument
293 struct sctp_association *asoc = transport->asoc; in sctp_transport_route()
294 struct sctp_af *af = transport->af_specific; in sctp_transport_route()
296 sctp_transport_dst_release(transport); in sctp_transport_route()
297 af->get_dst(transport, saddr, &transport->fl, sctp_opt2sk(opt)); in sctp_transport_route()
300 memcpy(&transport->saddr, saddr, sizeof(union sctp_addr)); in sctp_transport_route()
302 af->get_saddr(opt, transport, &transport->fl); in sctp_transport_route()
304 sctp_transport_pmtu(transport, sctp_opt2sk(opt)); in sctp_transport_route()
309 if (transport->dst && asoc && in sctp_transport_route()
310 (!asoc->peer.primary_path || transport == asoc->peer.active_path)) in sctp_transport_route()
311 opt->pf->to_sk_saddr(&transport->saddr, asoc->base.sk); in sctp_transport_route()
315 int sctp_transport_hold(struct sctp_transport *transport) in sctp_transport_hold() argument
317 return refcount_inc_not_zero(&transport->refcnt); in sctp_transport_hold()
323 void sctp_transport_put(struct sctp_transport *transport) in sctp_transport_put() argument
325 if (refcount_dec_and_test(&transport->refcnt)) in sctp_transport_put()
326 sctp_transport_destroy(transport); in sctp_transport_put()
397 void sctp_transport_raise_cwnd(struct sctp_transport *transport, in sctp_transport_raise_cwnd() argument
400 struct sctp_association *asoc = transport->asoc; in sctp_transport_raise_cwnd()
403 cwnd = transport->cwnd; in sctp_transport_raise_cwnd()
404 flight_size = transport->flight_size; in sctp_transport_raise_cwnd()
411 ssthresh = transport->ssthresh; in sctp_transport_raise_cwnd()
412 pba = transport->partial_bytes_acked; in sctp_transport_raise_cwnd()
413 pmtu = transport->asoc->pathmtu; in sctp_transport_raise_cwnd()
448 __func__, transport, bytes_acked, cwnd, ssthresh, in sctp_transport_raise_cwnd()
484 transport, bytes_acked, cwnd, ssthresh, in sctp_transport_raise_cwnd()
488 transport->cwnd = cwnd; in sctp_transport_raise_cwnd()
489 transport->partial_bytes_acked = pba; in sctp_transport_raise_cwnd()
495 void sctp_transport_lower_cwnd(struct sctp_transport *transport, in sctp_transport_lower_cwnd() argument
498 struct sctp_association *asoc = transport->asoc; in sctp_transport_lower_cwnd()
509 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
511 transport->cwnd = asoc->pathmtu; in sctp_transport_lower_cwnd()
537 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
539 transport->cwnd = transport->ssthresh; in sctp_transport_lower_cwnd()
555 if (time_after(jiffies, transport->last_time_ecne_reduced + in sctp_transport_lower_cwnd()
556 transport->rtt)) { in sctp_transport_lower_cwnd()
557 transport->ssthresh = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
559 transport->cwnd = transport->ssthresh; in sctp_transport_lower_cwnd()
560 transport->last_time_ecne_reduced = jiffies; in sctp_transport_lower_cwnd()
573 transport->cwnd = max(transport->cwnd/2, in sctp_transport_lower_cwnd()
576 transport->ssthresh = transport->cwnd; in sctp_transport_lower_cwnd()
580 transport->partial_bytes_acked = 0; in sctp_transport_lower_cwnd()
583 __func__, transport, reason, transport->cwnd, in sctp_transport_lower_cwnd()
584 transport->ssthresh); in sctp_transport_lower_cwnd()