net/mlx5: cache associated network device index
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>
Sun, 21 Jul 2019 14:56:40 +0000 (14:56 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:36 +0000 (14:31 +0200)
commitfa2e14d4921a2c4a1268231e72ccd73d1e7e58fc
tree97434700561cc9cf19bce71f8566b0cda2125400
parentcb9cb61e547b50552c82151b9a4aeefd5acda796
net/mlx5: cache associated network device index

The associated device index is retrieved via Netlink request to
underlying Infiniband device driver. This network device index
is permanent throughout the lifetime of device. We do not
spawn the rte_eth_dev ports without associated network device, and
if network device is being unbound we get the remove notification
message and rte_eth_dev port is also detached. So, we may store
the ifindex in mlx5_device_spawn() routine at rte_eth_dev port
creation and initialization time and use the cached value further
instead of doing actual Netlink request.

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/mlx5_ethdev.c