History

rds: deliver zerocopy completion notification with data

This commit is an optimization over commit 01883eda72bd ("rds: support for zcopy completion notification") for PF_RDS sockets. RDS applications are predominantly request-response transactions, so it is more efficient to reduce the number of system calls and have zerocopy completion notification delivered as ancillary data on the POLLIN channel. Cookies are passed up as ancillary data (at level SOL_RDS) in a struct rds_zcopy_cookies when the returned value of recvmsg() is greater than, or equal to, 0. A max of RDS_MAX_ZCOOKIES may be passed with each message. This commit removes support for zerocopy completion notification on MSG_ERRQUEUE for PF_RDS sockets.

Sowmini Varadhan committed 8 years ago

Commit 401910d1 parent 67490e36 files · +60 −27Browse files

Showing the changes to include/uapi/linux (2 of 6 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/errqueue.h +0 −2
  2. include/uapi/linux/rds.h +7 −0
include/uapi/linux/errqueue.h+0−2
@@ -20,13 +20,11 @@ struct sock_extended_err { · 19 unmodified lines
2020 #define SO_EE_ORIGIN_ICMP6 3
2121 #define SO_EE_ORIGIN_TXSTATUS 4
2222 #define SO_EE_ORIGIN_ZEROCOPY 5
23−#define SO_EE_ORIGIN_ZCOOKIE 6
2423 #define SO_EE_ORIGIN_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS
2524
2625 #define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
2726
2827 #define SO_EE_CODE_ZEROCOPY_COPIED 1
29−#define SO_EE_ORIGIN_MAX_ZCOOKIES 8
3028
3129 /**
3230 * struct scm_timestamping - timestamps exposed through cmsg
include/uapi/linux/rds.h+7−0
@@ -104,6 +104,7 @@ · 103 unmodified lines
104104 #define RDS_CMSG_MASKED_ATOMIC_CSWP 9
105105 #define RDS_CMSG_RXPATH_LATENCY 11
106106 #define RDS_CMSG_ZCOPY_COOKIE 12
107+#define RDS_CMSG_ZCOPY_COMPLETION 13
107108
108109 #define RDS_INFO_FIRST 10000
109110 #define RDS_INFO_COUNTERS 10000
@@ -317,6 +318,12 @@ struct rds_rdma_notify { · 207 unmodified lines
317318 #define RDS_RDMA_DROPPED 3
318319 #define RDS_RDMA_OTHER_ERROR 4
319320
321+#define RDS_MAX_ZCOOKIES 8
322+struct rds_zcopy_cookies {
323+ __u32 num;
324+ __u32 cookies[RDS_MAX_ZCOOKIES];
325+};
326+
320327 /*
321328 * Common set of flags for all RDMA related structs
322329 */