From patchwork Tue Jun 10 14:02:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 4329061 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0161F9F3B4 for ; Tue, 10 Jun 2014 14:05:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DDE3E202C8 for ; Tue, 10 Jun 2014 14:05:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC700202E6 for ; Tue, 10 Jun 2014 14:05:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752207AbaFJOFV (ORCPT ); Tue, 10 Jun 2014 10:05:21 -0400 Received: from cmexedge1.ext.emulex.com ([138.239.224.99]:39904 "EHLO CMEXEDGE1.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752142AbaFJOFT (ORCPT ); Tue, 10 Jun 2014 10:05:19 -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:06:19 -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:05:14 -0700 From: Selvin Xavier To: CC: , Selvin Xavier , "Devesh Sharma" Subject: [PATCH v1 for-next 13/16] RDMA/ocrdma: Increase the size of STAG array in dev structure to 16K Date: Tue, 10 Jun 2014 19:32:24 +0530 X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1402408947-2074-13-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> <1402408947-2074-7-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-8-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-9-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-10-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-11-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-12-git-send-email-selvin.xavier@emulex.com> <1402408947-2074-13-git-send-email-selvin.xavier@emulex.com> MIME-Version: 1.0 Message-ID: <9c65ea5c-a83b-470d-b31a-39a74d580592@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=unavailable 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 HW can support 16K STAG entries. Changing this max limit. Also, moving this array out of ocrdma_dev to reduce the size of this structure Signed-off-by: Devesh Sharma Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/ocrdma/ocrdma.h | 2 +- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 6 ++++++ drivers/infiniband/hw/ocrdma/ocrdma_sli.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h index fc27378..5716513 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma.h +++ b/drivers/infiniband/hw/ocrdma/ocrdma.h @@ -236,7 +236,7 @@ struct ocrdma_dev { struct list_head entry; struct rcu_head rcu; int id; - u64 stag_arr[OCRDMA_MAX_STAG]; + u64 *stag_arr; u8 sl; /* service level */ bool pfc_state; atomic_t update_sl; diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 3cb20c6..0d90c7f 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c @@ -324,6 +324,11 @@ static int ocrdma_alloc_resources(struct ocrdma_dev *dev) if (!dev->qp_tbl) goto alloc_err; } + + dev->stag_arr = kzalloc(sizeof(u64) * OCRDMA_MAX_STAG, GFP_KERNEL); + if (dev->stag_arr == NULL) + goto alloc_err; + spin_lock_init(&dev->av_tbl.lock); spin_lock_init(&dev->flush_q_lock); return 0; @@ -334,6 +339,7 @@ alloc_err: static void ocrdma_free_resources(struct ocrdma_dev *dev) { + kfree(dev->stag_arr); kfree(dev->qp_tbl); kfree(dev->cq_tbl); kfree(dev->sgid_tbl); diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h index a20d348..3d08e66 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h +++ b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h @@ -107,7 +107,7 @@ enum { #define OCRDMA_MAX_QP 2048 #define OCRDMA_MAX_CQ 2048 -#define OCRDMA_MAX_STAG 8192 +#define OCRDMA_MAX_STAG 16384 enum { OCRDMA_DB_RQ_OFFSET = 0xE0,