[ofw] [PATCH] ibal/cm: reference private data in received MAD not stored in CEP

Sean Hefty sean.hefty at intel.com
Fri Apr 17 11:20:01 PDT 2009


To avoid any potential synchronization issues with changes to the private
data in the CEP, reference the private data in the received MAD when
formatting CM events.

Fix the size of the reject private data.

This only affects users of the newer IB CM interface, which is only winverbs
at this point.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
diff -up -r -X \mshefty\scm\winof\trunk\docs\dontdiff.txt -I '\$Id:' trunk\core\al/kernel/al_cm_cep.c
branches\winverbs\core\al/kernel/al_cm_cep.c
--- trunk\core\al/kernel/al_cm_cep.c	2009-04-07 17:27:09.415750000 -0700
+++ branches\winverbs\core\al/kernel/al_cm_cep.c	2009-04-15 16:54:55.952875000 -0700
@@ -6052,7 +6052,7 @@ __format_event_rej(mad_cm_rej_t *p_mad, 
 	p_rej->p_pdata = p_mad->pdata;
 	p_rej->reason = p_mad->reason;
 	p_rej->ari_length = conn_rej_get_ari_len(p_mad);
-	p_rej->pdata_len = IB_MRA_PDATA_SIZE;
+	p_rej->pdata_len = IB_REJ_PDATA_SIZE;
 }
 
 static void
@@ -6063,13 +6063,6 @@ __format_event_mra(mad_cm_mra_t *p_mad, 
 	p_mra->service_timeout = conn_mra_get_svc_timeout(p_mad);
 }
 
-static void
-__format_event_pdata(kcep_t *p_cep, iba_cm_pdata *p_pdata)
-{
-	p_pdata->p_pdata = p_cep->pdata;
-	p_pdata->pdata_len = p_cep->psize;
-}
-
 /*
  * Called after polling a MAD from a CEP to parse the received CM message
  * into readable event data.
@@ -6107,19 +6100,22 @@ kal_cep_format_event(
 		break;
 	case CM_RTU_ATTR_ID:
 		p_event->type = iba_cm_rtu_received;
-		__format_event_pdata(p_cep, &p_event->data.rtu);
+		p_event->data.rtu.p_pdata = ((mad_cm_rtu_t*) p_mad)->pdata;
+		p_event->data.rtu.pdata_len = IB_RTU_PDATA_SIZE;
 		break;
 	case CM_DREQ_ATTR_ID:
 		if (p_mad->status == IB_SUCCESS) {
 			p_event->type = iba_cm_dreq_received;
-			__format_event_pdata(p_cep, &p_event->data.dreq);
+			p_event->data.dreq.p_pdata = ((mad_cm_dreq_t*) p_mad)->pdata;
+			p_event->data.dreq.pdata_len = IB_DREQ_PDATA_SIZE;
 		} else {
 			p_event->type = iba_cm_dreq_error;
 		}
 		break;
 	case CM_DREP_ATTR_ID:
 		p_event->type = iba_cm_drep_received;
-		__format_event_pdata(p_cep, &p_event->data.drep);
+		p_event->data.drep.p_pdata = ((mad_cm_drep_t*) p_mad)->pdata;
+		p_event->data.drep.pdata_len = IB_DREP_PDATA_SIZE;
 		break;
 	case CM_REJ_ATTR_ID:
 		p_event->type = iba_cm_rej_received;




More information about the ofw mailing list