提交 8c4ac95b 编写于 作者: X Xi Wang 提交者: Xie XiuQi

RDMA/hns: refactor reporting wc through software

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

rename the vars name for qp and cq which related the fake wc.

Feature or Bugfix:Bugfix

Fixes: c39141f4cd52 ("RDMA/hns: support reporting wc through software")
Signed-off-by: NXi Wang <wangxi11@huawei.com>
Reviewed-by: Nliyangyang20 <liyangyang20@huawei.com>
Reviewed-by: Nliweihang <liweihang@hisilicon.com>
Reviewed-by: Nchenglang <chenglang@huawei.com>
Reviewed-by: Nliuyixian <liuyixian@huawei.com>
Reviewed-by: NXi Wang <wangxi11@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 22cd0a6f
......@@ -574,10 +574,10 @@ struct hns_roce_cq {
u32 vector;
atomic_t refcount;
struct completion free;
struct list_head sq_list;
struct list_head rq_list;
struct list_head sq_list; /* list of all send cqs */
struct list_head rq_list; /* list of all recv cqs */
int comp_state;
struct list_head comp_entry;
struct list_head list; /* all armed cps are on a list */
u32 dfx_cnt[HNS_ROCE_CQ_DFX_TOTAL];
};
......@@ -793,9 +793,9 @@ struct hns_roce_qp {
u32 next_sge;
struct hns_roce_rinl_buf rq_inl_buf;
struct list_head qp_entry;
struct list_head rcq_entry;
struct list_head scq_entry;
struct list_head list; /* all qps are on a list */
struct list_head recv_list; /* all recv cqs are on a list */
struct list_head send_list; /* all send cqs are on a list */
u32 dfx_cnt[HNS_ROCE_QP_DFX_TOTAL];
};
......@@ -1188,8 +1188,8 @@ struct hns_roce_dev {
unsigned long reset_cnt;
struct hns_roce_ib_iboe iboe;
enum hns_roce_device_state state;
struct list_head qp_list;
spinlock_t qp_lock;
struct list_head qp_list; /* list of all qps on this dev */
spinlock_t qp_lock; /* protect qp_list */
struct list_head pgdir_list;
struct mutex pgdir_mutex;
......
......@@ -3037,13 +3037,13 @@ static void hns_roce_v2_poll_sw_cq(struct hns_roce_cq *hr_cq, int num_entries,
*npolled = 0;
list_for_each_entry(hr_qp, &hr_cq->sq_list, scq_entry) {
list_for_each_entry(hr_qp, &hr_cq->sq_list, send_list) {
sw_comp(hr_qp, num_entries, wc + *npolled, npolled, &hr_qp->sq);
if (*npolled >= num_entries)
return;
}
list_for_each_entry(hr_qp, &hr_cq->rq_list, rcq_entry) {
list_for_each_entry(hr_qp, &hr_cq->rq_list, recv_list) {
sw_comp(hr_qp, num_entries, wc + *npolled, npolled, &hr_qp->rq);
if (*npolled >= num_entries)
return;
......@@ -5229,11 +5229,11 @@ static int hns_roce_v2_destroy_qp_common(struct hns_roce_dev *hr_dev,
spin_lock_irqsave(&hr_dev->qp_lock, flags);
if (cq_lock)
hns_roce_lock_cqs(send_cq, recv_cq);
list_del(&hr_qp->qp_entry);
list_del(&hr_qp->list);
if (send_cq)
list_del(&hr_qp->scq_entry);
list_del(&hr_qp->send_list);
if (recv_cq)
list_del(&hr_qp->rcq_entry);
list_del(&hr_qp->recv_list);
if (!is_user) {
__hns_roce_v2_cq_clean(recv_cq, hr_qp->qpn, hr_qp->ibqp.srq ?
......
......@@ -1334,7 +1334,7 @@ static void hns_roce_find_armed_cq(struct list_head *cq_list, struct ib_cq *cq)
if (hr_cq->comp && cq->comp_handler) {
if (!hr_cq->comp_state) {
hr_cq->comp_state = 1;
list_add_tail(&hr_cq->comp_entry, cq_list);
list_add_tail(&hr_cq->list, cq_list);
}
}
spin_unlock_irqrestore(&hr_cq->lock, flags);
......@@ -1355,7 +1355,7 @@ void hns_roce_handle_device_err(struct hns_roce_dev *hr_dev)
INIT_LIST_HEAD(&cq_list);
spin_lock_irqsave(&hr_dev->qp_lock, flags);
list_for_each_entry(hr_qp, &hr_dev->qp_list, qp_entry) {
list_for_each_entry(hr_qp, &hr_dev->qp_list, list) {
spin_lock_irqsave(&hr_qp->sq.lock, flags_qp);
if (hr_qp->sq.tail != hr_qp->sq.head)
hns_roce_find_armed_cq(&cq_list, hr_qp->ibqp.send_cq);
......@@ -1367,7 +1367,7 @@ void hns_roce_handle_device_err(struct hns_roce_dev *hr_dev)
spin_unlock_irqrestore(&hr_qp->rq.lock, flags_qp);
}
list_for_each_entry(hr_cq, &cq_list, comp_entry)
list_for_each_entry(hr_cq, &cq_list, list)
hr_cq->comp(hr_cq);
spin_unlock_irqrestore(&hr_dev->qp_lock, flags);
......
......@@ -784,11 +784,11 @@ static void hns_roce_add_cq_to_qp(struct hns_roce_dev *hr_dev,
spin_lock_irqsave(&hr_dev->qp_lock, flags);
hns_roce_lock_cqs(hr_send_cq, hr_recv_cq);
list_add_tail(&hr_qp->qp_entry, &hr_dev->qp_list);
list_add_tail(&hr_qp->list, &hr_dev->qp_list);
if (hr_send_cq)
list_add_tail(&hr_qp->scq_entry, &hr_send_cq->sq_list);
list_add_tail(&hr_qp->send_list, &hr_send_cq->sq_list);
if (hr_recv_cq)
list_add_tail(&hr_qp->rcq_entry, &hr_recv_cq->rq_list);
list_add_tail(&hr_qp->recv_list, &hr_recv_cq->rq_list);
hns_roce_unlock_cqs(hr_send_cq, hr_recv_cq);
spin_unlock_irqrestore(&hr_dev->qp_lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册