Commit 1ed1fe24 authored by David S. Miller's avatar David S. Miller

Merge branch 'sctp-pmtud-convergence'

Xin Long says:

====================
sctp: make the PLPMTUD probe more effective and efficient

As David Laight noticed, it currently takes quite some time to find
the optimal pmtu in the Search state, and also lacks the black hole
detection in the Search Complete state. This patchset is to address
them to mke the PLPMTUD probe more effective and efficient.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 98ebad48 fea1d5b1
...@@ -2835,10 +2835,14 @@ encap_port - INTEGER ...@@ -2835,10 +2835,14 @@ encap_port - INTEGER
Default: 0 Default: 0
plpmtud_probe_interval - INTEGER plpmtud_probe_interval - INTEGER
The time interval (in milliseconds) for sending PLPMTUD probe chunks. The time interval (in milliseconds) for the PLPMTUD probe timer,
These chunks are sent at the specified interval with a variable size which is configured to expire after this period to receive an
to probe the mtu of a given path between 2 endpoints. PLPMTUD will acknowledgment to a probe packet. This is also the time interval
be disabled when 0 is set, and other values for it must be >= 5000. between the probes for the current pmtu when the probe search
is done.
PLPMTUD will be disabled when 0 is set, and other values for it
must be >= 5000.
Default: 0 Default: 0
......
...@@ -987,7 +987,8 @@ struct sctp_transport { ...@@ -987,7 +987,8 @@ struct sctp_transport {
__u16 pmtu; __u16 pmtu;
__u16 probe_size; __u16 probe_size;
__u16 probe_high; __u16 probe_high;
__u8 probe_count; __u8 probe_count:3;
__u8 raise_count:5;
__u8 state; __u8 state;
} pl; /* plpmtud related */ } pl; /* plpmtud related */
......
...@@ -1275,7 +1275,10 @@ enum sctp_disposition sctp_sf_backbeat_8_3(struct net *net, ...@@ -1275,7 +1275,10 @@ enum sctp_disposition sctp_sf_backbeat_8_3(struct net *net,
return SCTP_DISPOSITION_DISCARD; return SCTP_DISPOSITION_DISCARD;
sctp_transport_pl_recv(link); sctp_transport_pl_recv(link);
if (link->pl.state == SCTP_PL_COMPLETE)
return SCTP_DISPOSITION_CONSUME; return SCTP_DISPOSITION_CONSUME;
return sctp_sf_send_probe(net, ep, asoc, type, link, commands);
} }
max_interval = link->hbinterval + link->rto; max_interval = link->hbinterval + link->rto;
......
...@@ -213,15 +213,10 @@ void sctp_transport_reset_reconf_timer(struct sctp_transport *transport) ...@@ -213,15 +213,10 @@ void sctp_transport_reset_reconf_timer(struct sctp_transport *transport)
void sctp_transport_reset_probe_timer(struct sctp_transport *transport) void sctp_transport_reset_probe_timer(struct sctp_transport *transport)
{ {
int scale = 1;
if (timer_pending(&transport->probe_timer)) if (timer_pending(&transport->probe_timer))
return; return;
if (transport->pl.state == SCTP_PL_COMPLETE &&
transport->pl.probe_count == 1)
scale = 30; /* works as PMTU_RAISE_TIMER */
if (!mod_timer(&transport->probe_timer, if (!mod_timer(&transport->probe_timer,
jiffies + transport->probe_interval * scale)) jiffies + transport->probe_interval))
sctp_transport_hold(transport); sctp_transport_hold(transport);
} }
...@@ -333,13 +328,15 @@ void sctp_transport_pl_recv(struct sctp_transport *t) ...@@ -333,13 +328,15 @@ void sctp_transport_pl_recv(struct sctp_transport *t)
t->pl.probe_size += SCTP_PL_MIN_STEP; t->pl.probe_size += SCTP_PL_MIN_STEP;
if (t->pl.probe_size >= t->pl.probe_high) { if (t->pl.probe_size >= t->pl.probe_high) {
t->pl.probe_high = 0; t->pl.probe_high = 0;
t->pl.raise_count = 0;
t->pl.state = SCTP_PL_COMPLETE; /* Search -> Search Complete */ t->pl.state = SCTP_PL_COMPLETE; /* Search -> Search Complete */
t->pl.probe_size = t->pl.pmtu; t->pl.probe_size = t->pl.pmtu;
t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t); t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t);
sctp_assoc_sync_pmtu(t->asoc); sctp_assoc_sync_pmtu(t->asoc);
} }
} else if (t->pl.state == SCTP_PL_COMPLETE) { } else if (t->pl.state == SCTP_PL_COMPLETE && ++t->pl.raise_count == 30) {
/* Raise probe_size again after 30 * interval in Search Complete */
t->pl.state = SCTP_PL_SEARCH; /* Search Complete -> Search */ t->pl.state = SCTP_PL_SEARCH; /* Search Complete -> Search */
t->pl.probe_size += SCTP_PL_MIN_STEP; t->pl.probe_size += SCTP_PL_MIN_STEP;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment