[v3,1/1] net/mlx5: fix port down in link detection error branch
Checks
Commit Message
The port down state was not initialized in the error branch of link
detection when MLX NIC link status update failed (ret < 0).
This resulted in incorrect link state reporting, as the device
retained stale link status instead of reflecting the actual down
state under error conditions.
Fixes: 1256805dd54d ("net/mlx5: move Linux-specific functions")
Cc: stable@dpdk.org
Signed-off-by: Yang Xu <xu.yang3@zte.com.cn>
---
.mailmap | 1 +
drivers/net/mlx5/linux/mlx5_ethdev_os.c | 1 +
2 files changed, 2 insertions(+)
--
2.27.0
@@ -1891,3 +1891,4 @@ Zoltan Kiss <zoltan.kiss@schaman.hu> <zoltan.kiss@linaro.org>
Zorik Machulsky <zorik@amazon.com>
Zyta Szpak <zyta@marvell.com> <zr@semihalf.com>
Zyta Szpak <zyta@marvell.com> <zyta.szpak@semihalf.com>
+Yang Xu <xu.yang3@zte.com.cn>
@@ -504,6 +504,7 @@ mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete)
return -rte_errno;
}
} else if (ret < 0) {
+ memset(&dev->data->dev_link, 0, sizeof(dev->data->dev_link));
return ret;
}
} while (wait_to_complete || retry-- > 0);