transport.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. /* SCTP kernel reference Implementation
  2. * Copyright (c) 1999-2000 Cisco, Inc.
  3. * Copyright (c) 1999-2001 Motorola, Inc.
  4. * Copyright (c) 2001-2003 International Business Machines Corp.
  5. * Copyright (c) 2001 Intel Corp.
  6. * Copyright (c) 2001 La Monte H.P. Yarroll
  7. *
  8. * This file is part of the SCTP kernel reference Implementation
  9. *
  10. * This module provides the abstraction for an SCTP tranport representing
  11. * a remote transport address. For local transport addresses, we just use
  12. * union sctp_addr.
  13. *
  14. * The SCTP reference implementation is free software;
  15. * you can redistribute it and/or modify it under the terms of
  16. * the GNU General Public License as published by
  17. * the Free Software Foundation; either version 2, or (at your option)
  18. * any later version.
  19. *
  20. * The SCTP reference implementation is distributed in the hope that it
  21. * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  22. * ************************
  23. * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  24. * See the GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with GNU CC; see the file COPYING. If not, write to
  28. * the Free Software Foundation, 59 Temple Place - Suite 330,
  29. * Boston, MA 02111-1307, USA.
  30. *
  31. * Please send any bug reports or fixes you make to the
  32. * email address(es):
  33. * lksctp developers <lksctp-developers@lists.sourceforge.net>
  34. *
  35. * Or submit a bug report through the following website:
  36. * http://www.sf.net/projects/lksctp
  37. *
  38. * Written or modified by:
  39. * La Monte H.P. Yarroll <piggy@acm.org>
  40. * Karl Knutson <karl@athena.chicago.il.us>
  41. * Jon Grimm <jgrimm@us.ibm.com>
  42. * Xingang Guo <xingang.guo@intel.com>
  43. * Hui Huang <hui.huang@nokia.com>
  44. * Sridhar Samudrala <sri@us.ibm.com>
  45. * Ardelle Fan <ardelle.fan@intel.com>
  46. *
  47. * Any bugs reported given to us we will try to fix... any fixes shared will
  48. * be incorporated into the next SCTP release.
  49. */
  50. #include <linux/types.h>
  51. #include <linux/random.h>
  52. #include <net/sctp/sctp.h>
  53. #include <net/sctp/sm.h>
  54. /* 1st Level Abstractions. */
  55. /* Initialize a new transport from provided memory. */
  56. static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
  57. const union sctp_addr *addr,
  58. gfp_t gfp)
  59. {
  60. /* Copy in the address. */
  61. peer->ipaddr = *addr;
  62. peer->af_specific = sctp_get_af_specific(addr->sa.sa_family);
  63. peer->asoc = NULL;
  64. peer->dst = NULL;
  65. memset(&peer->saddr, 0, sizeof(union sctp_addr));
  66. /* From 6.3.1 RTO Calculation:
  67. *
  68. * C1) Until an RTT measurement has been made for a packet sent to the
  69. * given destination transport address, set RTO to the protocol
  70. * parameter 'RTO.Initial'.
  71. */
  72. peer->rtt = 0;
  73. peer->rto = msecs_to_jiffies(sctp_rto_initial);
  74. peer->rttvar = 0;
  75. peer->srtt = 0;
  76. peer->rto_pending = 0;
  77. peer->last_time_heard = jiffies;
  78. peer->last_time_used = jiffies;
  79. peer->last_time_ecne_reduced = jiffies;
  80. peer->init_sent_count = 0;
  81. peer->param_flags = SPP_HB_DISABLE |
  82. SPP_PMTUD_ENABLE |
  83. SPP_SACKDELAY_ENABLE;
  84. peer->hbinterval = 0;
  85. /* Initialize the default path max_retrans. */
  86. peer->pathmaxrxt = sctp_max_retrans_path;
  87. peer->error_count = 0;
  88. INIT_LIST_HEAD(&peer->transmitted);
  89. INIT_LIST_HEAD(&peer->send_ready);
  90. INIT_LIST_HEAD(&peer->transports);
  91. /* Set up the retransmission timer. */
  92. init_timer(&peer->T3_rtx_timer);
  93. peer->T3_rtx_timer.function = sctp_generate_t3_rtx_event;
  94. peer->T3_rtx_timer.data = (unsigned long)peer;
  95. /* Set up the heartbeat timer. */
  96. init_timer(&peer->hb_timer);
  97. peer->hb_timer.function = sctp_generate_heartbeat_event;
  98. peer->hb_timer.data = (unsigned long)peer;
  99. /* Initialize the 64-bit random nonce sent with heartbeat. */
  100. get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce));
  101. atomic_set(&peer->refcnt, 1);
  102. peer->dead = 0;
  103. peer->malloced = 0;
  104. /* Initialize the state information for SFR-CACC */
  105. peer->cacc.changeover_active = 0;
  106. peer->cacc.cycling_changeover = 0;
  107. peer->cacc.next_tsn_at_change = 0;
  108. peer->cacc.cacc_saw_newack = 0;
  109. return peer;
  110. }
  111. /* Allocate and initialize a new transport. */
  112. struct sctp_transport *sctp_transport_new(const union sctp_addr *addr,
  113. gfp_t gfp)
  114. {
  115. struct sctp_transport *transport;
  116. transport = t_new(struct sctp_transport, gfp);
  117. if (!transport)
  118. goto fail;
  119. if (!sctp_transport_init(transport, addr, gfp))
  120. goto fail_init;
  121. transport->malloced = 1;
  122. SCTP_DBG_OBJCNT_INC(transport);
  123. return transport;
  124. fail_init:
  125. kfree(transport);
  126. fail:
  127. return NULL;
  128. }
  129. /* This transport is no longer needed. Free up if possible, or
  130. * delay until it last reference count.
  131. */
  132. void sctp_transport_free(struct sctp_transport *transport)
  133. {
  134. transport->dead = 1;
  135. /* Try to delete the heartbeat timer. */
  136. if (del_timer(&transport->hb_timer))
  137. sctp_transport_put(transport);
  138. /* Delete the T3_rtx timer if it's active.
  139. * There is no point in not doing this now and letting
  140. * structure hang around in memory since we know
  141. * the tranport is going away.
  142. */
  143. if (timer_pending(&transport->T3_rtx_timer) &&
  144. del_timer(&transport->T3_rtx_timer))
  145. sctp_transport_put(transport);
  146. sctp_transport_put(transport);
  147. }
  148. /* Destroy the transport data structure.
  149. * Assumes there are no more users of this structure.
  150. */
  151. static void sctp_transport_destroy(struct sctp_transport *transport)
  152. {
  153. SCTP_ASSERT(transport->dead, "Transport is not dead", return);
  154. if (transport->asoc)
  155. sctp_association_put(transport->asoc);
  156. sctp_packet_free(&transport->packet);
  157. dst_release(transport->dst);
  158. kfree(transport);
  159. SCTP_DBG_OBJCNT_DEC(transport);
  160. }
  161. /* Start T3_rtx timer if it is not already running and update the heartbeat
  162. * timer. This routine is called every time a DATA chunk is sent.
  163. */
  164. void sctp_transport_reset_timers(struct sctp_transport *transport)
  165. {
  166. /* RFC 2960 6.3.2 Retransmission Timer Rules
  167. *
  168. * R1) Every time a DATA chunk is sent to any address(including a
  169. * retransmission), if the T3-rtx timer of that address is not running
  170. * start it running so that it will expire after the RTO of that
  171. * address.
  172. */
  173. if (!timer_pending(&transport->T3_rtx_timer))
  174. if (!mod_timer(&transport->T3_rtx_timer,
  175. jiffies + transport->rto))
  176. sctp_transport_hold(transport);
  177. /* When a data chunk is sent, reset the heartbeat interval. */
  178. if (!mod_timer(&transport->hb_timer,
  179. sctp_transport_timeout(transport)))
  180. sctp_transport_hold(transport);
  181. }
  182. /* This transport has been assigned to an association.
  183. * Initialize fields from the association or from the sock itself.
  184. * Register the reference count in the association.
  185. */
  186. void sctp_transport_set_owner(struct sctp_transport *transport,
  187. struct sctp_association *asoc)
  188. {
  189. transport->asoc = asoc;
  190. sctp_association_hold(asoc);
  191. }
  192. /* Initialize the pmtu of a transport. */
  193. void sctp_transport_pmtu(struct sctp_transport *transport)
  194. {
  195. struct dst_entry *dst;
  196. dst = transport->af_specific->get_dst(NULL, &transport->ipaddr, NULL);
  197. if (dst) {
  198. transport->pathmtu = dst_mtu(dst);
  199. dst_release(dst);
  200. } else
  201. transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
  202. }
  203. /* this is a complete rip-off from __sk_dst_check
  204. * the cookie is always 0 since this is how it's used in the
  205. * pmtu code
  206. */
  207. static struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
  208. {
  209. struct dst_entry *dst = t->dst;
  210. if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) {
  211. dst_release(t->dst);
  212. t->dst = NULL;
  213. return NULL;
  214. }
  215. return dst;
  216. }
  217. void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)
  218. {
  219. struct dst_entry *dst;
  220. if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) {
  221. printk(KERN_WARNING "%s: Reported pmtu %d too low, "
  222. "using default minimum of %d\n",
  223. __FUNCTION__, pmtu,
  224. SCTP_DEFAULT_MINSEGMENT);
  225. /* Use default minimum segment size and disable
  226. * pmtu discovery on this transport.
  227. */
  228. t->pathmtu = SCTP_DEFAULT_MINSEGMENT;
  229. t->param_flags = (t->param_flags & ~SPP_PMTUD) |
  230. SPP_PMTUD_DISABLE;
  231. } else {
  232. t->pathmtu = pmtu;
  233. }
  234. dst = sctp_transport_dst_check(t);
  235. if (dst)
  236. dst->ops->update_pmtu(dst, pmtu);
  237. }
  238. /* Caches the dst entry and source address for a transport's destination
  239. * address.
  240. */
  241. void sctp_transport_route(struct sctp_transport *transport,
  242. union sctp_addr *saddr, struct sctp_sock *opt)
  243. {
  244. struct sctp_association *asoc = transport->asoc;
  245. struct sctp_af *af = transport->af_specific;
  246. union sctp_addr *daddr = &transport->ipaddr;
  247. struct dst_entry *dst;
  248. dst = af->get_dst(asoc, daddr, saddr);
  249. if (saddr)
  250. memcpy(&transport->saddr, saddr, sizeof(union sctp_addr));
  251. else
  252. af->get_saddr(asoc, dst, daddr, &transport->saddr);
  253. transport->dst = dst;
  254. if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) {
  255. return;
  256. }
  257. if (dst) {
  258. transport->pathmtu = dst_mtu(dst);
  259. /* Initialize sk->sk_rcv_saddr, if the transport is the
  260. * association's active path for getsockname().
  261. */
  262. if (asoc && (transport == asoc->peer.active_path))
  263. opt->pf->af->to_sk_saddr(&transport->saddr,
  264. asoc->base.sk);
  265. } else
  266. transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
  267. }
  268. /* Hold a reference to a transport. */
  269. void sctp_transport_hold(struct sctp_transport *transport)
  270. {
  271. atomic_inc(&transport->refcnt);
  272. }
  273. /* Release a reference to a transport and clean up
  274. * if there are no more references.
  275. */
  276. void sctp_transport_put(struct sctp_transport *transport)
  277. {
  278. if (atomic_dec_and_test(&transport->refcnt))
  279. sctp_transport_destroy(transport);
  280. }
  281. /* Update transport's RTO based on the newly calculated RTT. */
  282. void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)
  283. {
  284. /* Check for valid transport. */
  285. SCTP_ASSERT(tp, "NULL transport", return);
  286. /* We should not be doing any RTO updates unless rto_pending is set. */
  287. SCTP_ASSERT(tp->rto_pending, "rto_pending not set", return);
  288. if (tp->rttvar || tp->srtt) {
  289. /* 6.3.1 C3) When a new RTT measurement R' is made, set
  290. * RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'|
  291. * SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R'
  292. */
  293. /* Note: The above algorithm has been rewritten to
  294. * express rto_beta and rto_alpha as inverse powers
  295. * of two.
  296. * For example, assuming the default value of RTO.Alpha of
  297. * 1/8, rto_alpha would be expressed as 3.
  298. */
  299. tp->rttvar = tp->rttvar - (tp->rttvar >> sctp_rto_beta)
  300. + ((abs(tp->srtt - rtt)) >> sctp_rto_beta);
  301. tp->srtt = tp->srtt - (tp->srtt >> sctp_rto_alpha)
  302. + (rtt >> sctp_rto_alpha);
  303. } else {
  304. /* 6.3.1 C2) When the first RTT measurement R is made, set
  305. * SRTT <- R, RTTVAR <- R/2.
  306. */
  307. tp->srtt = rtt;
  308. tp->rttvar = rtt >> 1;
  309. }
  310. /* 6.3.1 G1) Whenever RTTVAR is computed, if RTTVAR = 0, then
  311. * adjust RTTVAR <- G, where G is the CLOCK GRANULARITY.
  312. */
  313. if (tp->rttvar == 0)
  314. tp->rttvar = SCTP_CLOCK_GRANULARITY;
  315. /* 6.3.1 C3) After the computation, update RTO <- SRTT + 4 * RTTVAR. */
  316. tp->rto = tp->srtt + (tp->rttvar << 2);
  317. /* 6.3.1 C6) Whenever RTO is computed, if it is less than RTO.Min
  318. * seconds then it is rounded up to RTO.Min seconds.
  319. */
  320. if (tp->rto < tp->asoc->rto_min)
  321. tp->rto = tp->asoc->rto_min;
  322. /* 6.3.1 C7) A maximum value may be placed on RTO provided it is
  323. * at least RTO.max seconds.
  324. */
  325. if (tp->rto > tp->asoc->rto_max)
  326. tp->rto = tp->asoc->rto_max;
  327. tp->rtt = rtt;
  328. /* Reset rto_pending so that a new RTT measurement is started when a
  329. * new data chunk is sent.
  330. */
  331. tp->rto_pending = 0;
  332. SCTP_DEBUG_PRINTK("%s: transport: %p, rtt: %d, srtt: %d "
  333. "rttvar: %d, rto: %ld\n", __FUNCTION__,
  334. tp, rtt, tp->srtt, tp->rttvar, tp->rto);
  335. }
  336. /* This routine updates the transport's cwnd and partial_bytes_acked
  337. * parameters based on the bytes acked in the received SACK.
  338. */
  339. void sctp_transport_raise_cwnd(struct sctp_transport *transport,
  340. __u32 sack_ctsn, __u32 bytes_acked)
  341. {
  342. __u32 cwnd, ssthresh, flight_size, pba, pmtu;
  343. cwnd = transport->cwnd;
  344. flight_size = transport->flight_size;
  345. /* The appropriate cwnd increase algorithm is performed if, and only
  346. * if the cumulative TSN has advanced and the congestion window is
  347. * being fully utilized.
  348. */
  349. if ((transport->asoc->ctsn_ack_point >= sack_ctsn) ||
  350. (flight_size < cwnd))
  351. return;
  352. ssthresh = transport->ssthresh;
  353. pba = transport->partial_bytes_acked;
  354. pmtu = transport->asoc->pathmtu;
  355. if (cwnd <= ssthresh) {
  356. /* RFC 2960 7.2.1, sctpimpguide-05 2.14.2 When cwnd is less
  357. * than or equal to ssthresh an SCTP endpoint MUST use the
  358. * slow start algorithm to increase cwnd only if the current
  359. * congestion window is being fully utilized and an incoming
  360. * SACK advances the Cumulative TSN Ack Point. Only when these
  361. * two conditions are met can the cwnd be increased otherwise
  362. * the cwnd MUST not be increased. If these conditions are met
  363. * then cwnd MUST be increased by at most the lesser of
  364. * 1) the total size of the previously outstanding DATA
  365. * chunk(s) acknowledged, and 2) the destination's path MTU.
  366. */
  367. if (bytes_acked > pmtu)
  368. cwnd += pmtu;
  369. else
  370. cwnd += bytes_acked;
  371. SCTP_DEBUG_PRINTK("%s: SLOW START: transport: %p, "
  372. "bytes_acked: %d, cwnd: %d, ssthresh: %d, "
  373. "flight_size: %d, pba: %d\n",
  374. __FUNCTION__,
  375. transport, bytes_acked, cwnd,
  376. ssthresh, flight_size, pba);
  377. } else {
  378. /* RFC 2960 7.2.2 Whenever cwnd is greater than ssthresh,
  379. * upon each SACK arrival that advances the Cumulative TSN Ack
  380. * Point, increase partial_bytes_acked by the total number of
  381. * bytes of all new chunks acknowledged in that SACK including
  382. * chunks acknowledged by the new Cumulative TSN Ack and by
  383. * Gap Ack Blocks.
  384. *
  385. * When partial_bytes_acked is equal to or greater than cwnd
  386. * and before the arrival of the SACK the sender had cwnd or
  387. * more bytes of data outstanding (i.e., before arrival of the
  388. * SACK, flightsize was greater than or equal to cwnd),
  389. * increase cwnd by MTU, and reset partial_bytes_acked to
  390. * (partial_bytes_acked - cwnd).
  391. */
  392. pba += bytes_acked;
  393. if (pba >= cwnd) {
  394. cwnd += pmtu;
  395. pba = ((cwnd < pba) ? (pba - cwnd) : 0);
  396. }
  397. SCTP_DEBUG_PRINTK("%s: CONGESTION AVOIDANCE: "
  398. "transport: %p, bytes_acked: %d, cwnd: %d, "
  399. "ssthresh: %d, flight_size: %d, pba: %d\n",
  400. __FUNCTION__,
  401. transport, bytes_acked, cwnd,
  402. ssthresh, flight_size, pba);
  403. }
  404. transport->cwnd = cwnd;
  405. transport->partial_bytes_acked = pba;
  406. }
  407. /* This routine is used to lower the transport's cwnd when congestion is
  408. * detected.
  409. */
  410. void sctp_transport_lower_cwnd(struct sctp_transport *transport,
  411. sctp_lower_cwnd_t reason)
  412. {
  413. switch (reason) {
  414. case SCTP_LOWER_CWND_T3_RTX:
  415. /* RFC 2960 Section 7.2.3, sctpimpguide
  416. * When the T3-rtx timer expires on an address, SCTP should
  417. * perform slow start by:
  418. * ssthresh = max(cwnd/2, 4*MTU)
  419. * cwnd = 1*MTU
  420. * partial_bytes_acked = 0
  421. */
  422. transport->ssthresh = max(transport->cwnd/2,
  423. 4*transport->asoc->pathmtu);
  424. transport->cwnd = transport->asoc->pathmtu;
  425. break;
  426. case SCTP_LOWER_CWND_FAST_RTX:
  427. /* RFC 2960 7.2.4 Adjust the ssthresh and cwnd of the
  428. * destination address(es) to which the missing DATA chunks
  429. * were last sent, according to the formula described in
  430. * Section 7.2.3.
  431. *
  432. * RFC 2960 7.2.3, sctpimpguide Upon detection of packet
  433. * losses from SACK (see Section 7.2.4), An endpoint
  434. * should do the following:
  435. * ssthresh = max(cwnd/2, 4*MTU)
  436. * cwnd = ssthresh
  437. * partial_bytes_acked = 0
  438. */
  439. transport->ssthresh = max(transport->cwnd/2,
  440. 4*transport->asoc->pathmtu);
  441. transport->cwnd = transport->ssthresh;
  442. break;
  443. case SCTP_LOWER_CWND_ECNE:
  444. /* RFC 2481 Section 6.1.2.
  445. * If the sender receives an ECN-Echo ACK packet
  446. * then the sender knows that congestion was encountered in the
  447. * network on the path from the sender to the receiver. The
  448. * indication of congestion should be treated just as a
  449. * congestion loss in non-ECN Capable TCP. That is, the TCP
  450. * source halves the congestion window "cwnd" and reduces the
  451. * slow start threshold "ssthresh".
  452. * A critical condition is that TCP does not react to
  453. * congestion indications more than once every window of
  454. * data (or more loosely more than once every round-trip time).
  455. */
  456. if ((jiffies - transport->last_time_ecne_reduced) >
  457. transport->rtt) {
  458. transport->ssthresh = max(transport->cwnd/2,
  459. 4*transport->asoc->pathmtu);
  460. transport->cwnd = transport->ssthresh;
  461. transport->last_time_ecne_reduced = jiffies;
  462. }
  463. break;
  464. case SCTP_LOWER_CWND_INACTIVE:
  465. /* RFC 2960 Section 7.2.1, sctpimpguide
  466. * When the endpoint does not transmit data on a given
  467. * transport address, the cwnd of the transport address
  468. * should be adjusted to max(cwnd/2, 4*MTU) per RTO.
  469. * NOTE: Although the draft recommends that this check needs
  470. * to be done every RTO interval, we do it every hearbeat
  471. * interval.
  472. */
  473. if ((jiffies - transport->last_time_used) > transport->rto)
  474. transport->cwnd = max(transport->cwnd/2,
  475. 4*transport->asoc->pathmtu);
  476. break;
  477. }
  478. transport->partial_bytes_acked = 0;
  479. SCTP_DEBUG_PRINTK("%s: transport: %p reason: %d cwnd: "
  480. "%d ssthresh: %d\n", __FUNCTION__,
  481. transport, reason,
  482. transport->cwnd, transport->ssthresh);
  483. }
  484. /* What is the next timeout value for this transport? */
  485. unsigned long sctp_transport_timeout(struct sctp_transport *t)
  486. {
  487. unsigned long timeout;
  488. timeout = t->rto + sctp_jitter(t->rto);
  489. if (t->state != SCTP_UNCONFIRMED)
  490. timeout += t->hbinterval;
  491. timeout += jiffies;
  492. return timeout;
  493. }
  494. /* Reset transport variables to their initial values */
  495. void sctp_transport_reset(struct sctp_transport *t)
  496. {
  497. struct sctp_association *asoc = t->asoc;
  498. /* RFC 2960 (bis), Section 5.2.4
  499. * All the congestion control parameters (e.g., cwnd, ssthresh)
  500. * related to this peer MUST be reset to their initial values
  501. * (see Section 6.2.1)
  502. */
  503. t->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380));
  504. t->ssthresh = asoc->peer.i.a_rwnd;
  505. t->rto = asoc->rto_initial;
  506. t->rtt = 0;
  507. t->srtt = 0;
  508. t->rttvar = 0;
  509. /* Reset these additional varibles so that we have a clean
  510. * slate.
  511. */
  512. t->partial_bytes_acked = 0;
  513. t->flight_size = 0;
  514. t->error_count = 0;
  515. t->rto_pending = 0;
  516. /* Initialize the state information for SFR-CACC */
  517. t->cacc.changeover_active = 0;
  518. t->cacc.cycling_changeover = 0;
  519. t->cacc.next_tsn_at_change = 0;
  520. t->cacc.cacc_saw_newack = 0;
  521. }