DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yang Xu <xu.yang3@zte.com.cn>
To: thomas@monjalon.net, dsosnowski@nvidia.com,
	viacheslavo@nvidia.com, bingz@nvidia.com, orika@nvidia.com,
	suanmingm@nvidia.com, 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
Date: Mon, 18 Aug 2025 08:32:23 +0800	[thread overview]
Message-ID: <20250818003223.2098419-1-xu.yang3@zte.com.cn> (raw)


[-- 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 --]

                 reply	other threads:[~2025-08-18  0:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250818003223.2098419-1-xu.yang3@zte.com.cn \
    --to=xu.yang3@zte.com.cn \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    --cc=yao.chenghu@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).