Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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/20260326075233.3628047-1-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+9 -1
+9 -1
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
··· 795 795 struct enetc_si *si = priv->si; 796 796 int err = 0; 797 797 798 + if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE && 799 + rxfh->hfunc != ETH_RSS_HASH_TOP) 800 + return -EOPNOTSUPP; 801 + 798 802 /* 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 + 800 807 enetc_set_rss_key(si, rxfh->key); 808 + } 801 809 802 810 /* set RSS table */ 803 811 if (rxfh->indir)