Subject: Re: [RFC patch net-next-2.6] net: allow multiple rx_handler registration

From: Nicolas de Pesloüan<[email-masked]>
Date: Thu, 30 Jun 2011 21:50:52 +0200

Le 30/06/2011 17:16, Jiri Pirko a écrit :
> For some net topos it is necessary to have multiple "soft-net-devices"
> hooked on one netdev. For example very common is to have
> eth<->(br+vlan). Vlan is not using rh_handler (yet) but also for example
> macvlan would be useful to have hooked on same netdev as br.
>
> This patch introduces rx_handler list. size struct net_device stays
> intact. Measured performance regression on eth-br topo is ~1% (on received
> pkts generated by pktgen) and on eth-bond topo it is ~0.25%
>
> On br I think that the performance can be brought back maybe by using per-cpu
> variables to store port in rx_path (I must check this)
>
> Please comment.
>
> Signed-off-by: Jiri Pirko<[email-masked]>

I like the idea of this patch.

I didn't take time for a technical review yet, but I'm not sure ordering should be static, depending 
on the kind of device (bond, br, macvlan). Ordering is currently static, because it is hard coded.

I think rx_handler_prio should be exposed to userspace, to allow user setup to decide the exact 
order. Default order should be safe, but user should be allowed to force a different order for 
special setups.

	Nicolas.