io_uring zero-copy send
io_uring zero-copy send is a socket-send operation that attempts to avoid payload copying and separates the send result from any required buffer-release notification.
The initial CQE reports sent bytes or a negative error. If IORING_CQE_F_MORE is set, keep the payload unchanged until the matching IORING_CQE_F_NOTIF notification, even after an initial error. Both entries carry the request's user_data. Without F_MORE, no notification is promised for that send. [1] [4]
With IORING_SEND_ZC_REPORT_USAGE, notification res is a bitfield, not a second send result. IORING_NOTIF_USAGE_ZC_COPIED occupies bit 31 and therefore appears negative in signed res. Classify F_NOTIF before interpreting res as an errno. Without usage reporting, a zero notification result does not establish copy avoidance. [2]
Linux v6.16 sets COPIED when copying occurred or no successful zero-copy use was recorded. An unsuccessful send can therefore carry that indication without proving any nonzero copied-byte count. [3]
Copy fallback is permitted. Notification releases this request's lifetime hold; it does not establish transmission, remote receipt or remote persistence. Traditional MSG_ZEROCOPY instead reports lifetime events through the socket error queue; its send-ID ranges are not the SEND_ZC CQE interface. [1] [5]
Relations
Limitations
- A single-TCP-connection microbenchmark found zero-copy send costlier below about 1 KiB. This workload-specific crossover is not an API guarantee. [6]
Citations
- liburing 2.11: io_uring_enter(2), SEND_ZC results and notification lifetime
- Linux v6.16: io_uring.h, SEND_ZC_REPORT_USAGE and notification flags
- Linux v6.16: notif.c, io_notif_tw_complete and zero-copy usage reporting
- Linux v6.16: net.c, io_send_zc_prep and io_sendrecv_fail
- Linux v6.16: MSG_ZEROCOPY, socket error-queue notifications and deferred copying
- Jasny et al.: High-Performance DBMSs with io_uring, arXiv v3, section 4.6, Figure 17
Further reading
Sources & caveats
- API review targets liburing 2.11; implementation details target Linux v6.16. These are pinned review versions, not claims about the latest releases.
- The remote-persistence boundary is an engineering inference from the local send and buffer-lifetime contracts. No native zero-copy or performance experiment is claimed.