* [PATCH 1/1] net/mlx5/linux: set down if detect any anomaly
@ 2025-08-18 0:32 Yang Xu
2025-11-12 9:37 ` Bing Zhao
0 siblings, 1 reply; 2+ messages in thread
From: Yang Xu @ 2025-08-18 0:32 UTC (permalink / raw)
To: thomas, dsosnowski, viacheslavo, bingz, orika, suanmingm, matan,
xu.yang3, yao.chenghu
Cc: dev
[-- Attachment #1.1.1: Type: text/plain, Size: 1461 bytes --]
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@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@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>
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
[-- Attachment #1.1.2: Type: text/html , Size: 3062 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH 1/1] net/mlx5/linux: set down if detect any anomaly
2025-08-18 0:32 [PATCH 1/1] net/mlx5/linux: set down if detect any anomaly Yang Xu
@ 2025-11-12 9:37 ` Bing Zhao
0 siblings, 0 replies; 2+ messages in thread
From: Bing Zhao @ 2025-11-12 9:37 UTC (permalink / raw)
To: Yang Xu, NBU-Contact-Thomas Monjalon (EXTERNAL),
Dariusz Sosnowski, Slava Ovsiienko, Ori Kam, Suanming Mou,
Matan Azrad, yao.chenghu
Cc: dev
Hi,
Please check how to use plain text to send the email? And this is a bug fix, please add fixline and change description of the title line and commit log.
From: Yang Xu <xu.yang3@zte.com.cn>
Sent: Monday, August 18, 2025 8:32 AM
To: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>; Dariusz Sosnowski <dsosnowski@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Bing Zhao <bingz@nvidia.com>; Ori Kam <orika@nvidia.com>; Suanming Mou <suanmingm@nvidia.com>; Matan Azrad <matan@nvidia.com>; xu.yang3@zte.com.cn; yao.chenghu@zte.com.cn
Cc: dev@dpdk.org
Subject: [PATCH 1/1] net/mlx5/linux: set down if detect any anomaly
External email: Use caution opening links or attachments
MLX network interface card link detection will set the
interface to a down state upon detecting an anomaly.
Signed-off-by: Yang Xu <mailto:xu.yang3@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 <mailto:zoltan.kiss@schaman.hu> <mailto:zoltan.kiss@linaro.org>
Zorik Machulsky <mailto:zorik@amazon.com>
Zyta Szpak <mailto:zyta@marvell.com> <mailto:zr@semihalf.com>
Zyta Szpak <mailto:zyta@marvell.com> <mailto:zyta.szpak@semihalf.com>
+Yang Xu <mailto:xu.yang3@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));
// I think the inline initialization = {0} will be faster.
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;
// Or just set this to 0 directly would save some cost?
return ret;
}
} while (wait_to_complete || retry-- > 0);
--
2.27.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-12 9:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-18 0:32 [PATCH 1/1] net/mlx5/linux: set down if detect any anomaly Yang Xu
2025-11-12 9:37 ` Bing Zhao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).