/* SPDX-License-Identifier: BSD-3-Clause * Copyright 2015 6WIND S.A. * Copyright 2020 Mellanox Technologies, Ltd */ #include #include #include #include #include #include #include #include #include #include /* Verbs header. */ /* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */ #ifdef PEDANTIC #pragma GCC diagnostic ignored "-Wpedantic" #endif #include #ifdef PEDANTIC #pragma GCC diagnostic error "-Wpedantic" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "mlx5_defs.h" #include "mlx5.h" #include "mlx5_utils.h" #include "mlx5_rxtx.h" #include "mlx5_autoconf.h" #include "mlx5_mr.h" #include "mlx5_flow.h" #include "rte_pmd_mlx5.h" /** * Get ibv device name. Given an ibv_context pointer - return a * pointer to the corresponding device name. * * @param[in] ctx * Pointer to ibv context. * * @return * Pointer to device name if ctx is valid, NULL otherwise. */ const char * mlx5_os_get_ctx_device_name(void *ctx) { if (!ctx) return NULL; return ((struct ibv_context *)ctx)->device->name; } /** * Get ibv device path name. Given an ibv_context pointer - return a * pointer to the corresponding device path name. * * @param[in] ctx * Pointer to ibv context. * * @return * Pointer to device path name if ctx is valid, NULL otherwise. */ const char * mlx5_os_get_ctx_device_path(void *ctx) { if (!ctx) return NULL; return ((struct ibv_context *)ctx)->device->ibdev_path; }