Lines Matching refs:vcq

338 static void *get_cqe(struct mlx5_vdpa_cq *vcq, int n)  in get_cqe()  argument
340 return mlx5_frag_buf_get_wqe(&vcq->buf.fbc, n); in get_cqe()
343 static void cq_frag_buf_init(struct mlx5_vdpa_cq *vcq, struct mlx5_vdpa_cq_buf *buf) in cq_frag_buf_init() argument
350 cqe = get_cqe(vcq, i); in cq_frag_buf_init()
499 static int mlx5_vdpa_poll_one(struct mlx5_vdpa_cq *vcq) in mlx5_vdpa_poll_one() argument
503 cqe64 = next_cqe_sw(vcq); in mlx5_vdpa_poll_one()
507 vcq->mcq.cons_index++; in mlx5_vdpa_poll_one()
561 struct mlx5_vdpa_cq *vcq = &mvq->cq; in cq_create() local
569 err = mlx5_db_alloc(mdev, &vcq->db); in cq_create()
573 vcq->mcq.set_ci_db = vcq->db.db; in cq_create()
574 vcq->mcq.arm_db = vcq->db.db + 1; in cq_create()
575 vcq->mcq.cqe_sz = 64; in cq_create()
577 err = cq_frag_buf_alloc(ndev, &vcq->buf, num_ent); in cq_create()
581 cq_frag_buf_init(vcq, &vcq->buf); in cq_create()
584 MLX5_FLD_SZ_BYTES(create_cq_in, pas[0]) * vcq->buf.frag_buf.npages; in cq_create()
593 mlx5_fill_page_frag_array(&vcq->buf.frag_buf, pas); in cq_create()
596 MLX5_SET(cqc, cqc, log_page_size, vcq->buf.frag_buf.page_shift - MLX5_ADAPTER_PAGE_SHIFT); in cq_create()
609 MLX5_SET64(cqc, cqc, dbr_addr, vcq->db.dma); in cq_create()
611 err = mlx5_core_create_cq(mdev, &vcq->mcq, in, inlen, out, sizeof(out)); in cq_create()
615 vcq->mcq.comp = mlx5_vdpa_cq_comp; in cq_create()
616 vcq->cqe = num_ent; in cq_create()
617 vcq->mcq.set_ci_db = vcq->db.db; in cq_create()
618 vcq->mcq.arm_db = vcq->db.db + 1; in cq_create()
626 cq_frag_buf_free(ndev, &vcq->buf); in cq_create()
628 mlx5_db_free(ndev->mvdev.mdev, &vcq->db); in cq_create()
636 struct mlx5_vdpa_cq *vcq = &mvq->cq; in cq_destroy() local
638 if (mlx5_core_destroy_cq(mdev, &vcq->mcq)) { in cq_destroy()
639 mlx5_vdpa_warn(&ndev->mvdev, "destroy CQ 0x%x\n", vcq->mcq.cqn); in cq_destroy()
642 cq_frag_buf_free(ndev, &vcq->buf); in cq_destroy()
643 mlx5_db_free(ndev->mvdev.mdev, &vcq->db); in cq_destroy()