Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sctp: send pmtu probe only if packet loss in Search Complete state

This 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.

v1->v2:
- add the missing Fixes tag.

Fixes: 0dac127c0557 ("sctp: do black hole detection in search complete state")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Xin Long and committed by
David S. Miller
eacf078c 058e6e0e

+6 -1
+1
include/net/sctp/structs.h
··· 984 984 } cacc; 985 985 986 986 struct { 987 + __u32 last_rtx_chunks; 987 988 __u16 pmtu; 988 989 __u16 probe_size; 989 990 __u16 probe_high;
+5 -1
net/sctp/transport.c
··· 263 263 if (t->pl.probe_count < SCTP_MAX_PROBES) 264 264 goto out; 265 265 266 + t->pl.last_rtx_chunks = t->asoc->rtx_data_chunks; 266 267 t->pl.probe_count = 0; 267 268 if (t->pl.state == SCTP_PL_BASE) { 268 269 if (t->pl.probe_size == SCTP_BASE_PLPMTU) { /* BASE_PLPMTU Confirmation Failed */ ··· 299 298 300 299 out: 301 300 if (t->pl.state == SCTP_PL_COMPLETE && t->pl.raise_count < 30 && 302 - !t->pl.probe_count) 301 + !t->pl.probe_count && t->pl.last_rtx_chunks == t->asoc->rtx_data_chunks) { 303 302 t->pl.raise_count++; 303 + return false; 304 + } 304 305 305 306 pr_debug("%s: PLPMTUD: transport: %p, state: %d, pmtu: %d, size: %d, high: %d\n", 306 307 __func__, t, t->pl.state, t->pl.pmtu, t->pl.probe_size, t->pl.probe_high); ··· 316 313 pr_debug("%s: PLPMTUD: transport: %p, state: %d, pmtu: %d, size: %d, high: %d\n", 317 314 __func__, t, t->pl.state, t->pl.pmtu, t->pl.probe_size, t->pl.probe_high); 318 315 316 + t->pl.last_rtx_chunks = t->asoc->rtx_data_chunks; 319 317 t->pl.pmtu = t->pl.probe_size; 320 318 t->pl.probe_count = 0; 321 319 if (t->pl.state == SCTP_PL_BASE) {