* Allocate Protection Domain object. * * @param[out] cdev * Pointer to the mlx5 device. * * @return * 0 on success, a negative errno value otherwise. */
| 476 | * 0 on success, a negative errno value otherwise. |
| 477 | */ |
| 478 | static int |
| 479 | mlx5_os_pd_create(struct mlx5_common_device *cdev) |
| 480 | { |
| 481 | cdev->pd = mlx5_glue->alloc_pd(cdev->ctx); |
| 482 | if (cdev->pd == NULL) { |
| 483 | DRV_LOG(ERR, "Failed to allocate PD: %s", rte_strerror(errno)); |
| 484 | return errno ? -errno : -ENOMEM; |
| 485 | } |
| 486 | return 0; |
| 487 | } |
| 488 | |
| 489 | /** |
| 490 | * Import Protection Domain object according to given PD handle. |
no test coverage detected