Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Jason Wang
On 2018年05月22日 11:46, Michael S. Tsirkin wrote: On Tue, May 22, 2018 at 11:22:11AM +0800, Jason Wang wrote: On 2018年05月22日 06:08, Michael S. Tsirkin wrote: 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

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 11:22:11AM +0800, Jason Wang wrote: > > > On 2018年05月22日 06:08, Michael S. Tsirkin wrote: > > 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

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2018 at 11:22:11AM +0800, Jason Wang wrote: > > > On 2018年05月22日 06:08, Michael S. Tsirkin wrote: > > 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

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Jason Wang
On 2018年05月22日 06:08, Michael S. Tsirkin wrote: 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 tunta

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
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

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread Michael S. Tsirkin
On Sat, May 19, 2018 at 09:09:11AM +0800, Jason Wang wrote: > > > On 2018年05月18日 22:46, Michael S. Tsirkin wrote: > > On Fri, May 18, 2018 at 10:11:54PM +0800, Jason Wang wrote: > > > > > > On 2018年05月18日 22:06, Michael S. Tsirkin wrote: > > > > On Fri, May 18, 2018 at 10:00:31PM +0800, Jason Wa

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-21 Thread David Miller
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 tra

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Jason Wang
On 2018年05月18日 22:46, Michael S. Tsirkin wrote: On Fri, May 18, 2018 at 10:11:54PM +0800, Jason Wang wrote: On 2018年05月18日 22:06, Michael S. Tsirkin wrote: On Fri, May 18, 2018 at 10:00:31PM +0800, Jason Wang wrote: On 2018年05月18日 21:26, Jason Wang wrote: On 2018年05月18日 21:13, Michael S. T

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Michael S. Tsirkin
On Fri, May 18, 2018 at 10:11:54PM +0800, Jason Wang wrote: > > > On 2018年05月18日 22:06, Michael S. Tsirkin wrote: > > On Fri, May 18, 2018 at 10:00:31PM +0800, Jason Wang wrote: > > > > > > On 2018年05月18日 21:26, Jason Wang wrote: > > > > > > > > On 2018年05月18日 21:13, Michael S. Tsirkin wrote: >

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Jason Wang
On 2018年05月18日 22:06, Michael S. Tsirkin wrote: On Fri, May 18, 2018 at 10:00:31PM +0800, Jason Wang wrote: On 2018年05月18日 21:26, Jason Wang wrote: On 2018年05月18日 21:13, Michael S. Tsirkin wrote: On Fri, May 18, 2018 at 09:00:43PM +0800, Jason Wang wrote: We return -EIO on device down but

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Michael S. Tsirkin
On Fri, May 18, 2018 at 10:00:31PM +0800, Jason Wang wrote: > > > On 2018年05月18日 21:26, Jason Wang wrote: > > > > > > On 2018年05月18日 21:13, Michael S. Tsirkin wrote: > > > On Fri, May 18, 2018 at 09:00:43PM +0800, Jason Wang wrote: > > > > We return -EIO on device down but can not raise EPOLLOU

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Jason Wang
On 2018年05月18日 21:26, Jason Wang wrote: On 2018年05月18日 21:13, Michael S. Tsirkin wrote: On Fri, May 18, 2018 at 09:00:43PM +0800, Jason Wang wrote: 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 EPOLLO

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Jason Wang
On 2018年05月18日 21:13, Michael S. Tsirkin wrote: On Fri, May 18, 2018 at 09:00:43PM +0800, Jason Wang wrote: 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

Re: [PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Michael S. Tsirkin
On Fri, May 18, 2018 at 09:00:43PM +0800, Jason Wang wrote: > 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

[PATCH net] tuntap: raise EPOLLOUT on device up

2018-05-18 Thread Jason Wang
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. Fixin