Skip to contentSkip to conversation

Process RDMA WRITE ONLY with IMMEDIATE properly

PATCH In review Jason Gunthorpe 2 participants 2 messages Oct 22, 2010 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Process RDMA WRITE ONLY with IMMEDIATE properly

See table 35 in IBA - the header order for RDMA_WRITE_ONLY_WITH_IMMEDIATE and SEND_LAST_WITH_IMMEDIATE is different, the RDMA_WRITE_ONLY has a RETH header before the immediate data, so we need a different code path to extract the immediate data.

I tested this with a userspace app that does RDMA_WRITE with immediate on a QLE7140.

---
 drivers/infiniband/hw/qib/qib_rc.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/infiniband/hw/qib/qib_rc.c +6 -1
index 40c0a37..8d87ce3 100644
@@ -2076,7 +2076,12 @@ send_last:
 			goto nack_op_err;
 		if (!ret)
 			goto rnr_nak;
-		goto send_last_imm;
+
+		wc.ex.imm_data = ohdr->u.rc.imm_data;
+		hdrsize += 4;
+		wc.wc_flags = IB_WC_WITH_IMM;
+
+		goto send_last;
 
 	case OP(RDMA_READ_REQUEST): {
 		struct qib_ack_entry *e;
Signature · 6 lines
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to a message not in the archive

I don't think it needs the extra blank lines but I agree the code is correct.
________________________________________
From: Jason Gunthorpe [jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org]
Sent: Friday, October 22, 2010 3:00 PM
To: Ralph Campbell; RDMA list
Subject: [PATCH] [IB/QIB] Process RDMA WRITE ONLY with IMMEDIATE properly

See table 35 in IBA - the header order for RDMA_WRITE_ONLY_WITH_IMMEDIATE and SEND_LAST_WITH_IMMEDIATE is different, the RDMA_WRITE_ONLY has a RETH header before the immediate data, so we need a different code path to extract the immediate data.

I tested this with a userspace app that does RDMA_WRITE with immediate on a QLE7140.

---
 drivers/infiniband/hw/qib/qib_rc.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/infiniband/hw/qib/qib_rc.c +6 -1
index 40c0a37..8d87ce3 100644
@@ -2076,7 +2076,12 @@ send_last:
                        goto nack_op_err;
                if (!ret)
                        goto rnr_nak;
-               goto send_last_imm;
+
+               wc.ex.imm_data = ohdr->u.rc.imm_data;
+               hdrsize += 4;
+               wc.wc_flags = IB_WC_WITH_IMM;
+
+               goto send_last;
 
        case OP(RDMA_READ_REQUEST): {
                struct qib_ack_entry *e;

--
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html