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)
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>

No differences found