RDMA/ocrdma: Increase the size of STAG array in dev structure to 16K
authorSelvin Xavier <selvin.xavier@emulex.com>
Tue, 10 Jun 2014 14:02:24 +0000 (19:32 +0530)
committerRoland Dreier <roland@purestorage.com>
Fri, 1 Aug 2014 22:07:49 +0000 (15:07 -0700)
HW can support 16K STAG entries.  Change this max limit.  Also, move
this array out of ocrdma_dev to reduce the size of this structure.

Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/ocrdma/ocrdma.h
drivers/infiniband/hw/ocrdma/ocrdma_main.c
drivers/infiniband/hw/ocrdma/ocrdma_sli.h

index fc273782986e0b54c90ccbb3734729180655cb91..57165137a7a23edf0004573e91d719213e176429 100644 (file)
@@ -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;
index 3cb20c6b91ceb814af7abd9b538744ab1196b2bf..0d90c7f75a6f7a2ebf73449b1a49be77e918e674 100644 (file)
@@ -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);
index a20d3485ed603d9eebee9c2fd54e0f4ce71a515b..3d08e665be264eb11323c172ba56a23e6e06759f 100644 (file)
@@ -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,