Skip to content

Commit dc9e9d6

Browse files
committed
Merge branch 'net-enetc-add-more-checks-to-enetc_set_rxfh'
Wei Fang says: ==================== net: enetc: add more checks to enetc_set_rxfh() ENETC only supports Toeplitz algorithm, and VFs do not support setting the RSS key, but enetc_set_rxfh() does not check these constraints and silently accepts unsupported configurations. This may mislead users or tools into believing that the requested RSS settings have been successfully applied. So add checks to reject unsupported hash functions and RSS key updates on VFs, and return "-EOPNOTSUPP" to user space. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents eeee5a7 + a142d13 commit dc9e9d6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

drivers/net/ethernet/freescale/enetc/enetc_ethtool.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,9 +795,17 @@ static int enetc_set_rxfh(struct net_device *ndev,
795795
struct enetc_si *si = priv->si;
796796
int err = 0;
797797

798+
if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE &&
799+
rxfh->hfunc != ETH_RSS_HASH_TOP)
800+
return -EOPNOTSUPP;
801+
798802
/* set hash key, if PF */
799-
if (rxfh->key && enetc_si_is_pf(si))
803+
if (rxfh->key) {
804+
if (!enetc_si_is_pf(si))
805+
return -EOPNOTSUPP;
806+
800807
enetc_set_rss_key(si, rxfh->key);
808+
}
801809

802810
/* set RSS table */
803811
if (rxfh->indir)

0 commit comments

Comments
 (0)