summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_trigger.c
diff options
context:
space:
mode:
authorShahaf Shuler <shahafs@mellanox.com>2018-01-25 18:04:28 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2018-01-29 10:04:28 +0100
commite313ef4c2fe83509785ba195e75389d1ed6b6afb (patch)
treeb451b4c90b5533a617716969409a41ae90b72191 /drivers/net/mlx5/mlx5_trigger.c
parent5a29b9a35a7214e2e36764ea67e13d7573eb925a (diff)
downloaddpdk-e313ef4c2fe83509785ba195e75389d1ed6b6afb.zip
dpdk-e313ef4c2fe83509785ba195e75389d1ed6b6afb.tar.gz
dpdk-e313ef4c2fe83509785ba195e75389d1ed6b6afb.tar.xz
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: stable@dpdk.org Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_trigger.c')
-rw-r--r--drivers/net/mlx5/mlx5_trigger.c8
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)
priv_xstats_init(priv);
/* 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);
priv_unlock(priv);
return 0;