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 620ED46532 for ; Tue, 8 Apr 2025 10:03:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 592AE4027F; Tue, 8 Apr 2025 10:03:18 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2074.outbound.protection.outlook.com [40.107.237.74]) by mails.dpdk.org (Postfix) with ESMTP id 567CE4027F for ; Tue, 8 Apr 2025 10:03:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=txQ/TU1KiUipweyc40EfqSNFIs1da0ytfK4MdSC0pO5JcsI/ehZsV4yWs4BDdGXp+Bzw7o05gB+i9IRjtRipOrV0kusgW3Urk/89fbAMZET2rOZiEL5VZnp8EYdbW7G2QLlAdNeKdvFZ43KavF8W0xANVZdSXMLupTO6KP5kqvFT2/y+z1xruMaBFUqyJGuNOSQqwwIlwa+aM92evwHzgSOEgA6SnT4nuQxros+d3QjyMjpiq2P/3/sOwMRKufP/5LJGZXG9PFNqm4unPRkhajPhQv8ZN4/2fYIwyxXgd55SXmPE+7sGPJPainNAZPSY/BKwsdzu+xJA8TSzlNDSnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=QHXRk5de1T9smtjfmwn1EUMNbEuevVXvADFsAF2h+cQ=; b=d4lpHl421h2K01MjKECrcl1SsltKLdAx6k0ZjwhuWK+q/vEQmWBHtjMoNJa0AUGL/OATBhcz4axB9tjvtqRC6ZPJhlzeMsAn4K26UKIcqHRKmHThRMTYsEcCpcAyQxPCczB3NnH1Fe+vHCEoDD5BF5WosbYDOSQnQo2uIxix+3hjU9n38KNJgW/uwDMfEFSN+J/rgcI2iuZZBiG+umIUbf38gWKzAofAs3hpljS2Jvf7z6sy33HiS2DvODonPc82cdIOmvkWQGENBn7Wfzd0kD9iIJK9b18MbY78XDTRADJEiRu+15Kvj13GU9q6WU9ZMjo50K08HYYeyq0oxyyGww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QHXRk5de1T9smtjfmwn1EUMNbEuevVXvADFsAF2h+cQ=; b=PqUB5fZ67LgvyVAIDj9e3oufJ2CohMIawOc1uNgDS8uHQtA1Q2Ug4fzyhrwnVuqH3TtHseeRKYPcMvt9M9epUbGyTjj1GJRHa7fiLd/FdXECltgsn8dHJMl4aIDz6cT+Ab9KdysdNV7k/EQwvpRlTWgrvrYUvuXIj7TVZyLcllRh0CroPP6HM2pZ35BDhoxr1ZIuJY6V60sDqGxLQj8m6IsvzjqSCDr/uN6FC8zyW16g4nrVk9DIoBfo7aGh8SfwkV1swY1gZUwS9GCVfDjwOvqslMhxpvU+9HuLww+DpVIiVfovpV7M+mSxdSfbxBq5dO76uLDD/YjS0efyVeeTAw== Received: from PH2PEPF00003852.namprd17.prod.outlook.com (2603:10b6:518:1::77) by SA1PR12MB8120.namprd12.prod.outlook.com (2603:10b6:806:331::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8606.32; Tue, 8 Apr 2025 08:03:06 +0000 Received: from CO1PEPF000044FD.namprd21.prod.outlook.com (2a01:111:f403:c91d::4) by PH2PEPF00003852.outlook.office365.com (2603:1036:903:48::3) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8606.28 via Frontend Transport; Tue, 8 Apr 2025 08:03:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1PEPF000044FD.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8655.0 via Frontend Transport; Tue, 8 Apr 2025 08:03:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 8 Apr 2025 01:02:46 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 8 Apr 2025 01:02:34 -0700 From: Xueming Li To: Anatoly Burakov CC: Xueming Li , Bruce Richardson , dpdk stable Subject: patch 'net/e1000: fix crashes in secondary processes' has been queued to stable release 23.11.4 Date: Tue, 8 Apr 2025 16:01:40 +0800 Message-ID: <20250408080214.371154-2-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250408080214.371154-1-xuemingl@nvidia.com> References: <20250218123523.36836-1-xuemingl@nvidia.com> <20250408080214.371154-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044FD:EE_|SA1PR12MB8120:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e5bbf9a-3903-4f0a-69f7-08dd7673cba0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|1800799024|82310400026|13003099007|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?dqK8ecyhmQP1b+ejQyninCW699fa5GRJ7Kl++JI2fdZ2dnpl85vd8E5AkVLP?= =?us-ascii?Q?ik3USKpzqb0s6e6nOvUX+HXR75E7dqRJH0fRW70DzHBR4WiBYPcbvcH8h0o7?= =?us-ascii?Q?AKeHSQQRdVsWff36kPnAmJUhf+rr53+g/BrYbzBL5QmZf7y38su39t+HxTIw?= =?us-ascii?Q?A/H7uMsIBQxHBepxsSMvRYEGm1M1Q7PshGBJIiZ4+oQHRt4d4HU8e2xOv9hg?= =?us-ascii?Q?5Z4/VNaK6jwciyZCC7wLAPGstb4V9uXbuzcqPzHW5dWzMnywaJqZgavpi8BO?= =?us-ascii?Q?+74sn0q7e64okjDSgVn8PTgpSS2B0h5zIP6b+gxcyjxDY1kKerrF8SWvfEkA?= =?us-ascii?Q?/fBFyfwONcR/g8mtn2xvnx3+B9hLCyA702LZ72xccyq/NHSETV/1KDFtao4N?= =?us-ascii?Q?rDDB2xO7DnHuYD/gEuY2hiA7S+r2GmttBvqiBwrZJvRMPWnrNU0jW14DiePC?= =?us-ascii?Q?YUDNORqF84iIFGhvYwmZwoAAms6bInsRTuJaAaiq00PaxfqpC703Q6fZjOMB?= =?us-ascii?Q?TgaVekpf3pEnJDBviMFyTr2zUFiGudHzID77MqYXYRQSEIJhGTC30Dz4b2eL?= =?us-ascii?Q?GYk66ZIMPs9XGjQUPNHn0KQty0zlA0VFdOHcozQTIXk4qBw/5MSJ6apLI5Lh?= =?us-ascii?Q?x/AmDaml3tUC+i9e88EnbzAHWUvtUHZ2R8cDh88O2WhzKeOLp/enXmimCbOV?= =?us-ascii?Q?YQ5sh+B1MFK1ETdm1DmpvfeM689eSMZPa3XRv9s9oiCt/ZXLtjUFQ4crbwjr?= =?us-ascii?Q?HFbFvGuzbQ/7VDbgcbbuyJlPQmcyqQvaqzdhhgf7s0r0rXzMnn3a4+54BdSD?= =?us-ascii?Q?zyDHJGv5TAVJx2zTqtQ3tYEi+51dEAZjyEN49EftfClHbsDfJ2FTxuvMgq3F?= =?us-ascii?Q?H+qV/SRL+o0V96WdjnYcBWTdw++Y0S6P0GKbYxWrFHL7qLGh+wY1QHnPbsXz?= =?us-ascii?Q?a8VUV2Qgea9Gi0+DICkBa0oJVlYAH52snojsWy7oT6H+ka0M4U6z61y4pVIK?= =?us-ascii?Q?OGvCHbWBz1Ln8HsdPKJ/xz8Q+ONrqy9FbdI7z1+4VA6KQgy73rmCHr7xK11E?= =?us-ascii?Q?26XqHRs6q9Zye004aKtnGfMM+X0nI0Ripa8WcZ88bs+yHxYTd4b3pYDyt6kV?= =?us-ascii?Q?VDHdiZvDPeNmva64HFPKumPCW6NxQy9al3F+ZIia2s/J4u5mw87Zyyz0MfdC?= =?us-ascii?Q?Ie9iJbN4YGWiv2LwVuA8IwQgEOfIDkkFB2o0plFOI133HDFIw40kXmLqcsVh?= =?us-ascii?Q?mYnB9ufqDn4UbsHVs5AE33mTih08wGieAMHMbYHUnVUyVwcztr+O95VWCN6o?= =?us-ascii?Q?De6W06h1RKuIdBc0G6avNBdmgXLwHFnFosiaAYN2dSD99rzJYpXd4mH8iI0L?= =?us-ascii?Q?mjIKoANf5H/M/Ps+osC/SI6IQ8caDmRKmLwERphbFer7yCwgDHZ3Ezj6QlAl?= =?us-ascii?Q?ZKQPLK3RdvpETEIwUOTlOi4cdImS2HeaGvl2FO3m3N/+comzaCVONug+N82u?= =?us-ascii?Q?IJs1aMKnc5tJ2kbOpl7M3aPluF1ISZfFw1HlqwAljD/2CIQDMMDHUuBVPA?= =?us-ascii?Q?=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026)(13003099007)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2025 08:03:06.4964 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e5bbf9a-3903-4f0a-69f7-08dd7673cba0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044FD.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8120 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 23.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/10/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=63e8bec024d537684da0bdffa122de96b8c565b2 Thanks. Xueming Li --- >From 63e8bec024d537684da0bdffa122de96b8c565b2 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Mon, 17 Feb 2025 13:54:05 +0000 Subject: [PATCH] net/e1000: fix crashes in secondary processes Cc: Xueming Li [ upstream commit b0ef6e7a970bc745537c5b5140d838431f118c5e ] Currently, the architecture of e1000 base driver is such that it uses function pointers internally. These are not guaranteed to be valid in secondary processes, which can lead to crashes. This patch prevents EM, IGB and IGC ethdev drivers from calling into these functions from secondary processes Fixes: af75078fece3 ("first public release") Fixes: 805803445a02 ("e1000: support EM devices (also known as e1000/e1000e)") Fixes: 4f09bc55ac3d ("net/igc: implement device base operations") Signed-off-by: Anatoly Burakov Acked-by: Bruce Richardson --- doc/guides/nics/e1000em.rst | 5 + doc/guides/nics/igb.rst | 13 +++ doc/guides/nics/igc.rst | 5 + drivers/net/e1000/em_ethdev.c | 80 +++++++++++++++ drivers/net/e1000/igb_ethdev.c | 176 +++++++++++++++++++++++++++++++++ drivers/net/igc/igc_ethdev.c | 96 ++++++++++++++++++ 6 files changed, 375 insertions(+) diff --git a/doc/guides/nics/e1000em.rst b/doc/guides/nics/e1000em.rst index 5e752a29e5..ed4f57e9c6 100644 --- a/doc/guides/nics/e1000em.rst +++ b/doc/guides/nics/e1000em.rst @@ -153,3 +153,8 @@ The following are known limitations: #. Qemu e1000 only supports one interrupt source, so link and Rx interrupt should be exclusive. #. Qemu e1000 does not support interrupt auto-clear, application should disable interrupt immediately when woken up. + +Secondary Process Support +------------------------- + +Control plane operations are currently not supported in secondary processes. diff --git a/doc/guides/nics/igb.rst b/doc/guides/nics/igb.rst index e3a91c316b..3f7a4156ff 100644 --- a/doc/guides/nics/igb.rst +++ b/doc/guides/nics/igb.rst @@ -31,3 +31,16 @@ Features of the IGB PMD are: * Checksum offload * TCP segmentation offload * Jumbo frames supported + +Secondary Process Support +------------------------- + +IGB Physical Function Driver +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Control plane operations are currently not supported in secondary processes. + +IGB Virtual Function Driver +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Control plane operations are currently not supported in secondary processes. diff --git a/doc/guides/nics/igc.rst b/doc/guides/nics/igc.rst index c5af806b7b..07a1b12bcb 100644 --- a/doc/guides/nics/igc.rst +++ b/doc/guides/nics/igc.rst @@ -104,3 +104,8 @@ Add a rule to enable ipv4-udp RSS: .. code-block:: console testpmd> flow create 0 ingress pattern end actions rss types ipv4-udp end / end + +Secondary Process Support +------------------------- + +Control plane operations are currently not supported in secondary processes. diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index f6875b0762..e26930f1d6 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -543,6 +543,14 @@ eth_em_start(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + ret = eth_em_stop(dev); if (ret != 0) return ret; @@ -727,6 +735,14 @@ eth_em_stop(struct rte_eth_dev *dev) struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); struct rte_intr_handle *intr_handle = pci_dev->intr_handle; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + dev->data->dev_started = 0; eth_em_rxtx_control(dev, false); @@ -1016,6 +1032,10 @@ eth_em_rx_queue_intr_enable(struct rte_eth_dev *dev, __rte_unused uint16_t queue struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); struct rte_intr_handle *intr_handle = pci_dev->intr_handle; + /* device interrupts are only subscribed to in primary processes */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + em_rxq_intr_enable(hw); rte_intr_ack(intr_handle); @@ -1027,6 +1047,10 @@ eth_em_rx_queue_intr_disable(struct rte_eth_dev *dev, __rte_unused uint16_t queu { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + /* device interrupts are only subscribed to in primary processes */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + em_rxq_intr_disable(hw); return 0; @@ -1654,6 +1678,14 @@ eth_em_led_on(struct rte_eth_dev *dev) { struct e1000_hw *hw; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); return e1000_led_on(hw) == E1000_SUCCESS ? 0 : -ENOTSUP; } @@ -1663,6 +1695,14 @@ eth_em_led_off(struct rte_eth_dev *dev) { struct e1000_hw *hw; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); return e1000_led_off(hw) == E1000_SUCCESS ? 0 : -ENOTSUP; } @@ -1724,6 +1764,14 @@ eth_em_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) uint32_t max_high_water; uint32_t rctl; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); if (fc_conf->autoneg != hw->mac.autoneg) return -ENOTSUP; @@ -1775,6 +1823,14 @@ eth_em_rar_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + return e1000_rar_set(hw, mac_addr->addr_bytes, index); } @@ -1784,6 +1840,14 @@ eth_em_rar_clear(struct rte_eth_dev *dev, uint32_t index) uint8_t addr[RTE_ETHER_ADDR_LEN]; struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + memset(addr, 0, sizeof(addr)); e1000_rar_set(hw, addr, index); @@ -1793,6 +1857,14 @@ static int eth_em_default_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *addr) { + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + eth_em_rar_clear(dev, 0); return eth_em_rar_set(dev, (void *)addr, 0, 0); @@ -1837,6 +1909,14 @@ eth_em_set_mc_addr_list(struct rte_eth_dev *dev, { struct e1000_hw *hw; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); e1000_update_mc_addr_list(hw, (u8 *)mc_addr_set, nb_mc_addr); return 0; diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 222e359ed9..c83ce5bc80 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -1206,6 +1206,14 @@ eth_igb_start(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + /* disable uio/vfio intr/eventfd mapping */ rte_intr_disable(intr_handle); @@ -1421,6 +1429,14 @@ eth_igb_stop(struct rte_eth_dev *dev) struct e1000_adapter *adapter = E1000_DEV_PRIVATE(dev->data->dev_private); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + if (adapter->stopped) return 0; @@ -1474,6 +1490,14 @@ eth_igb_dev_set_link_up(struct rte_eth_dev *dev) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + if (hw->phy.media_type == e1000_media_type_copper) e1000_power_up_phy(hw); else @@ -1487,6 +1511,14 @@ eth_igb_dev_set_link_down(struct rte_eth_dev *dev) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + if (hw->phy.media_type == e1000_media_type_copper) e1000_power_down_phy(hw); else @@ -2108,6 +2140,14 @@ eth_igb_fw_version_get(struct rte_eth_dev *dev, char *fw_version, struct e1000_fw_version fw; int ret; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + e1000_get_fw_version(hw, &fw); switch (hw->mac.type) { @@ -2355,6 +2395,14 @@ eth_igb_link_update(struct rte_eth_dev *dev, int wait_to_complete) struct rte_eth_link link; int link_check, count; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + link_check = 0; hw->mac.get_link_status = 1; @@ -2977,6 +3025,14 @@ eth_igb_led_on(struct rte_eth_dev *dev) { struct e1000_hw *hw; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); return e1000_led_on(hw) == E1000_SUCCESS ? 0 : -ENOTSUP; } @@ -2986,6 +3042,14 @@ eth_igb_led_off(struct rte_eth_dev *dev) { struct e1000_hw *hw; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); return e1000_led_off(hw) == E1000_SUCCESS ? 0 : -ENOTSUP; } @@ -3048,6 +3112,14 @@ eth_igb_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) uint32_t rctl; uint32_t ctrl; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); if (fc_conf->autoneg != hw->mac.autoneg) return -ENOTSUP; @@ -3134,6 +3206,14 @@ eth_igb_rar_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); uint32_t rah; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + e1000_rar_set(hw, mac_addr->addr_bytes, index); rah = E1000_READ_REG(hw, E1000_RAH(index)); rah |= (0x1 << (E1000_RAH_POOLSEL_SHIFT + pool)); @@ -3147,6 +3227,14 @@ eth_igb_rar_clear(struct rte_eth_dev *dev, uint32_t index) uint8_t addr[RTE_ETHER_ADDR_LEN]; struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; + memset(addr, 0, sizeof(addr)); e1000_rar_set(hw, addr, index); @@ -3156,6 +3244,14 @@ static int eth_igb_default_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *addr) { + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + eth_igb_rar_clear(dev, 0); eth_igb_rar_set(dev, (void *)addr, 0, 0); @@ -3289,6 +3385,14 @@ igbvf_dev_start(struct rte_eth_dev *dev) int ret; uint32_t intr_vector = 0; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + PMD_INIT_FUNC_TRACE(); hw->mac.ops.reset_hw(hw); @@ -3345,6 +3449,14 @@ igbvf_dev_stop(struct rte_eth_dev *dev) struct e1000_adapter *adapter = E1000_DEV_PRIVATE(dev->data->dev_private); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + if (adapter->stopped) return 0; @@ -3417,6 +3529,14 @@ igbvf_promiscuous_enable(struct rte_eth_dev *dev) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + /* Set both unicast and multicast promisc */ e1000_promisc_set_vf(hw, e1000_promisc_enabled); @@ -3428,6 +3548,14 @@ igbvf_promiscuous_disable(struct rte_eth_dev *dev) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + /* If in allmulticast mode leave multicast promisc */ if (dev->data->all_multicast == 1) e1000_promisc_set_vf(hw, e1000_promisc_multicast); @@ -3442,6 +3570,14 @@ igbvf_allmulticast_enable(struct rte_eth_dev *dev) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + /* In promiscuous mode multicast promisc already set */ if (dev->data->promiscuous == 0) e1000_promisc_set_vf(hw, e1000_promisc_multicast); @@ -3454,6 +3590,14 @@ igbvf_allmulticast_disable(struct rte_eth_dev *dev) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + /* In promiscuous mode leave multicast promisc enabled */ if (dev->data->promiscuous == 0) e1000_promisc_set_vf(hw, e1000_promisc_disabled); @@ -4557,6 +4701,14 @@ eth_igb_set_mc_addr_list(struct rte_eth_dev *dev, { struct e1000_hw *hw; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); e1000_update_mc_addr_list(hw, (u8 *)mc_addr_set, nb_mc_addr); return 0; @@ -4986,6 +5138,14 @@ eth_igb_get_eeprom(struct rte_eth_dev *dev, uint16_t *data = in_eeprom->data; int first, length; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + first = in_eeprom->offset >> 1; length = in_eeprom->length >> 1; if ((first >= hw->nvm.word_size) || @@ -5010,6 +5170,14 @@ eth_igb_set_eeprom(struct rte_eth_dev *dev, uint16_t *data = in_eeprom->data; int first, length; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + first = in_eeprom->offset >> 1; length = in_eeprom->length >> 1; if ((first >= hw->nvm.word_size) || @@ -5110,6 +5278,10 @@ eth_igb_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) struct rte_intr_handle *intr_handle = pci_dev->intr_handle; uint32_t vec = E1000_MISC_VEC_ID; + /* device interrupts are only subscribed to in primary processes */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + if (rte_intr_allow_others(intr_handle)) vec = E1000_RX_VEC_START; @@ -5130,6 +5302,10 @@ eth_igb_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id) struct rte_intr_handle *intr_handle = pci_dev->intr_handle; uint32_t vec = E1000_MISC_VEC_ID; + /* device interrupts are only subscribed to in primary processes */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + if (rte_intr_allow_others(intr_handle)) vec = E1000_RX_VEC_START; diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c index 690736b6d1..bc8e0e127c 100644 --- a/drivers/net/igc/igc_ethdev.c +++ b/drivers/net/igc/igc_ethdev.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "igc_logs.h" #include "igc_txrx.h" @@ -392,6 +393,14 @@ eth_igc_set_link_up(struct rte_eth_dev *dev) { struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + if (hw->phy.media_type == igc_media_type_copper) igc_power_up_phy(hw); else @@ -404,6 +413,13 @@ eth_igc_set_link_down(struct rte_eth_dev *dev) { struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev); + /* + * This function calls into the base driver, which in turn will use + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + if (hw->phy.media_type == igc_media_type_copper) igc_power_down_phy(hw); else @@ -477,6 +493,14 @@ eth_igc_link_update(struct rte_eth_dev *dev, int wait_to_complete) struct rte_eth_link link; int link_check, count; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + link_check = 0; hw->mac.get_link_status = 1; @@ -654,6 +678,14 @@ eth_igc_stop(struct rte_eth_dev *dev) struct rte_intr_handle *intr_handle = pci_dev->intr_handle; struct rte_eth_link link; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + dev->data->dev_started = 0; adapter->stopped = 1; @@ -965,6 +997,14 @@ eth_igc_start(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + /* disable all MSI-X interrupts */ IGC_WRITE_REG(hw, IGC_EIMC, 0x1f); IGC_WRITE_FLUSH(hw); @@ -1548,7 +1588,15 @@ eth_igc_fw_version_get(struct rte_eth_dev *dev, char *fw_version, struct igc_fw_version fw; int ret; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ igc_get_fw_version(hw, &fw); + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + /* if option rom is valid, display its version too */ if (fw.or_valid) { @@ -1638,6 +1686,14 @@ eth_igc_led_on(struct rte_eth_dev *dev) { struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + return igc_led_on(hw) == IGC_SUCCESS ? 0 : -ENOTSUP; } @@ -1646,6 +1702,14 @@ eth_igc_led_off(struct rte_eth_dev *dev) { struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev); + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + return igc_led_off(hw) == IGC_SUCCESS ? 0 : -ENOTSUP; } @@ -2188,6 +2252,10 @@ eth_igc_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) struct rte_intr_handle *intr_handle = pci_dev->intr_handle; uint32_t vec = IGC_MISC_VEC_ID; + /* device interrupts are only subscribed to in primary processes */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + if (rte_intr_allow_others(intr_handle)) vec = IGC_RX_VEC_START; @@ -2207,6 +2275,10 @@ eth_igc_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id) struct rte_intr_handle *intr_handle = pci_dev->intr_handle; uint32_t vec = IGC_MISC_VEC_ID; + /* device interrupts are only subscribed to in primary processes */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + if (rte_intr_allow_others(intr_handle)) vec = IGC_RX_VEC_START; @@ -2270,6 +2342,14 @@ eth_igc_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) uint32_t rctl; int err; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + if (fc_conf->autoneg != hw->mac.autoneg) return -ENOTSUP; @@ -2771,6 +2851,14 @@ eth_igc_timesync_read_rx_timestamp(__rte_unused struct rte_eth_dev *dev, struct igc_rx_queue *rxq; uint64_t rx_timestamp; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + /* Get current link speed. */ eth_igc_link_update(dev, 1); rte_eth_linkstatus_get(dev, &link); @@ -2807,6 +2895,14 @@ eth_igc_timesync_read_tx_timestamp(struct rte_eth_dev *dev, uint64_t tx_timestamp; int adjust = 0; + /* + * This function calls into the base driver, which in turn will use + * function pointers, which are not guaranteed to be valid in secondary + * processes, so avoid using this function in secondary processes. + */ + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return -E_RTE_SECONDARY; + val = IGC_READ_REG(hw, IGC_TSYNCTXCTL); if (!(val & IGC_TSYNCTXCTL_VALID)) return -EINVAL; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-04-08 15:39:06.475437904 +0800 +++ 0016-net-e1000-fix-crashes-in-secondary-processes.patch 2025-04-08 15:39:05.906436588 +0800 @@ -1 +1 @@ -From b0ef6e7a970bc745537c5b5140d838431f118c5e Mon Sep 17 00:00:00 2001 +From 63e8bec024d537684da0bdffa122de96b8c565b2 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit b0ef6e7a970bc745537c5b5140d838431f118c5e ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -20,7 +22,7 @@ - doc/guides/nics/e1000em.rst | 5 + - doc/guides/nics/igb.rst | 13 ++ - doc/guides/nics/igc.rst | 5 + - drivers/net/intel/e1000/em_ethdev.c | 80 ++++++++++++ - drivers/net/intel/e1000/igb_ethdev.c | 176 +++++++++++++++++++++++++++ - drivers/net/intel/e1000/igc_ethdev.c | 97 +++++++++++++++ - 6 files changed, 376 insertions(+) + doc/guides/nics/e1000em.rst | 5 + + doc/guides/nics/igb.rst | 13 +++ + doc/guides/nics/igc.rst | 5 + + drivers/net/e1000/em_ethdev.c | 80 +++++++++++++++ + drivers/net/e1000/igb_ethdev.c | 176 +++++++++++++++++++++++++++++++++ + drivers/net/igc/igc_ethdev.c | 96 ++++++++++++++++++ + 6 files changed, 375 insertions(+) @@ -63 +65 @@ -index c267431c5f..9790b58102 100644 +index c5af806b7b..07a1b12bcb 100644 @@ -75,5 +77,5 @@ -diff --git a/drivers/net/intel/e1000/em_ethdev.c b/drivers/net/intel/e1000/em_ethdev.c -index bd3f7e44df..39dddf3384 100644 ---- a/drivers/net/intel/e1000/em_ethdev.c -+++ b/drivers/net/intel/e1000/em_ethdev.c -@@ -573,6 +573,14 @@ eth_em_start(struct rte_eth_dev *dev) +diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c +index f6875b0762..e26930f1d6 100644 +--- a/drivers/net/e1000/em_ethdev.c ++++ b/drivers/net/e1000/em_ethdev.c +@@ -543,6 +543,14 @@ eth_em_start(struct rte_eth_dev *dev) @@ -94 +96 @@ -@@ -757,6 +765,14 @@ eth_em_stop(struct rte_eth_dev *dev) +@@ -727,6 +735,14 @@ eth_em_stop(struct rte_eth_dev *dev) @@ -109 +111 @@ -@@ -1048,6 +1064,10 @@ eth_em_rx_queue_intr_enable(struct rte_eth_dev *dev, __rte_unused uint16_t queue +@@ -1016,6 +1032,10 @@ eth_em_rx_queue_intr_enable(struct rte_eth_dev *dev, __rte_unused uint16_t queue @@ -120 +122 @@ -@@ -1059,6 +1079,10 @@ eth_em_rx_queue_intr_disable(struct rte_eth_dev *dev, __rte_unused uint16_t queu +@@ -1027,6 +1047,10 @@ eth_em_rx_queue_intr_disable(struct rte_eth_dev *dev, __rte_unused uint16_t queu @@ -131 +133 @@ -@@ -1688,6 +1712,14 @@ eth_em_led_on(struct rte_eth_dev *dev) +@@ -1654,6 +1678,14 @@ eth_em_led_on(struct rte_eth_dev *dev) @@ -146 +148 @@ -@@ -1697,6 +1729,14 @@ eth_em_led_off(struct rte_eth_dev *dev) +@@ -1663,6 +1695,14 @@ eth_em_led_off(struct rte_eth_dev *dev) @@ -161 +163 @@ -@@ -1758,6 +1798,14 @@ eth_em_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) +@@ -1724,6 +1764,14 @@ eth_em_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) @@ -176 +178 @@ -@@ -1809,6 +1857,14 @@ eth_em_rar_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, +@@ -1775,6 +1823,14 @@ eth_em_rar_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, @@ -191 +193 @@ -@@ -1818,6 +1874,14 @@ eth_em_rar_clear(struct rte_eth_dev *dev, uint32_t index) +@@ -1784,6 +1840,14 @@ eth_em_rar_clear(struct rte_eth_dev *dev, uint32_t index) @@ -206 +208 @@ -@@ -1827,6 +1891,14 @@ static int +@@ -1793,6 +1857,14 @@ static int @@ -221 +223 @@ -@@ -1871,6 +1943,14 @@ eth_em_set_mc_addr_list(struct rte_eth_dev *dev, +@@ -1837,6 +1909,14 @@ eth_em_set_mc_addr_list(struct rte_eth_dev *dev, @@ -236,5 +238,5 @@ -diff --git a/drivers/net/intel/e1000/igb_ethdev.c b/drivers/net/intel/e1000/igb_ethdev.c -index be3123572f..cbd2f15f5f 100644 ---- a/drivers/net/intel/e1000/igb_ethdev.c -+++ b/drivers/net/intel/e1000/igb_ethdev.c -@@ -1248,6 +1248,14 @@ eth_igb_start(struct rte_eth_dev *dev) +diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c +index 222e359ed9..c83ce5bc80 100644 +--- a/drivers/net/e1000/igb_ethdev.c ++++ b/drivers/net/e1000/igb_ethdev.c +@@ -1206,6 +1206,14 @@ eth_igb_start(struct rte_eth_dev *dev) @@ -255 +257 @@ -@@ -1471,6 +1479,14 @@ eth_igb_stop(struct rte_eth_dev *dev) +@@ -1421,6 +1429,14 @@ eth_igb_stop(struct rte_eth_dev *dev) @@ -270 +272 @@ -@@ -1524,6 +1540,14 @@ eth_igb_dev_set_link_up(struct rte_eth_dev *dev) +@@ -1474,6 +1490,14 @@ eth_igb_dev_set_link_up(struct rte_eth_dev *dev) @@ -285 +287 @@ -@@ -1537,6 +1561,14 @@ eth_igb_dev_set_link_down(struct rte_eth_dev *dev) +@@ -1487,6 +1511,14 @@ eth_igb_dev_set_link_down(struct rte_eth_dev *dev) @@ -300 +302 @@ -@@ -2158,6 +2190,14 @@ eth_igb_fw_version_get(struct rte_eth_dev *dev, char *fw_version, +@@ -2108,6 +2140,14 @@ eth_igb_fw_version_get(struct rte_eth_dev *dev, char *fw_version, @@ -315 +317 @@ -@@ -2406,6 +2446,14 @@ eth_igb_link_update(struct rte_eth_dev *dev, int wait_to_complete) +@@ -2355,6 +2395,14 @@ eth_igb_link_update(struct rte_eth_dev *dev, int wait_to_complete) @@ -330 +332 @@ -@@ -3028,6 +3076,14 @@ eth_igb_led_on(struct rte_eth_dev *dev) +@@ -2977,6 +3025,14 @@ eth_igb_led_on(struct rte_eth_dev *dev) @@ -345 +347 @@ -@@ -3037,6 +3093,14 @@ eth_igb_led_off(struct rte_eth_dev *dev) +@@ -2986,6 +3042,14 @@ eth_igb_led_off(struct rte_eth_dev *dev) @@ -360 +362 @@ -@@ -3099,6 +3163,14 @@ eth_igb_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) +@@ -3048,6 +3112,14 @@ eth_igb_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) @@ -375 +377 @@ -@@ -3185,6 +3257,14 @@ eth_igb_rar_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, +@@ -3134,6 +3206,14 @@ eth_igb_rar_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, @@ -390 +392 @@ -@@ -3198,6 +3278,14 @@ eth_igb_rar_clear(struct rte_eth_dev *dev, uint32_t index) +@@ -3147,6 +3227,14 @@ eth_igb_rar_clear(struct rte_eth_dev *dev, uint32_t index) @@ -405 +407 @@ -@@ -3207,6 +3295,14 @@ static int +@@ -3156,6 +3244,14 @@ static int @@ -420 +422 @@ -@@ -3340,6 +3436,14 @@ igbvf_dev_start(struct rte_eth_dev *dev) +@@ -3289,6 +3385,14 @@ igbvf_dev_start(struct rte_eth_dev *dev) @@ -435 +437 @@ -@@ -3396,6 +3500,14 @@ igbvf_dev_stop(struct rte_eth_dev *dev) +@@ -3345,6 +3449,14 @@ igbvf_dev_stop(struct rte_eth_dev *dev) @@ -450 +452 @@ -@@ -3468,6 +3580,14 @@ igbvf_promiscuous_enable(struct rte_eth_dev *dev) +@@ -3417,6 +3529,14 @@ igbvf_promiscuous_enable(struct rte_eth_dev *dev) @@ -465 +467 @@ -@@ -3479,6 +3599,14 @@ igbvf_promiscuous_disable(struct rte_eth_dev *dev) +@@ -3428,6 +3548,14 @@ igbvf_promiscuous_disable(struct rte_eth_dev *dev) @@ -480 +482 @@ -@@ -3493,6 +3621,14 @@ igbvf_allmulticast_enable(struct rte_eth_dev *dev) +@@ -3442,6 +3570,14 @@ igbvf_allmulticast_enable(struct rte_eth_dev *dev) @@ -495 +497 @@ -@@ -3505,6 +3641,14 @@ igbvf_allmulticast_disable(struct rte_eth_dev *dev) +@@ -3454,6 +3590,14 @@ igbvf_allmulticast_disable(struct rte_eth_dev *dev) @@ -510 +512 @@ -@@ -4608,6 +4752,14 @@ eth_igb_set_mc_addr_list(struct rte_eth_dev *dev, +@@ -4557,6 +4701,14 @@ eth_igb_set_mc_addr_list(struct rte_eth_dev *dev, @@ -525 +527 @@ -@@ -5056,6 +5208,14 @@ eth_igb_get_eeprom(struct rte_eth_dev *dev, +@@ -4986,6 +5138,14 @@ eth_igb_get_eeprom(struct rte_eth_dev *dev, @@ -540 +542 @@ -@@ -5080,6 +5240,14 @@ eth_igb_set_eeprom(struct rte_eth_dev *dev, +@@ -5010,6 +5170,14 @@ eth_igb_set_eeprom(struct rte_eth_dev *dev, @@ -555 +557 @@ -@@ -5180,6 +5348,10 @@ eth_igb_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) +@@ -5110,6 +5278,10 @@ eth_igb_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) @@ -566 +568 @@ -@@ -5200,6 +5372,10 @@ eth_igb_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id) +@@ -5130,6 +5302,10 @@ eth_igb_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id) @@ -577,4 +579,4 @@ -diff --git a/drivers/net/intel/e1000/igc_ethdev.c b/drivers/net/intel/e1000/igc_ethdev.c -index 136f5af2a0..e712cfcf7c 100644 ---- a/drivers/net/intel/e1000/igc_ethdev.c -+++ b/drivers/net/intel/e1000/igc_ethdev.c +diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c +index 690736b6d1..bc8e0e127c 100644 +--- a/drivers/net/igc/igc_ethdev.c ++++ b/drivers/net/igc/igc_ethdev.c @@ -587 +589 @@ - #include "e1000_logs.h" + #include "igc_logs.h" @@ -589 +591 @@ -@@ -397,6 +398,14 @@ eth_igc_set_link_up(struct rte_eth_dev *dev) +@@ -392,6 +393,14 @@ eth_igc_set_link_up(struct rte_eth_dev *dev) @@ -591 +593 @@ - struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev); + struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev); @@ -601,2 +603,2 @@ - if (hw->phy.media_type == e1000_media_type_copper) - e1000_power_up_phy(hw); + if (hw->phy.media_type == igc_media_type_copper) + igc_power_up_phy(hw); @@ -604 +606 @@ -@@ -409,6 +418,14 @@ eth_igc_set_link_down(struct rte_eth_dev *dev) +@@ -404,6 +413,13 @@ eth_igc_set_link_down(struct rte_eth_dev *dev) @@ -606 +608 @@ - struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev); + struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev); @@ -610 +611,0 @@ -+ * function pointers, which are not guaranteed to be valid in secondary @@ -616,2 +617,2 @@ - if (hw->phy.media_type == e1000_media_type_copper) - e1000_power_down_phy(hw); + if (hw->phy.media_type == igc_media_type_copper) + igc_power_down_phy(hw); @@ -619 +620 @@ -@@ -482,6 +499,14 @@ eth_igc_link_update(struct rte_eth_dev *dev, int wait_to_complete) +@@ -477,6 +493,14 @@ eth_igc_link_update(struct rte_eth_dev *dev, int wait_to_complete) @@ -634 +635 @@ -@@ -659,6 +684,14 @@ eth_igc_stop(struct rte_eth_dev *dev) +@@ -654,6 +678,14 @@ eth_igc_stop(struct rte_eth_dev *dev) @@ -649 +650 @@ -@@ -970,6 +1003,14 @@ eth_igc_start(struct rte_eth_dev *dev) +@@ -965,6 +997,14 @@ eth_igc_start(struct rte_eth_dev *dev) @@ -662,4 +663,4 @@ - E1000_WRITE_REG(hw, E1000_EIMC, 0x1f); - E1000_WRITE_FLUSH(hw); -@@ -1553,6 +1594,14 @@ eth_igc_fw_version_get(struct rte_eth_dev *dev, char *fw_version, - struct e1000_fw_version fw; + IGC_WRITE_REG(hw, IGC_EIMC, 0x1f); + IGC_WRITE_FLUSH(hw); +@@ -1548,7 +1588,15 @@ eth_igc_fw_version_get(struct rte_eth_dev *dev, char *fw_version, + struct igc_fw_version fw; @@ -672,0 +674 @@ + igc_get_fw_version(hw, &fw); @@ -676 +677,0 @@ - e1000_get_fw_version(hw, &fw); @@ -679 +680,2 @@ -@@ -1643,6 +1692,14 @@ eth_igc_led_on(struct rte_eth_dev *dev) + if (fw.or_valid) { +@@ -1638,6 +1686,14 @@ eth_igc_led_on(struct rte_eth_dev *dev) @@ -681 +683 @@ - struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev); + struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev); @@ -691 +693 @@ - return e1000_led_on(hw) == E1000_SUCCESS ? 0 : -ENOTSUP; + return igc_led_on(hw) == IGC_SUCCESS ? 0 : -ENOTSUP; @@ -694 +696 @@ -@@ -1651,6 +1708,14 @@ eth_igc_led_off(struct rte_eth_dev *dev) +@@ -1646,6 +1702,14 @@ eth_igc_led_off(struct rte_eth_dev *dev) @@ -696 +698 @@ - struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev); + struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev); @@ -706 +708 @@ - return e1000_led_off(hw) == E1000_SUCCESS ? 0 : -ENOTSUP; + return igc_led_off(hw) == IGC_SUCCESS ? 0 : -ENOTSUP; @@ -709 +711 @@ -@@ -2194,6 +2259,10 @@ eth_igc_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) +@@ -2188,6 +2252,10 @@ eth_igc_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id) @@ -720 +722 @@ -@@ -2213,6 +2282,10 @@ eth_igc_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id) +@@ -2207,6 +2275,10 @@ eth_igc_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id) @@ -731 +733 @@ -@@ -2276,6 +2349,14 @@ eth_igc_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) +@@ -2270,6 +2342,14 @@ eth_igc_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) @@ -746 +748 @@ -@@ -2777,6 +2858,14 @@ eth_igc_timesync_read_rx_timestamp(__rte_unused struct rte_eth_dev *dev, +@@ -2771,6 +2851,14 @@ eth_igc_timesync_read_rx_timestamp(__rte_unused struct rte_eth_dev *dev, @@ -761 +763 @@ -@@ -2813,6 +2902,14 @@ eth_igc_timesync_read_tx_timestamp(struct rte_eth_dev *dev, +@@ -2807,6 +2895,14 @@ eth_igc_timesync_read_tx_timestamp(struct rte_eth_dev *dev, @@ -773,2 +775,2 @@ - val = E1000_READ_REG(hw, E1000_TSYNCTXCTL); - if (!(val & E1000_TSYNCTXCTL_VALID)) + val = IGC_READ_REG(hw, IGC_TSYNCTXCTL); + if (!(val & IGC_TSYNCTXCTL_VALID))