提交 2c6865d3 编写于 作者: L Lang Cheng 提交者: Xie XiuQi

RDMA/hns: Remove unnecessary structures hns_roce_sqp

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

Special QP has not any special.
This patch remove related definitions and just use hns_roce_qp.

Feature or Bugfix:Bugfix
Signed-off-by: NLang Cheng <chenglang@huawei.com>
Reviewed-by: Jiaran Zhang's avatarzhangjiaran <zhangjiaran@huawei.com>
Reviewed-by: Noulijun <oulijun@huawei.com>
Reviewed-by: Nliuyixian <liuyixian@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 f7249144
......@@ -803,10 +803,6 @@ struct hns_roce_qp {
u32 dfx_cnt[HNS_ROCE_QP_DFX_TOTAL];
};
struct hns_roce_sqp {
struct hns_roce_qp hr_qp;
};
struct hns_roce_ib_iboe {
spinlock_t lock;
struct net_device *netdevs[HNS_ROCE_MAX_PORTS];
......@@ -1293,11 +1289,6 @@ static inline struct hns_roce_srq *to_hr_srq(struct ib_srq *ibsrq)
return container_of(ibsrq, struct hns_roce_srq, ibsrq);
}
static inline struct hns_roce_sqp *hr_to_hr_sqp(struct hns_roce_qp *hr_qp)
{
return container_of(hr_qp, struct hns_roce_sqp, hr_qp);
}
static inline void hns_roce_write64_k(__le32 val[2], void __iomem *dest)
{
__raw_writeq(*(u64 *) val, dest);
......
......@@ -3938,13 +3938,11 @@ static void hns_roce_v1_destroy_qp_work_fn(struct work_struct *work)
hns_roce_qp_remove(hr_dev, hr_qp);
hns_roce_qp_free(hr_dev, hr_qp);
if (hr_qp->ibqp.qp_type == IB_QPT_RC) {
/* RC QP, release QPN */
/* RC QP, release QPN */
if (hr_qp->ibqp.qp_type == IB_QPT_RC)
hns_roce_release_range_qp(hr_dev, qpn, 1);
kfree(hr_qp);
} else
kfree(hr_to_hr_sqp(hr_qp));
kfree(hr_qp);
kfree(qp_work_entry);
dev_dbg(dev, "Accomplished destroy QP(0x%lx) work.\n", qpn);
......@@ -4002,10 +4000,7 @@ int hns_roce_v1_destroy_qp(struct ib_qp *ibqp)
}
if (!is_timeout) {
if (hr_qp->ibqp.qp_type == IB_QPT_RC)
kfree(hr_qp);
else
kfree(hr_to_hr_sqp(hr_qp));
} else {
qp_work = kzalloc(sizeof(*qp_work), GFP_KERNEL);
if (!qp_work)
......
......@@ -5551,11 +5551,7 @@ static int hns_roce_v2_destroy_qp(struct ib_qp *ibqp)
dev_err(hr_dev->dev, "Destroy qp 0x%06lx failed(%d)\n",
hr_qp->qpn, ret);
if (hr_qp->ibqp.qp_type == IB_QPT_GSI)
kfree(hr_to_hr_sqp(hr_qp));
else
kfree(hr_qp);
kfree(hr_qp);
return 0;
}
......
......@@ -1146,7 +1146,6 @@ struct ib_qp *hns_roce_create_qp(struct ib_pd *pd,
struct hns_roce_dev *hr_dev = pd ? to_hr_dev(pd->device) :
to_hr_dev(init_attr->xrcd->device);
struct device *dev = hr_dev->dev;
struct hns_roce_sqp *hr_sqp;
struct hns_roce_qp *hr_qp;
u16 xrcdn = 0;
int ret;
......@@ -1189,11 +1188,10 @@ struct ib_qp *hns_roce_create_qp(struct ib_pd *pd,
return ERR_PTR(-EINVAL);
}
hr_sqp = kzalloc(sizeof(*hr_sqp), GFP_KERNEL);
if (!hr_sqp)
hr_qp = kzalloc(sizeof(*hr_qp), GFP_KERNEL);
if (!hr_qp)
return ERR_PTR(-ENOMEM);
hr_qp = &hr_sqp->hr_qp;
hr_qp->port = init_attr->port_num - 1;
hr_qp->phy_port = hr_dev->iboe.phy_port[hr_qp->port];
......@@ -1208,7 +1206,7 @@ struct ib_qp *hns_roce_create_qp(struct ib_pd *pd,
hr_qp->ibqp.qp_num, hr_qp);
if (ret) {
dev_err(dev, "Create GSI QP failed(%d)!\n", ret);
kfree(hr_sqp);
kfree(hr_qp);
return ERR_PTR(ret);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册