Commit 80ccdd60 authored by Vipul Pandya's avatar Vipul Pandya Committed by David S. Miller

RDMA/cxgb4: Add module_params to enable DB FC & Coalescing on T5

Both DB Flow-Control and DB Coalescing are disabled by default on T5
Signed-off-by: default avatarVipul Pandya <vipul@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3cbdb928
...@@ -45,6 +45,16 @@ MODULE_DESCRIPTION("Chelsio T4/T5 RDMA Driver"); ...@@ -45,6 +45,16 @@ MODULE_DESCRIPTION("Chelsio T4/T5 RDMA Driver");
MODULE_LICENSE("Dual BSD/GPL"); MODULE_LICENSE("Dual BSD/GPL");
MODULE_VERSION(DRV_VERSION); 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 uld_ctx {
struct list_head entry; struct list_head entry;
struct cxgb4_lld_info lldi; struct cxgb4_lld_info lldi;
...@@ -630,8 +640,19 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop) ...@@ -630,8 +640,19 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop)
if (!ocqp_supported(infop)) if (!ocqp_supported(infop))
pr_info("%s: On-Chip Queues not supported on this device.\n", pr_info("%s: On-Chip Queues not supported on this device.\n",
pci_name(infop->pdev)); pci_name(infop->pdev));
if (!is_t4(infop->adapter_type))
if (!is_t4(infop->adapter_type)) {
if (!allow_db_fc_on_t5) {
db_fc_threshold = 100000; 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)); devp = (struct c4iw_dev *)ib_alloc_device(sizeof(*devp));
if (!devp) { if (!devp) {
printk(KERN_ERR MOD "Cannot allocate ib device\n"); printk(KERN_ERR MOD "Cannot allocate ib device\n");
......
...@@ -939,6 +939,7 @@ extern struct cxgb4_client t4c_client; ...@@ -939,6 +939,7 @@ extern struct cxgb4_client t4c_client;
extern c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS]; extern c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS];
extern int c4iw_max_read_depth; extern int c4iw_max_read_depth;
extern int db_fc_threshold; extern int db_fc_threshold;
extern int db_coalescing_threshold;
#endif #endif
...@@ -1455,6 +1455,7 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp) ...@@ -1455,6 +1455,7 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp)
rhp->db_state = NORMAL; rhp->db_state = NORMAL;
idr_for_each(&rhp->qpidr, enable_qp_db, NULL); idr_for_each(&rhp->qpidr, enable_qp_db, NULL);
} }
if (db_coalescing_threshold >= 0)
if (rhp->qpcnt <= db_coalescing_threshold) if (rhp->qpcnt <= db_coalescing_threshold)
cxgb4_enable_db_coalescing(rhp->rdev.lldi.ports[0]); cxgb4_enable_db_coalescing(rhp->rdev.lldi.ports[0]);
spin_unlock_irq(&rhp->lock); spin_unlock_irq(&rhp->lock);
...@@ -1574,6 +1575,7 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs, ...@@ -1574,6 +1575,7 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
rhp->db_state = FLOW_CONTROL; rhp->db_state = FLOW_CONTROL;
idr_for_each(&rhp->qpidr, disable_qp_db, NULL); idr_for_each(&rhp->qpidr, disable_qp_db, NULL);
} }
if (db_coalescing_threshold >= 0)
if (rhp->qpcnt > db_coalescing_threshold) if (rhp->qpcnt > db_coalescing_threshold)
cxgb4_disable_db_coalescing(rhp->rdev.lldi.ports[0]); cxgb4_disable_db_coalescing(rhp->rdev.lldi.ports[0]);
ret = insert_handle_nolock(rhp, &rhp->qpidr, qhp, qhp->wq.sq.qid); ret = insert_handle_nolock(rhp, &rhp->qpidr, qhp, qhp->wq.sq.qid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment