[ofa-general] [PATCH/RFC 2/2] RDMA/amso1100: Add support for "send with invalidate" work requests

Roland Dreier rdreier at cisco.com
Wed Mar 19 20:35:40 PDT 2008


Handle work requests that have the IB_SEND_INVALIDATE flag set.

This resurrects a patch sent long ago by Mikkel Hagen <mhagen at iol.unh.edu>.

Signed-off-by: Roland Dreier <rolandd at cisco.com>
---
Compile-tested only, because I retired my amso1100 systems a while ago.

 drivers/infiniband/hw/amso1100/c2_qp.c   |   16 ++++++++++++----
 drivers/infiniband/hw/amso1100/c2_rnic.c |    3 ++-
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2_qp.c b/drivers/infiniband/hw/amso1100/c2_qp.c
index 9190bd5..d63edc1 100644
--- a/drivers/infiniband/hw/amso1100/c2_qp.c
+++ b/drivers/infiniband/hw/amso1100/c2_qp.c
@@ -811,16 +811,24 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
 
 		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_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 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);
 			} else {
 				c2_wr_set_id(&wr, C2_WR_TYPE_SEND);
-				msg_size = sizeof(struct c2wr_send_req);
 			}
 
 			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;
diff --git a/drivers/infiniband/hw/amso1100/c2_rnic.c b/drivers/infiniband/hw/amso1100/c2_rnic.c
index b1441ae..9a054c6 100644
--- a/drivers/infiniband/hw/amso1100/c2_rnic.c
+++ b/drivers/infiniband/hw/amso1100/c2_rnic.c
@@ -455,7 +455,8 @@ int __devinit c2_rnic_init(struct c2_dev *c2dev)
 	     IB_DEVICE_CURR_QP_STATE_MOD |
 	     IB_DEVICE_SYS_IMAGE_GUID |
 	     IB_DEVICE_ZERO_STAG |
-	     IB_DEVICE_MEM_WINDOW);
+	     IB_DEVICE_MEM_WINDOW |
+	     IB_DEVICE_SEND_W_INV);
 
 	/* Allocate the qptr_array */
 	c2dev->qptr_array = vmalloc(C2_MAX_CQS * sizeof(void *));
-- 
1.5.4.3




More information about the general mailing list