Skip to contentSkip to conversation

eth: intel: fix unintentional symmetric RSS

PATCH In review Jakub Kicinski 4 participants 8 messages Nov 23

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

cover eth: intel: fix unintentional symmetric RSS

Fix Intel drivers not handling RXH_XFRM_NO_CHANGE.

I had an urge to "fix this in the core" and hide RXH_XFRM_NO_CHANGE from the drivers, by fetching the current config instead. But "NO_CHANGE" values are already part of the driver facing API (hfunc has ETH_RSS_HASH_NO_CHANGE). Besides we can't _completely_ hide RXH_XFRM_NO_CHANGE from the drivers, since we want the drivers to be able to populate the defaults for new RSS contexts. We need a "user didn't say" value there.

---

Matt pointed out that the upcoming RSS sizing series breaks NIPA tests, this is because the fix we shared in June:
https://lore.kernel.org/[email protected]
or Maciej's version:
https://lore.kernel.org/[email protected]
is still not upstream!?

Recent discussions suggest that Intel maintainers may be willing to ack patches on netdev directly. Let's put that to tests.

Note that I think this is a major bug likely to bother real users so I'm targetting net. Przemek's series will have to wait for net->net-next merge.

Jakub Kicinski (2):
ice: don't unintentionally switch to symmetric RSS hash
iavf: don't unintentionally switch to symmetric RSS hash

 drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 3 ++-
 drivers/net/ethernet/intel/ice/ice_ethtool.c   | 9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)
Signature · 1 line
2.56.1
author maintainer
#1 lore raw

PATCH 1/2 ice: don't unintentionally switch to symmetric RSS hash

RXH_XFRM_NO_CHANGE is 0xff, ice looks at this field to check if RXH_XFRM_SYM_XOR bit is set, without first checking for the special NO_CHANGE value.

This causes any ethtool -X invocation without explicitly specifying input_xfrm to enable symmetric-hashing. NIPA HW tests catch this, and we have been carrying this fix in NIPA test branches for months.

Fixes 0dd415d15505 ("net: ethtool: add a NO_CHANGE uAPI for new RXFH's input_xfrm")
---
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_ethtool.c +6 -3
index dffa213734f1..8f13b7607c9f 100644
@@ -3681,10 +3681,10 @@ ice_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh,
 	     struct netlink_ext_ack *extack)
 {
 	struct ice_netdev_priv *np = netdev_priv(netdev);
-	u8 hfunc = ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ;
 	struct ice_vsi *vsi = np->vsi;
 	struct ice_pf *pf = vsi->back;
 	struct device *dev;
+	u8 hfunc;
 	int err;
 
 	dev = ice_pf_to_dev(pf);
@@ -3703,9 +3703,12 @@ ice_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh,
 		return -EOPNOTSUPP;
 	}
 
-	/* Update the VSI's hash function */
-	if (rxfh->input_xfrm & RXH_XFRM_SYM_XOR)
+	if (rxfh->input_xfrm == RXH_XFRM_NO_CHANGE)
+		hfunc = vsi->rss_hfunc;
+	else if (rxfh->input_xfrm & RXH_XFRM_SYM_XOR)
 		hfunc = ICE_AQ_VSI_Q_OPT_RSS_HASH_SYM_TPLZ;
+	else /* input_xfrm == 0; core rejects any other value */
+		hfunc = ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ;
 
 	err = ice_set_rss_hfunc(vsi, hfunc);
 	if (err)
Signature · 1 line
2.56.1
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH net 1/2] ice: don't unintentionally switch to symmetric RSS hash

Quoted 11 lines · Jakub Kicinski

RXH_XFRM_NO_CHANGE is 0xff, ice looks at this field to check if RXH_XFRM_SYM_XOR bit is set, without first checking for the special NO_CHANGE value.

This causes any ethtool -X invocation without explicitly specifying input_xfrm to enable symmetric-hashing. NIPA HW tests catch this, and we have been carrying this fix in NIPA test branches for months.

Fixes 0dd415d15505 ("net: ethtool: add a NO_CHANGE uAPI for new RXFH's input_xfrm")

Let's just get this damn thing fixed ;)

Quoted 39 lines
---
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_ethtool.c +6 -3
index dffa213734f1..8f13b7607c9f 100644
@@ -3681,10 +3681,10 @@ ice_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh,
 	     struct netlink_ext_ack *extack)
 {
 	struct ice_netdev_priv *np = netdev_priv(netdev);
-	u8 hfunc = ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ;
 	struct ice_vsi *vsi = np->vsi;
 	struct ice_pf *pf = vsi->back;
 	struct device *dev;
+	u8 hfunc;
 	int err;
 
 	dev = ice_pf_to_dev(pf);
@@ -3703,9 +3703,12 @@ ice_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh,
 		return -EOPNOTSUPP;
 	}
 
-	/* Update the VSI's hash function */
-	if (rxfh->input_xfrm & RXH_XFRM_SYM_XOR)
+	if (rxfh->input_xfrm == RXH_XFRM_NO_CHANGE)
+		hfunc = vsi->rss_hfunc;
+	else if (rxfh->input_xfrm & RXH_XFRM_SYM_XOR)
 		hfunc = ICE_AQ_VSI_Q_OPT_RSS_HASH_SYM_TPLZ;
+	else /* input_xfrm == 0; core rejects any other value */
+		hfunc = ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ;
 
 	err = ice_set_rss_hfunc(vsi, hfunc);
 	if (err)
Signature · 1 line
2.56.1
author maintainer
#3 lore raw

Re: [PATCH net 1/2] ice: don't unintentionally switch to symmetric RSS hash

Quoted 1 line · On Mon, 23 Nov 2026 22:10:05 +0100 Maciej Fijalkowski wrote:

