Re: [PATCH V7 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-25 Thread Wanlong Gao
- for (i = 0; i < vi->max_queue_pairs; i++) { - int cpu = set ? i : -1; - virtqueue_set_affinity(vi->rq[i].vq, cpu); - virtqueue_set_affinity(vi->sq[i].vq, cpu); - } + if (set) { + i = 0; + for_each_onli

Re: [PATCH V7 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-25 Thread Jason Wang
On 01/25/2013 05:05 PM, Wanlong Gao wrote: > On 01/25/2013 05:00 PM, Jason Wang wrote: >> On 01/25/2013 04:36 PM, Wanlong Gao wrote: >>> 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 bu

Re: [PATCH V7 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-25 Thread Wanlong Gao
On 01/25/2013 05:00 PM, Jason Wang wrote: > On 01/25/2013 04:36 PM, Wanlong Gao wrote: >> 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

Re: [PATCH V7 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-25 Thread Jason Wang
On 01/25/2013 04:36 PM, Wanlong Gao wrote: > 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

[PATCH V7 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-25 Thread Wanlong Gao
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 C