virtio-pci: speedup MSI-X masking and unmasking
commit851c2a75a6e80c8aa5e713864d98cfb512e7229b
authorJason Wang <jasowang@redhat.com>
Thu, 23 Apr 2015 06:21:47 +0000 (23 14:21 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 27 Apr 2015 19:02:41 +0000 (27 21:02 +0200)
treef5c21c1986901ce53417858bab521668f53db4bf
parente0d686bf4b9d018ba5449f057b486bb5e1fa1a0d
virtio-pci: speedup MSI-X masking and unmasking

This patch tries to speed up the MSI-X masking and unmasking through
the mapping between vector and queues. With this patch it will there's
no need to go through all possible virtqueues, which may help to
reduce the time spent when doing MSI-X masking/unmasking a single
vector when more than hundreds or even thousands of virtqueues were
supported.

Tested with 80 queue pairs virito-net-pci by changing the smp affinity
in the background and doing netperf in the same time:

Before the patch:
5711.70 Gbits/sec
After the patch:
6830.98 Gbits/sec

About 19.6% improvements in throughput.

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio-pci.c