[openib-general] [PATCH 1 of 3] mad: large RMPP support
Jack Morgenstein
jackm at mellanox.co.il
Mon Feb 6 23:39:33 PST 2006
patch 1 of 3
---
Large RMPP support: changes/additions to underlying data structures and
prototypes.
Signed-off-by: Jack Morgenstein <jackm at mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>
Index: last_stable/drivers/infiniband/include/rdma/ib_mad.h
===================================================================
--- last_stable.orig/drivers/infiniband/include/rdma/ib_mad.h
+++ last_stable/drivers/infiniband/include/rdma/ib_mad.h
@@ -141,6 +141,12 @@ struct ib_rmpp_hdr {
__be32 paylen_newwin;
};
+struct ib_mad_multipacket_seg {
+ struct list_head list;
+ u32 size;
+ u8 data[0];
+};
+
typedef u64 __bitwise ib_sa_comp_mask;
#define IB_SA_COMP_MASK(n) ((__force ib_sa_comp_mask) cpu_to_be64(1ull << n))
@@ -220,7 +226,9 @@ struct ib_class_port_info
*/
struct ib_mad_send_buf {
struct ib_mad_send_buf *next;
- void *mad;
+ void *mad; /* RMPP: first segment,
+ including the MAD header */
+ void *mad_payload; /* RMPP: changed per segment */
struct ib_mad_agent *mad_agent;
struct ib_ah *ah;
void *context[2];
@@ -485,17 +493,6 @@ int ib_unregister_mad_agent(struct ib_ma
int ib_post_send_mad(struct ib_mad_send_buf *send_buf,
struct ib_mad_send_buf **bad_send_buf);
-/**
- * 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 MAD segments 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.
@@ -601,6 +598,16 @@ struct ib_mad_send_buf * ib_create_send_
gfp_t gfp_mask);
/**
+ * ib_get_multipacket_seg - returns a segment of an RMPP multipacket mad send
+ * @send_buf: Previously allocated send data buffer.
+ * @seg_num: number of the segment to return.
+ *
+ * This routine returns a pointer to a segment of a multipacket RMPP message.
+ */
+struct ib_mad_multipacket_seg *ib_get_multipacket_seg(struct ib_mad_send_buf *
+ send_buf, int seg_num);
+
+/**
* ib_free_send_mad - Returns data buffers used to send a MAD.
* @send_buf: Previously allocated send data buffer.
*/
Index: last_stable/drivers/infiniband/core/mad_priv.h
===================================================================
--- last_stable.orig/drivers/infiniband/core/mad_priv.h
+++ last_stable/drivers/infiniband/core/mad_priv.h
@@ -119,7 +119,8 @@ struct ib_mad_send_wr_private {
struct list_head agent_list;
struct ib_mad_agent_private *mad_agent_priv;
struct ib_mad_send_buf send_buf;
- DECLARE_PCI_UNMAP_ADDR(mapping)
+ DECLARE_PCI_UNMAP_ADDR(header_mapping)
+ DECLARE_PCI_UNMAP_ADDR(payload_mapping)
struct ib_send_wr send_wr;
struct ib_sge sg_list[IB_MAD_SEND_REQ_MAX_SG];
__be64 tid;
@@ -130,9 +131,11 @@ struct ib_mad_send_wr_private {
enum ib_wc_status status;
/* RMPP control */
+ struct list_head multipacket_list;
int last_ack;
int seg_num;
int newwin;
+ int total_length;
int total_seg;
int data_offset;
int pad;
Index: last_stable/drivers/infiniband/core/user_mad.c
===================================================================
--- last_stable.orig/drivers/infiniband/core/user_mad.c
+++ last_stable/drivers/infiniband/core/user_mad.c
@@ -123,6 +123,7 @@ struct ib_umad_packet {
struct ib_mad_send_buf *msg;
struct list_head list;
int length;
+ struct list_head seg_list;
struct ib_user_mad mad;
};
More information about the general
mailing list