xref: /linux/tools/testing/selftests/net/packetdrill/tcp_zerocopy_batch.pkt (revision 6dfafbd0299a60bfb5d5e277fdf100037c7ded07)
1// SPDX-License-Identifier: GPL-2.0
2// batch zerocopy test:
3//
4// send multiple packets, then read one range of all notifications.
5
6--send_omit_free	// do not reuse send buffers with zerocopy
7
8`./defaults.sh`
9
10    0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
11   +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
12   +0 setsockopt(3, SOL_SOCKET, SO_ZEROCOPY, [1], 4) = 0
13   +0 bind(3, ..., ...) = 0
14   +0 listen(3, 1) = 0
15
16   +0 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7>
17   +0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8>
18   +0 < . 1:1(0) ack 1 win 257
19
20   +0 accept(3, ..., ...) = 4
21   +0 setsockopt(4, SOL_SOCKET, SO_MARK, [666], 4) = 0
22
23   +0 send(4, ..., 4000, MSG_ZEROCOPY) = 4000
24   +0 > P. 1:4001(4000) ack 1
25   +0 < . 1:1(0) ack 4001 win 257
26
27   +0 send(4, ..., 4000, MSG_ZEROCOPY) = 4000
28   +0 > P. 4001:8001(4000) ack 1
29   +0 < . 1:1(0) ack 8001 win 257
30
31   +0 recvmsg(4, {msg_name(...)=...,
32                  msg_iov(1)=[{...,0}],
33                  msg_flags=MSG_ERRQUEUE,
34                  msg_control=[
35                        {cmsg_level=CMSG_LEVEL_IP,
36                         cmsg_type=CMSG_TYPE_RECVERR,
37                         cmsg_data={ee_errno=0,
38                                    ee_origin=SO_EE_ORIGIN_ZEROCOPY,
39                                    ee_type=0,
40                                    ee_code=SO_EE_CODE_ZEROCOPY_COPIED,
41                                    ee_info=0,
42                                    ee_data=1}}
43                  ]}, MSG_ERRQUEUE) = 0
44