Skip to content

Commit d235649

Browse files
Aditya Gargkuba-moo
authored andcommitted
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. Fixes: 962f3fe ("netvsc: add ethtool ops to get/set RSS key") Signed-off-by: Aditya Garg <gargaditya@linux.microsoft.com> Reviewed-by: Dipayaan Roy <dipayanroy@linux.microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Link: https://patch.msgid.link/1768212093-1594-1-git-send-email-gargaditya@linux.microsoft.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent fa57266 commit d235649

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/net/hyperv/netvsc_drv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,6 +1750,9 @@ static int netvsc_set_rxfh(struct net_device *dev,
17501750
rxfh->hfunc != ETH_RSS_HASH_TOP)
17511751
return -EOPNOTSUPP;
17521752

1753+
if (!ndc->rx_table_sz)
1754+
return -EOPNOTSUPP;
1755+
17531756
rndis_dev = ndev->extension;
17541757
if (rxfh->indir) {
17551758
for (i = 0; i < ndc->rx_table_sz; i++)

0 commit comments

Comments
 (0)