Skip to content

Commit c39ea5c

Browse files
haiyangzJakub Kicinski
authored andcommitted
hv_netvsc: Fix tx_table init in rndis_set_subchannel()
Host can provide send indirection table messages anytime after RSS is enabled by calling rndis_filter_set_rss_param(). So the host provided table values may be overwritten by the initialization in rndis_set_subchannel(). To prevent this problem, move the tx_table initialization before calling rndis_filter_set_rss_param(). Fixes: a6fb6aa ("hv_netvsc: Set tx_table to equal weight after subchannels open") Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
1 parent f3f2364 commit c39ea5c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/net/hyperv/rndis_filter.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,9 @@ int rndis_set_subchannel(struct net_device *ndev,
11711171
wait_event(nvdev->subchan_open,
11721172
atomic_read(&nvdev->open_chn) == nvdev->num_chn);
11731173

1174+
for (i = 0; i < VRSS_SEND_TAB_SIZE; i++)
1175+
ndev_ctx->tx_table[i] = i % nvdev->num_chn;
1176+
11741177
/* ignore failures from setting rss parameters, still have channels */
11751178
if (dev_info)
11761179
rndis_filter_set_rss_param(rdev, dev_info->rss_key);
@@ -1180,9 +1183,6 @@ int rndis_set_subchannel(struct net_device *ndev,
11801183
netif_set_real_num_tx_queues(ndev, nvdev->num_chn);
11811184
netif_set_real_num_rx_queues(ndev, nvdev->num_chn);
11821185

1183-
for (i = 0; i < VRSS_SEND_TAB_SIZE; i++)
1184-
ndev_ctx->tx_table[i] = i % nvdev->num_chn;
1185-
11861186
return 0;
11871187
}
11881188

0 commit comments

Comments
 (0)