[openib-general] [PATCH 1 of 3] mad: large RMPP support, Round 2

Jack Morgenstein jackm at mellanox.co.il
Sun Feb 12 07:27:44 PST 2006


Implement large RMPP support:
changes to header files.

Signed-off-by: Jack Morgenstein <jackm at mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: src/drivers/infiniband/include/rdma/ib_mad.h
===================================================================
--- src.orig/drivers/infiniband/include/rdma/ib_mad.h	2006-02-12 16:08:25.503620000 +0200
+++ src/drivers/infiniband/include/rdma/ib_mad.h	2006-02-12 16:08:48.063975000 +0200
@@ -141,6 +141,13 @@ struct ib_rmpp_hdr {
 	__be32	paylen_newwin;
 };
 
+struct ib_mad_multipacket_seg {
+	struct list_head list;
+	u32 num;
+	u16 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))
@@ -485,17 +492,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 +597,16 @@ struct ib_mad_send_buf * ib_create_send_
 					    gfp_t gfp_mask);
 
 /**
+ * *ib_mad_get_multipacket_seg - returns a given RMPP segment.
+ * @send_buf: Previously allocated send data buffer.
+ * @seg_num: number of segment to return
+ *
+ * This routine returns a pointer to a segment of a multipacket RMPP message.
+ */
+struct ib_mad_multipacket_seg
+*ib_mad_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: src/drivers/infiniband/core/mad_priv.h
===================================================================
--- src.orig/drivers/infiniband/core/mad_priv.h	2006-02-12 16:08:25.304631000 +0200
+++ src/drivers/infiniband/core/mad_priv.h	2006-02-12 16:08:48.073973000 +0200
@@ -119,10 +119,12 @@ 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;
+	void *mad_payload; /* RMPP: changed per segment */
 	unsigned long timeout;
 	int retries;
 	int retry;
@@ -130,9 +132,13 @@ struct ib_mad_send_wr_private {
 	enum ib_wc_status status;
 
 	/* RMPP control */
+	struct list_head multipacket_list;
+	struct ib_mad_multipacket_seg *last_ack_seg;
+	struct ib_mad_multipacket_seg *seg_num_seg;
 	int last_ack;
 	int seg_num;
 	int newwin;
+	int total_length;
 	int total_seg;
 	int data_offset;
 	int pad;
@@ -218,4 +224,7 @@ void ib_mark_mad_done(struct ib_mad_send
 void ib_reset_mad_timeout(struct ib_mad_send_wr_private *mad_send_wr,
 			  int timeout_ms);
 
+struct ib_mad_multipacket_seg
+*ib_rmpp_get_multipacket_seg(struct ib_mad_send_wr_private *wr, int seg_num);
+
 #endif	/* __IB_MAD_PRIV_H__ */



More information about the general mailing list