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 1437A45804 for ; Fri, 23 Aug 2024 18:21:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C92F402BE; Fri, 23 Aug 2024 18:21:13 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 9ABA940295 for ; Fri, 23 Aug 2024 18:21:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724430071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ESdWRic6loSkwxzRHCFbIBcqlZVK6Q4gp5aGETdMRcY=; b=Xz9uCc6PSmqF3dGjmQSYAPI5Lfe2Fe4ybleNZXArpFn5xIiYulUNYxH7zRrcyp7npflEjy hQEGCD7ePzjWyepze4tv1dwLAIYK+m5jsWjFerzCODbhCU4fkVSZxsZVdk25ftK0ZAQHvr +FuqLzImRGm+yGoKJU6bKCKobO4n1zU= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-472-qeGg2ZbaM4SH_lMucolL8A-1; Fri, 23 Aug 2024 12:21:08 -0400 X-MC-Unique: qeGg2ZbaM4SH_lMucolL8A-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 06F501955D42; Fri, 23 Aug 2024 16:21:07 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.193.224]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A700B1956053; Fri, 23 Aug 2024 16:21:05 +0000 (UTC) From: Kevin Traynor 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 21.11.8 Date: Fri, 23 Aug 2024 17:17:49 +0100 Message-ID: <20240823161929.1004778-41-ktraynor@redhat.com> In-Reply-To: <20240823161929.1004778-1-ktraynor@redhat.com> References: <20240823161929.1004778-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 21.11.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/28/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://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/f6e83fa8b322012c2fe5fa503e697e1fb4de89e8 Thanks. Kevin --- >From f6e83fa8b322012c2fe5fa503e697e1fb4de89e8 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 [ 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 1c65cf77f5..4ba25435fd 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4663,12 +4663,18 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev) 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.46.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-08-23 17:18:11.160806778 +0100 +++ 0041-net-ixgbe-do-not-create-delayed-interrupt-handler-tw.patch 2024-08-23 17:18:09.688429993 +0100 @@ -1 +1 @@ -From 130ece79670d57760acd18c9671f91a4cd4e07a0 Mon Sep 17 00:00:00 2001 +From f6e83fa8b322012c2fe5fa503e697e1fb4de89e8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 130ece79670d57760acd18c9671f91a4cd4e07a0 ] + @@ -33 +34,0 @@ -Cc: stable@dpdk.org @@ -42 +43 @@ -index a6916da0c5..1f93be98ca 100644 +index 1c65cf77f5..4ba25435fd 100644 @@ -45 +46 @@ -@@ -4673,12 +4673,18 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev) +@@ -4663,12 +4663,18 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev)