]> git.karo-electronics.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)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 7 Sep 2012 00:33:30 +0000 (10:33 +1000)
commit501b5a2021089b7f51e7393c4579e303c5a35d98
tree72e4397cadd913e5e51ec192587a39d6360858d1
parent0c7893423399470b47af13e1c4ea3fce41015248
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