From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1481FCA5FA5 for ; Mon, 28 Sep 2026 14:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=O3fJrMQL1fKhE5DPCwlRr2e8oi3phq7U6oB8w73Ea0I=; b=rYYSkyfhagjsDpWHrQKW+7e9jH +L45RPYWlXIFmfQJ55k4SANeztnsI/NhhpQvguNV9XS5HKWAuSVZYr9dJlKNFIF3Q0Dbm5RyWHR1V AQURjlFoW2mxwPmt/JK6+SnGrkI0yZuJoUCY7LlDp5O6pQGj5oIMcY5uNIENyu0Wwc8vEV2629Igq dkCR18LH9z6qaXWIYEp7E4IMDVGq2FHxlRRU/UxB42V7uJDyATILrdAMWRQw75LiXJjo/JGjaeeWf VJRHlw+CFU4BoY0z/a8wKmuTChIHjEM7W6FI8aBJBWj11gcLGPRddvJz04D9WQoe3ERN3BIfM8YTN 1ZNT3Q5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xBChJ-00000000ovw-08bk; Mon, 28 Sep 2026 14:51:17 +0000 Received: from smtpout-02.galae.net ([185.246.84.56]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xBCh5-00000000orn-1TgS for linux-arm-kernel@lists.infradead.org; Mon, 28 Sep 2026 14:51:06 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 4E0541A103C; Mon, 28 Sep 2026 14:51:01 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2171D601BD; Mon, 28 Sep 2026 14:51:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A18BF1032968D; Mon, 28 Sep 2026 16:50:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1790607059; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=O3fJrMQL1fKhE5DPCwlRr2e8oi3phq7U6oB8w73Ea0I=; b=SptTGbpvyTZxZi3oNTAkUvACSYop2iGc2oUfB9BB9vIXQkYHE7anqVr+Na61W/DR7beoFX eTsdG7ylS8dDLuk9yTkikpuweq7tmvYmMeJvO2Bdu6aTwWZDvtKDCpZx7WwcCxxV7SmtoQ +FYh/jVNHTv3EgrRZF+HJxfs2Zevg1hVQOTItaAFonV3q4xrsjC7l1njodRDDqOZKDCejd ahYsMnAeZGuqjCeAr3jgCbqiHssmMZQGrKFXLlsWraIGHBSdAb9LVR4s6Ixns7Ru5gxunN JMXBWSSgMFqxOc0awxWUghMSjR9mxQ6qPkVE/uzBUx4xqPekWSUVLtyl87mqPw== From: Maxime Chevallier To: Andrew Lunn , Jakub Kicinski , davem@davemloft.net, Eric Dumazet , Paolo Abeni , Simon Horman , Maxime Coquelin , Alexandre Torgue , Russell King , Nicolai Buchwitz , Jitendra Vegiraju Cc: Maxime Chevallier , thomas.petazzoni@bootlin.com, =?UTF-8?q?Alexis=20Lothor=C3=A9?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Peter Robinson Subject: [PATCH net-next v2 2/2] net: stmmac: Don't set or get RSS parameters when not supported Date: Mon, 28 Sep 2026 16:50:42 +0200 Message-ID: <20260928145043.1228968-3-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260928145043.1228968-1-maxime.chevallier@bootlin.com> References: <20260928145043.1228968-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260928_075103_546727_CCF65B6D X-CRM114-Status: GOOD ( 12.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The RSS kselftests fail on stmmac, and this is partly due to the driver reporting bogus data for the RSS ops : - ethtool -x reports an indirection table and a key while the hardware doesn't have any of that - ethtool -X fails with -EINVAL. Let's return early in the rss ops if we know the hardware and platform don't support RSS. Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c index 154cc0c7623d..b78dc301d70d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -927,6 +927,9 @@ static u32 stmmac_get_rxfh_key_size(struct net_device *dev) { struct stmmac_priv *priv = netdev_priv(dev); + if (!stmmac_rss_is_supported(priv)) + return 0; + return sizeof(priv->rss.key); } @@ -934,6 +937,9 @@ static u32 stmmac_get_rxfh_indir_size(struct net_device *dev) { struct stmmac_priv *priv = netdev_priv(dev); + if (!stmmac_rss_is_supported(priv)) + return 0; + return ARRAY_SIZE(priv->rss.table); } @@ -943,6 +949,9 @@ static int stmmac_get_rxfh(struct net_device *dev, struct stmmac_priv *priv = netdev_priv(dev); int i; + if (!stmmac_rss_is_supported(priv)) + return -EOPNOTSUPP; + if (rxfh->indir) { for (i = 0; i < ARRAY_SIZE(priv->rss.table); i++) rxfh->indir[i] = priv->rss.table[i]; @@ -962,6 +971,9 @@ static int stmmac_set_rxfh(struct net_device *dev, struct stmmac_priv *priv = netdev_priv(dev); int i; + if (!stmmac_rss_is_supported(priv)) + return -EOPNOTSUPP; + if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE && rxfh->hfunc != ETH_RSS_HASH_TOP) return -EOPNOTSUPP; -- 2.55.0