Lines Matching refs:cqe

81 	struct mlx4_cqe *cqe = get_cqe(cq, n & cq->ibcq.cqe);  in get_sw_cqe()  local
82 struct mlx4_cqe *tcqe = ((cq->buf.entry_size == 64) ? (cqe + 1) : cqe); in get_sw_cqe()
85 !!(n & (cq->ibcq.cqe + 1))) ? NULL : cqe; in get_sw_cqe()
133 static void mlx4_ib_free_cq_buf(struct mlx4_ib_dev *dev, struct mlx4_ib_cq_buf *buf, int cqe) in mlx4_ib_free_cq_buf() argument
135 mlx4_buf_free(dev->dev, (cqe + 1) * buf->entry_size, &buf->buf); in mlx4_ib_free_cq_buf()
140 struct ib_umem **umem, u64 buf_addr, int cqe) in mlx4_ib_get_cq_umem() argument
147 *umem = ib_umem_get(&dev->ib_dev, buf_addr, cqe * cqe_size, in mlx4_ib_get_cq_umem()
178 int entries = attr->cqe; in mlx4_ib_create_cq()
195 cq->ibcq.cqe = entries - 1; in mlx4_ib_create_cq()
281 mlx4_ib_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); in mlx4_ib_create_cq()
309 cq->resize_buf->cqe = entries - 1; in mlx4_alloc_resize_buf()
338 cq->resize_buf->cqe = entries - 1; in mlx4_alloc_resize_umem()
356 struct mlx4_cqe *cqe, *new_cqe; in mlx4_ib_cq_resize_copy_cqes() local
362 cqe = get_cqe(cq, i & cq->ibcq.cqe); in mlx4_ib_cq_resize_copy_cqes()
363 cqe += cqe_inc; in mlx4_ib_cq_resize_copy_cqes()
365 while ((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) != MLX4_CQE_OPCODE_RESIZE) { in mlx4_ib_cq_resize_copy_cqes()
367 (i + 1) & cq->resize_buf->cqe); in mlx4_ib_cq_resize_copy_cqes()
368 memcpy(new_cqe, get_cqe(cq, i & cq->ibcq.cqe), cqe_size); in mlx4_ib_cq_resize_copy_cqes()
371 new_cqe->owner_sr_opcode = (cqe->owner_sr_opcode & ~MLX4_CQE_OWNER_MASK) | in mlx4_ib_cq_resize_copy_cqes()
372 (((i + 1) & (cq->resize_buf->cqe + 1)) ? MLX4_CQE_OWNER_MASK : 0); in mlx4_ib_cq_resize_copy_cqes()
373 cqe = get_cqe(cq, ++i & cq->ibcq.cqe); in mlx4_ib_cq_resize_copy_cqes()
374 cqe += cqe_inc; in mlx4_ib_cq_resize_copy_cqes()
394 if (entries == ibcq->cqe + 1) { in mlx4_ib_resize_cq()
430 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_resize_cq()
445 tmp_cqe = cq->ibcq.cqe; in mlx4_ib_resize_cq()
447 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_resize_cq()
464 cq->resize_buf->cqe); in mlx4_ib_resize_cq()
493 mlx4_ib_free_cq_buf(dev, &mcq->buf, cq->cqe); in mlx4_ib_destroy_cq()
500 static void dump_cqe(void *cqe) in dump_cqe() argument
502 __be32 *buf = cqe; in dump_cqe()
510 static void mlx4_ib_handle_error_cqe(struct mlx4_err_cqe *cqe, in mlx4_ib_handle_error_cqe() argument
513 if (cqe->syndrome == MLX4_CQE_SYNDROME_LOCAL_QP_OP_ERR) { in mlx4_ib_handle_error_cqe()
517 be32_to_cpu(cqe->my_qpn), be16_to_cpu(cqe->wqe_index), in mlx4_ib_handle_error_cqe()
518 cqe->vendor_err_syndrome, in mlx4_ib_handle_error_cqe()
519 cqe->owner_sr_opcode & ~MLX4_CQE_OWNER_MASK); in mlx4_ib_handle_error_cqe()
520 dump_cqe(cqe); in mlx4_ib_handle_error_cqe()
523 switch (cqe->syndrome) { in mlx4_ib_handle_error_cqe()
568 wc->vendor_err = cqe->vendor_err_syndrome; in mlx4_ib_handle_error_cqe()
581 unsigned tail, struct mlx4_cqe *cqe, int is_eth) in use_tunnel_data() argument
660 struct mlx4_cqe *cqe; in mlx4_ib_poll_one() local
673 cqe = next_cqe_sw(cq); in mlx4_ib_poll_one()
674 if (!cqe) in mlx4_ib_poll_one()
678 cqe++; in mlx4_ib_poll_one()
688 is_send = cqe->owner_sr_opcode & MLX4_CQE_IS_SEND_MASK; in mlx4_ib_poll_one()
689 is_error = (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == in mlx4_ib_poll_one()
693 if (unlikely((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == MLX4_CQE_OPCODE_RESIZE)) { in mlx4_ib_poll_one()
697 mlx4_ib_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); in mlx4_ib_poll_one()
699 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_poll_one()
709 (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_QPN_MASK) != (*cur_qp)->mqp.qpn) { in mlx4_ib_poll_one()
716 be32_to_cpu(cqe->vlan_my_qpn)); in mlx4_ib_poll_one()
724 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); in mlx4_ib_poll_one()
734 wqe_ctr = be16_to_cpu(cqe->wqe_index); in mlx4_ib_poll_one()
741 wqe_ctr = be16_to_cpu(cqe->wqe_index); in mlx4_ib_poll_one()
746 wqe_ctr = be16_to_cpu(cqe->wqe_index); in mlx4_ib_poll_one()
757 mlx4_ib_handle_error_cqe((struct mlx4_err_cqe *) cqe, wc); in mlx4_ib_poll_one()
765 switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) { in mlx4_ib_poll_one()
781 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
810 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
812 switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) { in mlx4_ib_poll_one()
816 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
821 wc->ex.invalidate_rkey = be32_to_cpu(cqe->immed_rss_invalid); in mlx4_ib_poll_one()
830 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
841 use_tunnel_data(*cur_qp, cq, wc, tail, cqe, in mlx4_ib_poll_one()
847 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); in mlx4_ib_poll_one()
851 wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f; in mlx4_ib_poll_one()
852 wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status, in mlx4_ib_poll_one()
853 cqe->badfcs_enc, in mlx4_ib_poll_one()
854 cqe->checksum) ? IB_WC_IP_CSUM_OK : 0; in mlx4_ib_poll_one()
857 wc->sl = be16_to_cpu(cqe->sl_vid) >> 13; in mlx4_ib_poll_one()
858 if (be32_to_cpu(cqe->vlan_my_qpn) & in mlx4_ib_poll_one()
860 wc->vlan_id = be16_to_cpu(cqe->sl_vid) & in mlx4_ib_poll_one()
865 memcpy(wc->smac, cqe->smac, ETH_ALEN); in mlx4_ib_poll_one()
868 wc->slid = be16_to_cpu(cqe->rlid); in mlx4_ib_poll_one()
869 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12; in mlx4_ib_poll_one()
919 struct mlx4_cqe *cqe, *dest; in __mlx4_ib_cq_clean() local
931 if (prod_index == cq->mcq.cons_index + cq->ibcq.cqe) in __mlx4_ib_cq_clean()
939 cqe = get_cqe(cq, prod_index & cq->ibcq.cqe); in __mlx4_ib_cq_clean()
940 cqe += cqe_inc; in __mlx4_ib_cq_clean()
942 if ((be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_QPN_MASK) == qpn) { in __mlx4_ib_cq_clean()
943 if (srq && !(cqe->owner_sr_opcode & MLX4_CQE_IS_SEND_MASK)) in __mlx4_ib_cq_clean()
944 mlx4_ib_free_srq_wqe(srq, be16_to_cpu(cqe->wqe_index)); in __mlx4_ib_cq_clean()
947 dest = get_cqe(cq, (prod_index + nfreed) & cq->ibcq.cqe); in __mlx4_ib_cq_clean()
951 memcpy(dest, cqe, sizeof *cqe); in __mlx4_ib_cq_clean()