[PATCH 1/1] net/mlx5/linux: set down if detect any anomaly
Yang Xu
xu.yang3 at zte.com.cn
Mon Aug 18 02:32:23 CEST 2025
MLX network interface card link detection will set the
interface to a down state upon detecting an anomaly.
Signed-off-by: Yang Xu <xu.yang3 at zte.com.cn>
---
.mailmap | 1 +
drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/.mailmap b/.mailmap
index 34a99f93a1..14d6ee93dd 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1891,3 +1891,4 @@ Zoltan Kiss <zoltan.kiss at schaman.hu> <zoltan.kiss at linaro.org>
Zorik Machulsky <zorik at amazon.com>
Zyta Szpak <zyta at marvell.com> <zr at semihalf.com>
Zyta Szpak <zyta at marvell.com> <zyta.szpak at semihalf.com>
+Yang Xu <xu.yang3 at zte.com.cn>
diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index 9daeda5435..364b024b77 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -486,6 +486,7 @@ mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete)
struct rte_eth_link dev_link;
time_t start_time = time(NULL);
int retry = MLX5_GET_LINK_STATUS_RETRY_COUNT;
+ memset(&dev_link, 0, sizeof(dev_link));
do {
ret = mlx5_link_update_unlocked_gs(dev, &dev_link);
@@ -504,6 +505,7 @@ mlx5_link_update(struct rte_eth_dev *dev, int wait_to_complete)
return -rte_errno;
}
} else if (ret < 0) {
+ dev->data->dev_link = dev_link;
return ret;
}
} while (wait_to_complete || retry-- > 0);
--
2.27.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20250818/653bae67/attachment.htm>
More information about the dev
mailing list