Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f252b5dc authored by Mitesh Ahuja's avatar Mitesh Ahuja Committed by Roland Dreier
Browse files

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: default avatarMitesh Ahuja <mitesh.ahuja@emulex.Com>
Signed-off-by: default avatarDevesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: default avatarSelvin Xavier <selvin.xavier@emulex.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent a96ffb1d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2055,6 +2055,13 @@ int ocrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
	}

	while (wr) {
		if (qp->qp_type == IB_QPT_UD &&
		    (wr->opcode != IB_WR_SEND &&
		     wr->opcode != IB_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;