From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH net] tuntap: raise EPOLLOUT on device up Date: Tue, 22 May 2018 01:08:23 +0300 Message-ID: <20180522010700-mutt-send-email-mst@kernel.org> References: <1526648443-24128-1-git-send-email-jasowang@redhat.com> <20180521.114742.427929977852677864.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: jasowang@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, hannes@stressinduktion.org, edumazet@google.com To: David Miller Return-path: Content-Disposition: inline In-Reply-To: <20180521.114742.427929977852677864.davem@davemloft.net> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Mon, May 21, 2018 at 11:47:42AM -0400, David Miller wrote: > From: Jason Wang > Date: Fri, 18 May 2018 21:00:43 +0800 > > > We return -EIO on device down but can not raise EPOLLOUT after it was > > up. This may confuse user like vhost which expects tuntap to raise > > EPOLLOUT to re-enable its TX routine after tuntap is down. This could > > be easily reproduced by transmitting packets from VM while down and up > > the tap device. Fixing this by set SOCKWQ_ASYNC_NOSPACE on -EIO. > > > > Cc: Hannes Frederic Sowa > > Cc: Eric Dumazet > > Fixes: 1bd4978a88ac2 ("tun: honor IFF_UP in tun_get_user()") > > Signed-off-by: Jason Wang > > I'm no so sure what to do with this patch. > > Like Michael says, this flag bit is only checks upon transmit which > may or may not happen after this point. It doesn't seem to be > guaranteed. Jason, can't we detect a link up transition and respond accordingly? What do you think? -- MST