summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-10-08 04:16:33 -0400
committerChristoph Hellwig <hch@lst.de>2015-10-08 06:09:10 -0400
commite622f2f4ad2142d2a613a57fb85f8cf737935ef5 (patch)
tree19fa458bcaacf3f8b2f5e40676f748afc3df1e84 /include/rdma
parentb8cab5dab15ff5c2acc3faefdde28919b0341c11 (diff)
IB: split struct ib_send_wr
This patch split up struct ib_send_wr so that all non-trivial verbs use their own structure which embedds struct ib_send_wr. This dramaticly shrinks the size of a WR for most common operations: sizeof(struct ib_send_wr) (old): 96 sizeof(struct ib_send_wr): 48 sizeof(struct ib_rdma_wr): 64 sizeof(struct ib_atomic_wr): 96 sizeof(struct ib_ud_wr): 88 sizeof(struct ib_fast_reg_wr): 88 sizeof(struct ib_bind_mw_wr): 96 sizeof(struct ib_sig_handover_wr): 80 And with Sagi's pending MR rework the fast registration WR will also be down to a reasonable size: sizeof(struct ib_fastreg_wr): 64 Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> [srp, srpt] Reviewed-by: Chuck Lever <chuck.lever@oracle.com> [sunrpc] Tested-by: Haggai Eran <haggaie@mellanox.com> Tested-by: Sagi Grimberg <sagig@mellanox.com> Tested-by: Steve Wise <swise@opengridcomputing.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h130
1 files changed, 85 insertions, 45 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 7845fae6f2df..25f022c9aaac 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1100,54 +1100,94 @@ struct ib_send_wr {
1100 __be32 imm_data; 1100 __be32 imm_data;
1101 u32 invalidate_rkey; 1101 u32 invalidate_rkey;
1102 } ex; 1102 } ex;
1103 union {
1104 struct {
1105 u64 remote_addr;
1106 u32 rkey;
1107 } rdma;
1108 struct {
1109 u64 remote_addr;
1110 u64 compare_add;
1111 u64 swap;
1112 u64 compare_add_mask;
1113 u64 swap_mask;
1114 u32 rkey;
1115 } atomic;
1116 struct {
1117 struct ib_ah *ah;
1118 void *header;
1119 int hlen;
1120 int mss;
1121 u32 remote_qpn;
1122 u32 remote_qkey;
1123 u16 pkey_index; /* valid for GSI only */
1124 u8 port_num; /* valid for DR SMPs on switch only */
1125 } ud;
1126 struct {
1127 u64 iova_start;
1128 struct ib_fast_reg_page_list *page_list;
1129 unsigned int page_shift;
1130 unsigned int page_list_len;
1131 u32 length;
1132 int access_flags;
1133 u32 rkey;
1134 } fast_reg;
1135 struct {
1136 struct ib_mw *mw;
1137 /* The new rkey for the memory window. */
1138 u32 rkey;
1139 struct ib_mw_bind_info bind_info;
1140 } bind_mw;
1141 struct {
1142 struct ib_sig_attrs *sig_attrs;
1143 struct ib_mr *sig_mr;
1144 int access_flags;
1145 struct ib_sge *prot;
1146 } sig_handover;
1147 } wr;
1148 u32 xrc_remote_srq_num; /* XRC TGT QPs only */ 1103 u32 xrc_remote_srq_num; /* XRC TGT QPs only */
1149}; 1104};
1150 1105
1106struct ib_rdma_wr {
1107 struct ib_send_wr wr;
1108 u64 remote_addr;
1109 u32 rkey;
1110};
1111
1112static inline struct ib_rdma_wr *rdma_wr(struct ib_send_wr *wr)
1113{
1114 return container_of(wr, struct ib_rdma_wr, wr);
1115}
1116
1117struct ib_atomic_wr {
1118 struct ib_send_wr wr;
1119 u64 remote_addr;
1120 u64 compare_add;
1121 u64 swap;
1122 u64 compare_add_mask;
1123 u64 swap_mask;
1124 u32 rkey;
1125};
1126
1127static inline struct ib_atomic_wr *atomic_wr(struct ib_send_wr *wr)
1128{
1129 return container_of(wr, struct ib_atomic_wr, wr);
1130}
1131
1132struct ib_ud_wr {
1133 struct ib_send_wr wr;
1134 struct ib_ah *ah;
1135 void *header;
1136 int hlen;
1137 int mss;
1138 u32 remote_qpn;
1139 u32 remote_qkey;
1140 u16 pkey_index; /* valid for GSI only */
1141 u8 port_num; /* valid for DR SMPs on switch only */
1142};
1143
1144static inline struct ib_ud_wr *ud_wr(struct ib_send_wr *wr)
1145{
1146 return container_of(wr, struct ib_ud_wr, wr);
1147}
1148
1149struct ib_fast_reg_wr {
1150 struct ib_send_wr wr;
1151 u64 iova_start;
1152 struct ib_fast_reg_page_list *page_list;
1153 unsigned int page_shift;
1154 unsigned int page_list_len;
1155 u32 length;
1156 int access_flags;
1157 u32 rkey;
1158};
1159
1160static inline struct ib_fast_reg_wr *fast_reg_wr(struct ib_send_wr *wr)
1161{
1162 return container_of(wr, struct ib_fast_reg_wr, wr);
1163}
1164
1165struct ib_bind_mw_wr {
1166 struct ib_send_wr wr;
1167 struct ib_mw *mw;
1168 /* The new rkey for the memory window. */
1169 u32 rkey;
1170 struct ib_mw_bind_info bind_info;
1171};
1172
1173static inline struct ib_bind_mw_wr *bind_mw_wr(struct ib_send_wr *wr)
1174{
1175 return container_of(wr, struct ib_bind_mw_wr, wr);
1176}
1177
1178struct ib_sig_handover_wr {
1179 struct ib_send_wr wr;
1180 struct ib_sig_attrs *sig_attrs;
1181 struct ib_mr *sig_mr;
1182 int access_flags;
1183 struct ib_sge *prot;
1184};
1185
1186static inline struct ib_sig_handover_wr *sig_handover_wr(struct ib_send_wr *wr)
1187{
1188 return container_of(wr, struct ib_sig_handover_wr, wr);
1189}
1190
1151struct ib_recv_wr { 1191struct ib_recv_wr {
1152 struct ib_recv_wr *next; 1192 struct ib_recv_wr *next;
1153 u64 wr_id; 1193 u64 wr_id;