From patchwork Fri May 19 04:44:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 9735839 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 D00BD601A1 for ; Fri, 19 May 2017 04:45:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDDF4288C4 for ; Fri, 19 May 2017 04:45:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B224C288CF; Fri, 19 May 2017 04:45:23 +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 58E5B288C4 for ; Fri, 19 May 2017 04:45:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751025AbdESEpW (ORCPT ); Fri, 19 May 2017 00:45:22 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:37073 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751003AbdESEpV (ORCPT ); Fri, 19 May 2017 00:45:21 -0400 Received: by mail-wm0-f53.google.com with SMTP id d127so73488453wmf.0 for ; Thu, 18 May 2017 21:45:20 -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=UVoOZvZjU3V562U5WQ8BOpTHOJB9w3drK/MjJPKFEQzuKRuJKlhN6vGHhDWFYMkmfY LvaMG/77liErMGsXP67CdJwWkK1rV4PgTRQ+Fu8+bciVWPFXqN/+fAxaiCeTQFxfvZz6 kkgAe1H4ipLtPcYDg7HkG4BCB/PoEaBdH+lbU= 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=oHj2wl/mUEVEW8yz7VCVkOdUp+82ns4o/KtmkG4MNWIFj2pRJf2bcFSzoVATS9UncB fOogzl1/M8DjF83mXSOqD2z/WctvL0sXc0eWN8+H87oNYggrAQ3NNwI1RxFhLfpw21BV SetpTgMirJusouacNpT9OLCnOKU4ZMXCvDx5XGuaXYdC/okzzvGDsDCvhOHYbAGirQq5 K9DT/37AMZHgDI7pQd23zY/a9fC3OBrx7dyRv5LbRImXlIGxfjcXHLM46dIQZowLXBkj Rwhzq9HCF41lHAVbKkkFb4BDF7gCN1q94WxNf/K4HFbdKdC8ysEyYxz1dq+Kt7kv9wOH ea3w== X-Gm-Message-State: AODbwcC9YYaoeCV/lS4eKukkHV6aCwVDG57P0tB8FoD3j4IgN1HBomsi Y/s/AB5Y/VlSqJQg X-Received: by 10.28.144.15 with SMTP id s15mr4611541wmd.137.1495169119824; Thu, 18 May 2017 21:45:19 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id p107sm1202508wrb.64.2017.05.18.21.45.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 May 2017 21:45:19 -0700 (PDT) From: Selvin Xavier To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, Somnath Kotur , Selvin Xavier Subject: [PATCH V3 for-next 07/15] RDMA/bnxt_re: Fix WQE Size posted to HW to prevent it from throwing error Date: Thu, 18 May 2017 21:44:26 -0700 Message-Id: <1495169074-12641-8-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1495169074-12641-1-git-send-email-selvin.xavier@broadcom.com> References: <1495169074-12641-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);