[openib-general] [PATCH] ib_mad: Fix send side bugs

Hal Rosenstock
Fri Oct 1 05:25:28 PDT 2004


ib_mad: Fix send side bugs

Sending of DR SMPs is now working :-)

Index: ib_mad.c
===================================================================
--- ib_mad.c    (revision 916)
+++ ib_mad.c    (working copy)
@@ -894,6 +894,7 @@
                                     struct ib_wc *wc)
 {
        struct ib_mad_send_wr_private   *mad_send_wr;
+       struct list_head                *send_wr;
        unsigned long                   flags;
 
        /* Completion corresponds to first entry on posted MAD send list */
@@ -907,9 +908,13 @@
        mad_send_wr = list_entry(&port_priv->send_posted_mad_list,
                                 struct ib_mad_send_wr_private,
                                 send_list);
-       if (mad_send_wr->wr_id != wc->wr_id) {
+       send_wr = mad_send_wr->send_list.next;
+       mad_send_wr = container_of(send_wr, struct ib_mad_send_wr_private,
send_list);
+       if (wc->wr_id != (unsigned long)mad_send_wr) {
                printk(KERN_ERR "Send completion WR ID 0x%Lx doesn't match "
-                      "posted send WR ID 0x%Lx\n", wc->wr_id, mad_send_wr->wr_id);
+                      "posted send WR ID 0x%lx\n",
+                      wc->wr_id,
+                      (unsigned long)mad_send_wr);
                goto error;
        }
 





More information about the openib-general mailing list