From: Jun Wang <junwang01@cestc.cn>
To: dev@dpdk.org
Subject: [PATCH v1] net/e1000: do not update link status in secondary process
Date: Fri, 12 Jul 2024 19:30:47 +0800 [thread overview]
Message-ID: <1720783847-12292-1-git-send-email-junwang01@cestc.cn> (raw)
The code to update link status is not safe in secondary process.
If called from secondary it will crash, example from dumpcap:
eth_em_link_update
Signed-off-by: Jun Wang <junwang01@cestc.cn>
---
drivers/net/e1000/em_ethdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index c5a4dec..f6875b0 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -1136,6 +1136,9 @@ static int eth_em_pci_remove(struct rte_pci_device *pci_dev)
struct rte_eth_link link;
int link_up, count;
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return -1;
+
link_up = 0;
hw->mac.get_link_status = 1;
--
1.8.3.1
next reply other threads:[~2024-07-12 11:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 11:30 Jun Wang [this message]
2024-07-12 17:17 ` Stephen Hemminger
2024-07-14 8:26 ` Jun Wang
2024-07-22 17:08 ` Bruce Richardson
2024-07-23 2:07 ` Jun Wang
2024-08-22 15:58 ` Bruce Richardson
2024-08-22 16:02 ` Bruce Richardson
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=1720783847-12292-1-git-send-email-junwang01@cestc.cn \
--to=junwang01@cestc.cn \
--cc=dev@dpdk.org \
/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).