common/mlx5: fix device list operations concurrency
[dpdk.git] / drivers / common / mlx5 / mlx5_common.h
index e073039..a772371 100644 (file)
@@ -10,6 +10,7 @@
 #include <rte_pci.h>
 #include <rte_debug.h>
 #include <rte_atomic.h>
+#include <rte_rwlock.h>
 #include <rte_log.h>
 #include <rte_kvargs.h>
 #include <rte_devargs.h>
@@ -206,6 +207,20 @@ check_cqe(volatile struct mlx5_cqe *cqe, const uint16_t cqes_n,
        return MLX5_CQE_STATUS_SW_OWN;
 }
 
+/*
+ * Get PCI address <DBDF> string from EAL device.
+ *
+ * @param[out] addr
+ *     The output address buffer string
+ * @param[in] size
+ *     The output buffer size
+ * @return
+ *   - 0 on success.
+ *   - Negative value and rte_errno is set otherwise.
+ */
+__rte_internal
+int mlx5_dev_to_pci_str(const struct rte_device *dev, char *addr, size_t size);
+
 /*
  * Get PCI address from sysfs of a PCI-related device.
  *
@@ -220,7 +235,7 @@ check_cqe(volatile struct mlx5_cqe *cqe, const uint16_t cqes_n,
  *   - Negative value and rte_errno is set otherwise.
  */
 __rte_internal
-int mlx5_dev_to_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr);
+int mlx5_get_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr);
 
 /*
  * Get kernel network interface name from sysfs IB device path.