[ofw] [PATCH 2/4] DAPL v2: ucm cleanup extra cr/lf

Davis, Arlin R arlin.r.davis at intel.com
Wed Sep 9 15:14:42 PDT 2009


 

Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
 dapl/openib_ucm/cm.c |  108 +++++++++++++++++++++++++-------------------------
 1 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/dapl/openib_ucm/cm.c b/dapl/openib_ucm/cm.c
index 72de5d5..aa6bb73 100644
--- a/dapl/openib_ucm/cm.c
+++ b/dapl/openib_ucm/cm.c
@@ -246,12 +246,12 @@ retry:
 		struct ibv_wc wc;
 
 		/* process completions, based on UCM_SND_BURST */
-		ret = ibv_poll_cq(tp->scq, 1, &wc);
-		if (ret < 0) {
+		ret = ibv_poll_cq(tp->scq, 1, &wc);
+		if (ret < 0) {
 			dapl_log(DAPL_DBG_TYPE_WARN,
 				" get_smsg: cq %p %s\n", 
 				tp->scq, strerror(errno));
-		}
+		}
 		/* free up completed sends, update tail */
 		if (ret > 0) {
 			tp->s_tl = (int)wc.wr_id;
@@ -268,19 +268,19 @@ retry:
 /* RECEIVE CM MESSAGE PROCESSING */
 
 static int ucm_post_rmsg(ib_hca_transport_t *tp, ib_cm_msg_t *msg)
-{	
-	struct ibv_recv_wr recv_wr, *recv_err;
-	struct ibv_sge sge;
-        
-	recv_wr.next = NULL;
-	recv_wr.sg_list = &sge;
-	recv_wr.num_sge = 1;
-	recv_wr.wr_id = (uint64_t)(uintptr_t) msg;
-	sge.length = sizeof(ib_cm_msg_t) + sizeof(struct ibv_grh);
-	sge.lkey = tp->mr_rbuf->lkey;
-	sge.addr = (uintptr_t)((char *)msg - sizeof(struct ibv_grh));
-	
-	return (ibv_post_recv(tp->qp, &recv_wr, &recv_err));
+{	
+	struct ibv_recv_wr recv_wr, *recv_err;
+	struct ibv_sge sge;
+        
+	recv_wr.next = NULL;
+	recv_wr.sg_list = &sge;
+	recv_wr.num_sge = 1;
+	recv_wr.wr_id = (uint64_t)(uintptr_t) msg;
+	sge.length = sizeof(ib_cm_msg_t) + sizeof(struct ibv_grh);
+	sge.lkey = tp->mr_rbuf->lkey;
+	sge.addr = (uintptr_t)((char *)msg - sizeof(struct ibv_grh));
+	
+	return (ibv_post_recv(tp->qp, &recv_wr, &recv_err));
 }
 
 static int ucm_reject(ib_hca_transport_t *tp, ib_cm_msg_t *msg)
@@ -426,18 +426,18 @@ dp_ib_cm_handle_t ucm_cm_find(ib_hca_transport_t *tp, ib_cm_msg_t *msg)
 /* Get rmsgs from CM completion queue, 10 at a time */
 static void ucm_recv(ib_hca_transport_t *tp)
 {
-	struct ibv_wc wc[10];
-	ib_cm_msg_t *msg;
-	dp_ib_cm_handle_t cm;
-	int i, ret, notify = 0;
-	struct ibv_cq *ibv_cq = NULL;
-	DAPL_HCA *hca;
-
+	struct ibv_wc wc[10];
+	ib_cm_msg_t *msg;
+	dp_ib_cm_handle_t cm;
+	int i, ret, notify = 0;
+	struct ibv_cq *ibv_cq = NULL;
+	DAPL_HCA *hca;
+
 	/* POLLIN on channel FD */
 	ret = ibv_get_cq_event(tp->rch, &ibv_cq, (void *)&hca);
 	if (ret == 0) {
 		ibv_ack_cq_events(ibv_cq, 1);
-	}
+	}
 retry:	
 	ret = ibv_poll_cq(tp->rcq, 10, wc);
 	if (ret <= 0) {
@@ -493,9 +493,9 @@ static int ucm_send(ib_hca_transport_t *tp, ib_cm_msg_t *msg)
 {
 	ib_cm_msg_t *smsg = NULL;
 	struct ibv_send_wr wr, *bad_wr;
-	struct ibv_sge sge;
-	int len, ret = -1;
-	uint16_t dlid = ntohs(msg->daddr.ib.lid);
+	struct ibv_sge sge;
+	int len, ret = -1;
+	uint16_t dlid = ntohs(msg->daddr.ib.lid);
 
 	/* Get message from send queue, copy data, and send */
 	dapl_os_lock(&tp->slock);
@@ -504,39 +504,39 @@ static int ucm_send(ib_hca_transport_t *tp, ib_cm_msg_t *msg)
 
 	len = ((sizeof(*msg) - DCM_MAX_PDATA_SIZE) + ntohs(msg->p_size));
 	dapl_os_memcpy(smsg, msg, len);
-
-	wr.next = NULL;
-        wr.sg_list = &sge;
-        wr.num_sge = 1;
-        wr.opcode = IBV_WR_SEND;
-        wr.wr_id = (unsigned long)tp->s_hd;
-	wr.send_flags = (wr.wr_id % UCM_SND_BURST) ? 0 : IBV_SEND_SIGNALED;
-	if (len <= tp->max_inline_send)
-		wr.send_flags |= IBV_SEND_INLINE; 
-
-        sge.length = len;
-        sge.lkey = tp->mr_sbuf->lkey;
-        sge.addr = (uintptr_t)smsg;
-
+
+	wr.next = NULL;
+        wr.sg_list = &sge;
+        wr.num_sge = 1;
+        wr.opcode = IBV_WR_SEND;
+        wr.wr_id = (unsigned long)tp->s_hd;
+	wr.send_flags = (wr.wr_id % UCM_SND_BURST) ? 0 : IBV_SEND_SIGNALED;
+	if (len <= tp->max_inline_send)
+		wr.send_flags |= IBV_SEND_INLINE; 
+
+        sge.length = len;
+        sge.lkey = tp->mr_sbuf->lkey;
+        sge.addr = (uintptr_t)smsg;
+
 	dapl_dbg_log(DAPL_DBG_TYPE_CM, 
 		" ucm_send: op %d ln %d lid %x c_qpn %x rport %d\n", 
 		ntohs(smsg->op), len, htons(smsg->daddr.ib.lid), 
-		htonl(smsg->dqpn), htons(smsg->dport));
-
-	/* empty slot, then create AH */
-	if (!tp->ah[dlid]) {
-		tp->ah[dlid] = 	
-			dapls_create_ah(tp->hca, tp->pd, tp->qp, 
-					htons(dlid), NULL);
-		if (!tp->ah[dlid])
-			goto bail;
-	}
-		
+		htonl(smsg->dqpn), htons(smsg->dport));
+
+	/* empty slot, then create AH */
+	if (!tp->ah[dlid]) {
+		tp->ah[dlid] = 	
+			dapls_create_ah(tp->hca, tp->pd, tp->qp, 
+					htons(dlid), NULL);
+		if (!tp->ah[dlid])
+			goto bail;
+	}
+		
 	wr.wr.ud.ah = tp->ah[dlid];
 	wr.wr.ud.remote_qpn = ntohl(smsg->dqpn);
-	wr.wr.ud.remote_qkey = DAT_UD_QKEY;
+	wr.wr.ud.remote_qkey = DAT_UD_QKEY;
 
-	ret = ibv_post_send(tp->qp, &wr, &bad_wr);
+	ret = ibv_post_send(tp->qp, &wr, &bad_wr);
 bail:
 	dapl_os_unlock(&tp->slock);	
 	return ret;
-- 
1.5.2.5




More information about the ofw mailing list