Unverified Commit bdde34c2 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!1834 cleanup for RDMA/hns from mainline linux

parents 829ecc1d 5e958dec
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -656,7 +656,6 @@ struct hns_roce_qp {
	struct hns_roce_db	sdb;
	unsigned long		en_flags;
	unsigned long		congest_type;
	u32			doorbell_qpn;
	enum ib_sig_type	sq_signal_bits;
	struct hns_roce_wq	sq;

+5 −10
Original line number Diff line number Diff line
@@ -997,7 +997,7 @@ struct hns_roce_hem_head {

static struct hns_roce_hem_item *
hem_list_alloc_item(struct hns_roce_dev *hr_dev, int start, int end, int count,
		    bool exist_bt, int bt_level)
		    bool exist_bt)
{
	struct hns_roce_hem_item *hem;

@@ -1206,7 +1206,7 @@ static int hem_list_alloc_mid_bt(struct hns_roce_dev *hr_dev,
		start_aligned = (distance / step) * step + r->offset;
		end = min_t(int, start_aligned + step - 1, max_ofs);
		cur = hem_list_alloc_item(hr_dev, start_aligned, end, unit,
					  true, level);
					  true);
		if (!cur) {
			ret = -ENOMEM;
			goto err_exit;
@@ -1258,7 +1258,7 @@ alloc_root_hem(struct hns_roce_dev *hr_dev, int unit, int *max_ba_num,
	/* indicate to last region */
	r = &regions[region_cnt - 1];
	hem = hem_list_alloc_item(hr_dev, offset, r->offset + r->count - 1,
				  ba_num, true, 0);
				  ba_num, true);
	if (!hem)
		return ERR_PTR(-ENOMEM);

@@ -1275,7 +1275,7 @@ static int alloc_fake_root_bt(struct hns_roce_dev *hr_dev, void *cpu_base,
	struct hns_roce_hem_item *hem;

	hem = hem_list_alloc_item(hr_dev, r->offset, r->offset + r->count - 1,
				  r->count, false, 0);
				  r->count, false);
	if (!hem)
		return -ENOMEM;

@@ -1479,19 +1479,17 @@ void hns_roce_hem_list_init(struct hns_roce_hem_list *hem_list)

void *hns_roce_hem_list_find_mtt(struct hns_roce_dev *hr_dev,
				 struct hns_roce_hem_list *hem_list,
				 int offset, int *mtt_cnt, u64 *phy_addr)
				 int offset, int *mtt_cnt)
{
	struct list_head *head = &hem_list->btm_bt;
	struct hns_roce_hem_item *hem, *temp_hem;
	void *cpu_base = NULL;
	u64 phy_base = 0;
	int nr = 0;

	list_for_each_entry_safe(hem, temp_hem, head, sibling) {
		if (hem_list_page_is_in_range(hem, offset)) {
			nr = offset - hem->start;
			cpu_base = hem->addr + nr * BA_BYTE_LEN;
			phy_base = hem->dma_addr + nr * BA_BYTE_LEN;
			nr = hem->end + 1 - offset;
			break;
		}
@@ -1500,8 +1498,5 @@ void *hns_roce_hem_list_find_mtt(struct hns_roce_dev *hr_dev,
	if (mtt_cnt)
		*mtt_cnt = nr;

	if (phy_addr)
		*phy_addr = phy_base;

	return cpu_base;
}
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ void hns_roce_hem_list_release(struct hns_roce_dev *hr_dev,
			       struct hns_roce_hem_list *hem_list);
void *hns_roce_hem_list_find_mtt(struct hns_roce_dev *hr_dev,
				 struct hns_roce_hem_list *hem_list,
				 int offset, int *mtt_cnt, u64 *phy_addr);
				 int offset, int *mtt_cnt);

static inline void hns_roce_hem_first(struct hns_roce_hem *hem,
				      struct hns_roce_hem_iter *iter)
+4 −3
Original line number Diff line number Diff line
@@ -725,7 +725,7 @@ static inline void update_sq_db(struct hns_roce_dev *hr_dev,
	} else {
		struct hns_roce_v2_db sq_db = {};

		hr_reg_write(&sq_db, DB_TAG, qp->doorbell_qpn);
		hr_reg_write(&sq_db, DB_TAG, qp->qpn);
		hr_reg_write(&sq_db, DB_CMD, HNS_ROCE_V2_SQ_DB);
		hr_reg_write(&sq_db, DB_PI, qp->sq.head);
		hr_reg_write(&sq_db, DB_SL, qp->sl);
@@ -2245,7 +2245,8 @@ static void apply_func_caps(struct hns_roce_dev *hr_dev)
	caps->num_idx_segs = HNS_ROCE_V2_MAX_IDX_SEGS;

	if (!caps->num_comp_vectors)
		caps->num_comp_vectors = min_t(u32, caps->eqc_bt_num - 1,
		caps->num_comp_vectors =
			min_t(u32, caps->eqc_bt_num - HNS_ROCE_V2_AEQE_VEC_NUM,
				(u32)priv->handle->rinfo.num_vectors -
		(HNS_ROCE_V2_AEQE_VEC_NUM + HNS_ROCE_V2_ABNORMAL_VEC_NUM));

+2 −2
Original line number Diff line number Diff line
@@ -599,7 +599,7 @@ static int mtr_map_region(struct hns_roce_dev *hr_dev, struct hns_roce_mtr *mtr,
	while (offset < end && npage < max_count) {
		count = 0;
		mtts = hns_roce_hem_list_find_mtt(hr_dev, &mtr->hem_list,
						  offset, &count, NULL);
						  offset, &count);
		if (!mtts)
			return -ENOBUFS;

@@ -871,7 +871,7 @@ int hns_roce_mtr_find(struct hns_roce_dev *hr_dev, struct hns_roce_mtr *mtr,
		mtt_count = 0;
		mtts = hns_roce_hem_list_find_mtt(hr_dev, &mtr->hem_list,
						  start_index + total,
						  &mtt_count, NULL);
						  &mtt_count);
		if (!mtts || !mtt_count)
			goto done;

Loading