summaryrefslogtreecommitdiff
path: root/drivers/net/virtio_net.c
diff options
context:
space:
mode:
authorCaleb Raitto <caraitto@google.com>2018-08-10 04:18:28 +0300
committerDavid S. Miller <davem@davemloft.net>2018-08-11 22:02:18 +0300
commit19e226e8cc5da02f17ed119f9137036c0f0f5d80 (patch)
treeb5c1ac64ee439a15a3dd0c9e056acc676b8590b0 /drivers/net/virtio_net.c
parent07624df1c9efd4b7f2f6762581587c590b03c7a2 (diff)
downloadlinux-19e226e8cc5da02f17ed119f9137036c0f0f5d80.tar.xz
virtio: Make vp_set_vq_affinity() take a mask.
Make vp_set_vq_affinity() take a cpumask instead of taking a single CPU. If there are fewer queues than cores, queue affinity should be able to map to multiple cores. Link: https://patchwork.ozlabs.org/patch/948149/ Suggested-by: Willem de Bruijn <willemb@google.com> Signed-off-by: Caleb Raitto <caraitto@google.com> Acked-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/virtio_net.c')
-rw-r--r--drivers/net/virtio_net.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 39a7f4452587..43fabc0eb4d2 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1878,8 +1878,8 @@ static void virtnet_clean_affinity(struct virtnet_info *vi, long hcpu)
if (vi->affinity_hint_set) {
for (i = 0; i < vi->max_queue_pairs; i++) {
- virtqueue_set_affinity(vi->rq[i].vq, -1);
- virtqueue_set_affinity(vi->sq[i].vq, -1);
+ virtqueue_set_affinity(vi->rq[i].vq, NULL);
+ virtqueue_set_affinity(vi->sq[i].vq, NULL);
}
vi->affinity_hint_set = false;
@@ -1905,8 +1905,8 @@ static void virtnet_set_affinity(struct virtnet_info *vi)
for_each_online_cpu(cpu) {
const unsigned long *mask = cpumask_bits(cpumask_of(cpu));
- virtqueue_set_affinity(vi->rq[i].vq, cpu);
- virtqueue_set_affinity(vi->sq[i].vq, cpu);
+ virtqueue_set_affinity(vi->rq[i].vq, cpumask_of(cpu));
+ virtqueue_set_affinity(vi->sq[i].vq, cpumask_of(cpu));
__netif_set_xps_queue(vi->dev, mask, i, false);
i++;
}