Subject: Re: [PATCH] ifb: add multi-queue support

From: Eric Dumazet <[email-masked]>
Date: Mon, 16 Nov 2009 09:19:21 +0100

Changli Gao a écrit :
> ifb: add multi-queue support.
> 
> Add multi-queue support, through more than one tasklets. One tasklet per
> queue always steers on the same CPU, and if the number of the
> tasklets(queues) is lager than the number of CPUs, more than one
> tasklets will be assigned to the same CPU.
> 
> Signed-off-by: Changli Gao <[email-masked]>
> ----

I must say I fail to see how multiple tasklets per cpu can be of any use.

And :

+	if (skb_queue_len(&pq->rq) == 1)
+		tasklet_schedule_on(&pq->task, num % num_online_cpus());

Is probably not what you want, because :

A) num_online_cpus() can be expensive to compute,
B) and you can have such configs :

Three online cpus, CPU0 and CPU4, CPU5
-> you call tasklet_schedule_on(... , num = {0|1|2})

To avoid packets reorder, if your hash function selects an offline cpu,
you must forward the packet to a particular cpu, regardless of cpu currently running.
(even if real device is not multiqueue, its RX interrupts can be handled by any online cpu)

You maybe need to maintain a mapping table with cpu hotplug notifiers.