aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2009-11-23 15:53:57 -0500
committerVlad Yasevich <vladislav.yasevich@hp.com>2009-11-23 15:53:57 -0500
commit90f2f5318b3a5b0898fef0fec9b91376c7de7a2c (patch)
tree33622d2b9e2064c36c17cd108c9b3a23af1fd6a4 /net/sctp
parente0e9db178a5ba4dbb5f16f958f1affbdc63d2cc4 (diff)
sctp: Update SWS avaoidance receiver side algorithm
We currently send window update SACKs every time we free up 1 PMTU worth of data. That a lot more SACKs then necessary. Instead, we'll now send back the actuall window every time we send a sack, and do window-update SACKs when a fraction of the receive buffer has been opened. The fraction is controlled with a sysctl. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/associola.c5
-rw-r--r--net/sctp/protocol.c3
-rw-r--r--net/sctp/sm_sideeffect.c3
-rw-r--r--net/sctp/sysctl.c13
4 files changed, 20 insertions, 4 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 8e755ebff3b8..37e982510bea 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1383,8 +1383,9 @@ static inline int sctp_peer_needs_update(struct sctp_association *asoc)
1383 case SCTP_STATE_SHUTDOWN_RECEIVED: 1383 case SCTP_STATE_SHUTDOWN_RECEIVED:
1384 case SCTP_STATE_SHUTDOWN_SENT: 1384 case SCTP_STATE_SHUTDOWN_SENT:
1385 if ((asoc->rwnd > asoc->a_rwnd) && 1385 if ((asoc->rwnd > asoc->a_rwnd) &&
1386 ((asoc->rwnd - asoc->a_rwnd) >= 1386 ((asoc->rwnd - asoc->a_rwnd) >= max_t(__u32,
1387 min_t(__u32, (asoc->base.sk->sk_rcvbuf >> 1), asoc->pathmtu))) 1387 (asoc->base.sk->sk_rcvbuf >> sctp_rwnd_upd_shift),
1388 asoc->pathmtu)))
1388 return 1; 1389 return 1;
1389 break; 1390 break;
1390 default: 1391 default:
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 08ef203d36ac..a3c8988758b1 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1258,6 +1258,9 @@ SCTP_STATIC __init int sctp_init(void)
1258 /* Set SCOPE policy to enabled */ 1258 /* Set SCOPE policy to enabled */
1259 sctp_scope_policy = SCTP_SCOPE_POLICY_ENABLE; 1259 sctp_scope_policy = SCTP_SCOPE_POLICY_ENABLE;
1260 1260
1261 /* Set the default rwnd update threshold */
1262 sctp_rwnd_upd_shift = SCTP_DEFAULT_RWND_SHIFT;
1263
1261 sctp_sysctl_register(); 1264 sctp_sysctl_register();
1262 1265
1263 INIT_LIST_HEAD(&sctp_address_families); 1266 INIT_LIST_HEAD(&sctp_address_families);
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index eda4fe783be5..8ae67098e094 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -217,8 +217,7 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force,
217 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, 217 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,
218 SCTP_TO(SCTP_EVENT_TIMEOUT_SACK)); 218 SCTP_TO(SCTP_EVENT_TIMEOUT_SACK));
219 } else { 219 } else {
220 if (asoc->a_rwnd > asoc->rwnd) 220 asoc->a_rwnd = asoc->rwnd;
221 asoc->a_rwnd = asoc->rwnd;
222 sack = sctp_make_sack(asoc); 221 sack = sctp_make_sack(asoc);
223 if (!sack) 222 if (!sack)
224 goto nomem; 223 goto nomem;
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index ab7151da120f..ae03ded2bf1a 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -52,6 +52,7 @@ static int int_max = INT_MAX;
52static int sack_timer_min = 1; 52static int sack_timer_min = 1;
53static int sack_timer_max = 500; 53static int sack_timer_max = 500;
54static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */ 54static int addr_scope_max = 3; /* check sctp_scope_policy_t in include/net/sctp/constants.h for max entries */
55static int rwnd_scale_max = 16;
55 56
56extern int sysctl_sctp_mem[3]; 57extern int sysctl_sctp_mem[3];
57extern int sysctl_sctp_rmem[3]; 58extern int sysctl_sctp_rmem[3];
@@ -284,6 +285,18 @@ static ctl_table sctp_table[] = {
284 .extra1 = &zero, 285 .extra1 = &zero,
285 .extra2 = &addr_scope_max, 286 .extra2 = &addr_scope_max,
286 }, 287 },
288 {
289 .ctl_name = CTL_UNNUMBERED,
290 .procname = "rwnd_update_shift",
291 .data = &sctp_rwnd_upd_shift,
292 .maxlen = sizeof(int),
293 .mode = 0644,
294 .proc_handler = &proc_dointvec_minmax,
295 .strategy = &sysctl_intvec,
296 .extra1 = &one,
297 .extra2 = &rwnd_scale_max,
298 },
299
287 { .ctl_name = 0 } 300 { .ctl_name = 0 }
288}; 301};
289 302