]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
virtio: introduce an API to set affinity for a virtqueue
authorJason Wang <jasowang@redhat.com>
Tue, 28 Aug 2012 11:54:14 +0000 (13:54 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 28 Sep 2012 05:35:15 +0000 (15:05 +0930)
commit75a0a52be3c27b58654fbed2c8f2ff401482b9a4
tree01c2815aa913b714f4d11869d56941717737646e
parent17bb6d40880d4178f5f8a75900ed8c9ff47d3fb2
virtio: introduce an API to set affinity for a virtqueue

Sometimes, virtio device need to configure irq affinity hint to maximize the
performance. Instead of just exposing the irq of a virtqueue, this patch
introduce an API to set the affinity for a virtqueue.

The api is best-effort, the affinity hint may not be set as expected due to
platform support, irq sharing or irq type. Currently, only pci method were
implemented and we set the affinity according to:

- if device uses INTX, we just ignore the request
- if device has per vq vector, we force the affinity hint
- if the virtqueues share MSI, make the affinity OR over all affinities
  requested

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/virtio/virtio_pci.c
include/linux/virtio_config.h