virtio-net: correctly enable multiqueue
Subsystems (4)
PATCH 1/1 virtio-net: correctly enable multiqueue
Commit 4490001029012539937ff02778fe6180613fa949 ("virtio-net: enable multiqueue by default") blindly set the affinity instead of queues during probe which can cause a mismatch of #queues between guest and host. This patch fixes it by setting queues.
--- drivers/net/virtio_net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/virtio_net.c +3 -1
@@ -1930,7 +1930,9 @@ static int virtnet_probe(struct virtio_device *vdev) goto free_unregister_netdev; } -virtnet_set_affinity (vi); +rtnl_lock (); +virtnet_set_queues (vi, vi->curr_queue_pairs); +rtnl_unlock ();/* Assume link up if device can't report link status, otherwise get link status from config. */
Signature · 1 line
2.7.4
Quoted 11 lines · Jason Wang
Commit
4490001029012539937ff02778fe6180613fa949("virtio-net: enable multiqueue by default") blindly set the affinity instead of queues during probe which can cause a mismatch of #queues between guest and host. This patch fixes it by setting queues.Reported-by Theodore Ts'o <[email protected]>Tested-by Theodore Ts'o <[email protected]>Cc Neil Horman <[email protected]>Cc Michael S. Tsirkin <[email protected]>Fixes 49000102901 ("virtio-net: enable multiqueue by default")Signed-off-by Jason Wang <[email protected]>
Quoted 9 lines
--- drivers/net/virtio_net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/virtio_net.c +0
-0
drivers/net/virtio_net.c static int virtnet_probe(struct virtio_device *vdev) · line 1938
Quoted 10 lines
drivers/net/virtio_net.c +3
-1@@ -1930,7 +1930,9 @@ static int virtnet_probe(struct virtio_device *vdev) goto free_unregister_netdev; } -virtnet_set_affinity (vi); +rtnl_lock (); +virtnet_set_queues (vi, vi->curr_queue_pairs); +rtnl_unlock ();/* Assume link up if device can't report link status, otherwise get link status from config. */
I note that virtnet_set_channels also plays with affinity directly. Can this be changed to rely on cpu notifiers somehow?
Quoted 2 lines
Signature · 1 line
2.7.4
Quoted 11 lines · Jason Wang
Commit
4490001029012539937ff02778fe6180613fa949("virtio-net: enable multiqueue by default") blindly set the affinity instead of queues during probe which can cause a mismatch of #queues between guest and host. This patch fixes it by setting queues.Reported-by Theodore Ts'o <[email protected]>Tested-by Theodore Ts'o <[email protected]>Cc Neil Horman <[email protected]>Cc Michael S. Tsirkin <[email protected]>Fixes 49000102901 ("virtio-net: enable multiqueue by default")Signed-off-by Jason Wang <[email protected]>
Quoted 9 lines
--- drivers/net/virtio_net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/virtio_net.c +0
-0
drivers/net/virtio_net.c static int virtnet_probe(struct virtio_device *vdev) · line 1938
Quoted 10 lines
drivers/net/virtio_net.c +3
-1@@ -1930,7 +1930,9 @@ static int virtnet_probe(struct virtio_device *vdev) goto free_unregister_netdev; } -virtnet_set_affinity (vi); +rtnl_lock (); +virtnet_set_queues (vi, vi->curr_queue_pairs); +rtnl_unlock ();/* Assume link up if device can't report link status, otherwise get link status from config. */
I note that virtnet_set_channels also plays with affinity directly. Can this be changed to rely on cpu notifiers somehow?
Quoted 2 lines
Signature · 1 line
2.7.4
From: Jason Wang <[email protected]>
Date: Tue, 13 Dec 2016 14:23:05 +0800
Quoted 11 lines
Commit
4490001029012539937ff02778fe6180613fa949("virtio-net: enable multiqueue by default") blindly set the affinity instead of queues during probe which can cause a mismatch of #queues between guest and host. This patch fixes it by setting queues.Reported-by Theodore Ts'o <[email protected]>Tested-by Theodore Ts'o <[email protected]>Cc Neil Horman <[email protected]>Cc Michael S. Tsirkin <[email protected]>Fixes 49000102901 ("virtio-net: enable multiqueue by default")Signed-off-by Jason Wang <[email protected]>
Applied, thanks Jason.
From: Jason Wang <[email protected]>
Date: Tue, 13 Dec 2016 14:23:05 +0800
Quoted 11 lines
Commit
4490001029012539937ff02778fe6180613fa949("virtio-net: enable multiqueue by default") blindly set the affinity instead of queues during probe which can cause a mismatch of #queues between guest and host. This patch fixes it by setting queues.Reported-by Theodore Ts'o <[email protected]>Tested-by Theodore Ts'o <[email protected]>Cc Neil Horman <[email protected]>Cc Michael S. Tsirkin <[email protected]>Fixes 49000102901 ("virtio-net: enable multiqueue by default")Signed-off-by Jason Wang <[email protected]>
Applied, thanks Jason.