aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/cxgb4/device.c25
-rw-r--r--drivers/infiniband/hw/cxgb4/iw_cxgb4.h1
-rw-r--r--drivers/infiniband/hw/cxgb4/qp.c10
3 files changed, 30 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index 3487c08828f7..ae656016e1ae 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");
45MODULE_LICENSE("Dual BSD/GPL"); 45MODULE_LICENSE("Dual BSD/GPL");
46MODULE_VERSION(DRV_VERSION); 46MODULE_VERSION(DRV_VERSION);
47 47
48static int allow_db_fc_on_t5;
49module_param(allow_db_fc_on_t5, int, 0644);
50MODULE_PARM_DESC(allow_db_fc_on_t5,
51 "Allow DB Flow Control on T5 (default = 0)");
52
53static int allow_db_coalescing_on_t5;
54module_param(allow_db_coalescing_on_t5, int, 0644);
55MODULE_PARM_DESC(allow_db_coalescing_on_t5,
56 "Allow DB Coalescing on T5 (default = 0)");
57
48struct uld_ctx { 58struct uld_ctx {
49 struct list_head entry; 59 struct list_head entry;
50 struct cxgb4_lld_info lldi; 60 struct cxgb4_lld_info lldi;
@@ -630,8 +640,19 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop)
630 if (!ocqp_supported(infop)) 640 if (!ocqp_supported(infop))
631 pr_info("%s: On-Chip Queues not supported on this device.\n", 641 pr_info("%s: On-Chip Queues not supported on this device.\n",
632 pci_name(infop->pdev)); 642 pci_name(infop->pdev));
633 if (!is_t4(infop->adapter_type)) 643
634 db_fc_threshold = 100000; 644 if (!is_t4(infop->adapter_type)) {
645 if (!allow_db_fc_on_t5) {
646 db_fc_threshold = 100000;
647 pr_info("DB Flow Control Disabled.\n");
648 }
649
650 if (!allow_db_coalescing_on_t5) {
651 db_coalescing_threshold = -1;
652 pr_info("DB Coalescing Disabled.\n");
653 }
654 }
655
635 devp = (struct c4iw_dev *)ib_alloc_device(sizeof(*devp)); 656 devp = (struct c4iw_dev *)ib_alloc_device(sizeof(*devp));
636 if (!devp) { 657 if (!devp) {
637 printk(KERN_ERR MOD "Cannot allocate ib device\n"); 658 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 34c7e62b8676..4dbe96a06a84 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;
939extern c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS]; 939extern c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS];
940extern int c4iw_max_read_depth; 940extern int c4iw_max_read_depth;
941extern int db_fc_threshold; 941extern int db_fc_threshold;
942extern int db_coalescing_threshold;
942 943
943 944
944#endif 945#endif
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index da4869f41e35..28592d45809b 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)
1455 rhp->db_state = NORMAL; 1455 rhp->db_state = NORMAL;
1456 idr_for_each(&rhp->qpidr, enable_qp_db, NULL); 1456 idr_for_each(&rhp->qpidr, enable_qp_db, NULL);
1457 } 1457 }
1458 if (rhp->qpcnt <= db_coalescing_threshold) 1458 if (db_coalescing_threshold >= 0)
1459 cxgb4_enable_db_coalescing(rhp->rdev.lldi.ports[0]); 1459 if (rhp->qpcnt <= db_coalescing_threshold)
1460 cxgb4_enable_db_coalescing(rhp->rdev.lldi.ports[0]);
1460 spin_unlock_irq(&rhp->lock); 1461 spin_unlock_irq(&rhp->lock);
1461 atomic_dec(&qhp->refcnt); 1462 atomic_dec(&qhp->refcnt);
1462 wait_event(qhp->wait, !atomic_read(&qhp->refcnt)); 1463 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,
1574 rhp->db_state = FLOW_CONTROL; 1575 rhp->db_state = FLOW_CONTROL;
1575 idr_for_each(&rhp->qpidr, disable_qp_db, NULL); 1576 idr_for_each(&rhp->qpidr, disable_qp_db, NULL);
1576 } 1577 }
1577 if (rhp->qpcnt > db_coalescing_threshold) 1578 if (db_coalescing_threshold >= 0)
1578 cxgb4_disable_db_coalescing(rhp->rdev.lldi.ports[0]); 1579 if (rhp->qpcnt > db_coalescing_threshold)
1580 cxgb4_disable_db_coalescing(rhp->rdev.lldi.ports[0]);
1579 ret = insert_handle_nolock(rhp, &rhp->qpidr, qhp, qhp->wq.sq.qid); 1581 ret = insert_handle_nolock(rhp, &rhp->qpidr, qhp, qhp->wq.sq.qid);
1580 spin_unlock_irq(&rhp->lock); 1582 spin_unlock_irq(&rhp->lock);
1581 if (ret) 1583 if (ret)