1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2015 6WIND S.A.
3 * Copyright 2020 Mellanox Technologies, Ltd
14 #include <linux/rtnetlink.h>
18 /* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
20 #pragma GCC diagnostic ignored "-Wpedantic"
22 #include <infiniband/verbs.h>
24 #pragma GCC diagnostic error "-Wpedantic"
27 #include <rte_malloc.h>
28 #include <rte_ethdev_driver.h>
29 #include <rte_ethdev_pci.h>
31 #include <rte_bus_pci.h>
32 #include <rte_common.h>
33 #include <rte_kvargs.h>
34 #include <rte_rwlock.h>
35 #include <rte_spinlock.h>
36 #include <rte_string_fns.h>
37 #include <rte_alarm.h>
39 #include <mlx5_glue.h>
40 #include <mlx5_devx_cmds.h>
41 #include <mlx5_common.h>
43 #include "mlx5_defs.h"
45 #include "mlx5_utils.h"
46 #include "mlx5_rxtx.h"
47 #include "mlx5_autoconf.h"
49 #include "mlx5_flow.h"
50 #include "rte_pmd_mlx5.h"
53 * Get ibv device name. Given an ibv_context pointer - return a
54 * pointer to the corresponding device name.
57 * Pointer to ibv context.
60 * Pointer to device name if ctx is valid, NULL otherwise.
63 mlx5_os_get_ctx_device_name(void *ctx)
67 return ((struct ibv_context *)ctx)->device->name;
71 * Get ibv device path name. Given an ibv_context pointer - return a
72 * pointer to the corresponding device path name.
75 * Pointer to ibv context.
78 * Pointer to device path name if ctx is valid, NULL otherwise.
81 mlx5_os_get_ctx_device_path(void *ctx)
86 return ((struct ibv_context *)ctx)->device->ibdev_path;