From patchwork Wed Jun 4 08:52:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 4292571 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 DFA1D9F333 for ; Wed, 4 Jun 2014 08:55:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 09108201C8 for ; Wed, 4 Jun 2014 08:55:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28E4920176 for ; Wed, 4 Jun 2014 08:55:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751547AbaFDIze (ORCPT ); Wed, 4 Jun 2014 04:55:34 -0400 Received: from cmexedge2.ext.emulex.com ([138.239.224.100]:42655 "EHLO CMEXEDGE2.ext.emulex.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751121AbaFDIzd (ORCPT ); Wed, 4 Jun 2014 04:55:33 -0400 Received: from CMEXHTCAS1.ad.emulex.com (138.239.115.217) by CMEXEDGE2.ext.emulex.com (138.239.224.100) with Microsoft SMTP Server (TLS) id 14.3.174.1; Wed, 4 Jun 2014 01:56:22 -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; Wed, 4 Jun 2014 01:55:31 -0700 From: Selvin Xavier To: CC: , Selvin Xavier , "Devesh Sharma" Subject: [PATCH for-next 13/15] RDMA/ocrdma: Increase the size of STAG array Date: Wed, 4 Jun 2014 14:22:44 +0530 X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1401871966-20408-13-git-send-email-selvin.xavier@emulex.com> References: <1401871966-20408-1-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-2-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-3-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-4-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-5-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-6-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-7-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-8-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-9-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-10-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-11-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-12-git-send-email-selvin.xavier@emulex.com> <1401871966-20408-13-git-send-email-selvin.xavier@emulex.com> MIME-Version: 1.0 Message-ID: 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 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,