[0/2] net/mlx5: cache the associated network device ifindex
mbox series

Message ID 1563514305-27405-1-git-send-email-viacheslavo@mellanox.com
Headers show
Series
  • net/mlx5: cache the associated network device ifindex
Related show

Message

Slava Ovsiienko July 19, 2019, 5:31 a.m. UTC
In mlx5 PMD 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 event 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.

This approach allows the query API routines like mlx5_link_update to be
thread-safe due to Netlink request elimination. mlx5_link_update() may
be called in asynchronous event handler concurrently and it may cause
application hang.

This patch extends and updates the [1]. 

[1] http://patches.dpdk.org/patch/56417/

Proposed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>

Viacheslav Ovsiienko (2):
  net/mlx5: cache the associated network device ifindex
  Revert "net/mlx5: fix master device Netlink socket sharing"

 drivers/net/mlx5/mlx5.c        |  11 ++++
 drivers/net/mlx5/mlx5.h        |   7 +--
 drivers/net/mlx5/mlx5_ethdev.c | 128 ++++-------------------------------------
 3 files changed, 22 insertions(+), 124 deletions(-)