net/mlx5: add representor recognition on Linux 5.x
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>
Wed, 27 Mar 2019 13:15:35 +0000 (13:15 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 29 Mar 2019 16:25:32 +0000 (17:25 +0100)
commit299d7dc28c37afc459a802f6f1ef9ece9f9c0a0c
tree5b3e3a748f0f2780ad3f35b69fd1c47e4a23e59e
parentbc5560c15e74d66b019b4bbbd5573519b0a462c3
net/mlx5: add representor recognition on Linux 5.x

The master device and VF representors were distinguished by
presence of port name, master device did not have one. The new Linux
kernels starting from 5.0 provide the port name for master device
and the implemented representor recognizing method does not work.
The new recognizing method is based on querying the VF number,
has been created on the base of the device.

The IFLA_NUM_VF attribute is returned by kernel if IFLA_EXT_MASK
attribute is specified in the Netlink request message.

Also the presence check of device symlink in device sysfs folder
is added to distinguish representors with sysfs based method.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
drivers/net/mlx5/Makefile
drivers/net/mlx5/meson.build
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/mlx5_ethdev.c
drivers/net/mlx5/mlx5_nl.c