From: Vipul Pandya <vipul@chelsio.com>
To: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-scsi@vger.kernel.org
Cc: davem@davemloft.net, roland@purestorage.com,
JBottomley@parallels.com, dm@chelsio.com,
swise@opengridcomputing.com, leedom@chelsio.com,
naresh@chelsio.com, divy@chelsio.com, santosh@chelsio.com,
arvindb@chelsio.com, abhishek@chelsio.com,
Vipul Pandya <vipul@chelsio.com>
Subject: [PATCH net-next 14/22] RDMA/cxgb4: Add module_params to enable DB FC & Coalescing on T5
Date: Tue, 12 Mar 2013 17:16:26 +0530 [thread overview]
Message-ID: <1363088794-31453-15-git-send-email-vipul@chelsio.com> (raw)
In-Reply-To: <1363088794-31453-1-git-send-email-vipul@chelsio.com>
Both DB Flow-Control and DB Coalescing are disabled by default on T5
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
---
drivers/infiniband/hw/cxgb4/device.c | 25 +++++++++++++++++++++++--
drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 1 +
drivers/infiniband/hw/cxgb4/qp.c | 10 ++++++----
3 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index 3487c08..ae65601 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -45,6 +45,16 @@ MODULE_DESCRIPTION("Chelsio T4/T5 RDMA Driver");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_VERSION(DRV_VERSION);
+static int allow_db_fc_on_t5;
+module_param(allow_db_fc_on_t5, int, 0644);
+MODULE_PARM_DESC(allow_db_fc_on_t5,
+ "Allow DB Flow Control on T5 (default = 0)");
+
+static int allow_db_coalescing_on_t5;
+module_param(allow_db_coalescing_on_t5, int, 0644);
+MODULE_PARM_DESC(allow_db_coalescing_on_t5,
+ "Allow DB Coalescing on T5 (default = 0)");
+
struct uld_ctx {
struct list_head entry;
struct cxgb4_lld_info lldi;
@@ -630,8 +640,19 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop)
if (!ocqp_supported(infop))
pr_info("%s: On-Chip Queues not supported on this device.\n",
pci_name(infop->pdev));
- if (!is_t4(infop->adapter_type))
- db_fc_threshold = 100000;
+
+ if (!is_t4(infop->adapter_type)) {
+ if (!allow_db_fc_on_t5) {
+ db_fc_threshold = 100000;
+ pr_info("DB Flow Control Disabled.\n");
+ }
+
+ if (!allow_db_coalescing_on_t5) {
+ db_coalescing_threshold = -1;
+ pr_info("DB Coalescing Disabled.\n");
+ }
+ }
+
devp = (struct c4iw_dev *)ib_alloc_device(sizeof(*devp));
if (!devp) {
printk(KERN_ERR MOD "Cannot allocate ib device\n");
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
index 34c7e62..4dbe96a 100644
--- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
+++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
@@ -939,6 +939,7 @@ extern struct cxgb4_client t4c_client;
extern c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS];
extern int c4iw_max_read_depth;
extern int db_fc_threshold;
+extern int db_coalescing_threshold;
#endif
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index da4869f..28592d4 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -1455,8 +1455,9 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp)
rhp->db_state = NORMAL;
idr_for_each(&rhp->qpidr, enable_qp_db, NULL);
}
- if (rhp->qpcnt <= db_coalescing_threshold)
- cxgb4_enable_db_coalescing(rhp->rdev.lldi.ports[0]);
+ if (db_coalescing_threshold >= 0)
+ if (rhp->qpcnt <= db_coalescing_threshold)
+ cxgb4_enable_db_coalescing(rhp->rdev.lldi.ports[0]);
spin_unlock_irq(&rhp->lock);
atomic_dec(&qhp->refcnt);
wait_event(qhp->wait, !atomic_read(&qhp->refcnt));
@@ -1574,8 +1575,9 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
rhp->db_state = FLOW_CONTROL;
idr_for_each(&rhp->qpidr, disable_qp_db, NULL);
}
- if (rhp->qpcnt > db_coalescing_threshold)
- cxgb4_disable_db_coalescing(rhp->rdev.lldi.ports[0]);
+ if (db_coalescing_threshold >= 0)
+ if (rhp->qpcnt > db_coalescing_threshold)
+ cxgb4_disable_db_coalescing(rhp->rdev.lldi.ports[0]);
ret = insert_handle_nolock(rhp, &rhp->qpidr, qhp, qhp->wq.sq.qid);
spin_unlock_irq(&rhp->lock);
if (ret)
--
1.7.1
next prev parent reply other threads:[~2013-03-12 11:46 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 11:46 [PATCH net-next 00/22] Add support for Chelsio T5 adapter Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 01/22] cxgb4: Add register definations for T5 Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 02/22] cxgb4: Add macros, structures and inline functions " Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 03/22] cxgb4: Initialize T5 Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 06/22] cxgb4: Enable doorbell drop recovery only for T4 adapter Vipul Pandya
[not found] ` <1363088794-31453-1-git-send-email-vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2013-03-12 11:46 ` [PATCH net-next 04/22] cxgb4: Dump T5 registers Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 05/22] cxgb4: Add T5 write combining support Vipul Pandya
2013-03-12 12:19 ` David Miller
[not found] ` <20130312.081927.1036246728528667686.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2013-03-12 14:42 ` Steve Wise
[not found] ` <513F3EBD.5020504-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2013-03-13 14:36 ` Vipul Pandya
2013-03-13 15:43 ` David Laight
2013-03-13 22:54 ` Casey Leedom
2013-03-12 11:46 ` [PATCH net-next 07/22] cxgb4: Add T5 debugfs support Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 08/22] cxgb4: Add T5 PCI ids Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 09/22] cxgb4: Update driver version and description Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 10/22] cxgb4: Disable SR-IOV support for PF4-7 for T5 Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 11/22] cxgb4vf: Add support for Chelsio T5 adapter Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 12/22] RDMA/cxgb4: Add Support " Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 13/22] RDMA/cxgb4: Turn off db coalescing when RDMA QPs are in use Vipul Pandya
2013-03-12 11:46 ` Vipul Pandya [this message]
2013-03-12 11:46 ` [PATCH net-next 15/22] RDMA/cxgb4: Use DSGLs for fastreg and adapter memory writes for T5 Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 16/22] RDMA/cxgb4: Map pbl buffers for dma if using DSGL Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 17/22] RDMA/cxgb4: Bump tcam_full stat and WR reply timeout Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 18/22] RDMA/cxgb4: Fix onchip queue support for T5 Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 19/22] csiostor: Segregate T4 adapter operations Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 20/22] csiostor: Add T5 " Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 21/22] csiostor: Header file modifications for chip support and bug fixes Vipul Pandya
2013-03-12 11:46 ` [PATCH net-next 22/22] csiostor: Cleanup chip specific operations Vipul Pandya
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=1363088794-31453-15-git-send-email-vipul@chelsio.com \
--to=vipul@chelsio.com \
--cc=JBottomley@parallels.com \
--cc=abhishek@chelsio.com \
--cc=arvindb@chelsio.com \
--cc=davem@davemloft.net \
--cc=divy@chelsio.com \
--cc=dm@chelsio.com \
--cc=leedom@chelsio.com \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=naresh@chelsio.com \
--cc=netdev@vger.kernel.org \
--cc=roland@purestorage.com \
--cc=santosh@chelsio.com \
--cc=swise@opengridcomputing.com \
/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