From patchwork Thu Jun 29 19:28:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 9817831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E2466020A for ; Thu, 29 Jun 2017 19:29:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0062E2859A for ; Thu, 29 Jun 2017 19:29:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9218285E1; Thu, 29 Jun 2017 19:29:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 729FB2859A for ; Thu, 29 Jun 2017 19:29:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753125AbdF2T3A (ORCPT ); Thu, 29 Jun 2017 15:29:00 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:38254 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753095AbdF2T3A (ORCPT ); Thu, 29 Jun 2017 15:29:00 -0400 Received: by mail-wm0-f47.google.com with SMTP id b184so25027182wme.1 for ; Thu, 29 Jun 2017 12:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=a3KHHrdtqJGPPt5vemBCL1mKXQb2oJl/Y35BCvxQ59A=; b=NOKoGf6Y62PFqF/J2/BGdnSfB/mNLNM+NmpVRNHyMsTY8LVFpBqkuLPWseNoFECz05 SLCfG+B90MwQc5w1OFrBNDYYLEgRuJTSCx/ySv17rwTbLxd1OYK7VvoAE30NfPkQwgbj XGTAuBP3BhCsS2wW4ZTZt6DGgyM3QXht/DJ1o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=a3KHHrdtqJGPPt5vemBCL1mKXQb2oJl/Y35BCvxQ59A=; b=dyGy1XiPr8qCDN7Y53sPkhqvF70ggKHtGgtHJgc2UVdvKn4BfY3xl6b3TvauIqR1ma Em15D8gS2CAeLhzpIwLAN/lYP7j/+V6jAF2nptdrOSosE/DTFJQYdZnzjnaxx6FJIkE2 gRk0Mxsr9dP9Utkuz+1MvlCg6jGqCKhmrLY2zlz+v08Jac9jk2IEWAP5yQ1ifGW8DqL7 VrqhJZ2OmXXX79Cw9liP8PAX41k8zoY1BWSpjkzNVUiwSApwcWvaN4Q58ezuZ0Q5uNT8 eRp/HPrsSTID7T+rG54+LOwudJU/ZCrO+eutD5QsmbWqoxPtGWl9oJnVtAMyPsRMndh4 hxwg== X-Gm-Message-State: AKS2vOzk5aDGzGdWDBaAfrbQROd/TP2l14CvgUVPrFfh5BWrLbQjveOi lbqEpNNlsV53COy9 X-Received: by 10.28.212.207 with SMTP id l198mr3277301wmg.23.1498764538618; Thu, 29 Jun 2017 12:28:58 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id r40sm6135032wrb.37.2017.06.29.12.28.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2017 12:28:47 -0700 (PDT) From: Selvin Xavier To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, Somnath Kotur , Selvin Xavier Subject: [PATCH for-next V2 03/13] RDMA/bnxt_re: Fix WQE Size posted to HW to prevent it from throwing error Date: Thu, 29 Jun 2017 12:28:09 -0700 Message-Id: <1498764499-24157-4-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1498764499-24157-1-git-send-email-selvin.xavier@broadcom.com> References: <1498764499-24157-1-git-send-email-selvin.xavier@broadcom.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Somnath Kotur Posting WQE size of 2 results in a WQE_FORMAT_ERROR thrown by the HW as it requires host to supply WQE Size with room for atleast one SGE so that the resulting WQE size be atleast 3. Signed-off-by: Somnath Kotur Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c index f05500bc..8ef39df 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -1128,6 +1128,11 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp, } /* Each SGE entry = 1 WQE size16 */ wqe_size16 = wqe->num_sge; + /* HW requires wqe size has room for atleast one SGE even if + * none was supplied by ULP + */ + if (!wqe->num_sge) + wqe_size16++; } /* Specifics */ @@ -1364,6 +1369,11 @@ int bnxt_qplib_post_recv(struct bnxt_qplib_qp *qp, rqe->flags = wqe->flags; rqe->wqe_size = wqe->num_sge + ((offsetof(typeof(*rqe), data) + 15) >> 4); + /* HW requires wqe size has room for atleast one SGE even if none + * was supplied by ULP + */ + if (!wqe->num_sge) + rqe->wqe_size++; /* Supply the rqe->wr_id index to the wr_id_tbl for now */ rqe->wr_id[0] = cpu_to_le32(sw_prod);