summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5.h
diff options
context:
space:
mode:
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>2019-07-21 14:56:40 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-07-23 14:31:36 +0200
commitfa2e14d4921a2c4a1268231e72ccd73d1e7e58fc (patch)
tree97434700561cc9cf19bce71f8566b0cda2125400 /drivers/net/mlx5/mlx5.h
parentcb9cb61e547b50552c82151b9a4aeefd5acda796 (diff)
downloaddpdk-fa2e14d4921a2c4a1268231e72ccd73d1e7e58fc.zip
dpdk-fa2e14d4921a2c4a1268231e72ccd73d1e7e58fc.tar.gz
dpdk-fa2e14d4921a2c4a1268231e72ccd73d1e7e58fc.tar.xz
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>
Diffstat (limited to 'drivers/net/mlx5/mlx5.h')
-rw-r--r--drivers/net/mlx5/mlx5.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 7aad94d..5fe3cf9 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -466,6 +466,7 @@ struct mlx5_priv {
uint16_t domain_id; /* Switch domain identifier. */
uint16_t vport_id; /* Associated VF vport index (if any). */
int32_t representor_id; /* Port representor identifier. */
+ unsigned int if_index; /* Associated kernel network device index. */
/* RX/TX queues. */
unsigned int rxqs_n; /* RX queues array size. */
unsigned int txqs_n; /* TX queues array size. */