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 D6C1243DFA; Thu, 4 Apr 2024 16:56:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6933F402E8; Thu, 4 Apr 2024 16:56:20 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id A4D584025D; Thu, 4 Apr 2024 16:56:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712242579; x=1743778579; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=wEOLrViGem9nW8JqN9XZNMaLjiNmbPaZsMeHctT8Xao=; b=TOFrtivvWhwG48NA4si4Gn5h7DhbYWxPkzzTq1UE7WKsuXkdWQcailoK MhSJ9TE5/3I2fpXI9dYTbEiXsNSnC2Z7qnYq+d+3K4gpepsn1jdv8RMVj x4sDqmFgnbDzOAwIQavkqXqlZijfPnlcOjoDTQ7yedI1fFmM82ojVtBvq tn3Jx+Wp6zm/NK/3ZXAY1B9cPgfZGDRooN+4ZgpP+LczFiGyieWqonHCD EQHTtEakUrjGn7T9qXMUe0yiHYvchyt6vorA6K1bgDMWVZ2Ioup8tCuPN qbLsORFcQ9BDtJwivm0VpqG44a6of2yaQJ3yKapkgHM00cppwWo/TQdjP A==; X-CSE-ConnectionGUID: rFnnETKCSVe0Y4pbgEH2NQ== X-CSE-MsgGUID: JwV24oniTACXFKHP/Innqg== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="30000880" X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="30000880" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 07:56:18 -0700 X-CSE-ConnectionGUID: O8Mj1l00S8CZ9aM4MZof3g== X-CSE-MsgGUID: R+cqiHDhS8SZtGbblOFK/A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="18913520" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Apr 2024 07:56:17 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 4 Apr 2024 07:56:16 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Thu, 4 Apr 2024 07:56:16 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.168) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 4 Apr 2024 07:56:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ijHvYEoQn5j8CLnW6uIMwa3c6zjiml/TYQlOo8u6T7XtlspIConapf1syfeZlNHtcVjtA+UBQW2NSKVgJjCOioxan2ctO3lSVDk9obKtQ9GEm54tQHIAT5x3u/ujLuYLS27Rimym2g6CF5NFPTFDDWiiC8ZKULzNMDkkUlON7bSv8SY8CKZb5+9/FIkGDMbqD86xukwP0G/eCvOixNgLDutUujg8+8N2AXsDQ0AoWG+7GFGndHgPV4A1/6dx654xw3bHXKjHacK7zaI3XS6JxdYGAh8HHCUCC5HDwv5+FRu0+HHK6/JlMZDWuN40eCHoLvgSYu/MejT7GIPnqPfIuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ESnrgFCw6YQBG8hiVckz1++Yvbksvni7B823njN/jGE=; b=dskWn6yIU06h56r4p1KFDgDL+svAEkVBPu1agn8VdNOSXYf/4KAPqdDardF8ZKC5/uAYSRm4v3V+uriOCDBk04UA79U0DiUDkFomDq3E0NqrT9lPXmOz8PW8vV+PoP61EeTqQ8fMCWKjPeTOAG3n3nx9CXa2yoCjwu0BVyXMq2Qyu9PItYjmnC7h1ovG08D1XB5XOmgm3UjGbDIH22gypzm9ZZuauqxLLC+I21pUzxH5pXpbLRqoUuTHMPM2nvqwMWAnplkK1uQyiBJ1zJqWWpGS63dL3Plhwv/9uBooT8pBIQ0bMW2NMsNDMWsLwNJktyeEasuuGweJoPC9wG70IA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by SA2PR11MB5146.namprd11.prod.outlook.com (2603:10b6:806:116::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.26; Thu, 4 Apr 2024 14:56:15 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::487e:e20c:ad88:9c0f%7]) with mapi id 15.20.7452.019; Thu, 4 Apr 2024 14:56:14 +0000 Date: Thu, 4 Apr 2024 15:56:10 +0100 From: Bruce Richardson To: Stephen Hemminger CC: , , Subject: Re: [PATCH] net/ixgbe: do not update link status in secondary process Message-ID: References: <1710865092-2796-1-git-send-email-junwang01@cestc.cn> <20240320173407.216307-1-stephen@networkplumber.org> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240320173407.216307-1-stephen@networkplumber.org> X-ClientProxiedBy: DUZPR01CA0242.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b5::14) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SA2PR11MB5146:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J92RmfcQoozAIqDlTWpwZHDu1XVcnbhiIEKVgBE+DgFTpLfQgWIHP+c8Sx6mjz8AQk7RX2xF/BmUNkEpkCl89K+5SiLAKcUrWPYt+Zf+EV7S5xwni1zdNnDQq9m0vEoYWhTOaj/NmqY4wse34bCa5nOajBlV4hA78YPsa4h/4skw8eXN2zvbr5ohOEPoOAc81bO1X1e7gLVO7JgYPivt4fJCW0DAv/UxRLoif7PryfiBMLCjN48Y4rdAWRacvLuuZ7CBnL0Z8XPQ8FOL1tkFjy0TvDKjQk/F+C07B9JhZFfyXb5Om9Q6WHMAdaQ9hSHNIeKmaAFcRitV3uzVPKI7SAeu/MuN429ERdCySGXowJXqj7J13zoguM8t1pJ2JfKkPYAuM8y9zGyt6BXb0+00F9mwiAiPJv8H7fdhPkRXGP1uvnuzexHqRk1PyPkBX2CFP4bIfNJ3mSR4tbbCIxfOc79ntNUG412yXXJuM10sh2NYcxZsc4P88rSaO5Hsel140YrW/ixEd1unPkA2wR60lMhq6t6O80xl6gf410chmNPg5kOEfxpqJ/HV/PW4lJtTKuNYUVPihI0ys3bjcqvKsw20S9c8R4kP/Gt8UDDZpsvPEzt/0XLPK/2HIBSw0ivqDjmw8hDhIIP8y6IkJZGFHQJHZ3uG6XMx1+rMwXkWW+4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(1800799015)(376005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Ewutn8+7SGCXPUkW4q4FIOAm3iTiaSS/PvDDLXhZiwuz+D/UGt2cUGKblNTQ?= =?us-ascii?Q?EaETjWcHMOQjN/i2QJmIHJzDWGSH9L1DnSgluwoy+JzA7JS8O+rl3z3LOaVS?= =?us-ascii?Q?UPNGwOC2m6VJMleHWh7T9M76oy0xY54NWX0WHUHNYgGZK3DXslz2W84CXuit?= =?us-ascii?Q?yD7QpruWtjzxotzj2JCYC9f5u4Zo+hY/aRc1XC7ceZRzd0MPbpwqzM6Udkc0?= =?us-ascii?Q?Tkb7cfKVrB8gykG84QHj5XSw237wurWSj5nSs/mqN4Xw0o8wC25yY0tmPVfy?= =?us-ascii?Q?n+IUN+A4uq3p4m0I4L3oQlYnM+TXxPp4CATwV6Le47xXC5/PP9o3AiP2fJpv?= =?us-ascii?Q?1gSDU/v0qVtaoalS+BWShjsPKSujtJLy+kLr1mUvLomNAX1QJJTjddpfSXcP?= =?us-ascii?Q?FkaZW+GQSkaD8OLViFW4r5QBmcWF9PZ2Ds/1qZi1Yyxa2Xc/7qNT2OKnUOKs?= =?us-ascii?Q?dxB9rKR3NBWqnslNWFlVMvZWESnuzqx1stYgClYN1ycGfQ2nVBpNAInnSTQn?= =?us-ascii?Q?/VgTRyPvgNkkUKyVAfA+rcbVlM9RBhcVui2Gkp8DPb54K83O94TH473wztAa?= =?us-ascii?Q?NojwoqsceYombW6XWaWg/HbJ1kX2s8ZjZfdmAS537/X32hKaQBLYdGydow1t?= =?us-asc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M8y+/PSvJ+OYgGrOq0caCGVkF?= =?us-ascii?Q?ArRaRCP73wUxFcJfKRg4E8W9rVApzwGGblzy214t9cmkG9xV25oFtqArJ6dY?= =?us-ascii?Q?jw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: c42458bc-8ed9-4e19-96f9-08dc54b75fef X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2024 14:56:14.7707 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: isLQhWKaKWbHp1YG0fLWC/ERqDw33h+LEbW9jhTYQHtEHoBQ6XU4mmexFQuWekDqKwmFZxoWF1mn8z36hXudUTDavKjkONdDnxBi+RTu75c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB5146 X-OriginatorOrg: intel.com 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 On Wed, Mar 20, 2024 at 10:33:04AM -0700, Stephen Hemminger wrote: > 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() > Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org > Signed-off-by: Stephen Hemminger > Reported-by: Jun Wang Acked-by: Bruce Richardson Applied to dpdk-next-net-intel. Thanks, /Bruce > --- > 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 >