[dpdk-dev] [PATCH 0/2] net/mlx5: cache the associated network device ifindex

Viacheslav Ovsiienko viacheslavo at mellanox.com
Fri Jul 19 07:31:43 CEST 2019


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 at networkplumber.org>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo at 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(-)

-- 
1.8.3.1



More information about the dev mailing list