From: 李菲 <lifei.shirley@bytedance.com>
To: David Miller <davem@davemloft.net>
Cc: Jason Wang <jasowang@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
zhengfeiran@bytedance.com, duanxiongchun@bytedance.com
Subject: Re: [External Email] Re: [PATCH net v2] tun: wake up waitqueues after IFF_UP is set
Date: Thu, 20 Jun 2019 00:02:26 +0800 [thread overview]
Message-ID: <CA+=e4K42mM7-KprPbPjWvDbu8QOrv5=s4QxpWJieeUM73dfS_g@mail.gmail.com> (raw)
In-Reply-To: <20190618.105548.2200622033433520074.davem@davemloft.net>
Thanks.
Have a nice day
Fei
On Wed, Jun 19, 2019 at 1:55 AM David Miller <davem@davemloft.net> wrote:
>
> From: Fei Li <lifei.shirley@bytedance.com>
> Date: Mon, 17 Jun 2019 21:26:36 +0800
>
> > Currently after setting tap0 link up, the tun code wakes tx/rx waited
> > queues up in tun_net_open() when .ndo_open() is called, however the
> > IFF_UP flag has not been set yet. If there's already a wait queue, it
> > would fail to transmit when checking the IFF_UP flag in tun_sendmsg().
> > Then the saving vhost_poll_start() will add the wq into wqh until it
> > is waken up again. Although this works when IFF_UP flag has been set
> > when tun_chr_poll detects; this is not true if IFF_UP flag has not
> > been set at that time. Sadly the latter case is a fatal error, as
> > the wq will never be waken up in future unless later manually
> > setting link up on purpose.
> >
> > Fix this by moving the wakeup process into the NETDEV_UP event
> > notifying process, this makes sure IFF_UP has been set before all
> > waited queues been waken up.
> >
> > Signed-off-by: Fei Li <lifei.shirley@bytedance.com>
> > Acked-by: Jason Wang <jasowang@redhat.com>
>
> Applied and queued up for -stable, thanks.
prev parent reply other threads:[~2019-06-19 16:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 13:26 [PATCH net v2] tun: wake up waitqueues after IFF_UP is set Fei Li
2019-06-18 17:55 ` David Miller
2019-06-19 16:02 ` 李菲 [this message]
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='CA+=e4K42mM7-KprPbPjWvDbu8QOrv5=s4QxpWJieeUM73dfS_g@mail.gmail.com' \
--to=lifei.shirley@bytedance.com \
--cc=davem@davemloft.net \
--cc=duanxiongchun@bytedance.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=zhengfeiran@bytedance.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).