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()
183 int entries = attr->cqe; in mlx4_ib_create_cq()
200 cq->ibcq.cqe = entries - 1; in mlx4_ib_create_cq()
286 mlx4_ib_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); in mlx4_ib_create_cq()
314 cq->resize_buf->cqe = entries - 1; in mlx4_alloc_resize_buf()
343 cq->resize_buf->cqe = entries - 1; in mlx4_alloc_resize_umem()
361 struct mlx4_cqe *cqe, *new_cqe; in mlx4_ib_cq_resize_copy_cqes() local
367 cqe = get_cqe(cq, i & cq->ibcq.cqe); in mlx4_ib_cq_resize_copy_cqes()
368 cqe += cqe_inc; in mlx4_ib_cq_resize_copy_cqes()
370 while ((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) != MLX4_CQE_OPCODE_RESIZE) { in mlx4_ib_cq_resize_copy_cqes()
372 (i + 1) & cq->resize_buf->cqe); in mlx4_ib_cq_resize_copy_cqes()
373 memcpy(new_cqe, get_cqe(cq, i & cq->ibcq.cqe), cqe_size); in mlx4_ib_cq_resize_copy_cqes()
376 new_cqe->owner_sr_opcode = (cqe->owner_sr_opcode & ~MLX4_CQE_OWNER_MASK) | in mlx4_ib_cq_resize_copy_cqes()
377 (((i + 1) & (cq->resize_buf->cqe + 1)) ? MLX4_CQE_OWNER_MASK : 0); in mlx4_ib_cq_resize_copy_cqes()
378 cqe = get_cqe(cq, ++i & cq->ibcq.cqe); in mlx4_ib_cq_resize_copy_cqes()
379 cqe += cqe_inc; in mlx4_ib_cq_resize_copy_cqes()
399 if (entries == ibcq->cqe + 1) { in mlx4_ib_resize_cq()
435 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_resize_cq()
450 tmp_cqe = cq->ibcq.cqe; in mlx4_ib_resize_cq()
452 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_resize_cq()
469 cq->resize_buf->cqe); in mlx4_ib_resize_cq()
498 mlx4_ib_free_cq_buf(dev, &mcq->buf, cq->cqe); in mlx4_ib_destroy_cq()
505 static void dump_cqe(void *cqe) in dump_cqe() argument
507 __be32 *buf = cqe; in dump_cqe()
509 pr_debug("CQE contents %08x %08x %08x %08x %08x %08x %08x %08x\n", in dump_cqe()
515 static void mlx4_ib_handle_error_cqe(struct mlx4_err_cqe *cqe, in mlx4_ib_handle_error_cqe() argument
518 if (cqe->syndrome == MLX4_CQE_SYNDROME_LOCAL_QP_OP_ERR) { in mlx4_ib_handle_error_cqe()
522 be32_to_cpu(cqe->my_qpn), be16_to_cpu(cqe->wqe_index), in mlx4_ib_handle_error_cqe()
523 cqe->vendor_err_syndrome, in mlx4_ib_handle_error_cqe()
524 cqe->owner_sr_opcode & ~MLX4_CQE_OWNER_MASK); in mlx4_ib_handle_error_cqe()
525 dump_cqe(cqe); in mlx4_ib_handle_error_cqe()
528 switch (cqe->syndrome) { in mlx4_ib_handle_error_cqe()
573 wc->vendor_err = cqe->vendor_err_syndrome; in mlx4_ib_handle_error_cqe()
586 unsigned tail, struct mlx4_cqe *cqe, int is_eth) in use_tunnel_data() argument
665 struct mlx4_cqe *cqe; in mlx4_ib_poll_one() local
678 cqe = next_cqe_sw(cq); in mlx4_ib_poll_one()
679 if (!cqe) in mlx4_ib_poll_one()
683 cqe++; in mlx4_ib_poll_one()
693 is_send = cqe->owner_sr_opcode & MLX4_CQE_IS_SEND_MASK; in mlx4_ib_poll_one()
694 is_error = (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == in mlx4_ib_poll_one()
698 if (unlikely((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == MLX4_CQE_OPCODE_RESIZE)) { in mlx4_ib_poll_one()
702 mlx4_ib_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); in mlx4_ib_poll_one()
704 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_poll_one()
714 (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_QPN_MASK) != (*cur_qp)->mqp.qpn) { in mlx4_ib_poll_one()
721 be32_to_cpu(cqe->vlan_my_qpn)); in mlx4_ib_poll_one()
729 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); in mlx4_ib_poll_one()
739 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()
751 wqe_ctr = be16_to_cpu(cqe->wqe_index); in mlx4_ib_poll_one()
762 mlx4_ib_handle_error_cqe((struct mlx4_err_cqe *) cqe, wc); in mlx4_ib_poll_one()
770 switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) { in mlx4_ib_poll_one()
786 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
815 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
817 switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) { in mlx4_ib_poll_one()
821 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
826 wc->ex.invalidate_rkey = be32_to_cpu(cqe->immed_rss_invalid); in mlx4_ib_poll_one()
835 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
846 use_tunnel_data(*cur_qp, cq, wc, tail, cqe, in mlx4_ib_poll_one()
852 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); in mlx4_ib_poll_one()
856 wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f; in mlx4_ib_poll_one()
857 wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status, in mlx4_ib_poll_one()
858 cqe->badfcs_enc, in mlx4_ib_poll_one()
859 cqe->checksum) ? IB_WC_IP_CSUM_OK : 0; in mlx4_ib_poll_one()
862 wc->sl = be16_to_cpu(cqe->sl_vid) >> 13; in mlx4_ib_poll_one()
863 if (be32_to_cpu(cqe->vlan_my_qpn) & in mlx4_ib_poll_one()
865 wc->vlan_id = be16_to_cpu(cqe->sl_vid) & in mlx4_ib_poll_one()
870 memcpy(wc->smac, cqe->smac, ETH_ALEN); in mlx4_ib_poll_one()
873 wc->slid = be16_to_cpu(cqe->rlid); in mlx4_ib_poll_one()
874 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12; in mlx4_ib_poll_one()
924 struct mlx4_cqe *cqe, *dest; in __mlx4_ib_cq_clean() local
936 if (prod_index == cq->mcq.cons_index + cq->ibcq.cqe) in __mlx4_ib_cq_clean()
944 cqe = get_cqe(cq, prod_index & cq->ibcq.cqe); in __mlx4_ib_cq_clean()
945 cqe += cqe_inc; in __mlx4_ib_cq_clean()
947 if ((be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_QPN_MASK) == qpn) { in __mlx4_ib_cq_clean()
948 if (srq && !(cqe->owner_sr_opcode & MLX4_CQE_IS_SEND_MASK)) in __mlx4_ib_cq_clean()
949 mlx4_ib_free_srq_wqe(srq, be16_to_cpu(cqe->wqe_index)); in __mlx4_ib_cq_clean()
952 dest = get_cqe(cq, (prod_index + nfreed) & cq->ibcq.cqe); in __mlx4_ib_cq_clean()
956 memcpy(dest, cqe, sizeof *cqe); in __mlx4_ib_cq_clean()