diff options
author | Shaobo Xu <xushaobo2@huawei.com> | 2017-08-30 17:23:09 +0800 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-09-27 08:34:56 -0400 |
commit | 9766edc34ea17a8264b76696367aeb88a52ab108 (patch) | |
tree | 96a9fb63f353e536d50bf7d7e56c0ff0220e8967 /drivers/infiniband/hw/hns/hns_roce_cq.c | |
parent | 6a93c77afe088225363f6941a29fff415b1f7172 (diff) | |
download | blackbird-op-linux-9766edc34ea17a8264b76696367aeb88a52ab108.tar.gz blackbird-op-linux-9766edc34ea17a8264b76696367aeb88a52ab108.zip |
RDMA/hns: Split CQE from MTT in hip08
In hip08, the SQWQE/SGE/RQWQE and CQE have different hop num and
page size, so we need to manage the base address table of the
SQWQE/SGE/RQWQE and CQE separately.
This patch is to split CQE from MTT(SQWQE/SGE/RQWQE).
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_cq.c')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_cq.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_cq.c b/drivers/infiniband/hw/hns/hns_roce_cq.c index 362aeecc1a08..9cf213c53f4c 100644 --- a/drivers/infiniband/hw/hns/hns_roce_cq.c +++ b/drivers/infiniband/hw/hns/hns_roce_cq.c @@ -96,7 +96,11 @@ static int hns_roce_cq_alloc(struct hns_roce_dev *hr_dev, int nent, cq_table = &hr_dev->cq_table; /* Get the physical address of cq buf */ - mtt_table = &hr_dev->mr_table.mtt_table; + if (hns_roce_check_whether_mhop(hr_dev, HEM_TYPE_CQE)) + mtt_table = &hr_dev->mr_table.mtt_cqe_table; + else + mtt_table = &hr_dev->mr_table.mtt_table; + mtts = hns_roce_table_find(hr_dev, mtt_table, hr_mtt->first_seg, &dma_handle); if (!mtts) { @@ -221,6 +225,10 @@ static int hns_roce_ib_get_cq_umem(struct hns_roce_dev *hr_dev, if (IS_ERR(*umem)) return PTR_ERR(*umem); + if (hns_roce_check_whether_mhop(hr_dev, HEM_TYPE_CQE)) + buf->hr_mtt.mtt_type = MTT_TYPE_CQE; + else + buf->hr_mtt.mtt_type = MTT_TYPE_WQE; ret = hns_roce_mtt_init(hr_dev, ib_umem_page_count(*umem), (*umem)->page_shift, &buf->hr_mtt); if (ret) @@ -250,6 +258,11 @@ static int hns_roce_ib_alloc_cq_buf(struct hns_roce_dev *hr_dev, if (ret) goto out; + if (hns_roce_check_whether_mhop(hr_dev, HEM_TYPE_CQE)) + buf->hr_mtt.mtt_type = MTT_TYPE_CQE; + else + buf->hr_mtt.mtt_type = MTT_TYPE_WQE; + ret = hns_roce_mtt_init(hr_dev, buf->hr_buf.npages, buf->hr_buf.page_shift, &buf->hr_mtt); if (ret) |