From: Wanlong Gao Date: Thu, 24 Jan 2013 23:51:29 +0000 (+0000) Subject: virtio-net: fix the set affinity bug when CPU IDs are not consecutive X-Git-Tag: v3.8-rc6~20^2~14 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47be24796c13e7d9f087005c2bedc68ee0709f7b;p=pandora-kernel.git 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 Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Eric Dumazet Cc: "David S. Miller" Cc: virtualization@lists.linux-foundation.org Cc: netdev@vger.kernel.org Signed-off-by: Wanlong Gao Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller --- Reading git-diff-tree failed