From: Qin Chuanyu <qinchuanyu@huawei.com>
To: <herbert@gondor.apana.org.au>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
KVM list <kvm@vger.kernel.org>
Subject: Re: [PATCH] tun: use netif_receive_skb instead of netif_rx_ni
Date: Wed, 12 Feb 2014 09:50:03 +0800 [thread overview]
Message-ID: <52FAD34B.3030902@huawei.com> (raw)
In-Reply-To: <1392132244.6615.83.camel@edumazet-glaptop2.roam.corp.google.com>
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.
To: Eric
I approve your idea that rcu_read_lock make no sense. but I couldn't
understand why dev_queue_xmit use it.
What is the difference between vhost thread using tap to xmit skb and
another thread use dev_queue_xmit to xmit skb?
It is really my honor if you could explain it for me.
Thanks.
next prev parent reply other threads:[~2014-02-12 1:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 14:25 [PATCH] tun: use netif_receive_skb instead of netif_rx_ni Qin Chuanyu
2014-02-11 15:24 ` Eric Dumazet
2014-02-11 15:47 ` Michael S. Tsirkin
2014-02-12 1:50 ` Qin Chuanyu [this message]
2014-02-16 13:03 ` Herbert Xu
2014-02-12 5:28 ` Jason Wang
2014-02-12 5:47 ` Eric Dumazet
2014-02-12 5:50 ` Jason Wang
2014-02-12 6:26 ` Eric Dumazet
2014-02-12 7:38 ` Jason Wang
2014-02-12 6:46 ` Qin Chuanyu
2014-02-12 7:40 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52FAD34B.3030902@huawei.com \
--to=qinchuanyu@huawei.com \
--cc=eric.dumazet@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox