diff mbox series

[rdma-core] providers/i40iw: Add SEND_WITH_INVAL support

Message ID 20180925232811.13288-1-tatyana.e.nikolova@intel.com (mailing list archive)
State Accepted
Headers show
Series [rdma-core] providers/i40iw: Add SEND_WITH_INVAL support | expand

Commit Message

Nikolova, Tatyana E Sept. 25, 2018, 11:28 p.m. UTC
From: Shiraz Saleem <shiraz.saleem@intel.com>

The SEND_WITH_INVAL operation is supported in i40iw
driver but accidentally missed out in user-space.
Add the support in libi40iw.

Reported-by: Benjamin Walker <benjamin.walker@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
---
 providers/i40iw/i40iw_uverbs.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

Comments

Leon Romanovsky Sept. 26, 2018, 3:35 p.m. UTC | #1
On Tue, Sep 25, 2018 at 06:28:11PM -0500, Tatyana Nikolova wrote:
> From: Shiraz Saleem <shiraz.saleem@intel.com>
>
> The SEND_WITH_INVAL operation is supported in i40iw
> driver but accidentally missed out in user-space.
> Add the support in libi40iw.
>
> Reported-by: Benjamin Walker <benjamin.walker@intel.com>
> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
> Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
> ---
>  providers/i40iw/i40iw_uverbs.c | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
>

Thanks, applied.
diff mbox series

Patch

diff --git a/providers/i40iw/i40iw_uverbs.c b/providers/i40iw/i40iw_uverbs.c
index a213d8f..9d407c7 100644
--- a/providers/i40iw/i40iw_uverbs.c
+++ b/providers/i40iw/i40iw_uverbs.c
@@ -811,21 +811,30 @@  int i40iw_upost_send(struct ibv_qp *ib_qp, struct ibv_send_wr *ib_wr, struct ibv
 
 		switch (ib_wr->opcode) {
 		case IBV_WR_SEND:
-			if (ib_wr->send_flags & IBV_SEND_SOLICITED)
-				info.op_type = I40IW_OP_TYPE_SEND_SOL;
-			else
-				info.op_type = I40IW_OP_TYPE_SEND;
+		    /* fall-through */
+		case IBV_WR_SEND_WITH_INV:
+			if (ib_wr->opcode == IBV_WR_SEND) {
+				if (ib_wr->send_flags & IBV_SEND_SOLICITED)
+					info.op_type = I40IW_OP_TYPE_SEND_SOL;
+				else
+					info.op_type = I40IW_OP_TYPE_SEND;
+			} else {
+				if (ib_wr->send_flags & IBV_SEND_SOLICITED)
+					info.op_type = I40IW_OP_TYPE_SEND_SOL_INV;
+				else
+					info.op_type = I40IW_OP_TYPE_SEND_INV;
+			}
 
 			if (ib_wr->send_flags & IBV_SEND_INLINE) {
 			  info.op.inline_send.data = (void *)(uintptr_t)ib_wr->sg_list[0].addr;
 				info.op.inline_send.len = ib_wr->sg_list[0].length;
 				ret = iwuqp->qp.ops.iw_inline_send(&iwuqp->qp, &info,
-								   ib_wr->wr.rdma.rkey, false);
+								   ib_wr->invalidate_rkey, false);
 			} else {
 				info.op.send.num_sges = ib_wr->num_sge;
 				info.op.send.sg_list = (struct i40iw_sge *)ib_wr->sg_list;
 				ret = iwuqp->qp.ops.iw_send(&iwuqp->qp, &info,
-							    ib_wr->wr.rdma.rkey, false);
+							    ib_wr->invalidate_rkey, false);
 			}
 
 			if (ret) {