From patchwork Wed Jun 4 18:19:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 4296371 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4EA3E9F1D6 for ; Wed, 4 Jun 2014 18:22:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F8CE201D5 for ; Wed, 4 Jun 2014 18:21:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B73A6201DE for ; Wed, 4 Jun 2014 18:21:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751036AbaFDSV4 (ORCPT ); Wed, 4 Jun 2014 14:21:56 -0400 Received: from cmexedge1.ext.emulex.com ([138.239.224.99]:14591 "EHLO CMEXEDGE1.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751128AbaFDSV4 (ORCPT ); Wed, 4 Jun 2014 14:21:56 -0400 Received: from CMEXHTCAS1.ad.emulex.com (138.239.115.217) by CMEXEDGE1.ext.emulex.com (138.239.224.99) with Microsoft SMTP Server (TLS) id 14.3.174.1; Wed, 4 Jun 2014 11:22:46 -0700 Received: from localhost.localdomain (10.192.201.1) by smtp.emulex.com (138.239.115.207) with Microsoft SMTP Server id 14.3.174.1; Wed, 4 Jun 2014 11:21:54 -0700 From: Selvin Xavier To: CC: , Mitesh Ahuja , Devesh Sharma , Selvin Xavier Subject: [PATCH for-next 09/15] RDMA/ocrdma: Allow only SEND opcode in case of UD QPs Date: Wed, 4 Jun 2014 23:49:09 +0530 X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1401905955-28117-9-git-send-email-selvin.xavier@emulex.com> References: <1401905955-28117-1-git-send-email-selvin.xavier@emulex.com> <1401905955-28117-2-git-send-email-selvin.xavier@emulex.com> <1401905955-28117-3-git-send-email-selvin.xavier@emulex.com> <1401905955-28117-4-git-send-email-selvin.xavier@emulex.com> <1401905955-28117-5-git-send-email-selvin.xavier@emulex.com> <1401905955-28117-6-git-send-email-selvin.xavier@emulex.com> <1401905955-28117-7-git-send-email-selvin.xavier@emulex.com> <1401905955-28117-8-git-send-email-selvin.xavier@emulex.com> <1401905955-28117-9-git-send-email-selvin.xavier@emulex.com> MIME-Version: 1.0 Message-ID: Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mitesh Ahuja Signed-off-by: Mitesh Ahuja Signed-off-by: Devesh Sharma Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 7 +++++++ 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 2b68235..7f54d24 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, } 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;