diff mbox

[for-next,2/4] RDMA/libocrdma: do not allow RDMA on UD QP

Message ID 0de644e0-1c42-4f35-a32b-507c11df810e@CMEXHTCAS1.ad.emulex.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Devesh Sharma July 1, 2014, 5:54 a.m. UTC
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 |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c
index 0f138cf..a5b7252 100644
--- a/src/ocrdma_verbs.c
+++ b/src/ocrdma_verbs.c
@@ -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;