[openib-general] [PATCH] ib_mad: Add MAD pointer to send WR ud structure

Hal Rosenstock
Wed Oct 6 06:50:00 PDT 2004


ib_mad: Add MAD pointer to send WR ud structure (in ib_verbs.h)

Index: access/ib_mad_priv.h
===================================================================
--- access/ib_mad_priv.h        (revision 935)
+++ access/ib_mad_priv.h        (working copy)
@@ -119,7 +119,7 @@
        struct list_head agent_send_list;
        struct ib_mad_agent *agent;
        u64 wr_id;                      /* client WR ID */
-       u64 tid;
+       union ib_tid tid;
        int timeout_ms;
        int refcount;
        enum ib_wc_status status;
Index: access/ib_smi.c
===================================================================
--- access/ib_smi.c     (revision 937)
+++ access/ib_smi.c     (working copy)
@@ -361,8 +361,9 @@
                                                                                 
        send_wr.wr.ud.ah = ah;
        send_wr.wr.ud.remote_qkey = 0; /* for SMPs */
+       send_wr.wr.ud.mad = smp;
        send_wr.wr_id = ++port_priv->wr_id;
-       
+
        pci_unmap_addr_set(smp, mapping, gather_list.addr);
 
        /* Send */
Index: access/ib_mad.c
===================================================================
--- access/ib_mad.c     (revision 939)
+++ access/ib_mad.c     (working copy)
@@ -344,8 +344,7 @@
                        return -ENOMEM; 
                }
 
-               mad_send_wr->tid = ((struct ib_mad_hdr*)
-                                  bus_to_virt(cur_send_wr->sg_list->addr))->tid.id;
+               mad_send_wr->tid.id = send_wr->wr.ud.mad->mad_hdr.tid.id;
                mad_send_wr->agent = mad_agent;
                mad_send_wr->timeout_ms = cur_send_wr->wr.ud.timeout_ms;
                if (mad_send_wr->timeout_ms)
@@ -765,7 +764,7 @@
        list_for_each_entry(mad_send_wr, &mad_agent_priv->send_list,
                            agent_send_list) {
 
-               if (mad_send_wr->tid == tid) {
+               if (mad_send_wr->tid.id == tid) {
                        /* Verify request is still valid */
                        if (mad_send_wr->status == IB_WC_SUCCESS &&
                            mad_send_wr->timeout_ms)
Index: include/ib_verbs.h
===================================================================
--- include/ib_verbs.h  (revision 935)
+++ include/ib_verbs.h  (working copy)
@@ -539,6 +539,7 @@
                } atomic;
                struct {
                        struct  ib_ah *ah;
+                       struct  ib_mad *mad;
                        u32     remote_qpn;
                        u32     remote_qkey;
                        int     timeout_ms; /* valid for MADs only */





More information about the openib-general mailing list