aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/transport.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-08-07 03:29:57 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-15 02:32:16 -0400
commite1fc3b14f9a90d9591016749289f2c3d7b35fbf4 (patch)
tree709a6cfe1ac2d7164c9661a8c393a91d83ee6c85 /net/sctp/transport.c
parentf53b5b097e58361668b785eff9f7bcd12b4255ec (diff)
sctp: Make sysctl tunables per net
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/transport.c')
-rw-r--r--net/sctp/transport.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index aada963c9d6b..953c21e4af97 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -77,7 +77,7 @@ static struct sctp_transport *sctp_transport_init(struct net *net,
77 * given destination transport address, set RTO to the protocol 77 * given destination transport address, set RTO to the protocol
78 * parameter 'RTO.Initial'. 78 * parameter 'RTO.Initial'.
79 */ 79 */
80 peer->rto = msecs_to_jiffies(sctp_rto_initial); 80 peer->rto = msecs_to_jiffies(net->sctp.rto_initial);
81 81
82 peer->last_time_heard = jiffies; 82 peer->last_time_heard = jiffies;
83 peer->last_time_ecne_reduced = jiffies; 83 peer->last_time_ecne_reduced = jiffies;
@@ -87,8 +87,8 @@ static struct sctp_transport *sctp_transport_init(struct net *net,
87 SPP_SACKDELAY_ENABLE; 87 SPP_SACKDELAY_ENABLE;
88 88
89 /* Initialize the default path max_retrans. */ 89 /* Initialize the default path max_retrans. */
90 peer->pathmaxrxt = sctp_max_retrans_path; 90 peer->pathmaxrxt = net->sctp.max_retrans_path;
91 peer->pf_retrans = sctp_pf_retrans; 91 peer->pf_retrans = net->sctp.pf_retrans;
92 92
93 INIT_LIST_HEAD(&peer->transmitted); 93 INIT_LIST_HEAD(&peer->transmitted);
94 INIT_LIST_HEAD(&peer->send_ready); 94 INIT_LIST_HEAD(&peer->send_ready);
@@ -318,6 +318,7 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)
318 SCTP_ASSERT(tp->rto_pending, "rto_pending not set", return); 318 SCTP_ASSERT(tp->rto_pending, "rto_pending not set", return);
319 319
320 if (tp->rttvar || tp->srtt) { 320 if (tp->rttvar || tp->srtt) {
321 struct net *net = sock_net(tp->asoc->base.sk);
321 /* 6.3.1 C3) When a new RTT measurement R' is made, set 322 /* 6.3.1 C3) When a new RTT measurement R' is made, set
322 * RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'| 323 * RTTVAR <- (1 - RTO.Beta) * RTTVAR + RTO.Beta * |SRTT - R'|
323 * SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R' 324 * SRTT <- (1 - RTO.Alpha) * SRTT + RTO.Alpha * R'
@@ -329,10 +330,10 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)
329 * For example, assuming the default value of RTO.Alpha of 330 * For example, assuming the default value of RTO.Alpha of
330 * 1/8, rto_alpha would be expressed as 3. 331 * 1/8, rto_alpha would be expressed as 3.
331 */ 332 */
332 tp->rttvar = tp->rttvar - (tp->rttvar >> sctp_rto_beta) 333 tp->rttvar = tp->rttvar - (tp->rttvar >> net->sctp.rto_beta)
333 + ((abs(tp->srtt - rtt)) >> sctp_rto_beta); 334 + ((abs(tp->srtt - rtt)) >> net->sctp.rto_beta);
334 tp->srtt = tp->srtt - (tp->srtt >> sctp_rto_alpha) 335 tp->srtt = tp->srtt - (tp->srtt >> net->sctp.rto_alpha)
335 + (rtt >> sctp_rto_alpha); 336 + (rtt >> net->sctp.rto_alpha);
336 } else { 337 } else {
337 /* 6.3.1 C2) When the first RTT measurement R is made, set 338 /* 6.3.1 C2) When the first RTT measurement R is made, set
338 * SRTT <- R, RTTVAR <- R/2. 339 * SRTT <- R, RTTVAR <- R/2.