Lines Matching refs:cdev
459 mlx5_os_pd_release(struct mlx5_common_device *cdev) in mlx5_os_pd_release() argument
461 if (cdev->config.pd_handle == MLX5_ARG_UNSET) in mlx5_os_pd_release()
462 return mlx5_glue->dealloc_pd(cdev->pd); in mlx5_os_pd_release()
464 return mlx5_glue->unimport_pd(cdev->pd); in mlx5_os_pd_release()
477 mlx5_os_pd_create(struct mlx5_common_device *cdev) in mlx5_os_pd_create() argument
479 cdev->pd = mlx5_glue->alloc_pd(cdev->ctx); in mlx5_os_pd_create()
480 if (cdev->pd == NULL) { in mlx5_os_pd_create()
497 mlx5_os_pd_import(struct mlx5_common_device *cdev) in mlx5_os_pd_import() argument
499 cdev->pd = mlx5_glue->import_pd(cdev->ctx, cdev->config.pd_handle); in mlx5_os_pd_import()
500 if (cdev->pd == NULL) { in mlx5_os_pd_import()
502 cdev->config.pd_handle, rte_strerror(errno)); in mlx5_os_pd_import()
518 mlx5_os_pd_prepare(struct mlx5_common_device *cdev) in mlx5_os_pd_prepare() argument
526 if (cdev->config.pd_handle == MLX5_ARG_UNSET) in mlx5_os_pd_prepare()
527 ret = mlx5_os_pd_create(cdev); in mlx5_os_pd_prepare()
529 ret = mlx5_os_pd_import(cdev); in mlx5_os_pd_prepare()
534 if (cdev->config.devx == 0) in mlx5_os_pd_prepare()
537 obj.pd.in = cdev->pd; in mlx5_os_pd_prepare()
543 claim_zero(mlx5_os_pd_release(cdev)); in mlx5_os_pd_prepare()
544 cdev->pd = NULL; in mlx5_os_pd_prepare()
547 cdev->pdn = pd_info.pdn; in mlx5_os_pd_prepare()
775 mlx5_open_device(struct mlx5_common_device *cdev, uint32_t classes) in mlx5_open_device() argument
781 MLX5_ASSERT(cdev->config.device_fd == MLX5_ARG_UNSET); in mlx5_open_device()
783 ibv = mlx5_vdpa_get_ibv_dev(cdev->dev); in mlx5_open_device()
785 ibv = mlx5_os_get_ibv_dev(cdev->dev); in mlx5_open_device()
794 dbmap_env = mlx5_config_doorbell_mapping_env(cdev->config.dbnc); in mlx5_open_device()
799 cdev->config.devx = 1; in mlx5_open_device()
829 mlx5_import_device(struct mlx5_common_device *cdev) in mlx5_import_device() argument
833 MLX5_ASSERT(cdev->config.device_fd != MLX5_ARG_UNSET); in mlx5_import_device()
834 ctx = mlx5_glue->import_device(cdev->config.device_fd); in mlx5_import_device()
837 cdev->config.device_fd, rte_strerror(errno)); in mlx5_import_device()
855 mlx5_os_open_device(struct mlx5_common_device *cdev, uint32_t classes) in mlx5_os_open_device() argument
860 if (cdev->config.device_fd == MLX5_ARG_UNSET) in mlx5_os_open_device()
861 ctx = mlx5_open_device(cdev, classes); in mlx5_os_open_device()
863 ctx = mlx5_import_device(cdev); in mlx5_os_open_device()
867 mlx5_set_context_attr(cdev->dev, ctx); in mlx5_os_open_device()
868 cdev->ctx = ctx; in mlx5_os_open_device()