From: Qin Chuanyu <qinchuanyu@huawei.com>
To: Jason Wang <jasowang@redhat.com>, <davem@davemloft.net>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
Anthony Liguori <anthony@codemonkey.ws>,
KVM list <kvm@vger.kernel.org>, <netdev@vger.kernel.org>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH] tun: use netif_receive_skb instead of netif_rx_ni
Date: Wed, 12 Feb 2014 14:46:16 +0800 [thread overview]
Message-ID: <52FB18B8.4070401@huawei.com> (raw)
In-Reply-To: <52FB066E.1020006@redhat.com>
On 2014/2/12 13:28, Jason Wang wrote:
> A question: without NAPI weight, could this starve other net devices?
tap xmit skb use thread context,the poll func of physical nic driver
could be called in softirq context without change.
I had test it by binding vhost thread and physic nic interrupt on the
same vcpu, use netperf xmit udp, test model is VM1-Host1-Host2.
if only VM1 xmit skb, the top show as below :
Cpu1 :0.0%us, 95.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 5.0%si, 0.0%st
then use host2 xmit skb to VM1, the top show as below :
Cpu1 :0.0%us, 41.0%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 59.0%si, 0.0%st
so I think there is no problem with this change.
>> drivers/net/tun.c | 4 +++-
>> 1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> 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;
>
>
> .
>
next prev parent reply other threads:[~2014-02-12 6:47 UTC|newest]
Thread overview: 10+ 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 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 [this message]
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=52FB18B8.4070401@huawei.com \
--to=qinchuanyu@huawei.com \
--cc=anthony@codemonkey.ws \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).