]> git.baikalelectronics.ru Git - kernel.git/commit
virtio-net: fix the set affinity bug when CPU IDs are not consecutive
authorWanlong Gao <gaowanlong@cn.fujitsu.com>
Thu, 24 Jan 2013 23:51:29 +0000 (23:51 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Jan 2013 06:22:51 +0000 (01:22 -0500)
commit8f51ca5b7578783695c1042e9ff36341a2954f61
treed1f4e4c652876e1121f97cb8f5ccf4e1ef1946bf
parentc8f9a6918e7ef76d65348f2888893788d9ea1fcf
virtio-net: fix the set affinity bug when CPU IDs are not consecutive

As Michael mentioned, set affinity and select queue will not work very
well when CPU IDs are not consecutive, this can happen with hot unplug.
Fix this bug by traversal the online CPUs, and create a per cpu variable
to find the mapping from CPU to the preferable virtual-queue.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Eric Dumazet <erdnetdev@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: virtualization@lists.linux-foundation.org
Cc: netdev@vger.kernel.org
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c