From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22529610B; Mon, 14 Oct 2024 14:30:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728916236; cv=none; b=ltPKSj72JSEm890pFyGPzinIcwJPLXgdc1Yt2h8kIEX67Dr0xOS4DwZz1AY1HWUGeNob4Laagl7NaiOpShqgiZ+HZK7jqFKvgAkCMF/qt2UzbunkwiNpxP5k9yko96RlqvWkncFeb9ijEUJ4mN3EzI6/kNGFjxTJBmLt8jYGLl0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728916236; c=relaxed/simple; bh=6D7w2DAD2CTFivULAzbS190war7cozXRYS2WYdPMzp0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hd9GTG94v0JKxzGURBSAW6teblh+8g9KwCSU6/K9bDeFrFaeujJFRy315gWgrAWt7S4tmEdm7HNzjFEKvxK2yOLYw0cRIhacUZv63WPUiKEXseQlB4DYRs4xDlm+dUrdhiFlUPP42R9XXrf6kR+BoraeD5s0R6ZxSU/qLylyb0Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TIfu4nEE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TIfu4nEE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56B98C4CEC7; Mon, 14 Oct 2024 14:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728916235; bh=6D7w2DAD2CTFivULAzbS190war7cozXRYS2WYdPMzp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TIfu4nEE1NsJD5/yGXxF5V0hSzsmeWN/qrtPVXAyIL6BV/t/qQ2IHNNxw41+H9DqB V3v7eg97KkjI1dH59/5sYO+zU/mArx2rbpLAFaz5DTadLXFWRDWr27dGGiS05vRqyJ 8XBAax4DDeG+kjzAxVMjmZJYSzTTNsgbAhN5+yFM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Przemek Kitszel , Marcin Szycik , Brett Creeley , Sujai Buvaneswaran , Tony Nguyen , Sasha Levin Subject: [PATCH 6.11 121/214] ice: Fix netif_is_ice() in Safe Mode Date: Mon, 14 Oct 2024 16:19:44 +0200 Message-ID: <20241014141049.712634384@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241014141044.974962104@linuxfoundation.org> References: <20241014141044.974962104@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marcin Szycik [ Upstream commit 8e60dbcbaaa177dacef55a61501790e201bf8c88 ] netif_is_ice() works by checking the pointer to netdev ops. However, it only checks for the default ice_netdev_ops, not ice_netdev_safe_mode_ops, so in Safe Mode it always returns false, which is unintuitive. While it doesn't look like netif_is_ice() is currently being called anywhere in Safe Mode, this could change and potentially lead to unexpected behaviour. Fixes: df006dd4b1dc ("ice: Add initial support framework for LAG") Reviewed-by: Przemek Kitszel Signed-off-by: Marcin Szycik Reviewed-by: Brett Creeley Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 5bd0d7252081c..39f89cb590cf2 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -86,7 +86,8 @@ ice_indr_setup_tc_cb(struct net_device *netdev, struct Qdisc *sch, bool netif_is_ice(const struct net_device *dev) { - return dev && (dev->netdev_ops == &ice_netdev_ops); + return dev && (dev->netdev_ops == &ice_netdev_ops || + dev->netdev_ops == &ice_netdev_safe_mode_ops); } /** -- 2.43.0