[ofa-general] Re: [PATCH] infiniband: modify ammasso driver to use send with invalidate

mhagen at iol.unh.edu mhagen at iol.unh.edu
Wed May 2 10:52:15 PDT 2007


Ok, here is the patch reverted again.

--- linux-2.6.21.1/drivers/infiniband/hw/amso1100/c2_qp.c	2007-04-30
13:12:54.000000000 -0400
+++ linux-2.6.21.1/drivers/infiniband/hw/amso1100/c2_qp.c	2007-05-02
13:50:25.000000000 -0400
@@ -810,16 +810,25 @@ int c2_post_send(struct ib_qp *ibqp, str

 		switch (ib_wr->opcode) {
 		case IB_WR_SEND:
-			if (ib_wr->send_flags & IB_SEND_SOLICITED) {
+			if (ib_wr->send_flags & IB_SEND_SOLICITED
+				&& ib_wr->send_flags & IB_SEND_INVALIDATE) {
+				c2_wr_set_id(&wr, C2_WR_TYPE_SEND_SE_INV);
+				wr.sqwr.send.remote_stag =
+					cpu_to_be32(ib_wr->wr.invalidate.rkey);
+			} else if (ib_wr->send_flags & IB_SEND_SOLICITED) {
 				c2_wr_set_id(&wr, C2_WR_TYPE_SEND_SE);
-				msg_size = sizeof(struct c2wr_send_req);
+				wr.sqwr.send.remote_stag = 0;
+			} else if (ib_wr->send_flags & IB_SEND_INVALIDATE) {
+				c2_wr_set_id(&wr, C2_WR_TYPE_SEND_INV);
+				wr.sqwr.send.remote_stag =
+					cpu_to_be32(ib_wr->wr.invalidate.rkey);
 			} else {
 				c2_wr_set_id(&wr, C2_WR_TYPE_SEND);
-				msg_size = sizeof(struct c2wr_send_req);
+				wr.sqwr.send.remote_stag = 0;
 			}

-			wr.sqwr.send.remote_stag = 0;
-			msg_size += sizeof(struct c2_data_addr) * ib_wr->num_sge;
+			msg_size = sizeof(struct c2wr_send_req) +
+				sizeof(struct c2_data_addr) * ib_wr->num_sge;
 			if (ib_wr->num_sge > qp->send_sgl_depth) {
 				err = -EINVAL;
 				break;



-- 
Mikkel Hagen
Project Assistant - Fibre Channel/SAS/SATA Consortiums
Research and Development Engineer - iWARP Consortium
FC/SAS/SATA:1-603-862-0701  iWARP:1-603-862-5083  Fax:1-603-862-4181
UNH-IOL
121 Technology Drive, Suite 2
Durham, NH 03824




More information about the general mailing list