net/mlx5: add port representor awareness
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>
Tue, 10 Jul 2018 16:04:52 +0000 (18:04 +0200)
committerShahaf Shuler <shahafs@mellanox.com>
Wed, 11 Jul 2018 13:37:14 +0000 (15:37 +0200)
commit26c08b979d26b91ea3eb61f95ce335e4e4cff4a4
treebf78468b4a909975d2cd59917d193c01c1933ceb
parent681289345e50c801b9be7c6c1de2f9b619f757eb
net/mlx5: add port representor awareness

The current PCI probing method is not aware of Verbs port representors,
which appear as standard Verbs devices bound to the same PCI address and
cannot be distinguished.

Problem is that more often than not, the wrong Verbs device is used,
resulting in unexpected traffic.

This patch makes the driver discard representors to only use the master
device. If unable to identify it (e.g. kernel drivers not recent enough),
either:

- There is only one matching device which isn't identified as a
  representor, in that case use it.
- Otherwise log an error and do not probe the device.

(Patch based on prior work from Yuanhan Liu)

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Xueming Li <xuemingl@mellanox.com>
drivers/net/mlx5/Makefile
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/mlx5_nl.c