]> git.openfabrics.org - ~emulex/libocrdma.git/commitdiff
RDMA/libocrdma: do not allow RDMA on UD QP
authorDevesh Sharma <devesh.sharma@emulex.com>
Thu, 26 Jun 2014 11:24:07 +0000 (16:54 +0530)
committerDevesh Sharma <devesh.sharma@emulex.com>
Tue, 1 Jul 2014 05:43:40 +0000 (11:13 +0530)
As per IB compilance it is not allowed to post RDMA operations
on a UD QP. This patch is adding a compilance check and if any
violation is detected -EINVAL is returned.

Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: Mitesh Ahuja <mitesh.ahuja@emulex.com>
src/ocrdma_verbs.c

index 0f138cfd9bc90fcc8c04ed140cd0628f6496d304..a5b72524ad4c9bc2f24e3302551c8195e0bd4943 100644 (file)
@@ -1395,6 +1395,14 @@ int ocrdma_post_send(struct ibv_qp *ib_qp, struct ibv_send_wr *wr,
        }
 
        while (wr) {
+
+               if (qp->qp_type == IBV_QPT_UD && (wr->opcode != IBV_WR_SEND &&
+                   wr->opcode != IBV_WR_SEND_WITH_IMM)) {
+                       *bad_wr = wr;
+                       status = -EINVAL;
+                       break;
+               }
+
                if (ocrdma_hwq_free_cnt(&qp->sq) == 0 ||
                    wr->num_sge > qp->sq.max_sges) {
                        *bad_wr = wr;