summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_ethdev.c
diff options
context:
space:
mode:
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>2019-09-25 07:53:25 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-07 15:00:58 +0200
commit5cf5f710b057da7deaba6eefcc94048f9950926b (patch)
tree72d88f3edd1ff3144815bd829834317512ad20f2 /drivers/net/mlx5/mlx5_ethdev.c
parent46e10a4c1b87f08316702d2a43301199858f0597 (diff)
downloaddpdk-next-eventdev-5cf5f710b057da7deaba6eefcc94048f9950926b.zip
dpdk-next-eventdev-5cf5f710b057da7deaba6eefcc94048f9950926b.tar.gz
dpdk-next-eventdev-5cf5f710b057da7deaba6eefcc94048f9950926b.tar.xz
net/mlx5: update PCI address retrieving routine
The routine mlx5_ibv_device_to_pci_addr() takes Infiniband device list object, takes the device sysfs path from there and retrieves PCI address. The routine may be implemented in more generic way by taking sysfs path directly as parameter and can be used for getting PCI address of netdevs. The generic routine is renamed to mlx5_dev_to_pci_addr() Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_ethdev.c')
-rw-r--r--drivers/net/mlx5/mlx5_ethdev.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index ad53721..71f63ac 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -1131,10 +1131,10 @@ mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
}
/**
- * Get PCI information from struct ibv_device.
+ * Get PCI information by sysfs device path.
*
- * @param device
- * Pointer to Ethernet device structure.
+ * @param dev_path
+ * Pointer to device sysfs folder name.
* @param[out] pci_addr
* PCI bus address output buffer.
*
@@ -1142,12 +1142,12 @@ mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
* 0 on success, a negative errno value otherwise and rte_errno is set.
*/
int
-mlx5_ibv_device_to_pci_addr(const struct ibv_device *device,
- struct rte_pci_addr *pci_addr)
+mlx5_dev_to_pci_addr(const char *dev_path,
+ struct rte_pci_addr *pci_addr)
{
FILE *file;
char line[32];
- MKSTR(path, "%s/device/uevent", device->ibdev_path);
+ MKSTR(path, "%s/device/uevent", dev_path);
file = fopen(path, "rb");
if (file == NULL) {