Hi Hal.

This patch fixes an OSM crash when working with Cisco's TS stack.
Cisco's TopSpin doesn't follow the same rules when generating
transaction id.
When looking up the transaction in the table, SM applies a mask
that is supposed to mask out the umad id and leave only the
transaction id itself.
When mask was applied to the transaction id that was created by
TS stack, the result was 0, because it actually masked out the
transaction id itself.

Yevgeny

Signed-off-by:  Yevgeny Kliteynik < [EMAIL PROTECTED]>


Index: osm/libvendor/osm_vendor_ibumad.c
===================================================================
--- osm/libvendor/osm_vendor_ibumad.c   (revision 8614)
+++ osm/libvendor/osm_vendor_ibumad.c   (working copy)
@@ -141,12 +141,25 @@ get_madw(osm_vendor_t *p_vend, ib_net64_
        ib_net64_t mtid = (*tid & cl_ntoh64(0x00000000ffffffffllu));
        osm_madw_t *res;

+    /*
+     * Some vendors (such as Cisco's TopSpin) may not follow
+     * the same rules when generating transaction id.
+     * If the resuls of applying a mask (which is supposed to
+     * mask out the umad id and leave only the transaction id
+     * itself) on a transaction id is 0, it means that the
+     * creator of the transaction is not SM, hence we don't
+     * have this transaction in the table anyway.
+     */
+    if (mtid == 0)
+       return 0;
+
        cl_spinlock_acquire( &p_vend->match_tbl_lock );
        for (m = p_vend->mtbl.tbl, e = m + p_vend-> mtbl.max; m < e; m++) {
                if (m->tid == mtid) {
                        m->tid = 0;
                        *tid = mtid;
                        res = m->v;
+                       m->v = NULL;
                        cl_spinlock_release( &p_vend->match_tbl_lock );
                        return res;
                }
@@ -1148,7 +1161,7 @@ Resp:

        osm_log(p_vend->p_log, OSM_LOG_DEBUG, "osm_vendor_send: "
                "Completed sending %s p_madw = %p\n",
-               resp_expected ? "response" : "request", p_madw);
+               resp_expected ? "request" : "response", p_madw);
Exit:
        OSM_LOG_EXIT( p_vend->p_log );
        return( ret );

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to