public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* RE: Send with immediate data completion
@ 2012-01-11 21:59 Hefty, Sean
       [not found] ` <1828884A29C6694DAF28B7E6B8A82373256758E5-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Hefty, Sean @ 2012-01-11 21:59 UTC (permalink / raw)
  To: Hefty, Sean, Atchley, Scott
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

> From my interpretation of the spec, it looks like a bug and the immediate data
> should be available in the send wc, since it's not explicitly excluded.  I'll
> verify that this is the intent with the IBTA.

I'm still waiting on feedback from the IBTA, but they are looking into the matter.
 
> I haven't traced through the library and driver code to see if mlx4 driver can
> report it.  I'll see if I can do this within the next couple of days.

The following patch to libmlx4 added the immediate data to the send work completion for me.  A similar change looks like it would be needed in the kernel.

Report immediate data with send work completions

From: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 src/cq.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/cq.c b/src/cq.c
index 8226b6b..ad1d20c 100644
--- a/src/cq.c
+++ b/src/cq.c
@@ -46,6 +46,7 @@
 
 #include "mlx4.h"
 #include "doorbell.h"
+#include "wqe.h"
 
 enum {
 	MLX4_CQ_DOORBELL			= 0x20
@@ -194,6 +195,7 @@ static int mlx4_poll_one(struct mlx4_cq *cq,
 {
 	struct mlx4_wq *wq;
 	struct mlx4_cqe *cqe;
+	struct mlx4_wqe_ctrl_seg *ctrl;
 	struct mlx4_srq *srq;
 	uint32_t qpn;
 	uint32_t g_mlpath_rqpn;
@@ -240,6 +242,8 @@ static int mlx4_poll_one(struct mlx4_cq *cq,
 		wq = &(*cur_qp)->sq;
 		wqe_index = ntohs(cqe->wqe_index);
 		wq->tail += (uint16_t) (wqe_index - (uint16_t) wq->tail);
+		ctrl = (*cur_qp)->buf.buf + (*cur_qp)->sq.offset +
+			((wq->tail & (wq->wqe_cnt - 1)) << (*cur_qp)->sq.wqe_shift);
 		wc->wr_id = wq->wrid[wq->tail & (wq->wqe_cnt - 1)];
 		++wq->tail;
 	} else if ((*cur_qp)->ibv_qp.srq) {
@@ -265,11 +269,13 @@ static int mlx4_poll_one(struct mlx4_cq *cq,
 		switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) {
 		case MLX4_OPCODE_RDMA_WRITE_IMM:
 			wc->wc_flags |= IBV_WC_WITH_IMM;
+			wc->imm_data = ctrl->imm;
 		case MLX4_OPCODE_RDMA_WRITE:
 			wc->opcode    = IBV_WC_RDMA_WRITE;
 			break;
 		case MLX4_OPCODE_SEND_IMM:
 			wc->wc_flags |= IBV_WC_WITH_IMM;
+			wc->imm_data = ctrl->imm;
 		case MLX4_OPCODE_SEND:
 			wc->opcode    = IBV_WC_SEND;
 			break;


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* Send with immediate data completion
@ 2012-01-03 16:08 Atchley, Scott
       [not found] ` <11EC89F0-2BFD-4727-BC45-AD30E0F10348-1Heg1YXhbW8@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Atchley, Scott @ 2012-01-03 16:08 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Hi all,

I have a question about a completion for a send with immediate data. The IB spec (1.2.1) only mentions that the WC's immediate data be present at the receiver. It is silent on the value on the sender at completion. It does say that it is only valid if the WC's immediate data indicator is set.

When I test using a 2.6.38 kernel with the kernel.org libibverbs git tree, I see a send completion's wc_flags set with IBV_WC_WITH_IMM yet the imm_data is not what I passed in. Since the spec is silent on setting imm_data on the sender, I assume that I should not rely on looking at the imm_data on a send completion.

Given that, should IBV_WC_WITH_IMM ever be set on the sender?

Thanks,

Scott

-------------
Scott Atchley
HPC Systems Engineer
Center for Computational Sciences
Oak Ridge National Laboratory
atchleyes-1Heg1YXhbW8@public.gmane.org



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-01-12 15:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11 21:59 Send with immediate data completion Hefty, Sean
     [not found] ` <1828884A29C6694DAF28B7E6B8A82373256758E5-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-01-11 22:22   ` Hefty, Sean
     [not found]     ` <1828884A29C6694DAF28B7E6B8A823732567591B-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-01-11 23:35       ` Roland Dreier
     [not found]         ` <CAL1RGDVDR_yNmGyCpFKpH39PF5NG90qo7bBDV+DbGmh7FySiZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-12  0:51           ` Jason Gunthorpe
2012-01-12 15:57       ` Atchley, Scott
  -- strict thread matches above, loose matches on Subject: below --
2012-01-03 16:08 Atchley, Scott
     [not found] ` <11EC89F0-2BFD-4727-BC45-AD30E0F10348-1Heg1YXhbW8@public.gmane.org>
2012-01-03 16:55   ` Hefty, Sean
     [not found]     ` <1828884A29C6694DAF28B7E6B8A823732566A099-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-01-03 17:35       ` Atchley, Scott
     [not found]         ` <9A17BA94-61E0-4176-81CF-98BE023320AF-1Heg1YXhbW8@public.gmane.org>
2012-01-11 14:50           ` Atchley, Scott
     [not found]             ` <7B006904-1749-4562-B2FD-1A0E5212A449-1Heg1YXhbW8@public.gmane.org>
2012-01-11 16:15               ` Hefty, Sean
2012-01-03 17:38       ` Atchley, Scott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox