Lines Matching refs:cqe
80 struct mlx4_cqe *cqe = get_cqe(cq, n & cq->ibcq.cqe); in get_sw_cqe() local
81 struct mlx4_cqe *tcqe = ((cq->buf.entry_size == 64) ? (cqe + 1) : cqe); in get_sw_cqe()
84 !!(n & (cq->ibcq.cqe + 1))) ? NULL : cqe; in get_sw_cqe()
132 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
134 mlx4_buf_free(dev->dev, (cqe + 1) * buf->entry_size, &buf->buf); in mlx4_ib_free_cq_buf()
139 u64 buf_addr, int cqe) in mlx4_ib_get_cq_umem() argument
144 *umem = ib_umem_get(context, buf_addr, cqe * cqe_size, in mlx4_ib_get_cq_umem()
186 cq->ibcq.cqe = entries - 1; in mlx4_ib_create_cq()
262 mlx4_ib_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); in mlx4_ib_create_cq()
293 cq->resize_buf->cqe = entries - 1; in mlx4_alloc_resize_buf()
322 cq->resize_buf->cqe = entries - 1; in mlx4_alloc_resize_umem()
340 struct mlx4_cqe *cqe, *new_cqe; in mlx4_ib_cq_resize_copy_cqes() local
346 cqe = get_cqe(cq, i & cq->ibcq.cqe); in mlx4_ib_cq_resize_copy_cqes()
347 cqe += cqe_inc; in mlx4_ib_cq_resize_copy_cqes()
349 while ((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) != MLX4_CQE_OPCODE_RESIZE) { in mlx4_ib_cq_resize_copy_cqes()
351 (i + 1) & cq->resize_buf->cqe); in mlx4_ib_cq_resize_copy_cqes()
352 memcpy(new_cqe, get_cqe(cq, i & cq->ibcq.cqe), cqe_size); in mlx4_ib_cq_resize_copy_cqes()
355 new_cqe->owner_sr_opcode = (cqe->owner_sr_opcode & ~MLX4_CQE_OWNER_MASK) | in mlx4_ib_cq_resize_copy_cqes()
356 (((i + 1) & (cq->resize_buf->cqe + 1)) ? MLX4_CQE_OWNER_MASK : 0); in mlx4_ib_cq_resize_copy_cqes()
357 cqe = get_cqe(cq, ++i & cq->ibcq.cqe); in mlx4_ib_cq_resize_copy_cqes()
358 cqe += cqe_inc; in mlx4_ib_cq_resize_copy_cqes()
378 if (entries == ibcq->cqe + 1) { in mlx4_ib_resize_cq()
414 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_resize_cq()
429 tmp_cqe = cq->ibcq.cqe; in mlx4_ib_resize_cq()
431 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_resize_cq()
448 cq->resize_buf->cqe); in mlx4_ib_resize_cq()
476 mlx4_ib_free_cq_buf(dev, &mcq->buf, cq->cqe); in mlx4_ib_destroy_cq()
485 static void dump_cqe(void *cqe) in dump_cqe() argument
487 __be32 *buf = cqe; in dump_cqe()
495 static void mlx4_ib_handle_error_cqe(struct mlx4_err_cqe *cqe, in mlx4_ib_handle_error_cqe() argument
498 if (cqe->syndrome == MLX4_CQE_SYNDROME_LOCAL_QP_OP_ERR) { in mlx4_ib_handle_error_cqe()
502 be32_to_cpu(cqe->my_qpn), be16_to_cpu(cqe->wqe_index), in mlx4_ib_handle_error_cqe()
503 cqe->vendor_err_syndrome, in mlx4_ib_handle_error_cqe()
504 cqe->owner_sr_opcode & ~MLX4_CQE_OWNER_MASK); in mlx4_ib_handle_error_cqe()
505 dump_cqe(cqe); in mlx4_ib_handle_error_cqe()
508 switch (cqe->syndrome) { in mlx4_ib_handle_error_cqe()
553 wc->vendor_err = cqe->vendor_err_syndrome; in mlx4_ib_handle_error_cqe()
571 unsigned tail, struct mlx4_cqe *cqe, int is_eth) in use_tunnel_data() argument
651 struct mlx4_cqe *cqe; in mlx4_ib_poll_one() local
664 cqe = next_cqe_sw(cq); in mlx4_ib_poll_one()
665 if (!cqe) in mlx4_ib_poll_one()
669 cqe++; in mlx4_ib_poll_one()
679 is_send = cqe->owner_sr_opcode & MLX4_CQE_IS_SEND_MASK; in mlx4_ib_poll_one()
680 is_error = (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == in mlx4_ib_poll_one()
683 if (unlikely((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == MLX4_OPCODE_NOP && in mlx4_ib_poll_one()
690 if (unlikely((cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) == MLX4_CQE_OPCODE_RESIZE)) { in mlx4_ib_poll_one()
694 mlx4_ib_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); in mlx4_ib_poll_one()
696 cq->ibcq.cqe = cq->resize_buf->cqe; in mlx4_ib_poll_one()
706 (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_QPN_MASK) != (*cur_qp)->mqp.qpn) { in mlx4_ib_poll_one()
713 be32_to_cpu(cqe->vlan_my_qpn)); in mlx4_ib_poll_one()
716 cq->mcq.cqn, be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_QPN_MASK); in mlx4_ib_poll_one()
727 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); in mlx4_ib_poll_one()
742 wqe_ctr = be16_to_cpu(cqe->wqe_index); in mlx4_ib_poll_one()
749 wqe_ctr = be16_to_cpu(cqe->wqe_index); in mlx4_ib_poll_one()
754 wqe_ctr = be16_to_cpu(cqe->wqe_index); in mlx4_ib_poll_one()
765 mlx4_ib_handle_error_cqe((struct mlx4_err_cqe *) cqe, wc); in mlx4_ib_poll_one()
773 switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) { in mlx4_ib_poll_one()
787 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
819 wc->byte_len = be32_to_cpu(cqe->byte_cnt); in mlx4_ib_poll_one()
821 switch (cqe->owner_sr_opcode & MLX4_CQE_OPCODE_MASK) { in mlx4_ib_poll_one()
825 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
830 wc->ex.invalidate_rkey = be32_to_cpu(cqe->immed_rss_invalid); in mlx4_ib_poll_one()
839 wc->ex.imm_data = cqe->immed_rss_invalid; in mlx4_ib_poll_one()
851 cqe, is_eth); in mlx4_ib_poll_one()
854 wc->slid = be16_to_cpu(cqe->rlid); in mlx4_ib_poll_one()
855 g_mlpath_rqpn = be32_to_cpu(cqe->g_mlpath_rqpn); in mlx4_ib_poll_one()
859 wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f; in mlx4_ib_poll_one()
860 wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status, in mlx4_ib_poll_one()
861 cqe->checksum) ? IB_WC_IP_CSUM_OK : 0; in mlx4_ib_poll_one()
863 wc->sl = be16_to_cpu(cqe->sl_vid) >> 13; in mlx4_ib_poll_one()
864 if (be32_to_cpu(cqe->vlan_my_qpn) & in mlx4_ib_poll_one()
866 wc->vlan_id = be16_to_cpu(cqe->sl_vid) & in mlx4_ib_poll_one()
871 memcpy(wc->smac, cqe->smac, ETH_ALEN); in mlx4_ib_poll_one()
874 wc->sl = be16_to_cpu(cqe->sl_vid) >> 12; in mlx4_ib_poll_one()
929 struct mlx4_cqe *cqe, *dest; in __mlx4_ib_cq_clean() local
941 if (prod_index == cq->mcq.cons_index + cq->ibcq.cqe) in __mlx4_ib_cq_clean()
949 cqe = get_cqe(cq, prod_index & cq->ibcq.cqe); in __mlx4_ib_cq_clean()
950 cqe += cqe_inc; in __mlx4_ib_cq_clean()
952 if ((be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_QPN_MASK) == qpn) { in __mlx4_ib_cq_clean()
953 if (srq && !(cqe->owner_sr_opcode & MLX4_CQE_IS_SEND_MASK)) in __mlx4_ib_cq_clean()
954 mlx4_ib_free_srq_wqe(srq, be16_to_cpu(cqe->wqe_index)); in __mlx4_ib_cq_clean()
957 dest = get_cqe(cq, (prod_index + nfreed) & cq->ibcq.cqe); in __mlx4_ib_cq_clean()
961 memcpy(dest, cqe, sizeof *cqe); in __mlx4_ib_cq_clean()