aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
diff options
context:
space:
mode:
authorAdit Ranadive <aditr@vmware.com>2019-01-09 23:08:49 +0000
committerJason Gunthorpe <jgg@mellanox.com>2019-01-10 17:00:28 -0700
commit6325e01b6cdf4636b721cf7259c1616e3cf28ce2 (patch)
treedec6788add6ae4dd552b12787aadc3da9cabe016 /drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
parentRDMA/cma: Add cm_id restrack resource based on kernel or user cm_id type (diff)
downloadlinux-dev-6325e01b6cdf4636b721cf7259c1616e3cf28ce2.tar.xz
linux-dev-6325e01b6cdf4636b721cf7259c1616e3cf28ce2.zip
RDMA/vmw_pvrdma: Return the correct opcode when creating WR
Since the IB_WR_REG_MR opcode value changed, let's set the PVRDMA device opcodes explicitly. Reported-by: Ruishuang Wang <ruishuangw@vmware.com> Fixes: 9a59739bd01f ("IB/rxe: Revise the ib_wr_opcode enum") Cc: stable@vger.kernel.org Reviewed-by: Bryan Tan <bryantan@vmware.com> Reviewed-by: Ruishuang Wang <ruishuangw@vmware.com> Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Adit Ranadive <aditr@vmware.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c')
-rw-r--r--drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
index 3acf74cbe266..1ec3646087ba 100644
--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
+++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c
@@ -721,6 +721,12 @@ int pvrdma_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr,
wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM)
wqe_hdr->ex.imm_data = wr->ex.imm_data;
+ if (unlikely(wqe_hdr->opcode == PVRDMA_WR_ERROR)) {
+ *bad_wr = wr;
+ ret = -EINVAL;
+ goto out;
+ }
+
switch (qp->ibqp.qp_type) {
case IB_QPT_GSI:
case IB_QPT_UD: