tcp_zerocopy_closed.pkt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // SPDX-License-Identifier: GPL-2.0
  2. // send with MSG_ZEROCOPY on a non-established socket
  3. //
  4. // verify that a send in state TCP_CLOSE correctly aborts the zerocopy
  5. // operation, specifically it does not increment the zerocopy counter.
  6. //
  7. // First send on a closed socket and wait for (absent) notification.
  8. // Then connect and send and verify that notification nr. is zero.
  9. --send_omit_free // do not reuse send buffers with zerocopy
  10. `./defaults.sh`
  11. 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 4
  12. +0 setsockopt(4, SOL_SOCKET, SO_ZEROCOPY, [1], 4) = 0
  13. +0 send(4, ..., 4000, MSG_ZEROCOPY) = -1 EPIPE (Broken pipe)
  14. +0.1 recvmsg(4, {msg_name(...)=...,
  15. msg_iov(1)=[{...,0}],
  16. msg_flags=MSG_ERRQUEUE,
  17. msg_control=[]}, MSG_ERRQUEUE) = -1 EAGAIN (Resource temporarily unavailable)
  18. +0...0 connect(4, ..., ...) = 0
  19. +0 > S 0:0(0) <mss 1460,sackOK,TS val 0 ecr 0,nop,wscale 8>
  20. +0 < S. 0:0(0) ack 1 win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7>
  21. +0 > . 1:1(0) ack 1
  22. +0 send(4, ..., 4000, MSG_ZEROCOPY) = 4000
  23. +0 > P. 1:4001(4000) ack 1
  24. +0 < . 1:1(0) ack 4001 win 257
  25. +0 recvmsg(4, {msg_name(...)=...,
  26. msg_iov(1)=[{...,0}],
  27. msg_flags=MSG_ERRQUEUE,
  28. msg_control=[
  29. {cmsg_level=CMSG_LEVEL_IP,
  30. cmsg_type=CMSG_TYPE_RECVERR,
  31. cmsg_data={ee_errno=0,
  32. ee_origin=SO_EE_ORIGIN_ZEROCOPY,
  33. ee_type=0,
  34. ee_code=SO_EE_CODE_ZEROCOPY_COPIED,
  35. ee_info=0,
  36. ee_data=0}}
  37. ]}, MSG_ERRQUEUE) = 0