[dpdk-stable] [PATCH 25/33] net/mlx5: fix link status initialization

Shahaf Shuler shahafs at mellanox.com
Sun May 6 08:05:54 CEST 2018


[ upstream commit a85a606ca501296c81c4b3a5e6b359c7ad7e0a77 ]

Following commit 7ba5320baa32 ("net/mlx5: fix link status behavior")
The initial link status is no longer set as part of the port start.

When LSC interrupts are enabled, ethdev layer reads the link status
directly from the device data instead of using the PMD callback.
This may cause application to query the link as down while in fact it was
already up before the DPDK application start (and no interrupt to fix
it).

Fixes: 7ba5320baa32 ("net/mlx5: fix link status behavior")
Cc: stable at dpdk.org

Signed-off-by: Shahaf Shuler <shahafs at mellanox.com>
Acked-by: Yongseok Koh <yskoh at mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com>
---
 drivers/net/mlx5/mlx5.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index fc934b8018..fad367e850 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -928,6 +928,12 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		/* Bring Ethernet device up. */
 		DEBUG("forcing Ethernet interface up");
 		mlx5_set_link_up(eth_dev);
+		/*
+		 * Even though the interrupt handler is not installed yet,
+		 * interrupts will still trigger on the asyn_fd from
+		 * Verbs context returned by ibv_open_device().
+		 */
+		mlx5_link_update(eth_dev, 0);
 		/* Store device configuration on private structure. */
 		priv->config = config;
 		continue;
-- 
2.12.0



More information about the stable mailing list