Commit 1ca5b253 authored by Wei Hu (Xavier)'s avatar Wei Hu (Xavier) Committed by Doug Ledford

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: default avatarWei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 97f0e39f
...@@ -465,7 +465,6 @@ struct hns_roce_caps { ...@@ -465,7 +465,6 @@ struct hns_roce_caps {
u32 max_rq_desc_sz; /* 64 */ u32 max_rq_desc_sz; /* 64 */
int max_qp_init_rdma; int max_qp_init_rdma;
int max_qp_dest_rdma; int max_qp_dest_rdma;
int sqp_start;
int num_cqs; int num_cqs;
int max_cqes; int max_cqes;
int reserved_cqs; int reserved_cqs;
......
...@@ -936,7 +936,6 @@ void hns_roce_v1_profile(struct hns_roce_dev *hr_dev) ...@@ -936,7 +936,6 @@ void hns_roce_v1_profile(struct hns_roce_dev *hr_dev)
caps->mtt_entry_sz = HNS_ROCE_V1_MTT_ENTRY_SIZE; caps->mtt_entry_sz = HNS_ROCE_V1_MTT_ENTRY_SIZE;
caps->cq_entry_sz = HNS_ROCE_V1_CQE_ENTRY_SIZE; caps->cq_entry_sz = HNS_ROCE_V1_CQE_ENTRY_SIZE;
caps->page_size_cap = HNS_ROCE_V1_PAGE_SIZE_SUPPORT; caps->page_size_cap = HNS_ROCE_V1_PAGE_SIZE_SUPPORT;
caps->sqp_start = 0;
caps->reserved_lkey = 0; caps->reserved_lkey = 0;
caps->reserved_pds = 0; caps->reserved_pds = 0;
caps->reserved_mrws = 1; caps->reserved_mrws = 1;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "hns_roce_hem.h" #include "hns_roce_hem.h"
#include "hns_roce_user.h" #include "hns_roce_user.h"
#define SQP_NUM 12 #define SQP_NUM (2 * HNS_ROCE_MAX_PORTS)
void hns_roce_qp_event(struct hns_roce_dev *hr_dev, u32 qpn, int event_type) void hns_roce_qp_event(struct hns_roce_dev *hr_dev, u32 qpn, int event_type)
{ {
...@@ -246,7 +246,7 @@ void hns_roce_release_range_qp(struct hns_roce_dev *hr_dev, int base_qpn, ...@@ -246,7 +246,7 @@ void hns_roce_release_range_qp(struct hns_roce_dev *hr_dev, int base_qpn,
{ {
struct hns_roce_qp_table *qp_table = &hr_dev->qp_table; struct hns_roce_qp_table *qp_table = &hr_dev->qp_table;
if (base_qpn < (hr_dev->caps.sqp_start + 2 * hr_dev->caps.num_ports)) if (base_qpn < SQP_NUM)
return; return;
hns_roce_bitmap_free_range(&qp_table->bitmap, base_qpn, cnt); 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,8 +608,7 @@ struct ib_qp *hns_roce_create_qp(struct ib_pd *pd,
hr_qp = &hr_sqp->hr_qp; hr_qp = &hr_sqp->hr_qp;
hr_qp->port = init_attr->port_num - 1; hr_qp->port = init_attr->port_num - 1;
hr_qp->phy_port = hr_dev->iboe.phy_port[hr_qp->port]; hr_qp->phy_port = hr_dev->iboe.phy_port[hr_qp->port];
hr_qp->ibqp.qp_num = hr_dev->caps.sqp_start + hr_qp->ibqp.qp_num = HNS_ROCE_MAX_PORTS +
HNS_ROCE_MAX_PORTS +
hr_dev->iboe.phy_port[hr_qp->port]; hr_dev->iboe.phy_port[hr_qp->port];
ret = hns_roce_create_qp_common(hr_dev, pd, init_attr, udata, 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,8 +824,7 @@ int hns_roce_init_qp_table(struct hns_roce_dev *hr_dev)
/* A port include two SQP, six port total 12 */ /* A port include two SQP, six port total 12 */
ret = hns_roce_bitmap_init(&qp_table->bitmap, hr_dev->caps.num_qps, ret = hns_roce_bitmap_init(&qp_table->bitmap, hr_dev->caps.num_qps,
hr_dev->caps.num_qps - 1, hr_dev->caps.num_qps - 1, SQP_NUM,
hr_dev->caps.sqp_start + SQP_NUM,
reserved_from_top); reserved_from_top);
if (ret) { if (ret) {
dev_err(&hr_dev->pdev->dev, "qp bitmap init failed!error=%d\n", dev_err(&hr_dev->pdev->dev, "qp bitmap init failed!error=%d\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment