Lines Matching refs:vqp
367 static void rx_post(struct mlx5_vdpa_qp *vqp, int n) in rx_post() argument
369 vqp->head += n; in rx_post()
370 vqp->db.db[0] = cpu_to_be32(vqp->head); in rx_post()
376 struct mlx5_vdpa_qp *vqp; in qp_prepare() local
380 vqp = fw ? &mvq->fwqp : &mvq->vqqp; in qp_prepare()
383 if (vqp->fw) { in qp_prepare()
398 MLX5_SET(qpc, qpc, log_page_size, vqp->frag_buf.page_shift - MLX5_ADAPTER_PAGE_SHIFT); in qp_prepare()
404 mlx5_fill_page_frag_array(&vqp->frag_buf, pas); in qp_prepare()
407 static int rq_buf_alloc(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_qp *vqp, u32 num_ent) in rq_buf_alloc() argument
410 num_ent * sizeof(struct mlx5_wqe_data_seg), &vqp->frag_buf, in rq_buf_alloc()
414 static void rq_buf_free(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_qp *vqp) in rq_buf_free() argument
416 mlx5_frag_buf_free(ndev->mvdev.mdev, &vqp->frag_buf); in rq_buf_free()
420 struct mlx5_vdpa_qp *vqp) in qp_create() argument
429 if (!vqp->fw) { in qp_create()
430 vqp = &mvq->vqqp; in qp_create()
431 err = rq_buf_alloc(ndev, vqp, mvq->num_ent); in qp_create()
435 err = mlx5_db_alloc(ndev->mvdev.mdev, &vqp->db); in qp_create()
438 inlen += vqp->frag_buf.npages * sizeof(__be64); in qp_create()
447 qp_prepare(ndev, vqp->fw, in, mvq, mvq->num_ent); in qp_create()
453 if (!vqp->fw) in qp_create()
454 MLX5_SET64(qpc, qpc, dbr_addr, vqp->db.dma); in qp_create()
461 vqp->mqp.uid = ndev->mvdev.res.uid; in qp_create()
462 vqp->mqp.qpn = MLX5_GET(create_qp_out, out, qpn); in qp_create()
464 if (!vqp->fw) in qp_create()
465 rx_post(vqp, mvq->num_ent); in qp_create()
470 if (!vqp->fw) in qp_create()
471 mlx5_db_free(ndev->mvdev.mdev, &vqp->db); in qp_create()
473 if (!vqp->fw) in qp_create()
474 rq_buf_free(ndev, vqp); in qp_create()
479 static void qp_destroy(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_qp *vqp) in qp_destroy() argument
484 MLX5_SET(destroy_qp_in, in, qpn, vqp->mqp.qpn); in qp_destroy()
487 mlx5_vdpa_warn(&ndev->mvdev, "destroy qp 0x%x\n", vqp->mqp.qpn); in qp_destroy()
488 if (!vqp->fw) { in qp_destroy()
489 mlx5_db_free(ndev->mvdev.mdev, &vqp->db); in qp_destroy()
490 rq_buf_free(ndev, vqp); in qp_destroy()