path: root/drivers/net/mlx5/mlx5_trigger.c
diff options
authorShahaf Shuler <>2018-01-25 18:04:28 +0200
committerFerruh Yigit <>2018-01-29 10:04:28 +0100
commite313ef4c2fe83509785ba195e75389d1ed6b6afb (patch)
treeb451b4c90b5533a617716969409a41ae90b72191 /drivers/net/mlx5/mlx5_trigger.c
parent5a29b9a35a7214e2e36764ea67e13d7573eb925a (diff)
net/mlx5: fix link state on device start
Following commit c7bf62255edf ("net/mlx5: fix handling link status event") the link state must be up in order for the burst function to be set on the device ops. As the link may take time to move between down and up state it is possible the rte_eth_dev_start call will return with wrong burst function (either null or the empty burst function). Fixing it by forcing the link to be up before returning from device start. In case the link is still not up after 5 seconds fail the function. In addition initialize the burst function on device probe to prevent crashes before the link is up. Fixes: c7bf62255edf ("net/mlx5: fix handling link status event") Cc: Signed-off-by: Shahaf Shuler <> Acked-by: Nelio Laranjeiro <>
Diffstat (limited to 'drivers/net/mlx5/mlx5_trigger.c')
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 827db2e..c5429e1 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -166,7 +166,13 @@ mlx5_dev_start(struct rte_eth_dev *dev)
/* Update link status and Tx/Rx callbacks for the first time. */
memset(&dev->data->dev_link, 0, sizeof(struct rte_eth_link));
- priv_link_update(priv, 1);
+ INFO("Forcing port %u link to be up", dev->data->port_id);
+ err = priv_force_link_status_change(priv, ETH_LINK_UP);
+ if (err) {
+ DEBUG("Failed to set port %u link to be up",
+ dev->data->port_id);
+ goto error;
+ }
priv_dev_interrupt_handler_install(priv, dev);
return 0;