From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3F9CC45610; Fri, 12 Jul 2024 13:31:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D87440653; Fri, 12 Jul 2024 13:31:04 +0200 (CEST) Received: from smtp.cecloud.com (unknown [1.203.97.246]) by mails.dpdk.org (Postfix) with ESMTP id E0396402E5 for ; Fri, 12 Jul 2024 13:31:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by smtp.cecloud.com (Postfix) with ESMTP id DCFA07C0113 for ; Fri, 12 Jul 2024 19:31:00 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from izgc79c142y6tt9fty3vzrz.localdomain (unknown [47.122.22.90]) by smtp.cecloud.com (postfix) whith ESMTP id P2702681T281465036140912S1720783850653053_; Fri, 12 Jul 2024 19:31:00 +0800 (CST) X-IP-DOMAINF: 1 X-RL-SENDER: junwang01@cestc.cn X-SENDER: junwang01@cestc.cn X-LOGIN-NAME: junwang01@cestc.cn X-FST-TO: dev@dpdk.org X-RCPT-COUNT: 1 X-LOCAL-RCPT-COUNT: 0 X-MUTI-DOMAIN-COUNT: 0 X-SENDER-IP: 47.122.22.90 X-ATTACHMENT-NUM: 0 X-UNIQUE-TAG: X-System-Flag: 0 From: Jun Wang 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 Message-Id: <1720783847-12292-1-git-send-email-junwang01@cestc.cn> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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