libcxgb: export ppm release and tagmask set api
authorVarun Prakash <varun@chelsio.com>
Thu, 21 Jul 2016 17:27:18 +0000 (22:57 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Jul 2016 17:31:09 +0000 (10:31 -0700)
Export cxgbi_ppm_release() to release
ppod manager and cxgbi_tagmask_set() to
set tag mask, they are used by cxgb3i, cxgb4i
and cxgbit.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
drivers/scsi/cxgbi/libcxgbi.c
drivers/target/iscsi/cxgbit/cxgbit_main.c

index 01a4329fccc439c81006192bf4d483919e6524a5..551a365cfb719c53d72cbaec4fd1e7d184156f9a 100644 (file)
@@ -337,6 +337,7 @@ int cxgbi_ppm_release(struct cxgbi_ppm *ppm)
        }
        return 1;
 }
+EXPORT_SYMBOL(cxgbi_ppm_release);
 
 static struct cxgbi_ppm_pool *ppm_alloc_cpu_pool(unsigned int *total,
                                                 unsigned int *pcpu_ppmax)
@@ -490,6 +491,7 @@ unsigned int cxgbi_tagmask_set(unsigned int ppmax)
 
        return 1 << (bits + PPOD_IDX_SHIFT);
 }
+EXPORT_SYMBOL(cxgbi_tagmask_set);
 
 MODULE_AUTHOR("Chelsio Communications");
 MODULE_DESCRIPTION("Chelsio common library");
index bb25ebbe1ac0c2a3cbfc192ae163b42792b9cd98..61f16a2438f01d7d5ca74ae49815a380282a1858 100644 (file)
@@ -1234,6 +1234,7 @@ static int cxgb3i_ddp_init(struct cxgbi_device *cdev)
        }
 
        ppmax = (uinfo.ulimit - uinfo.llimit + 1) >> PPOD_SIZE_SHIFT;
+       tagmask = cxgbi_tagmask_set(ppmax);
 
        pr_info("T3 %s: 0x%x~0x%x, 0x%x, tagmask 0x%x -> 0x%x.\n",
                ndev->name, uinfo.llimit, uinfo.ulimit, ppmax, uinfo.tagmask,
index 9d425a779414919a074d610878da7dfc34692ade..d1421139e6eac615d1e3ae2a9af1e02ee78d0822 100644 (file)
@@ -121,6 +121,7 @@ static inline void cxgbi_device_destroy(struct cxgbi_device *cdev)
                "cdev 0x%p, p# %u.\n", cdev, cdev->nports);
        cxgbi_hbas_remove(cdev);
        cxgbi_device_portmap_cleanup(cdev);
+       cxgbi_ppm_release(cdev->cdev2ppm(cdev));
        if (cdev->pmap.max_connect)
                cxgbi_free_big_mem(cdev->pmap.port_csk);
        kfree(cdev);
index 60dccd02bd852e36e67b5a6d7340dc4f903ab734..27dd11aff9349e6ae964a82c0a706668aa5ba448 100644 (file)
@@ -26,6 +26,8 @@ void _cxgbit_free_cdev(struct kref *kref)
        struct cxgbit_device *cdev;
 
        cdev = container_of(kref, struct cxgbit_device, kref);
+
+       cxgbi_ppm_release(cdev2ppm(cdev));
        kfree(cdev);
 }