Message ID | 79f4da2e037fb14258865db606a102bf587404f0.1684440180.git.lucien.xin@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 6ca328e985cd995dfd1d5de44046e6074f853fbb |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [PATCHv2,net] sctp: fix an issue that plpmtu can never go to complete state | expand |
Hello: This patch was applied to netdev/net.git (main) by David S. Miller <davem@davemloft.net>: On Thu, 18 May 2023 16:03:00 -0400 you wrote: > When doing plpmtu probe, the probe size is growing every time when it > receives the ACK during the Search state until the probe fails. When > the failure occurs, pl.probe_high is set and it goes to the Complete > state. > > However, if the link pmtu is huge, like 65535 in loopback_dev, the probe > eventually keeps using SCTP_MAX_PLPMTU as the probe size and never fails. > Because of that, pl.probe_high can not be set, and the plpmtu probe can > never go to the Complete state. > > [...] Here is the summary with links: - [PATCHv2,net] sctp: fix an issue that plpmtu can never go to complete state https://git.kernel.org/netdev/net/c/6ca328e985cd You are awesome, thank you!
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 2f66a2006517..2abe45af98e7 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c @@ -324,9 +324,12 @@ bool sctp_transport_pl_recv(struct sctp_transport *t) t->pl.probe_size += SCTP_PL_BIG_STEP; } else if (t->pl.state == SCTP_PL_SEARCH) { if (!t->pl.probe_high) { - t->pl.probe_size = min(t->pl.probe_size + SCTP_PL_BIG_STEP, - SCTP_MAX_PLPMTU); - return false; + if (t->pl.probe_size < SCTP_MAX_PLPMTU) { + t->pl.probe_size = min(t->pl.probe_size + SCTP_PL_BIG_STEP, + SCTP_MAX_PLPMTU); + return false; + } + t->pl.probe_high = SCTP_MAX_PLPMTU; } t->pl.probe_size += SCTP_PL_MIN_STEP; if (t->pl.probe_size >= t->pl.probe_high) { @@ -341,7 +344,7 @@ bool sctp_transport_pl_recv(struct sctp_transport *t) } else if (t->pl.state == SCTP_PL_COMPLETE) { /* Raise probe_size again after 30 * interval in Search Complete */ t->pl.state = SCTP_PL_SEARCH; /* Search Complete -> Search */ - t->pl.probe_size += SCTP_PL_MIN_STEP; + t->pl.probe_size = min(t->pl.probe_size + SCTP_PL_MIN_STEP, SCTP_MAX_PLPMTU); } return t->pl.state == SCTP_PL_COMPLETE;
When doing plpmtu probe, the probe size is growing every time when it receives the ACK during the Search state until the probe fails. When the failure occurs, pl.probe_high is set and it goes to the Complete state. However, if the link pmtu is huge, like 65535 in loopback_dev, the probe eventually keeps using SCTP_MAX_PLPMTU as the probe size and never fails. Because of that, pl.probe_high can not be set, and the plpmtu probe can never go to the Complete state. Fix it by setting pl.probe_high to SCTP_MAX_PLPMTU when the probe size grows to SCTP_MAX_PLPMTU in sctp_transport_pl_recv(). Also, not allow the probe size greater than SCTP_MAX_PLPMTU in the Complete state. Fixes: b87641aff9e7 ("sctp: do state transition when a probe succeeds on HB ACK recv path") Signed-off-by: Xin Long <lucien.xin@gmail.com> --- v2: - fix the probe size can't reach SCTP_MAX_PLPMTU, as Paolo suggested. --- net/sctp/transport.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)