aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2014-04-09 10:38:27 -0400
committerRoland Dreier <roland@purestorage.com>2014-04-11 14:36:08 -0400
commita03d9f94cc54199bf681729b16ba649d7206369e (patch)
treee2bebbff12cd98b99d2e8110cdd1a4b8af5afea9 /drivers/infiniband/hw/cxgb4
parentb4e2901c52cc79f287e2b25804e029880e5e4b07 (diff)
RDMA/cxgb4: Max fastreg depth depends on DSGL support
The max depth of a fastreg mr depends on whether the device supports DSGL or not. So compute it dynamically based on the device support and the module use_dsgl option. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/cxgb4')
-rw-r--r--drivers/infiniband/hw/cxgb4/provider.c2
-rw-r--r--drivers/infiniband/hw/cxgb4/qp.c3
-rw-r--r--drivers/infiniband/hw/cxgb4/t4.h9
3 files changed, 11 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
index 79429256023a..a94a3e12c349 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -328,7 +328,7 @@ static int c4iw_query_device(struct ib_device *ibdev,
328 props->max_mr = c4iw_num_stags(&dev->rdev); 328 props->max_mr = c4iw_num_stags(&dev->rdev);
329 props->max_pd = T4_MAX_NUM_PD; 329 props->max_pd = T4_MAX_NUM_PD;
330 props->local_ca_ack_delay = 0; 330 props->local_ca_ack_delay = 0;
331 props->max_fast_reg_page_list_len = T4_MAX_FR_DEPTH; 331 props->max_fast_reg_page_list_len = t4_max_fr_depth(use_dsgl);
332 332
333 return 0; 333 return 0;
334} 334}
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index 9b4a8b88908e..2c037e1746d3 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -566,7 +566,8 @@ static int build_fastreg(struct t4_sq *sq, union t4_wr *wqe,
566 int pbllen = roundup(wr->wr.fast_reg.page_list_len * sizeof(u64), 32); 566 int pbllen = roundup(wr->wr.fast_reg.page_list_len * sizeof(u64), 32);
567 int rem; 567 int rem;
568 568
569 if (wr->wr.fast_reg.page_list_len > T4_MAX_FR_DEPTH) 569 if (wr->wr.fast_reg.page_list_len >
570 t4_max_fr_depth(use_dsgl))
570 return -EINVAL; 571 return -EINVAL;
571 572
572 wqe->fr.qpbinde_to_dcacpu = 0; 573 wqe->fr.qpbinde_to_dcacpu = 0;
diff --git a/drivers/infiniband/hw/cxgb4/t4.h b/drivers/infiniband/hw/cxgb4/t4.h
index 1f329fac9801..2178f3198410 100644
--- a/drivers/infiniband/hw/cxgb4/t4.h
+++ b/drivers/infiniband/hw/cxgb4/t4.h
@@ -84,7 +84,14 @@ struct t4_status_page {
84 sizeof(struct fw_ri_isgl)) / sizeof(struct fw_ri_sge)) 84 sizeof(struct fw_ri_isgl)) / sizeof(struct fw_ri_sge))
85#define T4_MAX_FR_IMMD ((T4_SQ_NUM_BYTES - sizeof(struct fw_ri_fr_nsmr_wr) - \ 85#define T4_MAX_FR_IMMD ((T4_SQ_NUM_BYTES - sizeof(struct fw_ri_fr_nsmr_wr) - \
86 sizeof(struct fw_ri_immd)) & ~31UL) 86 sizeof(struct fw_ri_immd)) & ~31UL)
87#define T4_MAX_FR_DEPTH (1024 / sizeof(u64)) 87#define T4_MAX_FR_IMMD_DEPTH (T4_MAX_FR_IMMD / sizeof(u64))
88#define T4_MAX_FR_DSGL 1024
89#define T4_MAX_FR_DSGL_DEPTH (T4_MAX_FR_DSGL / sizeof(u64))
90
91static inline int t4_max_fr_depth(int use_dsgl)
92{
93 return use_dsgl ? T4_MAX_FR_DSGL_DEPTH : T4_MAX_FR_IMMD_DEPTH;
94}
88 95
89#define T4_RQ_NUM_SLOTS 2 96#define T4_RQ_NUM_SLOTS 2
90#define T4_RQ_NUM_BYTES (T4_EQ_ENTRY_SIZE * T4_RQ_NUM_SLOTS) 97#define T4_RQ_NUM_BYTES (T4_EQ_ENTRY_SIZE * T4_RQ_NUM_SLOTS)