Let's just get this damn thing fixed ;)

Thanks for the quick ack!

BTW I started going down a rabbit hole of fixing more bugs in RSS handling in these two drivers (eg ice assumes that rxfh->indir == NULL means reset to default!?) but I gave up after 30min. There's certainly a lot more left to do... let's see what Clashiko points out.

#4 lore raw

Re: [PATCH net 1/2] ice: don't unintentionally switch to symmetric RSS hash

Quoted 9 lines · Jakub Kicinski
Quoted 1 line · On Mon, 23 Nov 2026 22:10:05 +0100 Maciej Fijalkowski wrote:

Let's just get this damn thing fixed ;)

Thanks for the quick ack!

BTW I started going down a rabbit hole of fixing more bugs in RSS handling in these two drivers (eg ice assumes that rxfh->indir == NULL means reset to default!?) but I gave up after 30min. There's certainly a lot more left to do... let's see what Clashiko points out.

Yea, we have a lot of "side quests" like that which still need a lot of work :(

author maintainer
#5 lore raw

PATCH 2/2 iavf: don't unintentionally switch to symmetric RSS hash

In reply to Jakub Kicinski

RXH_XFRM_NO_CHANGE is 0xff, iavf looks at this field to check if RXH_XFRM_SYM_XOR bit is set, without first checking for the special NO_CHANGE value.

This causes any ethtool -X invocation without explicitly specifying input_xfrm to try to enable symmetric-hashing. On VFs without input_xfrm support, NO_CHANGE would have returned -EOPNOTSUPP.

NIPA HW tests would catch this but there's no runner testing iavf. iavf was pointed out by an LLM, fix was compile-tested only.

Fixes 0dd415d15505 ("net: ethtool: add a NO_CHANGE uAPI for new RXFH's input_xfrm")
---
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_ethtool.c +2 -1
index e7cf12eaa268..d81b2d6a68ac 100644
@@ -1824,7 +1824,8 @@ static int iavf_set_rxfh(struct net_device *netdev,
 	    rxfh->hfunc != ETH_RSS_HASH_TOP)
 		return -EOPNOTSUPP;
 
-	if ((rxfh->input_xfrm & RXH_XFRM_SYM_XOR) &&
+	if (rxfh->input_xfrm != RXH_XFRM_NO_CHANGE &&
+	    (rxfh->input_xfrm & RXH_XFRM_SYM_XOR) &&
 	    adapter->hfunc != VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC) {
 		if (!ADV_RSS_SUPPORT(adapter))
 			return -EOPNOTSUPP;
Signature · 1 line
2.56.1
Acked-by on v1 2/2
#6 lore raw

Re: [PATCH net 2/2] iavf: don't unintentionally switch to symmetric RSS hash

Quoted 9 lines · Jakub Kicinski

RXH_XFRM_NO_CHANGE is 0xff, iavf looks at this field to check if RXH_XFRM_SYM_XOR bit is set, without first checking for the special NO_CHANGE value.

This causes any ethtool -X invocation without explicitly specifying input_xfrm to try to enable symmetric-hashing. On VFs without input_xfrm support, NO_CHANGE would have returned -EOPNOTSUPP.

Quoted 5 lines

NIPA HW tests would catch this but there's no runner testing iavf. iavf was pointed out by an LLM, fix was compile-tested only.

Fixes 0dd415d15505 ("net: ethtool: add a NO_CHANGE uAPI for new RXFH's input_xfrm")
Quoted 22 lines
---
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_ethtool.c +2 -1
index e7cf12eaa268..d81b2d6a68ac 100644
@@ -1824,7 +1824,8 @@ static int iavf_set_rxfh(struct net_device *netdev,
 	    rxfh->hfunc != ETH_RSS_HASH_TOP)
 		return -EOPNOTSUPP;
 
-	if ((rxfh->input_xfrm & RXH_XFRM_SYM_XOR) &&
+	if (rxfh->input_xfrm != RXH_XFRM_NO_CHANGE &&
+	    (rxfh->input_xfrm & RXH_XFRM_SYM_XOR) &&
 	    adapter->hfunc != VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC) {
 		if (!ADV_RSS_SUPPORT(adapter))
 			return -EOPNOTSUPP;
Signature · 1 line
2.56.1
maintainer Acked-by on the v1 series
#7 lore raw
In reply to Jakub Kicinski
Quoted 17 lines · Jakub Kicinski

Fix Intel drivers not handling RXH_XFRM_NO_CHANGE.

I had an urge to "fix this in the core" and hide RXH_XFRM_NO_CHANGE from the drivers, by fetching the current config instead. But "NO_CHANGE" values are already part of the driver facing API (hfunc has ETH_RSS_HASH_NO_CHANGE). Besides we can't _completely_ hide RXH_XFRM_NO_CHANGE from the drivers, since we want the drivers to be able to populate the defaults for new RSS contexts. We need a "user didn't say" value there.

---

Matt pointed out that the upcoming RSS sizing series breaks NIPA tests, this is because the fix we shared in June:

   https://lore.kernel.org/[email protected]
or Maciej's version:
   https://lore.kernel.org/[email protected]
Quoted 8 lines

is still not upstream!?

Recent discussions suggest that Intel maintainers may be willing to ack patches on netdev directly. Let's put that to tests.

Note that I think this is a major bug likely to bother real users so I'm targetting net. Przemek's series will have to wait for net->net-next merge.

For the series:

Quoted 8 lines

Jakub Kicinski (2):
ice: don't unintentionally switch to symmetric RSS hash
iavf: don't unintentionally switch to symmetric RSS hash

  drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 3 ++-
  drivers/net/ethernet/intel/ice/ice_ethtool.c   | 9 ++++++---
  2 files changed, 8 insertions(+), 4 deletions(-)