Re: [Qemu-devel] [net-next RFC PATCH 4/7] tuntap: multiqueue support

2011-08-14 Thread Jason Wang
- Original Message - Le vendredi 12 août 2011 à 09:55 +0800, Jason Wang a écrit : + rxq = skb_get_rxhash(skb); + if (rxq) { + tfile = rcu_dereference(tun-tfiles[rxq % numqueues]); + if (tfile) + goto out; + } You can avoid an expensive divide with following trick : u32 idx

Re: [Qemu-devel] [net-next RFC PATCH 4/7] tuntap: multiqueue support

2011-08-14 Thread Jason Wang
- Original Message - On Fri, Aug 12, 2011 at 09:55:20AM +0800, Jason Wang wrote: With the abstraction that each socket were a backend of a queue for userspace, this patch adds multiqueue support for tap device by allowing multiple sockets to be attached to a tap device. Then we

Re: [Qemu-devel] [net-next RFC PATCH 4/7] tuntap: multiqueue support

2011-08-12 Thread Eric Dumazet
Le vendredi 12 août 2011 à 09:55 +0800, Jason Wang a écrit : + rxq = skb_get_rxhash(skb); + if (rxq) { + tfile = rcu_dereference(tun-tfiles[rxq % numqueues]); + if (tfile) + goto out; + } You can avoid an expensive divide with

Re: [Qemu-devel] [net-next RFC PATCH 4/7] tuntap: multiqueue support

2011-08-12 Thread Paul E. McKenney
On Fri, Aug 12, 2011 at 09:55:20AM +0800, Jason Wang wrote: With the abstraction that each socket were a backend of a queue for userspace, this patch adds multiqueue support for tap device by allowing multiple sockets to be attached to a tap device. Then we could parallize the transmission by