From patchwork Thu Nov 8 23:59:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nikolova, Tatyana E" X-Patchwork-Id: 10675163 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39D5D15E9 for ; Fri, 9 Nov 2018 00:00:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A54D2E75D for ; Fri, 9 Nov 2018 00:00:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E5612E761; Fri, 9 Nov 2018 00:00:27 +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=-7.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SUBJ_OBFU_PUNCT_FEW 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 B2FCC2E75D for ; Fri, 9 Nov 2018 00:00:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727334AbeKIJiY (ORCPT ); Fri, 9 Nov 2018 04:38:24 -0500 Received: from mga12.intel.com ([192.55.52.136]:10577 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727306AbeKIJiY (ORCPT ); Fri, 9 Nov 2018 04:38:24 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Nov 2018 16:00:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,481,1534834800"; d="scan'208";a="279563849" Received: from tenikolo-mobl.amr.corp.intel.com ([10.255.37.93]) by fmsmga006.fm.intel.com with ESMTP; 08 Nov 2018 16:00:24 -0800 From: Tatyana Nikolova To: jgg@ziepe.ca, dledford@redhat.com, leonro@mellanox.com Cc: linux-rdma@vger.kernel.org Subject: [PATCH rdma-core] providers/i40iw: Return correct value for max_send_wr and max_recv_wr Date: Thu, 8 Nov 2018 17:59:59 -0600 Message-Id: <20181108235959.37164-1-tatyana.e.nikolova@intel.com> X-Mailer: git-send-email 2.14.2 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: "Sindhu, Devale" The max_send_wr and max_recv_wr attributes returned in create QP do not account for the internally reserved quantas (minimum sized WQE) used in sizing the WQ. Thus the values reported exceed what can actually be fit in the WQ. Fix this accounting for the reserve quantas when returning max_send_wr/max_recv_wr. Reported-by: Stefan Assmann Signed-off-by: Sindhu, Devale Reviewed-by: Shiraz, Saleem Signed-off-by: Tatyana Nikolova --- providers/i40iw/i40iw_uverbs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/providers/i40iw/i40iw_uverbs.c b/providers/i40iw/i40iw_uverbs.c index 9d407c76..63b7206a 100644 --- a/providers/i40iw/i40iw_uverbs.c +++ b/providers/i40iw/i40iw_uverbs.c @@ -689,8 +689,11 @@ struct ibv_qp *i40iw_ucreate_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr info.max_rq_frag_cnt = attr->cap.max_recv_sge; info.max_inline_data = attr->cap.max_inline_data; - if (!iwvctx->dev.ops_uk.iwarp_qp_uk_init(&iwuqp->qp, &info)) + if (!iwvctx->dev.ops_uk.iwarp_qp_uk_init(&iwuqp->qp, &info)) { + attr->cap.max_send_wr = (sqdepth - I40IW_SQ_RSVD) >> sqshift; + attr->cap.max_recv_wr = (rqdepth - I40IW_RQ_RSVD) >> rqshift; return &iwuqp->ibv_qp; + } i40iw_destroy_vmapped_qp(iwuqp, info.sq); err_free_rq_wrid: