From patchwork Tue Jun 10 14:02:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 4328971 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 94471BEEAA for ; Tue, 10 Jun 2014 14:05:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C265F202E5 for ; Tue, 10 Jun 2014 14:05:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5C08202C8 for ; Tue, 10 Jun 2014 14:05:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751715AbaFJOE7 (ORCPT ); Tue, 10 Jun 2014 10:04:59 -0400 Received: from cmexedge1.ext.emulex.com ([138.239.224.99]:39891 "EHLO CMEXEDGE1.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751163AbaFJOE7 (ORCPT ); Tue, 10 Jun 2014 10:04:59 -0400 Received: from CMEXHTCAS1.ad.emulex.com (138.239.115.217) by CMEXEDGE1.ext.emulex.com (138.239.224.99) with Microsoft SMTP Server (TLS) id 14.3.174.1; Tue, 10 Jun 2014 07:05:59 -0700 Received: from localhost.localdomain (10.192.201.1) by smtp.emulex.com (138.239.115.207) with Microsoft SMTP Server id 14.3.174.1; Tue, 10 Jun 2014 07:04:54 -0700 From: Selvin Xavier To: CC: , Devesh Sharma , "Selvin Xavier" Subject: [PATCH v1 for-next 06/16] RDMA/ocrdma: Remove hardcoding of the max DPP QPs supported Date: Tue, 10 Jun 2014 19:32:17 +0530 X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1402408947-2074-6-git-send-email-selvin.xavier@emulex.com> References: <1402408947-2074-1-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-2-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-3-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-4-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-5-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-6-git-send-email-selvin.xavier@emulex.com> MIME-Version: 1.0 Message-ID: <3485bb4e-54dc-4a5b-b157-bb6d9a35f30e@CMEXHTCAS1.ad.emulex.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Devesh Sharma Removing hardcoded value of max dpp qps and calculate the same from doorbell page size and WQE size Signed-off-by: Devesh Sharma Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/ocrdma/ocrdma_sli.h | 1 - drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h index 4defae8..14a84b2 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h +++ b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h @@ -1236,7 +1236,6 @@ struct ocrdma_destroy_srq { enum { OCRDMA_ALLOC_PD_ENABLE_DPP = BIT(16), - OCRDMA_PD_MAX_DPP_ENABLED_QP = 8, OCRDMA_DPP_PAGE_SIZE = 4096 }; diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index edf6211..0d7d808 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -268,7 +268,8 @@ static struct ocrdma_pd *_ocrdma_alloc_pd(struct ocrdma_dev *dev, pd->dpp_enabled = ocrdma_get_asic_type(dev) == OCRDMA_ASIC_GEN_SKH_R; pd->num_dpp_qp = - pd->dpp_enabled ? OCRDMA_PD_MAX_DPP_ENABLED_QP : 0; + pd->dpp_enabled ? (dev->nic_info.db_page_size / + dev->attr.wqe_size) : 0; } retry: