aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorMitesh Ahuja <mitesh.ahuja@emulex.Com>2014-06-10 10:02:20 -0400
committerRoland Dreier <roland@purestorage.com>2014-08-01 18:07:36 -0400
commitf252b5dc36e26368c7161f32ef304c30cd2d1f6c (patch)
treecb36b32e27926862805f6841bd79f1de0bf11406 /drivers/infiniband
parenta96ffb1de9d656ce7083277a8badaa1082813498 (diff)
RDMA/ocrdma: Allow only SEND opcode in case of UD QPs
Prevent posting opcodes other than send and send immediate on the UD QPs. Signed-off-by: Mitesh Ahuja <mitesh.ahuja@emulex.Com> Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com> Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_verbs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 2b68235973d7..7f54d2478738 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -2055,6 +2055,13 @@ int ocrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
2055 } 2055 }
2056 2056
2057 while (wr) { 2057 while (wr) {
2058 if (qp->qp_type == IB_QPT_UD &&
2059 (wr->opcode != IB_WR_SEND &&
2060 wr->opcode != IB_WR_SEND_WITH_IMM)) {
2061 *bad_wr = wr;
2062 status = -EINVAL;
2063 break;
2064 }
2058 if (ocrdma_hwq_free_cnt(&qp->sq) == 0 || 2065 if (ocrdma_hwq_free_cnt(&qp->sq) == 0 ||
2059 wr->num_sge > qp->sq.max_sges) { 2066 wr->num_sge > qp->sq.max_sges) {
2060 *bad_wr = wr; 2067 *bad_wr = wr;