DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] net/e1000: do not update link status in secondary process
@ 2024-07-12 11:30 Jun Wang
  2024-07-12 17:17 ` Stephen Hemminger
  2024-08-22 15:58 ` Bruce Richardson
  0 siblings, 2 replies; 7+ messages in thread
From: Jun Wang @ 2024-07-12 11:30 UTC (permalink / raw)
  To: dev

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




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-08-22 16:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-12 11:30 [PATCH v1] net/e1000: do not update link status in secondary process Jun Wang
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

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).