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 EAE4043D06; Wed, 20 Mar 2024 18:37:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D189140ED3; Wed, 20 Mar 2024 18:37:16 +0100 (CET) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id A240F40A6F for ; Wed, 20 Mar 2024 18:37:15 +0100 (CET) Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-5d8b70b39efso80171a12.0 for ; Wed, 20 Mar 2024 10:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1710956235; x=1711561035; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fT+wPQLAWuMg0f42jW3l9au1pm+NjlKhSuLfaSsFMFQ=; b=bHAp4wqcM5V4JJOyRvdxyRer4qc+9jmKW98RtwVMU0uFG72wiyHecUNloZaxT4B4e6 RKe+HaVCc+raziPh6etSI7tps+jBPru/XHmm/IecGkJN1hMkyY+jrKZnKHcqgS/RqU/5 O2wF/xqNAeGt1LKvtccEyzFSDRVnpQI15j93Q4OtOh7fo2WnxIUipFu+/2HrZypDYKPi wJVtZr1WI79avIL9PnYhwIxSYtEAqKeKWsLOlS/flmINOZ4vOGqfxPKsCfyc/YsdSh/9 GHVZ0amLMgPhXSZJiKFEcrNRuD8bvRJDMroeS5Sh+uaGvH3nnxluPdCMhF2ApwXntzFT aKvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710956235; x=1711561035; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fT+wPQLAWuMg0f42jW3l9au1pm+NjlKhSuLfaSsFMFQ=; b=QW334l6/mkJ8i09tUMQHu/K6fw6XlrQQ6ZkyfMiw/hFCV4zPUMinOojonyGJVxHl96 WdIgxtT4ppJJZ/5Vi+YUKsH6IeQ7UR8WwEEXGiR7DC5Oky2/g1GcgKRV3bdO2XH42qoO tWKNc24JXyFgND7X/SstlfGt5sH5DQP1WnV3l5NnbquK8aMBWyorwoXHDaYYgRaT4/2V JqfWCdQAOCYu4tAobiCePdrlJaNgwjPeconM6zvLkHeUKQouDW+bjqbviGL1IQWpmm+w +iB82FM2C+JnQaTVyLzoFRhk3+d5hCyfnP5WF8CffASbIrNJxyuR30NOLCsNskg/+e0J UAQA== X-Gm-Message-State: AOJu0YzFQVngN3bTvBvwYz7hceULHcyyvNTgGDDOD6M0obqVvmsWRaiW YGRFGXJ5385OFYjzfkXtre7dsgpFcVcnea0/7miKM0cGEk6TKtBIhgKd6+q+jfXz80+r0FKg9ez j X-Google-Smtp-Source: AGHT+IFpzggKaLp8Ub6JMD5O32aaJdtI90IQ1cNPKPe0s1vtUQKSlCrUh3PQHeUbb0in+M3boxlNEA== X-Received: by 2002:a05:6a20:8f06:b0:1a3:5440:520 with SMTP id b6-20020a056a208f0600b001a354400520mr14422803pzk.1.1710956234759; Wed, 20 Mar 2024 10:37:14 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id d1-20020aa78141000000b006e6c0080466sm12221350pfn.176.2024.03.20.10.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 10:37:14 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: junwang01@cestc.cn, Stephen Hemminger Subject: [PATCH] net/ixgbe: do not update link status in secondary process Date: Wed, 20 Mar 2024 10:33:04 -0700 Message-ID: <20240320173407.216307-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <1710865092-2796-1-git-send-email-junwang01@cestc.cn> References: <1710865092-2796-1-git-send-email-junwang01@cestc.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: ixgbe_dev_link_update_share() ixgbe_dev_link_update() rte_eth_link_get() Signed-off-by: Stephen Hemminger Reported-by: Jun Wang --- Simpler version of earlier patch, and add explanation. drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index c61c52b2966b..86ccbdd78292 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4293,6 +4293,9 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, int wait = 1; u32 esdp_reg; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -1; + memset(&link, 0, sizeof(link)); link.link_status = RTE_ETH_LINK_DOWN; link.link_speed = RTE_ETH_SPEED_NUM_NONE; -- 2.43.0