[openib-general] Re: ib_mad.h ib_mad_recv_wc.mad_flags
Sean Hefty
mshefty at ichips.intel.com
Tue Sep 7 16:10:55 PDT 2004
On Tue, 7 Sep 2004 14:12:27 -0700
Sean Hefty <mshefty at ichips.intel.com> wrote:
> I will see if there's a way to have the MAD receive completion match closer with the normal receive completion case. For example, ib_wc is the only structure that uses bit fields for flags. Other structures in the API use an integer set using enum values.
Here's a patch for discussion that changes ib_mad_recv_wc to use ib_wc. The intent of the patch is to allow an API that: supports 0-copy receives, is efficient for processing non-RMPP receives, and helps simplify the underlying MAD implementation.
Along these same lines, I thought about removing ib_mad_send_wc, and using ib_wc directly. I held off on this change for now. I also thought about replacing the bit fields in ib_wc with a single flag field. If I do that I'll submit a patch for Roland's stack, since it changes the verbs API.
Comments?
- Sean
Index: ib_mad.h
===================================================================
--- ib_mad.h (revision 750)
+++ ib_mad.h (working copy)
@@ -130,10 +130,6 @@
u32 hi_tid;
};
-enum ib_mad_flags {
- IB_MAD_GRH_VALID = 1
-};
-
/**
* ib_mad_send_wc - MAD send completion information.
* @wr_id - Work request identifier associated with the send MAD request.
@@ -148,36 +144,32 @@
};
/**
- * ib_mad_recv_wc - received MAD information.
- * @wr_id - For received response, set to the work request identifier specified
- * for the corresponding send request.
+ * ib_mad_recv_buf - received MAD buffer information.
+ * @list - Reference to next data buffer for a received RMPP MAD.
* @grh - References a data buffer containing the global route header.
* The data refereced by this buffer is only valid if the GRH is
* valid.
* @mad - References the start of the received MAD.
- * @length - Specifies the size of the received MAD.
- * @mad_flags - Flags used to specify information about the received MAD.
+ */
+struct ib_mad_recv_buf {
+ struct list_head list;
+ struct ib_grh *grh;
+ struct ib_mad *mad;
+};
+
+/**
+ * ib_mad_recv_wc - received MAD information.
+ * @wc - Completion information for the received data.
+ * @recv_buf - Specifies the location of the received data buffer(s).
* @mad_len - The length of the received MAD, without duplicated headers.
- * @src_qpn - Source QP.
- * @pkey_index - Pkey index.
- * @slid - LID of remote QP.
- * @sl - Service level of source for a received message.
- * @dlid_path_bits - Path bits of source for a received message.
*
- * An RMPP receive will be coalesced into a single data buffer.
+ * For received response, the wr_id field of the wc is set to the wr_id
+ * for the corresponding send request.
*/
struct ib_mad_recv_wc {
- u64 wr_id;
- struct ib_grh *grh;
- struct ib_mad *mad;
- u32 length;
- int mad_flags;
- u32 mad_len;
- u32 src_qp;
- u16 pkey_index;
- u16 slid;
- u8 sl;
- u8 dlid_path_bits;
+ struct ib_wc *wc;
+ struct ib_mad_recv_buf *recv_buf;
+ int mad_len;
};
/**
More information about the general
mailing list