sctp: improve the pmtu probe in Search Complete state
Subsystems (3)
Xin Long
maintainerPATCH 1/2 sctp: improve the code for pmtu probe send and recv update
In reply to Xin LongThis patch does 3 things:
- make sctp_transport_pl_send() and sctp_transport_pl_recv() return bool type to decide if more probe is needed to send.
- pr_debug() only when probe is really needed to send.
- count pl.raise_count in sctp_transport_pl_send() instead of sctp_transport_pl_recv(), and it's only incremented for the 1st probe for the same size.
These are preparations for the next patch to make probes happen only when there's packet loss in Search Complete state.
--- include/net/sctp/structs.h | 4 ++-- net/sctp/sm_statefuns.c | 15 +++++++------- net/sctp/transport.c | 41 +++++++++++++++++++++----------------- 3 files changed, 32 insertions(+), 28 deletions(-)
include/net/sctp/structs.h +2 -2
@@ -1024,8 +1024,8 @@ bool sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu);void sctp_transport_immediate_rtx (struct sctp_transport *);void sctp_transport_dst_release (struct sctp_transport *t);void sctp_transport_dst_confirm (struct sctp_transport *t); -void sctp_transport_pl_send (struct sctp_transport *t); -void sctp_transport_pl_recv (struct sctp_transport *t); +bool sctp_transport_pl_send (struct sctp_transport *t); +bool sctp_transport_pl_recv (struct sctp_transport *t);/* This is the structure we use to queue packets as they come into
net/sctp/sm_statefuns.c +7 -8
@@ -1109,12 +1109,12 @@ enum sctp_disposition sctp_sf_send_probe(struct net *net,if (!sctp_transport_pl_enabled (transport))return SCTP_DISPOSITION_CONSUME ; -sctp_transport_pl_send (transport); - - reply =sctp_make_heartbeat (asoc, transport, transport->pl.probe_size); -if (!reply) -return SCTP_DISPOSITION_NOMEM ; -sctp_add_cmd_sf (commands,SCTP_CMD_REPLY ,SCTP_CHUNK (reply)); +if (sctp_transport_pl_send (transport)) { + reply =sctp_make_heartbeat (asoc, transport, transport->pl.probe_size); +if (!reply) +return SCTP_DISPOSITION_NOMEM ; +sctp_add_cmd_sf (commands,SCTP_CMD_REPLY ,SCTP_CHUNK (reply)); + }sctp_add_cmd_sf (commands,SCTP_CMD_PROBE_TIMER_UPDATE ,SCTP_TRANSPORT (transport));
@@ -1274,8 +1274,7 @@ enum sctp_disposition sctp_sf_backbeat_8_3(struct net *net, !sctp_transport_pl_enabled(link))return SCTP_DISPOSITION_DISCARD ; -sctp_transport_pl_recv (link); -if (link->pl.state ==SCTP_PL_COMPLETE ) +if (sctp_transport_pl_recv (link))return SCTP_DISPOSITION_CONSUME ;return sctp_sf_send_probe (net, ep, asoc, type, link, commands);
net/sctp/transport.c +23 -18
70 lines not on this page · raw message
Signature · 1 line
2.27.0
Xin Long
maintainerPATCH 2/2 sctp: send pmtu probe only if packet loss in Search Complete state
In reply to Xin LongThis patch is to introduce last_rtx_chunks into sctp_transport to detect if there's any packet retransmission/loss happened by checking against asoc's rtx_data_chunks in sctp_transport_pl_send().
If there is, namely, transport->last_rtx_chunks != asoc->rtx_data_chunks, the pmtu probe will be sent out. Otherwise, increment the pl.raise_count and return when it's in Search Complete state.
With this patch, if in Search Complete state, which is a long period, it doesn't need to keep probing the current pmtu unless there's data packet loss. This will save quite some traffic.
--- include/net/sctp/structs.h | 1 + net/sctp/transport.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-)
include/net/sctp/structs.h +1 -0
@@ -984,6 +984,7 @@ struct sctp_transport { } cacc;struct { +__u32 last_rtx_chunks;__u16 pmtu;__u16 probe_size;__u16 probe_high;
net/sctp/transport.c +5 -1
@@ -263,6 +263,7 @@ bool sctp_transport_pl_send(struct sctp_transport *t)if (t->pl.probe_count <SCTP_MAX_PROBES ) goto out; + t->pl.last_rtx_chunks = t->asoc->rtx_data_chunks; t->pl.probe_count =0 ;if (t->pl.state ==SCTP_PL_BASE ) {if (t->pl.probe_size ==SCTP_BASE_PLPMTU ) {/* BASE_PLPMTU Confirmation Failed */
@@ -298,8 +299,10 @@ bool sctp_transport_pl_send(struct sctp_transport *t) out:if (t->pl.state ==SCTP_PL_COMPLETE && t->pl.raise_count <30 && - !t->pl.probe_count) + !t->pl.probe_count && t->pl.last_rtx_chunks == t->asoc->rtx_data_chunks) { t->pl.raise_count++; +return false; + }pr_debug ("%s: PLPMTUD: transport: %p, state: %d, pmtu: %d, size: %d, high: %d\n" , __func__, t, t->pl.state, t->pl.pmtu, t->pl.probe_size, t->pl.probe_high);
@@ -313,6 +316,7 @@ bool sctp_transport_pl_recv(struct sctp_transport *t)pr_debug ("%s: PLPMTUD: transport: %p, state: %d, pmtu: %d, size: %d, high: %d\n" , __func__, t, t->pl.state, t->pl.pmtu, t->pl.probe_size, t->pl.probe_high); + t->pl.last_rtx_chunks = t->asoc->rtx_data_chunks; t->pl.pmtu = t->pl.probe_size; t->pl.probe_count =0 ;if (t->pl.state ==SCTP_PL_BASE ) {
Signature · 1 line
2.27.0
Xin Long
maintainercover sctp: improve the pmtu probe in Search Complete state
Timo recently suggested to use the loss of (data) packets as indication to send pmtu probe for Search Complete state, which should also be implied by RFC8899. This patchset is to change the current one that is doing probe with current pmtu all the time.
Xin Long (2):
sctp: improve the code for pmtu probe send and recv update
sctp: send pmtu probe only if packet loss in Search Complete state
include/net/sctp/structs.h | 5 +++-- net/sctp/sm_statefuns.c | 15 ++++++------- net/sctp/transport.c | 45 +++++++++++++++++++++++--------------- 3 files changed, 37 insertions(+), 28 deletions(-)
Signature · 1 line
2.27.0
Jakub Kicinski
maintainerRe: [PATCH net 2/2] sctp: send pmtu probe only if packet loss in Search Complete state
In reply to Xin LongQuoted 8 lines · Xin Long
This patch is to introduce
last_rtx_chunksintosctp_transportto detect if there's any packet retransmission/loss happened by checking against asoc'srtx_data_chunksinsctp_transport_pl_send().If there is, namely,
transport->last_rtx_chunks!=asoc->rtx_data_chunks, the pmtu probe will be sent out. Otherwise, increment the pl.raise_count and return when it's in Search Complete state.
Quoted 5 lines
With this patch, if in Search Complete state, which is a long period, it doesn't need to keep probing the current pmtu unless there's data packet loss. This will save quite some traffic.
Signed-off-by Xin Long <[email protected]>
Can we get a Fixes tag, please?
Xin Long
maintainerRe: [PATCH net 2/2] sctp: send pmtu probe only if packet loss in Search Complete state
Quoted 10 lines · Jakub Kicinski
Quoted 8 lines · Xin Long
This patch is to introduce
last_rtx_chunksintosctp_transportto detect if there's any packet retransmission/loss happened by checking against asoc'srtx_data_chunksinsctp_transport_pl_send().If there is, namely,
transport->last_rtx_chunks!=asoc->rtx_data_chunks, the pmtu probe will be sent out. Otherwise, increment the pl.raise_count and return when it's in Search Complete state.
Quoted 7 lines
Quoted 5 lines
With this patch, if in Search Complete state, which is a long period, it doesn't need to keep probing the current pmtu unless there's data packet loss. This will save quite some traffic.
Signed-off-by Xin Long <[email protected]>Can we get a Fixes tag, please?
Should I repost?