From: "Michael S. Tsirkin" <mst@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Qin Chuanyu <qinchuanyu@huawei.com>,
davem@davemloft.net, jasowang@redhat.com,
Anthony Liguori <anthony@codemonkey.ws>,
KVM list <kvm@vger.kernel.org>,
netdev@vger.kernel.org
Subject: Re: [PATCH] tun: use netif_receive_skb instead of netif_rx_ni
Date: Tue, 11 Feb 2014 17:47:02 +0200 [thread overview]
Message-ID: <20140211154702.GB467@redhat.com> (raw)
In-Reply-To: <1392132244.6615.83.camel@edumazet-glaptop2.roam.corp.google.com>
On Tue, Feb 11, 2014 at 07:24:04AM -0800, Eric Dumazet wrote:
> On Tue, 2014-02-11 at 22:25 +0800, Qin Chuanyu wrote:
> > we could xmit directly instead of going through softirq to gain
> > throughput and lantency improved.
> > test model: VM-Host-Host just do transmit. with vhost thread and nic
> > interrupt bind cpu1. netperf do throuhput test and qperf do lantency test.
> > Host OS: suse11sp3, Guest OS: suse11sp3
> >
> > latency result(us):
> > packet_len 64 256 512 1460
> > old(UDP) 44 47 48 66
> > new(UDP) 38 41 42 66
> >
> > old(TCP) 52 55 70 117
> > new(TCP) 45 48 61 114
> >
> > throughput result(Gbit/s):
> > packet_len 64 512 1024 1460
> > old(UDP) 0.42 2.02 3.75 4.68
> > new(UDP) 0.45 2.14 3.77 5.06
> >
> > TCP due to the latency, client couldn't send packet big enough
> > to get benefit from TSO of nic, so the result show it will send
> > more packet per sencond but get lower throughput.
> >
> > Eric mentioned that it would has problem with cgroup, but the patch
> > had been sent by Herbert Xu.
> > patch_id f845172531fb7410c7fb7780b1a6e51ee6df7d52
> >
> > Signed-off-by: Chuanyu Qin <qinchuanyu@huawei.com>
> > ---
> > 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;
>
> 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 ?
>
But not before making sure (testing) that patch does not break the
cgroups classifier please.
--
MST
next prev parent reply other threads:[~2014-02-11 15:42 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 [this message]
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=20140211154702.GB467@redhat.com \
--to=mst@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=qinchuanyu@huawei.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;
as well as URLs for NNTP newsgroup(s).