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

Function mlx5_os_open_device

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

* Function API to prepare IB device. * * @param cdev * Pointer to the mlx5 device. * @param classes * Chosen classes come from device arguments. * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

856 * 0 on success, a negative errno value otherwise and rte_errno is set.
857 */
858int
859mlx5_os_open_device(struct mlx5_common_device *cdev, uint32_t classes)
860{
861
862 struct ibv_context *ctx = NULL;
863
864 if (cdev->config.device_fd == MLX5_ARG_UNSET)
865 ctx = mlx5_open_device(cdev, classes);
866 else
867 ctx = mlx5_import_device(cdev);
868 if (ctx == NULL)
869 return -rte_errno;
870 /* Hint libmlx5 to use PMD allocator for data plane resources */
871 mlx5_set_context_attr(cdev->dev, ctx);
872 cdev->ctx = ctx;
873 return 0;
874}
875
876int
877mlx5_get_device_guid(const struct rte_pci_addr *dev, uint8_t *guid, size_t len)

Callers 1

Calls 3

mlx5_open_deviceFunction · 0.85
mlx5_import_deviceFunction · 0.85
mlx5_set_context_attrFunction · 0.85

Tested by

no test coverage detected