MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_import_device

Function mlx5_import_device

dpdk/drivers/common/mlx5/linux/mlx5_common_os.c:832–845  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

830 * Pointer to ibv_context on success, NULL otherwise and rte_errno is set.
831 */
832static struct ibv_context *
833mlx5_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.

Callers 1

mlx5_os_open_deviceFunction · 0.85

Calls 1

rte_strerrorFunction · 0.85

Tested by

no test coverage detected