]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nfp: fix RSS hash key size when RSS is not supported
authorKohei Enju <enjuk@amazon.com>
Mon, 29 Sep 2025 05:42:15 +0000 (14:42 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2025 09:56:38 +0000 (11:56 +0200)
[ Upstream commit 8425161ac1204d2185e0a10f5ae652bae75d2451 ]

The nfp_net_get_rxfh_key_size() function returns -EOPNOTSUPP when
devices don't support RSS, and callers treat the negative value as a
large positive value since the return type is u32.

Return 0 when devices don't support RSS, aligning with the ethtool
interface .get_rxfh_key_size() that requires returning 0 in such cases.

Fixes: 9ff304bfaf58 ("nfp: add support for reporting CRC32 hash function")
Signed-off-by: Kohei Enju <enjuk@amazon.com>
Link: https://patch.msgid.link/20250929054230.68120-1-enjuk@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c

index af376b900067736f0c6575b4bb840c7275f0196e..7ee919201985fc4ef8e9cbbcb1b1d5a9d537e1b3 100644 (file)
@@ -1409,7 +1409,7 @@ static u32 nfp_net_get_rxfh_key_size(struct net_device *netdev)
        struct nfp_net *nn = netdev_priv(netdev);
 
        if (!(nn->cap & NFP_NET_CFG_CTRL_RSS_ANY))
-               return -EOPNOTSUPP;
+               return 0;
 
        return nfp_net_rss_key_sz(nn);
 }