From patchwork Wed May 10 10:45:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 9719659 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 0858960236 for ; Wed, 10 May 2017 10:46:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F312C28576 for ; Wed, 10 May 2017 10:46:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E82B02857F; Wed, 10 May 2017 10:46:17 +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 9463228576 for ; Wed, 10 May 2017 10:46:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595AbdEJKqQ (ORCPT ); Wed, 10 May 2017 06:46:16 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:34162 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752285AbdEJKqQ (ORCPT ); Wed, 10 May 2017 06:46:16 -0400 Received: by mail-qk0-f181.google.com with SMTP id k74so24697759qke.1 for ; Wed, 10 May 2017 03:46:15 -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=WY4sZPIaJVoRoAvLesKjr2Qx22Ud9oyGngnxz/G7A70=; b=QbGb2sK0vWXNgasZF3O+l6rF6KjjdTB+PHcpXZA8DRP6TnFqAXlNHxhlB+46rWJAOU 9P8F9I+JAMCU/D3599GVx+s1xQu/bthmd6tUFNFmDWbKtnv472vfTMwG/c13lZkQKVga QjT4uHj6agFVouX2dmpWDaiBuPZH3sFFFm28M= 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=WY4sZPIaJVoRoAvLesKjr2Qx22Ud9oyGngnxz/G7A70=; b=S2zXJw7Tg3JSoqH5EHbcM33O636gNKH+l/fd+PSMxbrCY/+n4lLCaLnOK1d5mMeRDq pkPlpNl6x2F73I/JQGIwMkcAypTrcEE7ZUjhrNboG7EECg91gptkqTZPACNtzlyvgTxN BAMpwRg4AOw4CaAQntFHwg7QrLL8Kx7vgwynhHeIJoIYCgaSXnArZg8u9tHaNB6ENdwt nbter/ninA66anq3Bq7cvwuxD4X1MjUeUdEf+ti8ebFUimDC5qJe4R0cmTUiLwo5L06J Z8rxP9TzO1HUOkYm/OPkO+6VhbUG4Ir6Np3e/r4oGJXY+HO9OFvLjjc6KrAIyK0T51Yo glvQ== X-Gm-Message-State: AODbwcBDQXUBZAaLzWYRXMvnyr95n7gHZbixCqEOGLTbMT6mrEDeL0Hn t+3bGHoHhZ7zYXHa X-Received: by 10.55.26.153 with SMTP id l25mr5000389qkh.9.1494413175212; Wed, 10 May 2017 03:46:15 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id k10sm1868531qke.3.2017.05.10.03.46.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2017 03:46:14 -0700 (PDT) From: Selvin Xavier To: dledford@redhat.com, linux-rdma@vger.kernel.org Cc: Somnath Kotur , Selvin Xavier Subject: [PATCH for-next 07/14] RDMA/bnxt_re: Fix WQE Size posted to HW to prevent it from throwing error Date: Wed, 10 May 2017 03:45:32 -0700 Message-Id: <1494413139-11883-8-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1494413139-11883-1-git-send-email-selvin.xavier@broadcom.com> References: <1494413139-11883-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 0716298..6a07e4b 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);