Skip to content

Commit a142d13

Browse files
WeiFang-NXPkuba-moo
authored andcommitted
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: d382563 ("enetc: Add RFS and RSS support") Signed-off-by: Wei Fang <[email protected]> Reviewed-by: Clark Wang <[email protected]> Reviewed-by: Claudiu Manoil <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d389954 commit a142d13

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,12 @@ static int enetc_set_rxfh(struct net_device *ndev,
800800
return -EOPNOTSUPP;
801801

802802
/* set hash key, if PF */
803-
if (rxfh->key && enetc_si_is_pf(si))
803+
if (rxfh->key) {
804+
if (!enetc_si_is_pf(si))
805+
return -EOPNOTSUPP;
806+
804807
enetc_set_rss_key(si, rxfh->key);
808+
}
805809

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

0 commit comments

Comments
 (0)