Lines Matching full: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()
179 int entries = attr->cqe; in mlx4_ib_create_cq()
196 cq->ibcq.cqe = entries - 1; in mlx4_ib_create_cq()
282 mlx4_ib_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); in mlx4_ib_create_cq()
310 cq->resize_buf->cqe = entries - 1; in mlx4_alloc_resize_buf()
339 cq->resize_buf->cqe = entries - 1; in mlx4_alloc_resize_umem()
357 struct mlx4_cqe *cqe, *new_cqe; in mlx4_ib_cq_resize_copy_cqes() local
363 cqe = get_cqe(cq, i & cq->ibcq.cqe); in mlx4_ib_cq_resize_copy_cqes()
364 cqe += cqe_inc; in mlx4_ib_cq_resize_copy_cqes()
366 while ((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) != MLX4_CQE_OPCODE_RESIZE) { in mlx4_ib_cq_resize_copy_cqes()
368 (i + 1) & cq->resize_buf->cqe); in mlx4_ib_cq_resize_copy_cqes()
369 memcpy(new_cqe, get_cqe(cq, i & cq->ibcq.cqe), cqe_size); in mlx4_ib_cq_resize_copy_cqes()
372 new_cqe->owner_sr_opcode = (cqe->owner_sr_opcode & ~MLX4_CQE_OWNER_MASK) | in mlx4_ib_cq_resize_copy_cqes()
373 (((i + 1) & (cq->resize_buf->cqe + 1)) ? MLX4_CQE_OWNER_MASK : 0); in mlx4_ib_cq_resize_copy_cqes()
374 cqe = get_cqe(cq, ++i & cq->ibcq.cqe); in mlx4_ib_cq_resize_copy_cqes()
375 cqe += cqe_inc; in mlx4_ib_cq_resize_copy_cqes()
395 if (entries == ibcq->cqe + 1) { in mlx4_ib_resize_cq()
431 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_resize_cq()
446 tmp_cqe = cq->ibcq.cqe; in mlx4_ib_resize_cq()
448 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_resize_cq()
465 cq->resize_buf->cqe); in mlx4_ib_resize_cq()
494 mlx4_ib_free_cq_buf(dev, &mcq->buf, cq->cqe); in mlx4_ib_destroy_cq()
501 static void dump_cqe(void *cqe) in dump_cqe() argument
503 __be32 *buf = cqe; in dump_cqe()
505 pr_debug("CQE contents %08x %08x %08x %08x %08x %08x %08x %08x\n", in dump_cqe()
511 static void mlx4_ib_handle_error_cqe(struct mlx4_err_cqe *cqe, in mlx4_ib_handle_error_cqe() argument
514 if (cqe->syndrome == MLX4_CQE_SYNDROME_LOCAL_QP_OP_ERR) { in mlx4_ib_handle_error_cqe()
518 be32_to_cpu(cqe->my_qpn), be16_to_cpu(cqe->wqe_index), in mlx4_ib_handle_error_cqe()
519 cqe->vendor_err_syndrome, in mlx4_ib_handle_error_cqe()
520 cqe->owner_sr_opcode & ~MLX4_CQE_OWNER_MASK); in mlx4_ib_handle_error_cqe()
521 dump_cqe(cqe); in mlx4_ib_handle_error_cqe()
524 switch (cqe->syndrome) { in mlx4_ib_handle_error_cqe()
569 wc->vendor_err = cqe->vendor_err_syndrome; in mlx4_ib_handle_error_cqe()
582 unsigned tail, struct mlx4_cqe *cqe, int is_eth) in use_tunnel_data() argument
661 struct mlx4_cqe *cqe; in mlx4_ib_poll_one() local
674 cqe = next_cqe_sw(cq); in mlx4_ib_poll_one()
675 if (!cqe) in mlx4_ib_poll_one()
679 cqe++; in mlx4_ib_poll_one()
689 is_send = cqe->owner_sr_opcode & MLX4_CQE_IS_SEND_MASK; in mlx4_ib_poll_one()
690 is_error = (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == in mlx4_ib_poll_one()
694 if (unlikely((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == MLX4_CQE_OPCODE_RESIZE)) { in mlx4_ib_poll_one()
698 mlx4_ib_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); in mlx4_ib_poll_one()
700 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_poll_one()
710 (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_QPN_MASK) != (*cur_qp)->mqp.qpn) { in mlx4_ib_poll_one()
717 be32_to_cpu(cqe->vlan_my_qpn)); in mlx4_ib_poll_one()
725 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); in mlx4_ib_poll_one()
735 wqe_ctr = be16_to_cpu(cqe->wqe_index); in mlx4_ib_poll_one()
742 wqe_ctr = be16_to_cpu(cqe->wqe_index); in mlx4_ib_poll_one()
747 wqe_ctr = be16_to_cpu(cqe->wqe_index); in mlx4_ib_poll_one()
758 mlx4_ib_handle_error_cqe((struct mlx4_err_cqe *) cqe, wc); in mlx4_ib_poll_one()
766 switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) { in mlx4_ib_poll_one()
782 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
811 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
813 switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) { in mlx4_ib_poll_one()
817 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
822 wc->ex.invalidate_rkey = be32_to_cpu(cqe->immed_rss_invalid); in mlx4_ib_poll_one()
831 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
842 use_tunnel_data(*cur_qp, cq, wc, tail, cqe, in mlx4_ib_poll_one()
848 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); in mlx4_ib_poll_one()
852 wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f; in mlx4_ib_poll_one()
853 wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status, in mlx4_ib_poll_one()
854 cqe->badfcs_enc, in mlx4_ib_poll_one()
855 cqe->checksum) ? IB_WC_IP_CSUM_OK : 0; in mlx4_ib_poll_one()
858 wc->sl = be16_to_cpu(cqe->sl_vid) >> 13; in mlx4_ib_poll_one()
859 if (be32_to_cpu(cqe->vlan_my_qpn) & in mlx4_ib_poll_one()
861 wc->vlan_id = be16_to_cpu(cqe->sl_vid) & in mlx4_ib_poll_one()
866 memcpy(wc->smac, cqe->smac, ETH_ALEN); in mlx4_ib_poll_one()
869 wc->slid = be16_to_cpu(cqe->rlid); in mlx4_ib_poll_one()
870 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12; in mlx4_ib_poll_one()
920 struct mlx4_cqe *cqe, *dest; in __mlx4_ib_cq_clean() local
932 if (prod_index == cq->mcq.cons_index + cq->ibcq.cqe) in __mlx4_ib_cq_clean()
940 cqe = get_cqe(cq, prod_index & cq->ibcq.cqe); in __mlx4_ib_cq_clean()
941 cqe += cqe_inc; in __mlx4_ib_cq_clean()
943 if ((be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_QPN_MASK) == qpn) { in __mlx4_ib_cq_clean()
944 if (srq && !(cqe->owner_sr_opcode & MLX4_CQE_IS_SEND_MASK)) in __mlx4_ib_cq_clean()
945 mlx4_ib_free_srq_wqe(srq, be16_to_cpu(cqe->wqe_index)); in __mlx4_ib_cq_clean()
948 dest = get_cqe(cq, (prod_index + nfreed) & cq->ibcq.cqe); in __mlx4_ib_cq_clean()
952 memcpy(dest, cqe, sizeof *cqe); in __mlx4_ib_cq_clean()