xref: /linux/tools/testing/selftests/net/packetdrill/tcp_zerocopy_batch.pkt (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
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`./defaults.sh`
7
8    0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
9   +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
10   +0 setsockopt(3, SOL_SOCKET, SO_ZEROCOPY, [1], 4) = 0
11   +0 bind(3, ..., ...) = 0
12   +0 listen(3, 1) = 0
13
14   +0 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7>
15   +0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8>
16   +0 < . 1:1(0) ack 1 win 257
17
18   +0 accept(3, ..., ...) = 4
19   +0 setsockopt(4, SOL_SOCKET, SO_MARK, [666], 4) = 0
20
21   +0 send(4, ..., 4000, MSG_ZEROCOPY) = 4000
22   +0 > P. 1:4001(4000) ack 1
23   +0 < . 1:1(0) ack 4001 win 257
24
25   +0 send(4, ..., 4000, MSG_ZEROCOPY) = 4000
26   +0 > P. 4001:8001(4000) ack 1
27   +0 < . 1:1(0) ack 8001 win 257
28
29   +0 recvmsg(4, {msg_name(...)=...,
30                  msg_iov(1)=[{...,0}],
31                  msg_flags=MSG_ERRQUEUE,
32                  msg_control=[
33                        {cmsg_level=CMSG_LEVEL_IP,
34                         cmsg_type=CMSG_TYPE_RECVERR,
35                         cmsg_data={ee_errno=0,
36                                    ee_origin=SO_EE_ORIGIN_ZEROCOPY,
37                                    ee_type=0,
38                                    ee_code=SO_EE_CODE_ZEROCOPY_COPIED,
39                                    ee_info=0,
40                                    ee_data=1}}
41                  ]}, MSG_ERRQUEUE) = 0
42