* Function API to import IB device. * * @param cdev * Pointer to the mlx5 device. * * @return * Pointer to ibv_context on success, NULL otherwise and rte_errno is set. */
| 830 | * Pointer to ibv_context on success, NULL otherwise and rte_errno is set. |
| 831 | */ |
| 832 | static struct ibv_context * |
| 833 | mlx5_import_device(struct mlx5_common_device *cdev) |
| 834 | { |
| 835 | struct ibv_context *ctx = NULL; |
| 836 | |
| 837 | MLX5_ASSERT(cdev->config.device_fd != MLX5_ARG_UNSET); |
| 838 | ctx = mlx5_glue->import_device(cdev->config.device_fd); |
| 839 | if (!ctx) { |
| 840 | DRV_LOG(ERR, "Failed to import device for fd=%d: %s", |
| 841 | cdev->config.device_fd, rte_strerror(errno)); |
| 842 | rte_errno = errno; |
| 843 | } |
| 844 | return ctx; |
| 845 | } |
| 846 | |
| 847 | /** |
| 848 | * Function API to prepare IB device. |
no test coverage detected