Re: tun: Use netif_receive_skb instead of netif_rx

Herbert Xu
2010-05-20T06:11:54Z

On Thu, May 20, 2010 at 08:03:35AM +0200, Eric Dumazet wrote:
> Le jeudi 20 mai 2010 à 15:46 +1000, Herbert Xu a écrit :
>
> > +#ifdef CONFIG_NET_CLS_CGROUP
> > +static inline u32 task_cls_classid(struct task_struct *p)
> > +{
> > + return container_of(task_subsys_state(p, net_cls_subsys_id),
> > + struct cgroup_cls_state, css).classid;
> > +}
> > +#else
> > +int net_cls_subsys_id = -1;
> > +EXPORT_SYMBOL_GPL(net_cls_subsys_id);
> > +
> > +static inline u32 task_cls_classid(struct task_struct *p)
> > +{
> > + int id;
> > + u32 classid;
> > +
> > + rcu_read_lock();
> > + id = rcu_dereference(net_cls_subsys_id);
> > + if (id >= 0)
> > + classid = container_of(task_subsys_state(p, id),
> > + struct cgroup_cls_state, css)->classid;
> > + rcu_read_unlock();
> > +
> > + return classid;
> > +}
> > +#endif
>
> I still dont understand why you introduce this function and not reuse it
> in net/sched/cls_cgroup.c
>
> You told me it needs a separate patch, I dont think so.
> Just make it non static and EXPORTed

Because it doesn't have to go through this RCU crap.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt