]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
RDMA/ocrdma: Remove hardcoding of the max DPP QPs supported
authorDevesh Sharma <devesh.sharma@emulex.com>
Tue, 10 Jun 2014 14:02:17 +0000 (19:32 +0530)
committerRoland Dreier <roland@purestorage.com>
Fri, 1 Aug 2014 22:07:36 +0000 (15:07 -0700)
Removing hardcoded value of max dpp qps and calculate the same from
doorbell page size and WQE size.

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_sli.h
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c

index 4defae8f63df196fc5e6030973a4e317d1d268e8..14a84b269cc057434bec33bde52d616da2bcf697 100644 (file)
@@ -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
 };
 
index edf6211d84b8ec5f7b9d22da5f7f6170f0c810ef..0d7d8083287fe9c418e87263cb6b15bb95a3465a 100644 (file)
@@ -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: