Re: [PATCH] tun: use netif_receive_skb instead of netif_rx_ni

Herbert Xu
2014-02-16T13:03:14Z

On Wed, Feb 12, 2014 at 09:50:03AM +0800, Qin Chuanyu wrote:
> On 2014/2/11 23:24, Eric Dumazet wrote:
> >>diff --git a/drivers/net/tun.c b/drivers/net/tun.c
> >>index 44c4db8..90b4e58 100644
> >>--- a/drivers/net/tun.c
> >>+++ b/drivers/net/tun.c
> >>@@ -1184,7 +1184,9 @@ static ssize_t tun_get_user(struct tun_struct
> >>*tun, struct tun_file *tfile,
> >> skb_probe_transport_header(skb, 0);
> >>
> >> rxhash = skb_get_hash(skb);
> >>- netif_rx_ni(skb);
> >>+ rcu_read_lock_bh();
> >>+ netif_receive_skb(skb);
> >>+ rcu_read_unlock_bh();
> >>
> >> tun->dev->stats.rx_packets++;
> >> tun->dev->stats.rx_bytes += len;
> >
> >I already said this patch is not good :
> >
> >rcu_read_lock_bh() makes no sense here.
> >
> >What is really needed is local_bh_disable();
> >
> >Herbert patch ( http://patchwork.ozlabs.org/patch/52963/ ) had a much
> >cleaner form.
> >
> >Just use it, CC him, credit him, please ?
> >
> To: Herbert Xu
> I saw that you had delivered a patch to resolve the problem of cgroup.
> patch num is f845172531fb7410c7fb7780b1a6e51ee6df7d52
>
> so would you deliver your patch for tun again? I had test it and
> found it work well.

Feel free to resubmit my patch either as is or with your
modifications as I no longer need it for my original purposes.

Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt