Skip to contentSkip to conversation

virtio_pci: Clear stale cpumask when setting irq affinity

PATCH In review Jiang Liu 2 participants 2 messages Jun 4, 2015 virtio core

lore
Share & tools
lore

Jiang Liu

author
#0 lore raw

PATCH 1/1 virtio_pci: Clear stale cpumask when setting irq affinity

The cpumask vp_dev->msix_affinity_masks[info->msix_vector] may contain staled information when vp_set_vq_affinity() gets called, so clear it before setting the new cpu bit mask.

---
 drivers/virtio/virtio_pci_common.c |    1 +
 1 file changed, 1 insertion(+)
drivers/virtio/virtio_pci_common.c +1 -0
index e894eb278d83..eba1b7ac7294 100644
@@ -423,6 +423,7 @@ int vp_set_vq_affinity(struct virtqueue *vq, int cpu)
 		if (cpu == -1)
 			irq_set_affinity_hint(irq, NULL);
 		else {
+			cpumask_clear(mask);
 			cpumask_set_cpu(cpu, mask);
 			irq_set_affinity_hint(irq, mask);
 		}
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 5 lines · Jiang Liu

The cpumask vp_dev->msix_affinity_masks[info->msix_vector] may contain staled information when vp_set_vq_affinity() gets called, so clear it before setting the new cpu bit mask.

I have queued this up.
Thanks!

Quoted 18 lines
---
 drivers/virtio/virtio_pci_common.c |    1 +
 1 file changed, 1 insertion(+)
drivers/virtio/virtio_pci_common.c +1 -0
index e894eb278d83..eba1b7ac7294 100644
@@ -423,6 +423,7 @@ int vp_set_vq_affinity(struct virtqueue *vq, int cpu)
 		if (cpu == -1)
 			irq_set_affinity_hint(irq, NULL);
 		else {
+			cpumask_clear(mask);
 			cpumask_set_cpu(cpu, mask);
 			irq_set_affinity_hint(irq, mask);
 		}
Signature · 1 line
1.7.10.4