net/mlx5: change device reference for secondary process
authorYongseok Koh <yskoh@mellanox.com>
Wed, 9 May 2018 11:04:50 +0000 (04:04 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:31:51 +0000 (22:31 +0100)
commitdf428ceef4fdbceacda8d50341c25ddd46a76a39
tree22f0275c40b0130593b4b1c6f20ebb633af0e577
parentce07b1514d5961baf59ead7d030b522eb06ea527
net/mlx5: change device reference for secondary process

rte_eth_devices[] is not shared between primary and secondary process, but
a static array to each process. The reverse pointer of device (priv->dev)
is invalid. Instead, priv has the pointer to shared data of the device,
  struct rte_eth_dev_data *dev_data;

Two macros are added,
  #define PORT_ID(priv) ((priv)->dev_data->port_id)
  #define ETH_DEV(priv) (&rte_eth_devices[PORT_ID(priv)])

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_mr.c
drivers/net/mlx5/mlx5_rxq.c
drivers/net/mlx5/mlx5_txq.c