summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5.c
diff options
context:
space:
mode:
authorNelio Laranjeiro <nelio.laranjeiro@6wind.com>2018-07-24 10:36:45 +0200
committerThomas Monjalon <thomas@monjalon.net>2018-07-26 14:05:52 +0200
commitf872b4b99d2cb55933ff2172f5f6e346545bc27b (patch)
tree27ebd9b884f4f4dafcbe3675a2a61285d8286e1d /drivers/net/mlx5/mlx5.c
parent2bc98393ac3ab980557187257369ec436a8f9eeb (diff)
downloaddpdk-next-eventdev-f872b4b99d2cb55933ff2172f5f6e346545bc27b.zip
dpdk-next-eventdev-f872b4b99d2cb55933ff2172f5f6e346545bc27b.tar.gz
dpdk-next-eventdev-f872b4b99d2cb55933ff2172f5f6e346545bc27b.tar.xz
net/mlx5: fix representors detection
On systems where the required Netlink commands are not supported but Mellanox OFED is installed, representors information must be retrieved through sysfs. Fixes: 26c08b979d26 ("net/mlx5: add port representor awareness") Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5.c')
-rw-r--r--drivers/net/mlx5/mlx5.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 78a6922..a1c0ad7 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1330,7 +1330,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
* Netlink calls assuming kernel drivers are recent enough to
* support them.
*
- * In the event of identification failure through Netlink, either:
+ * In the event of identification failure through Netlink, try again
+ * through sysfs, then either:
*
* 1. No device matches (n == 0), complain and bail out.
* 2. A single IB device matches (n == 1) and is not a representor,
@@ -1349,7 +1350,9 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
if (nl_route < 0 ||
!list[i].ifindex ||
mlx5_nl_switch_info(nl_route, list[i].ifindex,
- &list[i].info)) {
+ &list[i].info) ||
+ ((!list[i].info.representor && !list[i].info.master) &&
+ mlx5_sysfs_switch_info(list[i].ifindex, &list[i].info))) {
list[i].ifindex = 0;
memset(&list[i].info, 0, sizeof(list[i].info));
continue;