History

sock: add MSG_ZEROCOPY

The kernel supports zerocopy sendmsg in virtio and tap. Expand the infrastructure to support other socket types. Introduce a completion notification channel over the socket error queue. Notifications are returned with ee_origin SO_EE_ORIGIN_ZEROCOPY. ee_errno is 0 to avoid blocking the send/recv path on receiving notifications. Add reference counting, to support the skb split, merge, resize and clone operations possible with SOCK_STREAM and other socket types. The patch does not yet modify any datapaths.

Willem de Bruijn committed 9 years ago

Commit 52267791 parent 3ece7827 files · +235 −21Browse files

Showing the changes to include/uapi/linux/errqueue.h (1 of 7 files). Show all

Unified · Split

include/uapi/linux/errqueue.h+3−0
@@ -18,10 +18,13 @@ struct sock_extended_err { · 17 unmodified lines
18#define SO_EE_ORIGIN_ICMP 218#define SO_EE_ORIGIN_ICMP 2
19#define SO_EE_ORIGIN_ICMP6 319#define SO_EE_ORIGIN_ICMP6 3
20#define SO_EE_ORIGIN_TXSTATUS 420#define SO_EE_ORIGIN_TXSTATUS 4
21#define SO_EE_ORIGIN_ZEROCOPY 5
21#define SO_EE_ORIGIN_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS22#define SO_EE_ORIGIN_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS
22 23
23#define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))24#define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
24 25
26#define SO_EE_CODE_ZEROCOPY_COPIED 1
27
25/**28/**
26 * struct scm_timestamping - timestamps exposed through cmsg29 * struct scm_timestamping - timestamps exposed through cmsg
27 *30 *