brintos

brintos / linux-shallow public Read only

0
0
Text · 2.4 KiB · fadc480 Raw
64 lines · plain
1// SPDX-License-Identifier: GPL-2.02// epoll zerocopy test:3//4// EPOLLERR is known to be not edge-triggered unlike EPOLLIN and EPOLLOUT but5// it is not level-triggered either. this tests verify that the same behavior is6// maintained when we have EPOLLEXCLUSIVE.7//8// fire two sends with MSG_ZEROCOPY and receive the acks. confirm that EPOLLERR9// is correctly fired only once, when EPOLLET is set. send another packet with10// MSG_ZEROCOPY. confirm that EPOLLERR is correctly fired again only once.11`./defaults.sh`12 13    0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 314   +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 015   +0 setsockopt(3, SOL_SOCKET, SO_ZEROCOPY, [1], 4) = 016   +0 bind(3, ..., ...) = 017   +0 listen(3, 1) = 018 19   +0 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7>20   +0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8>21   +0 < . 1:1(0) ack 1 win 25722 23   +0 accept(3, ..., ...) = 424 25   +0 fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 026   +0 epoll_create(1) = 527   +0 epoll_ctl(5, EPOLL_CTL_ADD, 4,28		{events=EPOLLOUT|EPOLLET|EPOLLEXCLUSIVE, fd=4}) = 029   +0 epoll_wait(5, {events=EPOLLOUT, fd=4}, 1, 0) = 130 31   +0 send(4, ..., 4000, MSG_ZEROCOPY) = 400032   +0 > P. 1:4001(4000) ack 133   +0 < . 1:1(0) ack 4001 win 25734 35   +0 send(4, ..., 4000, MSG_ZEROCOPY) = 400036   +0 > P. 4001:8001(4000) ack 137   +0 < . 1:1(0) ack 8001 win 25738 39// receive only one EPOLLERR for the two sends above.40   +0 epoll_wait(5, {events=EPOLLERR|EPOLLOUT, fd=4}, 1, 0) = 141   +0 epoll_wait(5, {events=0, ptr=0}, 1, 0) = 042 43   +0 send(4, ..., 4000, MSG_ZEROCOPY) = 400044   +0 > P. 8001:12001(4000) ack 145   +0 < . 1:1(0) ack 12001 win 25746 47// receive only one EPOLLERR for the third send above.48   +0 epoll_wait(5, {events=EPOLLERR|EPOLLOUT, fd=4}, 1, 0) = 149   +0 epoll_wait(5, {events=0, ptr=0}, 1, 0) = 050 51   +0 recvmsg(4, {msg_name(...)=...,52                  msg_iov(1)=[{...,0}],53                  msg_flags=MSG_ERRQUEUE,54                  msg_control=[55                        {cmsg_level=CMSG_LEVEL_IP,56                         cmsg_type=CMSG_TYPE_RECVERR,57                         cmsg_data={ee_errno=0,58                                    ee_origin=SO_EE_ORIGIN_ZEROCOPY,59                                    ee_type=0,60                                    ee_code=SO_EE_CODE_ZEROCOPY_COPIED,61                                    ee_info=0,62                                    ee_data=2}}63                   ]}, MSG_ERRQUEUE) = 064