net: hv_netvsc: reject RSS hash key programming without RX indirection table
PATCH 1/1 net: hv_netvsc: reject RSS hash key programming without RX indirection table
RSS configuration requires a valid RX indirection table. When the device reports a single receive queue, rndis_filter_device_add() does not allocate an indirection table, accepting RSS hash key updates in this state leads to a hang.
Fix this by gating netvsc_set_rxfh() on ndc->rx_table_sz and return -EOPNOTSUPP when the table is absent. This aligns set_rxfh with the device capabilities and prevents incorrect behavior.
--- drivers/net/hyperv/netvsc_drv.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/hyperv/netvsc_drv.c +3 -0
@@ -1750,6 +1750,9 @@ static int netvsc_set_rxfh(struct net_device *dev, rxfh->hfunc != ETH_RSS_HASH_TOP)return -EOPNOTSUPP ; +if (!ndc->rx_table_sz) +return -EOPNOTSUPP ; + rndis_dev = ndev->extension;if (rxfh->indir) {for (i =0 ; i < ndc->rx_table_sz; i++)
Signature · 1 line
2.43.0
Quoted 33 lines · Aditya Garg
RSS configuration requires a valid RX indirection table. When the device reports a single receive queue,
rndis_filter_device_add()does not allocate an indirection table, accepting RSS hash key updates in this state leads to a hang.Fix this by gating
netvsc_set_rxfh()onndc->rx_table_szand return-EOPNOTSUPPwhen the table is absent. This alignsset_rxfhwith the device capabilities and prevents incorrect behavior.Fixes 962f3fee83a4 ("netvsc: add ethtool ops to get/set RSS key")Signed-off-by Aditya Garg <[email protected]>Reviewed-by Dipayaan Roy <[email protected]>--- drivers/net/hyperv/netvsc_drv.c | 3 +++ 1 file changed, 3 insertions(+)drivers/net/hyperv/netvsc_drv.c +3
-0@@ -1750,6 +1750,9 @@ static int netvsc_set_rxfh(struct net_device *dev, rxfh->hfunc != ETH_RSS_HASH_TOP)return -EOPNOTSUPP ; +if (!ndc->rx_table_sz) +return -EOPNOTSUPP ; + rndis_dev = ndev->extension;if (rxfh->indir) {for (i =0 ; i < ndc->rx_table_sz; i++)Signature · 1 line
2.43.0
LGTM.
Quoted 23 lines
-----Original Message-----
From: Aditya Garg <[email protected]>
Sent: Monday, January 12, 2026 5:02 AM
To: KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]; Dexuan Cui <[email protected]>; Long Li <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Aditya Garg <[email protected]>; [email protected]
Subject: [PATCH net-next] net:hv_netvsc: reject RSS hash key programming without RX indirection tableRSS configuration requires a valid RX indirection table. When the device reports a single receive queue,
rndis_filter_device_add()does not allocate an indirection table, accepting RSS hash key updates in this state leads to a hang.
Quoted 7 lines
Fix this by gating
netvsc_set_rxfh()onndc->rx_table_szand return-EOPNOTSUPPwhen the table is absent. This alignsset_rxfhwith the device capabilities and prevents incorrect behavior.Fixes 962f3fee83a4 ("netvsc: add ethtool ops to get/set RSS key")Signed-off-by Aditya Garg <[email protected]>Reviewed-by Dipayaan Roy <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Mon, 12 Jan 2026 02:01:33 -0800 you wrote:
RSS configuration requires a valid RX indirection table. When the device reports a single receive queue,
rndis_filter_device_add()does not allocate an indirection table, accepting RSS hash key updates in this state leads to a hang.Fix this by gating
netvsc_set_rxfh()onndc->rx_table_szand return-EOPNOTSUPPwhen the table is absent. This alignsset_rxfhwith the device capabilities and prevents incorrect behavior.[...]
Here is the summary with links:
- [net-next] net: hv_netvsc: reject RSS hash key programming without RX indirection table
https://git.kernel.org/netdev/net/c/d23564955811
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html