net/mlx4: fix crash on info query in secondary process
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 12 Jul 2019 20:54:24 +0000 (13:54 -0700)
committerRaslan Darawsheh <rasland@mellanox.com>
Tue, 6 Aug 2019 15:42:12 +0000 (17:42 +0200)
commit164cad78b040122eac581a905a466bd22e7e66b8
tree1318d3f3ba3b5c758c9442b57308de0970398749
parent20215627cd5268a90c309cc91ee08b9e95c2c107
net/mlx4: fix crash on info query in secondary process

mlx4_dev_info_get calls mlx4_get_ifname, but mlx4_get_ifname
uses priv->ctx which is not a valid pointer in a secondary
process. The fix is to cache the value in primary.

In the primary process, get and store the interface index of
the device so that secondary process can see it.

Bugzilla ID: 320
Fixes: 61cbdd419478 ("net/mlx4: separate device control functions")
Cc: stable@dpdk.org
Reported-by: Suyang Ju <sju@paloaltonetworks.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx4/mlx4.c
drivers/net/mlx4/mlx4.h
drivers/net/mlx4/mlx4_ethdev.c