netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Varun Prakash <varun@chelsio.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-scsi@vger.kernel.org,
	target-devel@vger.kernel.org, nab@linux-iscsi.org,
	gerlitz.or@gmail.com, swise@opengridcomputing.com,
	james.bottomley@hansenpartnership.com, indranil@chelsio.com,
	hariprasad@chelsio.com, varun@chelsio.com
Subject: [net-next v2 5/6] libcxgb: export ppm release and tagmask set api
Date: Sat, 16 Jul 2016 22:49:19 +0530	[thread overview]
Message-ID: <cf7a242eb9b5e844b263e36e411030792273ea3e.1468689125.git.varun@chelsio.com> (raw)
In-Reply-To: <cover.1468689125.git.varun@chelsio.com>
In-Reply-To: <cover.1468689125.git.varun@chelsio.com>

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>
---
 drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c | 2 ++
 drivers/scsi/cxgbi/cxgb3i/cxgb3i.c                 | 1 +
 drivers/scsi/cxgbi/libcxgbi.c                      | 1 +
 drivers/target/iscsi/cxgbit/cxgbit_main.c          | 2 ++
 4 files changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c
index 4cd1072..96c9651 100644
--- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c
+++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_ppm.c
@@ -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);
 
 static int __init libcxgb_init(void)
 {
diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
index bb25ebb..61f16a2 100644
--- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
+++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
@@ -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,
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 9d425a7..d142113 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -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);
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_main.c b/drivers/target/iscsi/cxgbit/cxgbit_main.c
index 60dccd0..27dd11a 100644
--- a/drivers/target/iscsi/cxgbit/cxgbit_main.c
+++ b/drivers/target/iscsi/cxgbit/cxgbit_main.c
@@ -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);
 }
 
-- 
2.0.2

  parent reply	other threads:[~2016-07-16 17:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-16 17:19 [net-next v2 0/6] common library for Chelsio drivers Varun Prakash
2016-07-16 17:19 ` [net-next v2 1/6] libcxgb: add library module " Varun Prakash
2016-07-19 17:43   ` David Miller
2016-07-16 17:19 ` [net-next v2 2/6] cxgb3i,cxgb4i,libcxgbi: remove iSCSI DDP support Varun Prakash
2016-07-16 17:19 ` [net-next v2 3/6] cxgb4i,libcxgbi: add " Varun Prakash
2016-07-16 17:19 ` [net-next v2 4/6] cxgb3i: " Varun Prakash
2016-07-16 17:19 ` Varun Prakash [this message]
2016-07-16 17:19 ` [net-next v2 6/6] cxgb3i,cxgb4i: fix symbol not declared sparse warning Varun Prakash
2016-07-19 13:49   ` kbuild test robot
2016-07-20 21:13 ` [net-next v2 0/6] common library for Chelsio drivers Nicholas A. Bellinger
2016-07-20 21:38   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf7a242eb9b5e844b263e36e411030792273ea3e.1468689125.git.varun@chelsio.com \
    --to=varun@chelsio.com \
    --cc=davem@davemloft.net \
    --cc=gerlitz.or@gmail.com \
    --cc=hariprasad@chelsio.com \
    --cc=indranil@chelsio.com \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=netdev@vger.kernel.org \
    --cc=swise@opengridcomputing.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).