Lines Matching refs:hr_qp

46 	struct hns_roce_qp *hr_qp = container_of(flush_work,  in flush_work_handle()  local
56 if (test_and_clear_bit(HNS_ROCE_FLUSH_FLAG, &hr_qp->flush_flag)) { in flush_work_handle()
57 ret = hns_roce_modify_qp(&hr_qp->ibqp, &attr, attr_mask, NULL); in flush_work_handle()
67 if (refcount_dec_and_test(&hr_qp->refcount)) in flush_work_handle()
68 complete(&hr_qp->free); in flush_work_handle()
71 void init_flush_work(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp) in init_flush_work() argument
73 struct hns_roce_work *flush_work = &hr_qp->flush_work; in init_flush_work()
77 refcount_inc(&hr_qp->refcount); in init_flush_work()
128 static void hns_roce_ib_qp_event(struct hns_roce_qp *hr_qp, in hns_roce_ib_qp_event() argument
131 struct ib_qp *ibqp = &hr_qp->ibqp; in hns_roce_ib_qp_event()
166 type, hr_qp->qpn); in hns_roce_ib_qp_event()
227 static int alloc_qpn(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp, in alloc_qpn() argument
235 if (hr_qp->ibqp.qp_type == IB_QPT_GSI) { in alloc_qpn()
254 hr_qp->qpn = num; in alloc_qpn()
260 struct hns_roce_qp *hr_qp, in add_qp_to_list() argument
272 list_add_tail(&hr_qp->node, &hr_dev->qp_list); in add_qp_to_list()
274 list_add_tail(&hr_qp->sq_node, &hr_send_cq->sq_list); in add_qp_to_list()
276 list_add_tail(&hr_qp->rq_node, &hr_recv_cq->rq_list); in add_qp_to_list()
283 struct hns_roce_qp *hr_qp, in hns_roce_qp_store() argument
289 if (!hr_qp->qpn) in hns_roce_qp_store()
292 ret = xa_err(xa_store_irq(xa, hr_qp->qpn, hr_qp, GFP_KERNEL)); in hns_roce_qp_store()
297 add_qp_to_list(hr_dev, hr_qp, init_attr->send_cq, in hns_roce_qp_store()
303 static int alloc_qpc(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp) in alloc_qpc() argument
309 if (!hr_qp->qpn) in alloc_qpc()
313 ret = hns_roce_table_get(hr_dev, &qp_table->qp_table, hr_qp->qpn); in alloc_qpc()
320 ret = hns_roce_table_get(hr_dev, &qp_table->irrl_table, hr_qp->qpn); in alloc_qpc()
329 hr_qp->qpn); in alloc_qpc()
339 hr_qp->qpn); in alloc_qpc()
350 hns_roce_table_put(hr_dev, &qp_table->trrl_table, hr_qp->qpn); in alloc_qpc()
353 hns_roce_table_put(hr_dev, &qp_table->irrl_table, hr_qp->qpn); in alloc_qpc()
356 hns_roce_table_put(hr_dev, &qp_table->qp_table, hr_qp->qpn); in alloc_qpc()
362 static void qp_user_mmap_entry_remove(struct hns_roce_qp *hr_qp) in qp_user_mmap_entry_remove() argument
364 rdma_user_mmap_entry_remove(&hr_qp->dwqe_mmap_entry->rdma_entry); in qp_user_mmap_entry_remove()
367 void hns_roce_qp_remove(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp) in hns_roce_qp_remove() argument
372 list_del(&hr_qp->node); in hns_roce_qp_remove()
374 if (hr_qp->ibqp.qp_type != IB_QPT_XRC_TGT) in hns_roce_qp_remove()
375 list_del(&hr_qp->sq_node); in hns_roce_qp_remove()
377 if (hr_qp->ibqp.qp_type != IB_QPT_XRC_INI && in hns_roce_qp_remove()
378 hr_qp->ibqp.qp_type != IB_QPT_XRC_TGT) in hns_roce_qp_remove()
379 list_del(&hr_qp->rq_node); in hns_roce_qp_remove()
382 __xa_erase(xa, hr_qp->qpn); in hns_roce_qp_remove()
386 static void free_qpc(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp) in free_qpc() argument
391 hns_roce_table_put(hr_dev, &qp_table->trrl_table, hr_qp->qpn); in free_qpc()
392 hns_roce_table_put(hr_dev, &qp_table->irrl_table, hr_qp->qpn); in free_qpc()
401 static void free_qpn(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp) in free_qpn() argument
405 if (hr_qp->ibqp.qp_type == IB_QPT_GSI) in free_qpn()
408 if (hr_qp->qpn < hr_dev->caps.reserved_qps) in free_qpn()
411 bankid = get_qp_bankid(hr_qp->qpn); in free_qpn()
414 hr_qp->qpn / HNS_ROCE_QP_BANK_NUM); in free_qpn()
421 static u32 proc_rq_sge(struct hns_roce_dev *dev, struct hns_roce_qp *hr_qp, in proc_rq_sge() argument
438 hr_qp->rq.rsv_sge = 1; in proc_rq_sge()
444 struct hns_roce_qp *hr_qp, int has_rq, bool user) in set_rq_size() argument
446 u32 max_sge = proc_rq_sge(hr_dev, hr_qp, user); in set_rq_size()
451 hr_qp->rq.wqe_cnt = 0; in set_rq_size()
452 hr_qp->rq.max_gs = 0; in set_rq_size()
475 hr_qp->rq.max_gs = roundup_pow_of_two(max(1U, cap->max_recv_sge) + in set_rq_size()
476 hr_qp->rq.rsv_sge); in set_rq_size()
478 hr_qp->rq.wqe_shift = ilog2(hr_dev->caps.max_rq_desc_sz * in set_rq_size()
479 hr_qp->rq.max_gs); in set_rq_size()
481 hr_qp->rq.wqe_cnt = cnt; in set_rq_size()
484 cap->max_recv_sge = hr_qp->rq.max_gs - hr_qp->rq.rsv_sge; in set_rq_size()
501 static void update_inline_data(struct hns_roce_qp *hr_qp, in update_inline_data() argument
504 u32 sge_num = hr_qp->sq.ext_sge_cnt; in update_inline_data()
506 if (hr_qp->config & HNS_ROCE_EXSGE_FLAGS) { in update_inline_data()
507 if (!(hr_qp->ibqp.qp_type == IB_QPT_GSI || in update_inline_data()
508 hr_qp->ibqp.qp_type == IB_QPT_UD)) in update_inline_data()
515 hr_qp->max_inline_data = cap->max_inline_data; in update_inline_data()
551 struct hns_roce_qp *hr_qp, struct ib_qp_cap *cap) in set_ext_sge_param() argument
553 bool is_ud_or_gsi = (hr_qp->ibqp.qp_type == IB_QPT_GSI || in set_ext_sge_param()
554 hr_qp->ibqp.qp_type == IB_QPT_UD); in set_ext_sge_param()
562 hr_qp->sge.sge_shift = HNS_ROCE_SGE_SHIFT; in set_ext_sge_param()
567 if (hr_qp->config & HNS_ROCE_EXSGE_FLAGS) { in set_ext_sge_param()
571 hr_qp->sq.ext_sge_cnt = inline_ext_sge ? in set_ext_sge_param()
574 hr_qp->sq.max_gs = max(1U, (hr_qp->sq.ext_sge_cnt + std_sge_num)); in set_ext_sge_param()
575 hr_qp->sq.max_gs = min(hr_qp->sq.max_gs, hr_dev->caps.max_sq_sg); in set_ext_sge_param()
577 ext_wqe_sge_cnt = hr_qp->sq.ext_sge_cnt; in set_ext_sge_param()
579 hr_qp->sq.max_gs = max(1U, cap->max_send_sge); in set_ext_sge_param()
580 hr_qp->sq.max_gs = min(hr_qp->sq.max_gs, hr_dev->caps.max_sq_sg); in set_ext_sge_param()
581 hr_qp->sq.ext_sge_cnt = hr_qp->sq.max_gs; in set_ext_sge_param()
589 hr_qp->sge.sge_cnt = max(total_sge_cnt, in set_ext_sge_param()
593 update_inline_data(hr_qp, cap); in set_ext_sge_param()
620 struct ib_qp_cap *cap, struct hns_roce_qp *hr_qp, in set_user_sq_size() argument
638 set_ext_sge_param(hr_dev, cnt, hr_qp, cap); in set_user_sq_size()
640 hr_qp->sq.wqe_shift = ucmd->log_sq_stride; in set_user_sq_size()
641 hr_qp->sq.wqe_cnt = cnt; in set_user_sq_size()
642 cap->max_send_sge = hr_qp->sq.max_gs; in set_user_sq_size()
648 struct hns_roce_qp *hr_qp, in set_wqe_buf_attr() argument
654 hr_qp->buff_size = 0; in set_wqe_buf_attr()
657 hr_qp->sq.offset = 0; in set_wqe_buf_attr()
658 buf_size = to_hr_hem_entries_size(hr_qp->sq.wqe_cnt, in set_wqe_buf_attr()
659 hr_qp->sq.wqe_shift); in set_wqe_buf_attr()
664 hr_qp->buff_size += buf_size; in set_wqe_buf_attr()
668 hr_qp->sge.offset = hr_qp->buff_size; in set_wqe_buf_attr()
669 buf_size = to_hr_hem_entries_size(hr_qp->sge.sge_cnt, in set_wqe_buf_attr()
670 hr_qp->sge.sge_shift); in set_wqe_buf_attr()
675 hr_qp->buff_size += buf_size; in set_wqe_buf_attr()
679 hr_qp->rq.offset = hr_qp->buff_size; in set_wqe_buf_attr()
680 buf_size = to_hr_hem_entries_size(hr_qp->rq.wqe_cnt, in set_wqe_buf_attr()
681 hr_qp->rq.wqe_shift); in set_wqe_buf_attr()
686 hr_qp->buff_size += buf_size; in set_wqe_buf_attr()
689 if (hr_qp->buff_size < 1) in set_wqe_buf_attr()
699 struct ib_qp_cap *cap, struct hns_roce_qp *hr_qp) in set_kernel_sq_size() argument
717 hr_qp->sq.wqe_shift = ilog2(hr_dev->caps.max_sq_desc_sz); in set_kernel_sq_size()
718 hr_qp->sq.wqe_cnt = cnt; in set_kernel_sq_size()
720 set_ext_sge_param(hr_dev, cnt, hr_qp, cap); in set_kernel_sq_size()
724 cap->max_send_sge = hr_qp->sq.max_gs; in set_kernel_sq_size()
747 static int alloc_qp_buf(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp, in alloc_qp_buf() argument
755 ret = set_wqe_buf_attr(hr_dev, hr_qp, &buf_attr); in alloc_qp_buf()
760 ret = hns_roce_mtr_create(hr_dev, &hr_qp->mtr, &buf_attr, in alloc_qp_buf()
769 hr_qp->en_flags |= HNS_ROCE_QP_CAP_DIRECT_WQE; in alloc_qp_buf()
778 static void free_qp_buf(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp) in free_qp_buf() argument
780 hns_roce_mtr_destroy(hr_dev, &hr_qp->mtr); in free_qp_buf()
812 static int qp_mmap_entry(struct hns_roce_qp *hr_qp, in qp_mmap_entry() argument
823 address = hr_dev->dwqe_page + hr_qp->qpn * HNS_ROCE_DWQE_SIZE; in qp_mmap_entry()
825 hr_qp->dwqe_mmap_entry = in qp_mmap_entry()
830 if (!hr_qp->dwqe_mmap_entry) { in qp_mmap_entry()
835 rdma_entry = &hr_qp->dwqe_mmap_entry->rdma_entry; in qp_mmap_entry()
842 struct hns_roce_qp *hr_qp, in alloc_user_qp_db() argument
854 ret = hns_roce_db_map_user(uctx, ucmd->sdb_addr, &hr_qp->sdb); in alloc_user_qp_db()
861 hr_qp->en_flags |= HNS_ROCE_QP_CAP_SQ_RECORD_DB; in alloc_user_qp_db()
865 ret = hns_roce_db_map_user(uctx, ucmd->db_addr, &hr_qp->rdb); in alloc_user_qp_db()
872 hr_qp->en_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB; in alloc_user_qp_db()
878 if (hr_qp->en_flags & HNS_ROCE_QP_CAP_SQ_RECORD_DB) in alloc_user_qp_db()
879 hns_roce_db_unmap_user(uctx, &hr_qp->sdb); in alloc_user_qp_db()
885 struct hns_roce_qp *hr_qp, in alloc_kernel_qp_db() argument
892 hr_qp->sq.db_reg = hr_dev->mem_base + in alloc_kernel_qp_db()
893 HNS_ROCE_DWQE_SIZE * hr_qp->qpn; in alloc_kernel_qp_db()
895 hr_qp->sq.db_reg = hr_dev->reg_base + hr_dev->sdb_offset + in alloc_kernel_qp_db()
898 hr_qp->rq.db_reg = hr_dev->reg_base + hr_dev->odb_offset + in alloc_kernel_qp_db()
902 ret = hns_roce_alloc_db(hr_dev, &hr_qp->rdb, 0); in alloc_kernel_qp_db()
909 *hr_qp->rdb.db_record = 0; in alloc_kernel_qp_db()
910 hr_qp->en_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB; in alloc_kernel_qp_db()
916 static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp, in alloc_qp_db() argument
925 hr_qp->en_flags |= HNS_ROCE_QP_CAP_OWNER_DB; in alloc_qp_db()
928 if (hr_qp->en_flags & HNS_ROCE_QP_CAP_DIRECT_WQE) { in alloc_qp_db()
929 ret = qp_mmap_entry(hr_qp, hr_dev, udata, resp); in alloc_qp_db()
934 ret = alloc_user_qp_db(hr_dev, hr_qp, init_attr, udata, ucmd, in alloc_qp_db()
939 ret = alloc_kernel_qp_db(hr_dev, hr_qp, init_attr); in alloc_qp_db()
947 if (hr_qp->en_flags & HNS_ROCE_QP_CAP_DIRECT_WQE) in alloc_qp_db()
948 qp_user_mmap_entry_remove(hr_qp); in alloc_qp_db()
953 static void free_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp, in free_qp_db() argument
960 if (hr_qp->en_flags & HNS_ROCE_QP_CAP_RQ_RECORD_DB) in free_qp_db()
961 hns_roce_db_unmap_user(uctx, &hr_qp->rdb); in free_qp_db()
962 if (hr_qp->en_flags & HNS_ROCE_QP_CAP_SQ_RECORD_DB) in free_qp_db()
963 hns_roce_db_unmap_user(uctx, &hr_qp->sdb); in free_qp_db()
964 if (hr_qp->en_flags & HNS_ROCE_QP_CAP_DIRECT_WQE) in free_qp_db()
965 qp_user_mmap_entry_remove(hr_qp); in free_qp_db()
967 if (hr_qp->en_flags & HNS_ROCE_QP_CAP_RQ_RECORD_DB) in free_qp_db()
968 hns_roce_free_db(hr_dev, &hr_qp->rdb); in free_qp_db()
973 struct hns_roce_qp *hr_qp) in alloc_kernel_wrid() argument
980 sq_wrid = kcalloc(hr_qp->sq.wqe_cnt, sizeof(u64), GFP_KERNEL); in alloc_kernel_wrid()
986 if (hr_qp->rq.wqe_cnt) { in alloc_kernel_wrid()
987 rq_wrid = kcalloc(hr_qp->rq.wqe_cnt, sizeof(u64), GFP_KERNEL); in alloc_kernel_wrid()
995 hr_qp->sq.wrid = sq_wrid; in alloc_kernel_wrid()
996 hr_qp->rq.wrid = rq_wrid; in alloc_kernel_wrid()
1004 static void free_kernel_wrid(struct hns_roce_qp *hr_qp) in free_kernel_wrid() argument
1006 kfree(hr_qp->rq.wrid); in free_kernel_wrid()
1007 kfree(hr_qp->sq.wrid); in free_kernel_wrid()
1011 struct hns_roce_qp *hr_qp) in default_congest_type() argument
1013 if (hr_qp->ibqp.qp_type == IB_QPT_UD || in default_congest_type()
1014 hr_qp->ibqp.qp_type == IB_QPT_GSI) in default_congest_type()
1015 hr_qp->cong_type = CONG_TYPE_DCQCN; in default_congest_type()
1017 hr_qp->cong_type = hr_dev->caps.default_cong_type; in default_congest_type()
1020 static int set_congest_type(struct hns_roce_qp *hr_qp, in set_congest_type() argument
1023 struct hns_roce_dev *hr_dev = to_hr_dev(hr_qp->ibqp.device); in set_congest_type()
1027 hr_qp->cong_type = CONG_TYPE_DCQCN; in set_congest_type()
1030 hr_qp->cong_type = CONG_TYPE_LDCP; in set_congest_type()
1033 hr_qp->cong_type = CONG_TYPE_HC3; in set_congest_type()
1036 hr_qp->cong_type = CONG_TYPE_DIP; in set_congest_type()
1042 if (!test_bit(hr_qp->cong_type, (unsigned long *)&hr_dev->caps.cong_cap)) in set_congest_type()
1045 if (hr_qp->ibqp.qp_type == IB_QPT_UD && in set_congest_type()
1046 hr_qp->cong_type != CONG_TYPE_DCQCN) in set_congest_type()
1053 struct hns_roce_qp *hr_qp, in set_congest_param() argument
1057 return set_congest_type(hr_qp, ucmd); in set_congest_param()
1059 default_congest_type(hr_dev, hr_qp); in set_congest_param()
1064 static int set_qp_param(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp, in set_qp_param() argument
1074 hr_qp->sq_signal_bits = IB_SIGNAL_ALL_WR; in set_qp_param()
1076 hr_qp->sq_signal_bits = IB_SIGNAL_REQ_WR; in set_qp_param()
1078 ret = set_rq_size(hr_dev, &init_attr->cap, hr_qp, in set_qp_param()
1097 hr_qp->config = uctx->config; in set_qp_param()
1098 ret = set_user_sq_size(hr_dev, &init_attr->cap, hr_qp, ucmd); in set_qp_param()
1104 ret = set_congest_param(hr_dev, hr_qp, ucmd); in set_qp_param()
1109 hr_qp->config = HNS_ROCE_EXSGE_FLAGS; in set_qp_param()
1110 ret = set_kernel_sq_size(hr_dev, &init_attr->cap, hr_qp); in set_qp_param()
1116 default_congest_type(hr_dev, hr_qp); in set_qp_param()
1125 struct hns_roce_qp *hr_qp) in hns_roce_create_qp_common() argument
1132 mutex_init(&hr_qp->mutex); in hns_roce_create_qp_common()
1133 spin_lock_init(&hr_qp->sq.lock); in hns_roce_create_qp_common()
1134 spin_lock_init(&hr_qp->rq.lock); in hns_roce_create_qp_common()
1136 hr_qp->state = IB_QPS_RESET; in hns_roce_create_qp_common()
1137 hr_qp->flush_flag = 0; in hns_roce_create_qp_common()
1142 ret = set_qp_param(hr_dev, hr_qp, init_attr, udata, &ucmd); in hns_roce_create_qp_common()
1149 ret = alloc_kernel_wrid(hr_dev, hr_qp); in hns_roce_create_qp_common()
1157 ret = alloc_qp_buf(hr_dev, hr_qp, init_attr, udata, ucmd.buf_addr); in hns_roce_create_qp_common()
1163 ret = alloc_qpn(hr_dev, hr_qp, init_attr); in hns_roce_create_qp_common()
1169 ret = alloc_qp_db(hr_dev, hr_qp, init_attr, udata, &ucmd, &resp); in hns_roce_create_qp_common()
1176 ret = alloc_qpc(hr_dev, hr_qp); in hns_roce_create_qp_common()
1183 ret = hns_roce_qp_store(hr_dev, hr_qp, init_attr); in hns_roce_create_qp_common()
1190 resp.cap_flags = hr_qp->en_flags; in hns_roce_create_qp_common()
1200 ret = hr_dev->hw->qp_flow_control_init(hr_dev, hr_qp); in hns_roce_create_qp_common()
1205 hr_qp->ibqp.qp_num = hr_qp->qpn; in hns_roce_create_qp_common()
1206 hr_qp->event = hns_roce_ib_qp_event; in hns_roce_create_qp_common()
1207 refcount_set(&hr_qp->refcount, 1); in hns_roce_create_qp_common()
1208 init_completion(&hr_qp->free); in hns_roce_create_qp_common()
1213 hns_roce_qp_remove(hr_dev, hr_qp); in hns_roce_create_qp_common()
1215 free_qpc(hr_dev, hr_qp); in hns_roce_create_qp_common()
1217 free_qp_db(hr_dev, hr_qp, udata); in hns_roce_create_qp_common()
1219 free_qpn(hr_dev, hr_qp); in hns_roce_create_qp_common()
1221 free_qp_buf(hr_dev, hr_qp); in hns_roce_create_qp_common()
1223 free_kernel_wrid(hr_qp); in hns_roce_create_qp_common()
1225 mutex_destroy(&hr_qp->mutex); in hns_roce_create_qp_common()
1229 void hns_roce_qp_destroy(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp, in hns_roce_qp_destroy() argument
1232 if (refcount_dec_and_test(&hr_qp->refcount)) in hns_roce_qp_destroy()
1233 complete(&hr_qp->free); in hns_roce_qp_destroy()
1234 wait_for_completion(&hr_qp->free); in hns_roce_qp_destroy()
1236 free_qpc(hr_dev, hr_qp); in hns_roce_qp_destroy()
1237 free_qpn(hr_dev, hr_qp); in hns_roce_qp_destroy()
1238 free_qp_buf(hr_dev, hr_qp); in hns_roce_qp_destroy()
1239 free_kernel_wrid(hr_qp); in hns_roce_qp_destroy()
1240 free_qp_db(hr_dev, hr_qp, udata); in hns_roce_qp_destroy()
1241 mutex_destroy(&hr_qp->mutex); in hns_roce_qp_destroy()
1278 struct hns_roce_qp *hr_qp = to_hr_qp(qp); in hns_roce_create_qp() local
1286 hr_qp->xrcdn = to_hr_xrcd(init_attr->xrcd)->xrcdn; in hns_roce_create_qp()
1289 hr_qp->port = init_attr->port_num - 1; in hns_roce_create_qp()
1290 hr_qp->phy_port = hr_dev->iboe.phy_port[hr_qp->port]; in hns_roce_create_qp()
1293 ret = hns_roce_create_qp_common(hr_dev, init_attr, udata, hr_qp); in hns_roce_create_qp()
1322 struct hns_roce_qp *hr_qp, in check_mtu_validate() argument
1328 p = attr_mask & IB_QP_PORT ? (attr->port_num - 1) : hr_qp->port; in check_mtu_validate()
1347 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_check_qp_attr() local
1358 p = attr_mask & IB_QP_PORT ? (attr->port_num - 1) : hr_qp->port; in hns_roce_check_qp_attr()
1384 return check_mtu_validate(hr_dev, hr_qp, attr, attr_mask); in hns_roce_check_qp_attr()
1394 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp); in hns_roce_modify_qp() local
1398 mutex_lock(&hr_qp->mutex); in hns_roce_modify_qp()
1400 if (attr_mask & IB_QP_CUR_STATE && attr->cur_qp_state != hr_qp->state) in hns_roce_modify_qp()
1403 cur_state = hr_qp->state; in hns_roce_modify_qp()
1408 if (hr_qp->en_flags & HNS_ROCE_QP_CAP_SQ_RECORD_DB) { in hns_roce_modify_qp()
1409 hr_qp->sq.head = *(int *)(hr_qp->sdb.virt_addr); in hns_roce_modify_qp()
1411 if (hr_qp->en_flags & HNS_ROCE_QP_CAP_RQ_RECORD_DB) in hns_roce_modify_qp()
1412 hr_qp->rq.head = *(int *)(hr_qp->rdb.virt_addr); in hns_roce_modify_qp()
1439 resp.tc_mode = hr_qp->tc_mode; in hns_roce_modify_qp()
1440 resp.priority = hr_qp->sl; in hns_roce_modify_qp()
1449 mutex_unlock(&hr_qp->mutex); in hns_roce_modify_qp()
1505 static inline void *get_wqe(struct hns_roce_qp *hr_qp, u32 offset) in get_wqe() argument
1507 return hns_roce_buf_offset(hr_qp->mtr.kmem, offset); in get_wqe()
1510 void *hns_roce_get_recv_wqe(struct hns_roce_qp *hr_qp, unsigned int n) in hns_roce_get_recv_wqe() argument
1512 return get_wqe(hr_qp, hr_qp->rq.offset + (n << hr_qp->rq.wqe_shift)); in hns_roce_get_recv_wqe()
1515 void *hns_roce_get_send_wqe(struct hns_roce_qp *hr_qp, unsigned int n) in hns_roce_get_send_wqe() argument
1517 return get_wqe(hr_qp, hr_qp->sq.offset + (n << hr_qp->sq.wqe_shift)); in hns_roce_get_send_wqe()
1520 void *hns_roce_get_extend_sge(struct hns_roce_qp *hr_qp, unsigned int n) in hns_roce_get_extend_sge() argument
1522 return get_wqe(hr_qp, hr_qp->sge.offset + (n << hr_qp->sge.sge_shift)); in hns_roce_get_extend_sge()