From patchwork Wed May 17 09:19:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 9730505 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 5C85A602DB for ; Wed, 17 May 2017 09:21:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58D0C26E39 for ; Wed, 17 May 2017 09:21:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DCE2286E7; Wed, 17 May 2017 09:21:13 +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 6BB5526E39 for ; Wed, 17 May 2017 09:21:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753623AbdEQJVK (ORCPT ); Wed, 17 May 2017 05:21:10 -0400 Received: from mail-qt0-f178.google.com ([209.85.216.178]:33649 "EHLO mail-qt0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753706AbdEQJVJ (ORCPT ); Wed, 17 May 2017 05:21:09 -0400 Received: by mail-qt0-f178.google.com with SMTP id t26so4549704qtg.0 for ; Wed, 17 May 2017 02:21:09 -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=N/9+rPNbvYKpt/D2aRr8Phck5bJLFjkbdLfgcIbMxePgkFPf0vmfg7xwHe2nkMqV80 4PjJhzRzYa3Q+HhgjGcnI+a4i+LkHX+/TnkhS3tlCn2MXgw4Lw2FqkJJDMyGah4BWCGn WmTP+kKPdZxBWCUCt/H96aiMp47dl+g1PZ4qo= 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=hNujAxwv1GyluG1Ov2tS6pj7QMyGEhlJZdJBg5GtUQLw8Gh9of9i8MLH305+mQ4/bi xu8448EyxF2LUWwd7+tmtEBnF6eFGfEAoXs3qQZXT1lZj7Elp9UMKRqzd8CNsSN2GC4U fLGsjJCFCSAx2a5AGSrDLHP//KzB7QOIn0PX4DmIyITBx+b5+Afi5zhHLGv1UXN4gVgT eiwTs6xat1ZlqxhOW3oecmVLX8E3vUx4OgS3LMise7JeeJa/4tGQ5zPMVjgClfB+UgdY rVYm/Lyk+ZtL9dxKrEOibsQNlGB/WJTePUFg9xAoL3K0Ouq1u34taDtdN32qui0M0rQI 9dXg== X-Gm-Message-State: AODbwcB9EfyMZo/2D9bobDgwq8W1MoXfokcDXyBYfM+VSBELro4/yTgW 54QGhMs5boeMkSJm X-Received: by 10.200.57.37 with SMTP id s34mr1913180qtb.141.1495012868514; Wed, 17 May 2017 02:21:08 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id t136sm998431qke.40.2017.05.17.02.21.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 May 2017 02:21:08 -0700 (PDT) From: Selvin Xavier To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, Somnath Kotur , Selvin Xavier Subject: [PATCH V2 for-next 07/15] RDMA/bnxt_re: Fix WQE Size posted to HW to prevent it from throwing error Date: Wed, 17 May 2017 02:19:43 -0700 Message-Id: <1495012791-5053-8-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1495012791-5053-1-git-send-email-selvin.xavier@broadcom.com> References: <1495012791-5053-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);