aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds/ib_send.c
diff options
context:
space:
mode:
authorAndy Grover <andy.grover@oracle.com>2010-01-12 17:13:15 -0500
committerAndy Grover <andy.grover@oracle.com>2010-09-08 21:11:38 -0400
commitff87e97a9d70c9ae133d3d3d7792b26ab85f4297 (patch)
tree32de73cdf5e4353e89b3351eaae695f69faa868b /net/rds/ib_send.c
parent21f79afa5fda2820671a8f64c3d0e43bb118053b (diff)
RDS: make m_rdma_op a member of rds_message
This eliminates a separate memory alloc, although it is now necessary to add an "r_active" flag, since it is no longer to use the m_rdma_op pointer as an indicator of if an rdma op is present. rdma SGs allocated from rm sg pool. rds_rm_size also gets bigger. It's a little inefficient to run through CMSGs twice, but it makes later steps a lot smoother. Signed-off-by: Andy Grover <andy.grover@oracle.com>
Diffstat (limited to 'net/rds/ib_send.c')
-rw-r--r--net/rds/ib_send.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index 575fce463c65..f0edfdb2866c 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -85,8 +85,8 @@ static void rds_ib_send_unmap_rm(struct rds_ib_connection *ic,
85 rm->data.m_sg, rm->data.m_nents, 85 rm->data.m_sg, rm->data.m_nents,
86 DMA_TO_DEVICE); 86 DMA_TO_DEVICE);
87 87
88 if (rm->rdma.m_rdma_op) { 88 if (rm->rdma.m_rdma_op.r_active) {
89 rds_ib_send_unmap_rdma(ic, rm->rdma.m_rdma_op); 89 rds_ib_send_unmap_rdma(ic, &rm->rdma.m_rdma_op);
90 90
91 /* If the user asked for a completion notification on this 91 /* If the user asked for a completion notification on this
92 * message, we can implement three different semantics: 92 * message, we can implement three different semantics:
@@ -110,10 +110,10 @@ static void rds_ib_send_unmap_rm(struct rds_ib_connection *ic,
110 */ 110 */
111 rds_ib_send_rdma_complete(rm, wc_status); 111 rds_ib_send_rdma_complete(rm, wc_status);
112 112
113 if (rm->rdma.m_rdma_op->r_write) 113 if (rm->rdma.m_rdma_op.r_write)
114 rds_stats_add(s_send_rdma_bytes, rm->rdma.m_rdma_op->r_bytes); 114 rds_stats_add(s_send_rdma_bytes, rm->rdma.m_rdma_op.r_bytes);
115 else 115 else
116 rds_stats_add(s_recv_rdma_bytes, rm->rdma.m_rdma_op->r_bytes); 116 rds_stats_add(s_recv_rdma_bytes, rm->rdma.m_rdma_op.r_bytes);
117 } 117 }
118 118
119 /* If anyone waited for this message to get flushed out, wake 119 /* If anyone waited for this message to get flushed out, wake
@@ -243,8 +243,8 @@ void rds_ib_send_cq_comp_handler(struct ib_cq *cq, void *context)
243 243
244 rm = rds_send_get_message(conn, send->s_op); 244 rm = rds_send_get_message(conn, send->s_op);
245 if (rm) { 245 if (rm) {
246 if (rm->rdma.m_rdma_op) 246 if (rm->rdma.m_rdma_op.r_active)
247 rds_ib_send_unmap_rdma(ic, rm->rdma.m_rdma_op); 247 rds_ib_send_unmap_rdma(ic, &rm->rdma.m_rdma_op);
248 rds_ib_send_rdma_complete(rm, wc.status); 248 rds_ib_send_rdma_complete(rm, wc.status);
249 rds_message_put(rm); 249 rds_message_put(rm);
250 } 250 }
@@ -560,10 +560,10 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
560 560
561 /* If it has a RDMA op, tell the peer we did it. This is 561 /* If it has a RDMA op, tell the peer we did it. This is
562 * used by the peer to release use-once RDMA MRs. */ 562 * used by the peer to release use-once RDMA MRs. */
563 if (rm->rdma.m_rdma_op) { 563 if (rm->rdma.m_rdma_op.r_active) {
564 struct rds_ext_header_rdma ext_hdr; 564 struct rds_ext_header_rdma ext_hdr;
565 565
566 ext_hdr.h_rdma_rkey = cpu_to_be32(rm->rdma.m_rdma_op->r_key); 566 ext_hdr.h_rdma_rkey = cpu_to_be32(rm->rdma.m_rdma_op.r_key);
567 rds_message_add_extension(&rm->m_inc.i_hdr, 567 rds_message_add_extension(&rm->m_inc.i_hdr,
568 RDS_EXTHDR_RDMA, &ext_hdr, sizeof(ext_hdr)); 568 RDS_EXTHDR_RDMA, &ext_hdr, sizeof(ext_hdr));
569 } 569 }
@@ -601,7 +601,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
601 * or when requested by the user. Right now, we let 601 * or when requested by the user. Right now, we let
602 * the application choose. 602 * the application choose.
603 */ 603 */
604 if (rm->rdma.m_rdma_op && rm->rdma.m_rdma_op->r_fence) 604 if (rm->rdma.m_rdma_op.r_active && rm->rdma.m_rdma_op.r_fence)
605 send_flags = IB_SEND_FENCE; 605 send_flags = IB_SEND_FENCE;
606 606
607 /* 607 /*