Subject: Re: [PATCH net-next-2.6] net: replace hooks in __netif_receive_skb V2

From: Stephen Hemminger <[email-masked]>
Date: Thu, 27 May 2010 13:08:22 -0700

On Thu, 27 May 2010 20:08:24 +0200
Jiri Pirko <[email-masked]> wrote:

> changelog:
> v1->v2
> 	- writers are locked by rtnl_lock (removed unnecessary spinlock)
> 	- using call_rcu in unregister
> 	- nicer macvlan_port_create cleanup
> 	- struct rx_hanler is made const in funtion parameters
> 
> What this patch does is it removes two receive frame hooks (for bridge and for
> macvlan) from __netif_receive_skb. These are replaced them with a general
> list of rx_handlers which is iterated thru instead.
> 
> Then a network driver (of virtual netdev like macvlan or bridge) can register
> an rx_handler for needed net device.
> 
> Signed-off-by: Jiri Pirko <[email-masked]>

I wonder if we really need the chaining.  What about allowing only one
hook per device (and return -EBUSY)?  That also gets rid of the allocation,
and the extra overhead.

The handler hook, has to be export GPL, since we really don't want more
network stack abuse by 3rd parties.