]> git.ipfire.org Git - thirdparty/linux.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)
committerJakub Kicinski <kuba@kernel.org>
Tue, 30 Sep 2025 01:33:27 +0000 (18:33 -0700)
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>
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c

index a36215195923cf8bd2223b14aef9c60a060dc19d..16c828dd5c1a3f83beeeba217eef6c7c5684c150 100644 (file)
@@ -1788,7 +1788,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);
 }