diff options
author | Wei Hu (Xavier) <xavier.huwei@huawei.com> | 2016-09-20 12:07:00 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-10-03 11:43:15 -0400 |
commit | 1ca5b253adbf7da514475f24151fb700062795c0 (patch) | |
tree | d79a36ab9ad32f705abebd8f423a796ef04b9b17 | |
parent | 97f0e39fa51406e7d73b37e635c04c85829ce9ab (diff) |
IB/hns: Delete the sqp_start from the structure hns_roce_caps
This patch deleted the sqp_start from the structure hns_roce_caps, and
modified the calculation of the qp number.
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_device.h | 1 | ||||
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 1 | ||||
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_qp.c | 10 |
3 files changed, 4 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_device.h b/drivers/infiniband/hw/hns/hns_roce_device.h index 3058599d0404..341731553a60 100644 --- a/drivers/infiniband/hw/hns/hns_roce_device.h +++ b/drivers/infiniband/hw/hns/hns_roce_device.h | |||
@@ -465,7 +465,6 @@ struct hns_roce_caps { | |||
465 | u32 max_rq_desc_sz; /* 64 */ | 465 | u32 max_rq_desc_sz; /* 64 */ |
466 | int max_qp_init_rdma; | 466 | int max_qp_init_rdma; |
467 | int max_qp_dest_rdma; | 467 | int max_qp_dest_rdma; |
468 | int sqp_start; | ||
469 | int num_cqs; | 468 | int num_cqs; |
470 | int max_cqes; | 469 | int max_cqes; |
471 | int reserved_cqs; | 470 | int reserved_cqs; |
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c index d767ebebd27e..65c3192c2f00 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c | |||
@@ -936,7 +936,6 @@ void hns_roce_v1_profile(struct hns_roce_dev *hr_dev) | |||
936 | caps->mtt_entry_sz = HNS_ROCE_V1_MTT_ENTRY_SIZE; | 936 | caps->mtt_entry_sz = HNS_ROCE_V1_MTT_ENTRY_SIZE; |
937 | caps->cq_entry_sz = HNS_ROCE_V1_CQE_ENTRY_SIZE; | 937 | caps->cq_entry_sz = HNS_ROCE_V1_CQE_ENTRY_SIZE; |
938 | caps->page_size_cap = HNS_ROCE_V1_PAGE_SIZE_SUPPORT; | 938 | caps->page_size_cap = HNS_ROCE_V1_PAGE_SIZE_SUPPORT; |
939 | caps->sqp_start = 0; | ||
940 | caps->reserved_lkey = 0; | 939 | caps->reserved_lkey = 0; |
941 | caps->reserved_pds = 0; | 940 | caps->reserved_pds = 0; |
942 | caps->reserved_mrws = 1; | 941 | caps->reserved_mrws = 1; |
diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c index 177f48f081ab..dd1b2140d8db 100644 --- a/drivers/infiniband/hw/hns/hns_roce_qp.c +++ b/drivers/infiniband/hw/hns/hns_roce_qp.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include "hns_roce_hem.h" | 38 | #include "hns_roce_hem.h" |
39 | #include "hns_roce_user.h" | 39 | #include "hns_roce_user.h" |
40 | 40 | ||
41 | #define SQP_NUM 12 | 41 | #define SQP_NUM (2 * HNS_ROCE_MAX_PORTS) |
42 | 42 | ||
43 | void hns_roce_qp_event(struct hns_roce_dev *hr_dev, u32 qpn, int event_type) | 43 | void hns_roce_qp_event(struct hns_roce_dev *hr_dev, u32 qpn, int event_type) |
44 | { | 44 | { |
@@ -246,7 +246,7 @@ void hns_roce_release_range_qp(struct hns_roce_dev *hr_dev, int base_qpn, | |||
246 | { | 246 | { |
247 | struct hns_roce_qp_table *qp_table = &hr_dev->qp_table; | 247 | struct hns_roce_qp_table *qp_table = &hr_dev->qp_table; |
248 | 248 | ||
249 | if (base_qpn < (hr_dev->caps.sqp_start + 2 * hr_dev->caps.num_ports)) | 249 | if (base_qpn < SQP_NUM) |
250 | return; | 250 | return; |
251 | 251 | ||
252 | hns_roce_bitmap_free_range(&qp_table->bitmap, base_qpn, cnt); | 252 | hns_roce_bitmap_free_range(&qp_table->bitmap, base_qpn, cnt); |
@@ -608,8 +608,7 @@ struct ib_qp *hns_roce_create_qp(struct ib_pd *pd, | |||
608 | hr_qp = &hr_sqp->hr_qp; | 608 | hr_qp = &hr_sqp->hr_qp; |
609 | hr_qp->port = init_attr->port_num - 1; | 609 | hr_qp->port = init_attr->port_num - 1; |
610 | hr_qp->phy_port = hr_dev->iboe.phy_port[hr_qp->port]; | 610 | hr_qp->phy_port = hr_dev->iboe.phy_port[hr_qp->port]; |
611 | hr_qp->ibqp.qp_num = hr_dev->caps.sqp_start + | 611 | hr_qp->ibqp.qp_num = HNS_ROCE_MAX_PORTS + |
612 | HNS_ROCE_MAX_PORTS + | ||
613 | hr_dev->iboe.phy_port[hr_qp->port]; | 612 | hr_dev->iboe.phy_port[hr_qp->port]; |
614 | 613 | ||
615 | ret = hns_roce_create_qp_common(hr_dev, pd, init_attr, udata, | 614 | ret = hns_roce_create_qp_common(hr_dev, pd, init_attr, udata, |
@@ -825,8 +824,7 @@ int hns_roce_init_qp_table(struct hns_roce_dev *hr_dev) | |||
825 | 824 | ||
826 | /* A port include two SQP, six port total 12 */ | 825 | /* A port include two SQP, six port total 12 */ |
827 | ret = hns_roce_bitmap_init(&qp_table->bitmap, hr_dev->caps.num_qps, | 826 | ret = hns_roce_bitmap_init(&qp_table->bitmap, hr_dev->caps.num_qps, |
828 | hr_dev->caps.num_qps - 1, | 827 | hr_dev->caps.num_qps - 1, SQP_NUM, |
829 | hr_dev->caps.sqp_start + SQP_NUM, | ||
830 | reserved_from_top); | 828 | reserved_from_top); |
831 | if (ret) { | 829 | if (ret) { |
832 | dev_err(&hr_dev->pdev->dev, "qp bitmap init failed!error=%d\n", | 830 | dev_err(&hr_dev->pdev->dev, "qp bitmap init failed!error=%d\n", |