Commit a142d139 authored by Wei Fang's avatar Wei Fang Committed by Jakub Kicinski
Browse files

net: enetc: do not allow VF to configure the RSS key



VFs do not have privilege to configure the RSS key because the registers
are owned by the PF. Currently, if VF attempts to configure the RSS key,
enetc_set_rxfh() simply skips the configuration and does not generate a
warning, which may mislead users into thinking the feature is supported.
To improve this situation, add a check to reject RSS key configuration
on VFs.

Fixes: d382563f ("enetc: Add RFS and RSS support")
Signed-off-by: default avatarWei Fang <wei.fang@nxp.com>
Reviewed-by: default avatarClark Wang <xiaoning.wang@nxp.com>
Reviewed-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
Link: https://patch.msgid.link/20260326075233.3628047-3-wei.fang@nxp.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent d389954a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -800,8 +800,12 @@ static int enetc_set_rxfh(struct net_device *ndev,
		return -EOPNOTSUPP;

	/* set hash key, if PF */
	if (rxfh->key && enetc_si_is_pf(si))
	if (rxfh->key) {
		if (!enetc_si_is_pf(si))
			return -EOPNOTSUPP;

		enetc_set_rss_key(si, rxfh->key);
	}

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