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 290394624E for ; Mon, 17 Feb 2025 18:06:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24404400D6; Mon, 17 Feb 2025 18:06:46 +0100 (CET) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id C8786402DF for ; Mon, 17 Feb 2025 18:06:44 +0100 (CET) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4397e5d5d99so8387185e9.1 for ; Mon, 17 Feb 2025 09:06:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739812004; x=1740416804; 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=+f95TR7MuQbpW1klGdaAY0EpwckbKNJ709D8NoamjwA=; b=Y7wQp4uZ4v8DaCT78TgYnP6YAQwFzOP9rLjGZDdNRuXAmvJ+0ZWt6v2lcIk7cKq34D pbntZjNjWlKSOKnJ/eJNhTUOkfTch2DlaZ33HFDIL0+p6KnAbUgN1Nqr3XGtytTgJELn 0Ai75130zTDTTPrx8+NSYYEsVt7GBuYG4Eef62YC0RX9WmbC8kKI6GEiZpexexQr9ehg zSYi+ckGbOzLjn/hbv35LKyxHlw8IpZwz+weWizC5UUi/NpzIcu50UYJlmvVhtQcoHSk ju70nhpNLolZwjfka7CQsGes02dto1EU9XN+yVByno4PqRQFXa4h328uqQjmvSve3PKf fWcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739812004; x=1740416804; 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=+f95TR7MuQbpW1klGdaAY0EpwckbKNJ709D8NoamjwA=; b=YDHoJejgj+sNf6Xq0bCIthmZlA5iAdjaw3zHL8ETC/+jrC4lIwohfurRKFBpzpj8Bi 67eAYJBl/FpQOGHa4VI3tYmXzAqfIq7ltjpFoVcKUl4kb1PShvpLgxhIc1I1Ubh+C6uZ Mzg0wN7LUuXV9ige/XbEaAGUmBHNe1839wItIpT2izPB16Nsnb58U0dJxvhhGe0PjLhn ygHSjwugv+rkTNyXlFQSLXRpPl5jwFxVu3pzRqSEO7GYZriBqsrAvUzrSuBl0dbZrqeR 0u2WWKTQhjXtOEXiOs3qiGGrhAbAAtk062bwQkjveqi6mMUG0ICFE3sc0kAEDu/9QtGr 36rw== X-Forwarded-Encrypted: i=1; AJvYcCXcYN8t98/sT3mvNBzT34KLkcCV+EV28aHL+2TxPy1fMjY/1tU/vFe1y85PKeVn72LuNnc2gsI=@dpdk.org X-Gm-Message-State: AOJu0YwH10RRM+3WVDPMDNJTHZACKGcQ2j7GKw27hsZSAy6z6mFypY5E ElaOC5vOh/VdLewvGcpxMq0LgQHd8D5/qy6eSLyCvGLEUqEBEod/ X-Gm-Gg: ASbGncvWAJmYXid4cXIKzHjgu9KPihltcmvtu+8fbX5mDhxSIY5ruYrk0TIKoG0u7s5 ibvatF6uKyRzCEELSz9m0Fd+6fR3+Dbrd+DpfdJhrpnVBRfGI3X508jtT7P4CHzirKvkjMIXbZM a8m+AwZ4lif5Ilas5zG0NDSug+rdikNcI9L+9ird9RQg1qSHFjVw7tQv1NHmLLMYKtdF6enki1q qDlH12Q5OaYmJXOyaADm3jRWeeDK4pM6wiWPVf2tzZB6D/h5CLYDXBm2sYHFMgw+147t5nhceaP D2Q43hcQC6jGxwUg+mrvwA== X-Google-Smtp-Source: AGHT+IEtvKW20jovTc36lwoGWp7o++Yt+QTIiZsHqZF/W8tRAiWwLjmDYkhc0UgMQMi/Ap8JjoZ1vQ== X-Received: by 2002:a5d:5a4c:0:b0:38b:f44b:8663 with SMTP id ffacd0b85a97d-38f3417165fmr8798125f8f.55.1739812004152; Mon, 17 Feb 2025 09:06:44 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:f83c:95e7:29fd:a997]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-38f258b4118sm13100703f8f.18.2025.02.17.09.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 09:06:43 -0800 (PST) From: luca.boccassi@gmail.com To: Dima Ruinskiy Cc: Anatoly Burakov , Bruce Richardson , dpdk stable Subject: patch 'net/igc/base: fix infinite loop' has been queued to stable release 22.11.8 Date: Mon, 17 Feb 2025 17:04:08 +0000 Message-ID: <20250217170456.1068278-35-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250217170456.1068278-1-luca.boccassi@gmail.com> References: <20250217170456.1068278-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.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 02/19/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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/17e21b8056ae9ab66dc5f9e42297aaffb730886a Thanks. Luca Boccassi --- >From 17e21b8056ae9ab66dc5f9e42297aaffb730886a Mon Sep 17 00:00:00 2001 From: Dima Ruinskiy Date: Thu, 6 Feb 2025 16:08:25 +0000 Subject: [PATCH] net/igc/base: fix infinite loop [ upstream commit 532e495e4a20cf09e1f42d01bcbe782f7e2bb03f ] When the driver fails to acquire HW semaphore, there is nothing that can be done to address it, so just leave to avoid an infinite loop. Fixes: 8cb7c57d9b3c ("net/igc: support device initialization") Signed-off-by: Dima Ruinskiy Signed-off-by: Anatoly Burakov Acked-by: Bruce Richardson --- drivers/net/igc/base/igc_i225.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/igc/base/igc_i225.c b/drivers/net/igc/base/igc_i225.c index 180d3cf687..c2fae6e797 100644 --- a/drivers/net/igc/base/igc_i225.c +++ b/drivers/net/igc/base/igc_i225.c @@ -330,8 +330,15 @@ void igc_release_swfw_sync_i225(struct igc_hw *hw, u16 mask) DEBUGFUNC("igc_release_swfw_sync_i225"); - while (igc_get_hw_semaphore_i225(hw) != IGC_SUCCESS) - ; /* Empty */ + /* Releasing the resource requires first getting the HW semaphore. + * If we fail to get the semaphore, there is nothing we can do, + * except log an error and quit. We are not allowed to hang here + * indefinitely, as it may cause denial of service or system crash. + */ + if (igc_get_hw_semaphore_i225(hw) != IGC_SUCCESS) { + DEBUGOUT("Failed to release SW_FW_SYNC.\n"); + return; + } swfw_sync = IGC_READ_REG(hw, IGC_SW_FW_SYNC); swfw_sync &= ~mask; -- 2.47.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-02-17 16:13:18.120543038 +0000 +++ 0035-net-igc-base-fix-infinite-loop.patch 2025-02-17 16:13:16.838441592 +0000 @@ -1 +1 @@ -From 532e495e4a20cf09e1f42d01bcbe782f7e2bb03f Mon Sep 17 00:00:00 2001 +From 17e21b8056ae9ab66dc5f9e42297aaffb730886a Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 532e495e4a20cf09e1f42d01bcbe782f7e2bb03f ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -16 +17 @@ - drivers/net/intel/igc/base/igc_i225.c | 11 +++++++++-- + drivers/net/igc/base/igc_i225.c | 11 +++++++++-- @@ -19,5 +20,5 @@ -diff --git a/drivers/net/intel/igc/base/igc_i225.c b/drivers/net/intel/igc/base/igc_i225.c -index 17a1573064..8f01f8d918 100644 ---- a/drivers/net/intel/igc/base/igc_i225.c -+++ b/drivers/net/intel/igc/base/igc_i225.c -@@ -333,8 +333,15 @@ void igc_release_swfw_sync_i225(struct igc_hw *hw, u16 mask) +diff --git a/drivers/net/igc/base/igc_i225.c b/drivers/net/igc/base/igc_i225.c +index 180d3cf687..c2fae6e797 100644 +--- a/drivers/net/igc/base/igc_i225.c ++++ b/drivers/net/igc/base/igc_i225.c +@@ -330,8 +330,15 @@ void igc_release_swfw_sync_i225(struct igc_hw *hw, u16 mask)