Skip to content

Commit b939c07

Browse files
edumazetkuba-moo
authored andcommitted
selftests/net: packetdrill: add tcp_ooo-before-and-after-accept.pkt
Test how new passive flows react to ooo incoming packets. Their sk_rcvbuf can increase only after accept(). Signed-off-by: Eric Dumazet <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1a03ede commit b939c07

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
--mss=1000
4+
5+
`./defaults.sh
6+
sysctl -q net.ipv4.tcp_rmem="4096 131072 $((32*1024*1024))"`
7+
8+
// Test that a not-yet-accepted socket does not change
9+
// its initial sk_rcvbuf (tcp_rmem[1]) when receiving ooo packets.
10+
11+
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
12+
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
13+
+0 bind(3, ..., ...) = 0
14+
+0 listen(3, 1) = 0
15+
16+
+0 < S 0:0(0) win 65535 <mss 1000,nop,nop,sackOK,nop,wscale 7>
17+
+0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 10>
18+
+.1 < . 1:1(0) ack 1 win 257
19+
+0 < . 2001:41001(39000) ack 1 win 257
20+
+0 > . 1:1(0) ack 1 <nop,nop,sack 2001:41001>
21+
+0 < . 41001:101001(60000) ack 1 win 257
22+
+0 > . 1:1(0) ack 1 <nop,nop,sack 2001:101001>
23+
+0 < . 1:1001(1000) ack 1 win 257
24+
+0 > . 1:1(0) ack 1001 <nop,nop,sack 2001:101001>
25+
+0 < . 1001:2001(1000) ack 1 win 257
26+
+0 > . 1:1(0) ack 101001
27+
28+
+0 accept(3, ..., ...) = 4
29+
30+
+0 %{ assert SK_MEMINFO_RCVBUF == 131072, SK_MEMINFO_RCVBUF }%
31+
32+
+0 close(4) = 0
33+
+0 close(3) = 0
34+
35+
// Test that ooo packets for accepted sockets do increase sk_rcvbuf
36+
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
37+
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
38+
+0 bind(3, ..., ...) = 0
39+
+0 listen(3, 1) = 0
40+
41+
+0 < S 0:0(0) win 65535 <mss 1000,nop,nop,sackOK,nop,wscale 7>
42+
+0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 10>
43+
+.1 < . 1:1(0) ack 1 win 257
44+
45+
+0 accept(3, ..., ...) = 4
46+
47+
+0 < . 2001:41001(39000) ack 1 win 257
48+
+0 > . 1:1(0) ack 1 <nop,nop,sack 2001:41001>
49+
+0 < . 41001:101001(60000) ack 1 win 257
50+
+0 > . 1:1(0) ack 1 <nop,nop,sack 2001:101001>
51+
52+
+0 %{ assert SK_MEMINFO_RCVBUF > 131072, SK_MEMINFO_RCVBUF }%
53+

0 commit comments

Comments
 (0)