diff options
author | Shiraz Saleem <shiraz.saleem@intel.com> | 2016-06-14 17:54:19 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-06-23 10:35:34 -0400 |
commit | 7748e4990de42ea796543c0ffd34118c3a5e6a98 (patch) | |
tree | 732cbcac813768990cc1dd5e9013e533d1883d53 | |
parent | 0477e18145c565f9ca74c6df4112f818f673fcaa (diff) |
i40iw: Enable level-1 PBL for fast memory registration
Set the chunk_size to enable level-1 PBL support when the fast memory
page count is more than one.
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Faisal Latif <faisal.latif@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/hw/i40iw/i40iw.h | 1 | ||||
-rw-r--r-- | drivers/infiniband/hw/i40iw/i40iw_verbs.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw.h b/drivers/infiniband/hw/i40iw/i40iw.h index 14f16a2dcbed..b738acdb9b02 100644 --- a/drivers/infiniband/hw/i40iw/i40iw.h +++ b/drivers/infiniband/hw/i40iw/i40iw.h | |||
@@ -114,6 +114,7 @@ | |||
114 | #define IW_HMC_OBJ_TYPE_NUM ARRAY_SIZE(iw_hmc_obj_types) | 114 | #define IW_HMC_OBJ_TYPE_NUM ARRAY_SIZE(iw_hmc_obj_types) |
115 | #define IW_CFG_FPM_QP_COUNT 32768 | 115 | #define IW_CFG_FPM_QP_COUNT 32768 |
116 | #define I40IW_MAX_PAGES_PER_FMR 512 | 116 | #define I40IW_MAX_PAGES_PER_FMR 512 |
117 | #define I40IW_MIN_PAGES_PER_FMR 1 | ||
117 | 118 | ||
118 | #define I40IW_MTU_TO_MSS 40 | 119 | #define I40IW_MTU_TO_MSS 40 |
119 | #define I40IW_DEFAULT_MSS 1460 | 120 | #define I40IW_DEFAULT_MSS 1460 |
diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c index 31eda323fcbf..33959ed14563 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c | |||
@@ -2150,6 +2150,7 @@ static int i40iw_post_send(struct ib_qp *ibqp, | |||
2150 | struct i40iw_sc_dev *dev = &iwqp->iwdev->sc_dev; | 2150 | struct i40iw_sc_dev *dev = &iwqp->iwdev->sc_dev; |
2151 | struct i40iw_fast_reg_stag_info info; | 2151 | struct i40iw_fast_reg_stag_info info; |
2152 | 2152 | ||
2153 | memset(&info, 0, sizeof(info)); | ||
2153 | info.access_rights = I40IW_ACCESS_FLAGS_LOCALREAD; | 2154 | info.access_rights = I40IW_ACCESS_FLAGS_LOCALREAD; |
2154 | info.access_rights |= i40iw_get_user_access(flags); | 2155 | info.access_rights |= i40iw_get_user_access(flags); |
2155 | info.stag_key = reg_wr(ib_wr)->key & 0xff; | 2156 | info.stag_key = reg_wr(ib_wr)->key & 0xff; |
@@ -2159,10 +2160,14 @@ static int i40iw_post_send(struct ib_qp *ibqp, | |||
2159 | info.addr_type = I40IW_ADDR_TYPE_VA_BASED; | 2160 | info.addr_type = I40IW_ADDR_TYPE_VA_BASED; |
2160 | info.va = (void *)(uintptr_t)iwmr->ibmr.iova; | 2161 | info.va = (void *)(uintptr_t)iwmr->ibmr.iova; |
2161 | info.total_len = iwmr->ibmr.length; | 2162 | info.total_len = iwmr->ibmr.length; |
2163 | info.reg_addr_pa = *(u64 *)palloc->level1.addr; | ||
2162 | info.first_pm_pbl_index = palloc->level1.idx; | 2164 | info.first_pm_pbl_index = palloc->level1.idx; |
2163 | info.local_fence = ib_wr->send_flags & IB_SEND_FENCE; | 2165 | info.local_fence = ib_wr->send_flags & IB_SEND_FENCE; |
2164 | info.signaled = ib_wr->send_flags & IB_SEND_SIGNALED; | 2166 | info.signaled = ib_wr->send_flags & IB_SEND_SIGNALED; |
2165 | 2167 | ||
2168 | if (iwmr->npages > I40IW_MIN_PAGES_PER_FMR) | ||
2169 | info.chunk_size = 1; | ||
2170 | |||
2166 | if (page_shift == 21) | 2171 | if (page_shift == 21) |
2167 | info.page_size = 1; /* 2M page */ | 2172 | info.page_size = 1; /* 2M page */ |
2168 | 2173 | ||