[openib-general] [PATCH] review for new MAD APIs
Sean Hefty
mshefty at ichips.intel.com
Mon Sep 13 15:16:49 PDT 2004
The following patch adds two new APIs to better support zero-copy receives on MADs.
The first call copies a chain of RMPP MADs into a single data buffer, ignoring the extra MAD headers.
The second call returns the receive MAD buffers and chained completion structures to the access layer, where they were allocated.
Comments?
- Sean
-- Index: include/ib_mad.h
===================================================================
--- include/ib_mad.h (revision 808)
+++ include/ib_mad.h (working copy)
@@ -249,6 +249,29 @@
struct ib_send_wr **bad_send_wr);
/**
+ * ib_coalesce_recv_mad - Coalesces received MAD data into a single buffer.
+ * @mad_recv_wc - Work completion information for a received MAD.
+ * @buf - User-provided data buffer to receive the coalesced buffers. The
+ * referenced buffer should be at least the size of the mad_len specified
+ * by @mad_recv_wc.
+ *
+ * This call copies a chain of received RMPP MADs into a single data buffer,
+ * removing duplicated headers.
+ */
+void ib_coalesce_recv_mad(struct ib_mad_recv_wc *mad_recv_wc,
+ void *buf);
+
+/**
+ * ib_free_recv_mad - Returns data buffers used to receive a MAD to the
+ * access layer.
+ * @mad_recv_wc - Work completion information for a received MAD.
+ *
+ * Clients receiving MADs through their ib_mad_recv_handler must call this
+ * routine to return the work completion buffers to the access layer.
+ */
+void ib_free_recv_mad(struct ib_mad_recv_wc *mad_recv_wc);
+
+/**
* ib_redirect_mad_qp - Registers a QP for MAD services.
* @qp - Reference to a QP that requires MAD services.
* @rmpp_version - If set, indicates that the client will send
More information about the general
mailing list