1// SPDX-License-Identifier: GPL-2.0 2// small packet zerocopy test: 3// 4// verify that SO_EE_CODE_ZEROCOPY_COPIED is set on zerocopy 5// packets of all sizes, including the smallest payload, 1B. 6 7--send_omit_free // do not reuse send buffers with zerocopy 8 9`./defaults.sh` 10 11 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 12 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 13 +0 setsockopt(3, SOL_SOCKET, SO_ZEROCOPY, [1], 4) = 0 14 +0 bind(3, ..., ...) = 0 15 +0 listen(3, 1) = 0 16 17 +0 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7> 18 +0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8> 19 +0 < . 1:1(0) ack 1 win 257 20 21 +0 accept(3, ..., ...) = 4 22 23 // send 1B 24 +0 send(4, ..., 1, MSG_ZEROCOPY) = 1 25 +0 > P. 1:2(1) ack 1 26 +0 < . 1:1(0) ack 2 win 257 27 28 +1 recvmsg(4, {msg_name(...)=..., 29 msg_iov(1)=[{...,0}], 30 msg_flags=MSG_ERRQUEUE, 31 msg_control=[ 32 {cmsg_level=CMSG_LEVEL_IP, 33 cmsg_type=CMSG_TYPE_RECVERR, 34 cmsg_data={ee_errno=0, 35 ee_origin=SO_EE_ORIGIN_ZEROCOPY, 36 ee_type=0, 37 ee_code=SO_EE_CODE_ZEROCOPY_COPIED, 38 ee_info=0, 39 ee_data=0}} 40 ]}, MSG_ERRQUEUE) = 0 41 42 // send 1B again 43 +0 send(4, ..., 1, MSG_ZEROCOPY) = 1 44 +0 > P. 2:3(1) ack 1 45 +0 < . 1:1(0) ack 3 win 257 46 47 +1 recvmsg(4, {msg_name(...)=..., 48 msg_iov(1)=[{...,0}], 49 msg_flags=MSG_ERRQUEUE, 50 msg_control=[ 51 {cmsg_level=CMSG_LEVEL_IP, 52 cmsg_type=CMSG_TYPE_RECVERR, 53 cmsg_data={ee_errno=0, 54 ee_origin=SO_EE_ORIGIN_ZEROCOPY, 55 ee_type=0, 56 ee_code=SO_EE_CODE_ZEROCOPY_COPIED, 57 ee_info=1, 58 ee_data=1}} 59 ]}, MSG_ERRQUEUE) = 0 60