Skip to content

Commit dc749b7

Browse files
LPhghPaolo Abeni
authored andcommitted
virtio_net: Sync rss config to device when virtnet_probe
During virtnet_probe, default rss configuration is initialized, but was not committed to the device. This patch fix this by sending rss command after device ready in virtnet_probe. Otherwise, the actual rss configuration used by device can be different with that read by user from driver, which may confuse the user. If the command committing fails, driver rss will be disabled. Fixes: c7114b1 ("drivers/net/virtio_net: Added basic RSS support.") Signed-off-by: Philo Lu <[email protected]> Signed-off-by: Xuan Zhuo <[email protected]> Acked-by: Joe Damato <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 3f7d9c1 commit dc749b7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/net/virtio_net.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6584,6 +6584,15 @@ static int virtnet_probe(struct virtio_device *vdev)
65846584

65856585
virtio_device_ready(vdev);
65866586

6587+
if (vi->has_rss || vi->has_rss_hash_report) {
6588+
if (!virtnet_commit_rss_command(vi)) {
6589+
dev_warn(&vdev->dev, "RSS disabled because committing failed.\n");
6590+
dev->hw_features &= ~NETIF_F_RXHASH;
6591+
vi->has_rss_hash_report = false;
6592+
vi->has_rss = false;
6593+
}
6594+
}
6595+
65876596
virtnet_set_queues(vi, vi->curr_queue_pairs);
65886597

65896598
/* a random MAC address has been assigned, notify the device.

0 commit comments

Comments
 (0)