ibal/cm: reference private data in received MAD not stored in CEP
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 23 Apr 2009 19:20:50 +0000 (19:20 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 23 Apr 2009 19:20:50 +0000 (19:20 +0000)
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@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2125 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/kernel/al_cm_cep.c

index f79edec..694debb 100644 (file)
@@ -6055,7 +6055,7 @@ __format_event_rej(mad_cm_rej_t *p_mad, iba_cm_rej_event *p_rej)
        p_rej->p_pdata = p_mad->pdata;\r
        p_rej->reason = p_mad->reason;\r
        p_rej->ari_length = conn_rej_get_ari_len(p_mad);\r
-       p_rej->pdata_len = IB_MRA_PDATA_SIZE;\r
+       p_rej->pdata_len = IB_REJ_PDATA_SIZE;\r
 }\r
 \r
 static void\r
@@ -6066,13 +6066,6 @@ __format_event_mra(mad_cm_mra_t *p_mad, iba_cm_mra_event *p_mra)
        p_mra->service_timeout = conn_mra_get_svc_timeout(p_mad);\r
 }\r
 \r
-static void\r
-__format_event_pdata(kcep_t *p_cep, iba_cm_pdata *p_pdata)\r
-{\r
-       p_pdata->p_pdata = p_cep->pdata;\r
-       p_pdata->pdata_len = p_cep->psize;\r
-}\r
-\r
 /*\r
  * Called after polling a MAD from a CEP to parse the received CM message\r
  * into readable event data.\r
@@ -6110,19 +6103,22 @@ kal_cep_format_event(
                break;\r
        case CM_RTU_ATTR_ID:\r
                p_event->type = iba_cm_rtu_received;\r
-               __format_event_pdata(p_cep, &p_event->data.rtu);\r
+               p_event->data.rtu.p_pdata = ((mad_cm_rtu_t*) p_mad)->pdata;\r
+               p_event->data.rtu.pdata_len = IB_RTU_PDATA_SIZE;\r
                break;\r
        case CM_DREQ_ATTR_ID:\r
                if (p_mad->status == IB_SUCCESS) {\r
                        p_event->type = iba_cm_dreq_received;\r
-                       __format_event_pdata(p_cep, &p_event->data.dreq);\r
+                       p_event->data.dreq.p_pdata = ((mad_cm_dreq_t*) p_mad)->pdata;\r
+                       p_event->data.dreq.pdata_len = IB_DREQ_PDATA_SIZE;\r
                } else {\r
                        p_event->type = iba_cm_dreq_error;\r
                }\r
                break;\r
        case CM_DREP_ATTR_ID:\r
                p_event->type = iba_cm_drep_received;\r
-               __format_event_pdata(p_cep, &p_event->data.drep);\r
+               p_event->data.drep.p_pdata = ((mad_cm_drep_t*) p_mad)->pdata;\r
+               p_event->data.drep.pdata_len = IB_DREP_PDATA_SIZE;\r
                break;\r
        case CM_REJ_ATTR_ID:\r
                p_event->type = iba_cm_rej_received;\r