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 9B98C45610 for ; Fri, 12 Jul 2024 12:52:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94D3E42F1F; Fri, 12 Jul 2024 12:52:17 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2057.outbound.protection.outlook.com [40.107.237.57]) by mails.dpdk.org (Postfix) with ESMTP id 887E340261 for ; Fri, 12 Jul 2024 12:52:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fHIwjfelb4q3G1kW/ISl4Obv9XGt7N0OSUljLNyk4D9E6GdRwYhIN8OYb1W23dr6+LLr3QIX+pSvYe1VN3qgNpW2KonZgd/NLLvPAIRqVBQMAuLSk8X1BNxZ/ihSy57OH7gDZPOxn3pk0IjhPK+kOrvrHjErZeh/zKBR7WFY93xi558CzD6phULQxSaIJh99SMHMTSyLMQxXLDCuX8rpXl4tOJlfNMMpvYkSc95vBmNBlsdor24WGavKarKzWB20tG3NUjpiNev+PyV5TpKuUU5eWqiJ3dKg+HW3vLH54XgdMi8YPwUkYEeNKUDxvpq8eZlCj6VpOHrEXRo/4WpIOg== 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=myVLlaFVfoaYjFZiaD/HcAMY9ha8yLXbnNQWpjPMyBs=; b=SXHL/QXL8VYvuUw5TqU9MFAt/3whb+cD52YgGv8Bd9GAl5ZvYTEiJ/R6Bh9mU0qyUK45tK56ElEFaTVc4BA2hPpvVYSp5Gz6Kx6I2wUKFvEZa/kV7oOayyYLz/2wBz0YE1VR2EgSVxH0c8wlFhz4bqdyBVoV1uL1e5UA++R+jSKbuO3b6l8VY1YNafiz6wVr8B+HdPAEcr0mVqOPNB2+fV9mHDPFIN/9yMgDaMA4hBDQS5uzVZQLqjteqZdHe2pDer6oSxrm94f0UvdLH2rDh9z+DQP6E/4s5IlKsU6XTjSJHqpxeflny/+GiL3lUU2Y5GL7kMkKYA6kHEW3E/VBRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=6wind.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=myVLlaFVfoaYjFZiaD/HcAMY9ha8yLXbnNQWpjPMyBs=; b=OFra9rnqmpzXWVmimMrMPHWRMR3H0J5R3MzQd2TOYVKYS/GWAoL4UUq4AfIAGzIw9WDRWPf/OxsHtgKvISnBgmPbRRryhiCNXZc7Y9hR4YcVZ0HyIFyaSPdonA4s6h5/nPGzEkSCNRa+YONfOXtG8LSHkiY4Ab/dR1TXyUE4ZXoC2JHkFJTrT7dHRvrNKoX6HI269vnbJZ2bwsrkSuemy2bGwSx0ip6mJowO0Pn7k8PTwn7L2wFHBupoSSXw/kReQl4Narxnj6ar4ocySNwhv1qv68QTxAqGFebjkAquKMDX8B+WsnrQpndDPPKpoqR4tO+hRw3LO0jztaDOSvHW2g== Received: from SJ0PR03CA0238.namprd03.prod.outlook.com (2603:10b6:a03:39f::33) by MN2PR12MB4080.namprd12.prod.outlook.com (2603:10b6:208:1d9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23; Fri, 12 Jul 2024 10:52:11 +0000 Received: from SJ5PEPF000001D0.namprd05.prod.outlook.com (2603:10b6:a03:39f:cafe::b2) by SJ0PR03CA0238.outlook.office365.com (2603:10b6:a03:39f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23 via Frontend Transport; Fri, 12 Jul 2024 10:52:11 +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 SJ5PEPF000001D0.mail.protection.outlook.com (10.167.242.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Fri, 12 Jul 2024 10:52:11 +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; Fri, 12 Jul 2024 03:52:02 -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.4; Fri, 12 Jul 2024 03:52:00 -0700 From: Xueming Li To: Edwin Brossette CC: Anatoly Burakov , dpdk stable Subject: patch 'net/ixgbe: do not create delayed interrupt handler twice' has been queued to stable release 23.11.2 Date: Fri, 12 Jul 2024 18:44:50 +0800 Message-ID: <20240712104528.308638-65-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240712104528.308638-1-xuemingl@nvidia.com> References: <20240712104528.308638-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: SJ5PEPF000001D0:EE_|MN2PR12MB4080:EE_ X-MS-Office365-Filtering-Correlation-Id: a9f00b19-cce3-4a27-3a99-08dca260aecc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?VbP7nJxUAmvB/0KwRElVWh5vPX9Ky39OwKTuUfGGcwDaAGiUuf63Q8R+88qg?= =?us-ascii?Q?ttVT2pCm3SWBSCD4a4nsA3fvmgCURFClGuvd1GqPMrmvrErk6P1bk/f01Uth?= =?us-ascii?Q?oZo1w32YvtW/OiSFWrkplfcDAzRFoTXpa+QBCKNfFSShU+7x7IhkZ8uPSY9/?= =?us-ascii?Q?7Ri6hQUsDIZyMwik9bWC8yVbp943THCNxTM6jmjaVOVzcReQ9gKF/XiPqwN+?= =?us-ascii?Q?NcrD/5xhSMidyse1rPuZxylJjhZW4r33HWaZKfZsZ5xiNDILLrwDum8PXTno?= =?us-ascii?Q?f1qF4FVhS066eu3sAsEqzq8NfG36czxXD2woRD0ulsUI6urSYZZerBG8o3Q+?= =?us-ascii?Q?p82hWRjFNZJoqyIuQDT6bFUqvs7ozpcsHDmHFLAoFouNmk4zMejFOxHto/Hb?= =?us-ascii?Q?FGbze8wCiqo3mUf/ViSty28TXB4mjnfUJvNw8ImOLWzUXa184Nymwma2q4n7?= =?us-ascii?Q?iDXUNyHseBmfGTq/Np5/aBZYbPC8x5SdVE4U2/ODQNNysH1PiPL4Rj76TCd1?= =?us-ascii?Q?Zb8tOdgL3SHGAPqATAUZJ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e?= =?us-ascii?Q?F9Vhz66eB+QiXdH/aEinatzJymKMwd6R?= 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)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 10:52:11.2479 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9f00b19-cce3-4a27-3a99-08dca260aecc 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: SJ5PEPF000001D0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4080 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.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/24. 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=84946e8d982ab9cec49c94313bf56fae9ce3f100 Thanks. Xueming Li --- >From 84946e8d982ab9cec49c94313bf56fae9ce3f100 Mon Sep 17 00:00:00 2001 From: Edwin Brossette Date: Thu, 18 Apr 2024 15:53:07 +0200 Subject: [PATCH] net/ixgbe: do not create delayed interrupt handler twice Cc: Xueming Li [ upstream commit 130ece79670d57760acd18c9671f91a4cd4e07a0 ] Since link state may need some time to stabilize after a link state change, we cannot update the link state right after one occurs. So link state change interrupts (LSC) are handled after a delay. To do this, an alarm to call a delayed handler is programmed. This delayed handler is tasked with updating the link after a variable delay of one to four seconds which should be enough time for the link state to become stable again. However, a problem can occur with some models of network cards. For example, ixgbe_mac_X550EM_x may trigger this interrupt twice because another interrupt signal is received on the General Purpose Interrupt pin SPD0, which has the same interrupt handler. In such a case, the delayed interrupt handler would be programmed to be executed twice. Since we save the original interrupt mask value to restore it after the delayed handler is done with its work, we end up overwriting its value after the second alarm is programmed. Even worse: when restoring it the first time, the saved original mask variable is reset to 0, so we end up completely disabling all interrupts when trying to restore this mask after the second time the delayed handler is executed. Add a check on the interrupt mask value when programming the alarm for the delayed handler. If the bit for LSC interrupts is unset, it means an alarm was already programmed for the delayed handler. In this case, skip the alarm creation. Fixes: 9b667210700e ("net/ixgbe: fix blocked interrupts") Signed-off-by: Edwin Brossette Reviewed-by: Anatoly Burakov --- drivers/net/ixgbe/ixgbe_ethdev.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index a54920042b..a44497ce51 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4666,14 +4666,20 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev) timeout = IXGBE_LINK_DOWN_CHECK_TIMEOUT; ixgbe_dev_link_status_print(dev); - if (rte_eal_alarm_set(timeout * 1000, - ixgbe_dev_interrupt_delayed_handler, (void *)dev) < 0) - PMD_DRV_LOG(ERR, "Error setting alarm"); - else { - /* remember original mask */ - intr->mask_original = intr->mask; - /* only disable lsc interrupt */ - intr->mask &= ~IXGBE_EIMS_LSC; + + /* Don't program delayed handler if LSC interrupt is disabled. + * It means one is already programmed. + */ + if (intr->mask & IXGBE_EIMS_LSC) { + if (rte_eal_alarm_set(timeout * 1000, + ixgbe_dev_interrupt_delayed_handler, (void *)dev) < 0) + PMD_DRV_LOG(ERR, "Error setting alarm"); + else { + /* remember original mask */ + intr->mask_original = intr->mask; + /* only disable lsc interrupt */ + intr->mask &= ~IXGBE_EIMS_LSC; + } } } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-12 18:40:17.068612771 +0800 +++ 0064-net-ixgbe-do-not-create-delayed-interrupt-handler-tw.patch 2024-07-12 18:40:14.156594221 +0800 @@ -1 +1 @@ -From 130ece79670d57760acd18c9671f91a4cd4e07a0 Mon Sep 17 00:00:00 2001 +From 84946e8d982ab9cec49c94313bf56fae9ce3f100 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 130ece79670d57760acd18c9671f91a4cd4e07a0 ] @@ -33 +35,0 @@ -Cc: stable@dpdk.org @@ -42 +44 @@ -index a6916da0c5..1f93be98ca 100644 +index a54920042b..a44497ce51 100644 @@ -45 +47 @@ -@@ -4672,14 +4672,20 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev) +@@ -4666,14 +4666,20 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev)