Lines Matching refs:cqe

2587 	cq_init_attr.cqe = HNS_ROCE_FREE_MR_USED_CQE_NUM;
3446 "failed to poll cqe for free mr, remain %d cqe.\n",
3453 "failed to poll cqe for free mr and timeout, remain %d cqe.\n",
3477 struct hns_roce_v2_cqe *cqe = get_cqe_v2(hr_cq, n & hr_cq->ib_cq.cqe);
3479 /* Get cqe when Owner bit is Conversely with the MSB of cons_idx */
3480 return (hr_reg_read(cqe, CQE_OWNER) ^ !!(n & hr_cq->cq_depth)) ? cqe :
3505 struct hns_roce_v2_cqe *cqe, *dest;
3513 if (prod_index > hr_cq->cons_index + hr_cq->ib_cq.cqe)
3522 cqe = get_cqe_v2(hr_cq, prod_index & hr_cq->ib_cq.cqe);
3523 if (hr_reg_read(cqe, CQE_LCL_QPN) == qpn) {
3524 if (srq && hr_reg_read(cqe, CQE_S_R)) {
3525 wqe_index = hr_reg_read(cqe, CQE_WQE_IDX);
3531 hr_cq->ib_cq.cqe);
3533 memcpy(dest, cqe, hr_cq->cqe_size);
3677 struct hns_roce_cq *cq, struct hns_roce_v2_cqe *cqe,
3702 u32 cqe_status = hr_reg_read(cqe, CQE_STATUS);
3716 ibdev_err_ratelimited(&hr_dev->ib_dev, "error cqe status 0x%x:\n",
3718 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_NONE, 16, 4, cqe,
3720 wc->vendor_err = hr_reg_read(cqe, CQE_SUB_STATUS);
3733 static int get_cur_qp(struct hns_roce_cq *hr_cq, struct hns_roce_v2_cqe *cqe,
3740 qpn = hr_reg_read(cqe, CQE_LCL_QPN);
3806 static void fill_send_wc(struct ib_wc *wc, struct hns_roce_v2_cqe *cqe)
3813 hr_opcode = hr_reg_read(cqe, CQE_OPCODE);
3816 wc->byte_len = le32_to_cpu(cqe->byte_cnt);
3839 static int fill_recv_wc(struct ib_wc *wc, struct hns_roce_v2_cqe *cqe)
3844 wc->byte_len = le32_to_cpu(cqe->byte_cnt);
3846 hr_opcode = hr_reg_read(cqe, CQE_OPCODE);
3851 wc->ex.imm_data = cpu_to_be32(le32_to_cpu(cqe->immtdata));
3855 wc->ex.invalidate_rkey = le32_to_cpu(cqe->rkey);
3867 wc->sl = hr_reg_read(cqe, CQE_SL);
3868 wc->src_qp = hr_reg_read(cqe, CQE_RMT_QPN);
3870 wc->wc_flags |= hr_reg_read(cqe, CQE_GRH) ? IB_WC_GRH : 0;
3871 wc->port_num = hr_reg_read(cqe, CQE_PORTN);
3874 if (hr_reg_read(cqe, CQE_VID_VLD)) {
3875 wc->vlan_id = hr_reg_read(cqe, CQE_VID);
3881 wc->network_hdr_type = hr_reg_read(cqe, CQE_PORT_TYPE);
3892 struct hns_roce_v2_cqe *cqe;
3898 cqe = get_sw_cqe_v2(hr_cq, hr_cq->cons_index);
3899 if (!cqe)
3906 ret = get_cur_qp(hr_cq, cqe, &qp);
3913 wqe_idx = hr_reg_read(cqe, CQE_WQE_IDX);
3915 is_send = !hr_reg_read(cqe, CQE_S_R);
3929 fill_send_wc(wc, cqe);
3941 ret = fill_recv_wc(wc, cqe);
3944 get_cqe_status(hr_dev, qp, hr_cq, cqe, wc);