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 92212454E9 for ; Tue, 25 Jun 2024 02:02:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DC9C410DC; Tue, 25 Jun 2024 02:02:04 +0200 (CEST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mails.dpdk.org (Postfix) with ESMTP id 4173940EDD for ; Tue, 25 Jun 2024 02:02:03 +0200 (CEST) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-421820fc26dso40384045e9.2 for ; Mon, 24 Jun 2024 17:02:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719273723; x=1719878523; 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=7IOeYj2QaQlVENK8/zWg4NcxlRVJiRTiRgqpvmRwZJY=; b=JwCDz0AP7n+8yyLKZ8MtX8pDxK+LAFwpMt2BHOlWrfMokGNernRTeDAKhlPvjKMemX 0auXWnq6j+moRgX+dHhZPqwUMEsb1GouURt5iHk+Nt9euJ7v5NfQiHxHHK7qdy/jOZ12 o+phECb75AJ1P3zgi+VonU3iV0KhnDu485ObnUZ3Ct4TgKfQVb1fkjbUR4/6V6oCU/b8 5yp2WqgkccSzpZpAXy77s7RNx8FiLJJ5oTvrUQLThmeMNNm+h1y3SCCDlY26p1Zu3Zfx 5G99Si9H/IoC2pTWC/UzhLJ66y0l70VrCC06AgUszy2dZv5f4wX6EFcE2cRginQPC4yY xgCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719273723; x=1719878523; 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=7IOeYj2QaQlVENK8/zWg4NcxlRVJiRTiRgqpvmRwZJY=; b=luabGTNBdQpLL6YDox//Y/2ZQviAdc+Zr08A4kD9bXQEa9vwd+vNZV7IOIslxZ7bOn iUNYhsByKDAXNBNYsGhcpiB/W1x+MatEF4Y7+t//zbx7mmt5pYjNf5bKow5L4JoqAb5d B6o68YqKbhYBYfdiPG09WCSpyl1wFbTaS0WDS8fS0fE6myuq3kBx9emBOxf/XLxh4wOt WMqePMzXSF6jwaOS4/xlAz0xztcO26Eo/6/mCOseLxtfEvZs4AjuRbqqL7dGLgzjhLuv cfUIOB80QIcMejNybWEAzW3aIQUWvxFBOXFtJAHJ8xOaVgNpZb9Y4ywwM0HnV2agxM7Z SZhA== X-Forwarded-Encrypted: i=1; AJvYcCUcdBrdZ4IsC2o9r194PLW9k4GoKIQclgsUPxw0kRQtDB1uSmr1lR56XeKmekN48/3d33WV/nsgoO8mVyZWuHQ= X-Gm-Message-State: AOJu0YyruU816YuH1k08zhd9TQqiFVy4CmR5GPgYz+Zb+hL403LaOfRd QNbYj4GeYTM6yQx064oLtbMOZLNSNBnG9FOgpNkqcm1OACeHbU/D X-Google-Smtp-Source: AGHT+IFTt7ISBaqi2KK3W3y/s5gX3H5qp2yoJ9JMfUVqbtYUBn0Hu9Y4r/ckeeKfhbqn0f5TWQAKaw== X-Received: by 2002:a05:600c:358c:b0:424:9177:17ef with SMTP id 5b1f17b1804b1-42491771ccdmr28469165e9.39.1719273722790; Mon, 24 Jun 2024 17:02:02 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-366e88c0c38sm6958214f8f.32.2024.06.24.17.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 17:02:02 -0700 (PDT) From: luca.boccassi@gmail.com 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 22.11.6 Date: Tue, 25 Jun 2024 00:58:39 +0100 Message-Id: <20240624235907.885628-53-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240624235907.885628-1-luca.boccassi@gmail.com> References: <20240624235907.885628-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/27/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/b2e98edd71e3695d23c9f83840246099fb23f28d Thanks. Luca Boccassi --- >From b2e98edd71e3695d23c9f83840246099fb23f28d 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 311a6828a0..9e1a65a50a 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4660,14 +4660,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.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-06-25 00:22:16.589954884 +0100 +++ 0053-net-ixgbe-do-not-create-delayed-interrupt-handler-tw.patch 2024-06-25 00:22:13.197185893 +0100 @@ -1 +1 @@ -From 130ece79670d57760acd18c9671f91a4cd4e07a0 Mon Sep 17 00:00:00 2001 +From b2e98edd71e3695d23c9f83840246099fb23f28d 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 311a6828a0..9e1a65a50a 100644 @@ -45 +46 @@ -@@ -4672,14 +4672,20 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev) +@@ -4660,14 +4660,20 @@ ixgbe_dev_interrupt_action(struct rte_eth_dev *dev)