path: root/drivers/net/mlx4/mlx4.c
diff options
authorYongseok Koh <>2019-04-01 14:15:51 -0700
committerFerruh Yigit <>2019-04-05 17:45:22 +0200
commit099c2c5376131b3d352d70f8904e586c0e84651e (patch)
treeb2caff9034df247d5f7710ca2ebfb1ba988374da /drivers/net/mlx4/mlx4.c
parent2aac5b5d119f425964868a7e530e95d18af9e31c (diff)
net/mlx4: 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) becomes invalid if mlx4 supports secondary process. 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)]) Cc: Suggested-by: Raslan Darawsheh <> Signed-off-by: Yongseok Koh <> Acked-by: Shahaf Shuler <>
Diffstat (limited to 'drivers/net/mlx4/mlx4.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 5ef2e7f..bb6ab8e 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -753,11 +753,11 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
* handled by rte_intr_rx_ctl().
eth_dev->intr_handle = &priv->intr_handle;
- priv->dev = eth_dev;
+ priv->dev_data = eth_dev->data;
eth_dev->dev_ops = &mlx4_dev_ops;
/* Bring Ethernet device up. */
DEBUG("forcing Ethernet interface up");
- mlx4_dev_set_link_up(priv->dev);
+ mlx4_dev_set_link_up(eth_dev);
/* Update link status once if waiting for LSC. */
if (eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
mlx4_link_update(eth_dev, 0);