[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Yuanhan Liu
On Thu, Jul 21, 2016 at 03:58:11PM +0300, Ilya Maximets wrote: > On 21.07.2016 15:58, Yuanhan Liu wrote: > > On Thu, Jul 21, 2016 at 03:42:54PM +0300, Ilya Maximets wrote: > >> On 21.07.2016 15:35, Yuanhan Liu wrote: > >>> On Thu, Jul 21, 2016 at 03:13:14PM +0300, Ilya Maximets wrote: > >> >

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Yuanhan Liu
On Thu, Jul 21, 2016 at 03:42:54PM +0300, Ilya Maximets wrote: > On 21.07.2016 15:35, Yuanhan Liu wrote: > > On Thu, Jul 21, 2016 at 03:13:14PM +0300, Ilya Maximets wrote: > > What do you think of it? > >>> > >>> I found that we can't check connection status without select/poll > >>> on

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Yuanhan Liu
On Thu, Jul 21, 2016 at 03:13:14PM +0300, Ilya Maximets wrote: > >> > >> What do you think of it? > > > > I found that we can't check connection status without select/poll > > on it. 'getsockopt()' will return 0 with no errors if connection > > is not still established just like if it was. > >

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Yuanhan Liu
On Thu, Jul 21, 2016 at 02:14:59PM +0300, Ilya Maximets wrote: > > Hmm, how about this fixup: > > -- > > diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c > > b/lib/librte_vhost/vhost_user/vhost-net-user.c > >

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Yuanhan Liu
On Thu, Jul 21, 2016 at 12:45:32PM +0300, Ilya Maximets wrote: > On 21.07.2016 12:37, Yuanhan Liu wrote: > > On Thu, Jul 21, 2016 at 11:21:15AM +0300, Ilya Maximets wrote: > >> If something abnormal happened to QEMU, 'connect()' can block calling > >> thread (e.g. main thread of OVS) forever or

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Yuanhan Liu
On Thu, Jul 21, 2016 at 11:21:15AM +0300, Ilya Maximets wrote: > If something abnormal happened to QEMU, 'connect()' can block calling > thread (e.g. main thread of OVS) forever or for a really long time. > This can break whole application or block the reconnection thread. > > Example with OVS: >

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Ilya Maximets
On 21.07.2016 15:58, Yuanhan Liu wrote: > On Thu, Jul 21, 2016 at 03:42:54PM +0300, Ilya Maximets wrote: >> On 21.07.2016 15:35, Yuanhan Liu wrote: >>> On Thu, Jul 21, 2016 at 03:13:14PM +0300, Ilya Maximets wrote: >> >> What do you think of it? > > I found that we can't check

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Ilya Maximets
On 21.07.2016 15:35, Yuanhan Liu wrote: > On Thu, Jul 21, 2016 at 03:13:14PM +0300, Ilya Maximets wrote: What do you think of it? >>> >>> I found that we can't check connection status without select/poll >>> on it. 'getsockopt()' will return 0 with no errors if connection >>> is not

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Ilya Maximets
On 21.07.2016 15:10, Ilya Maximets wrote: > On 21.07.2016 14:40, Yuanhan Liu wrote: >> On Thu, Jul 21, 2016 at 02:14:59PM +0300, Ilya Maximets wrote: Hmm, how about this fixup: -- diff --git

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Ilya Maximets
On 21.07.2016 14:40, Yuanhan Liu wrote: > On Thu, Jul 21, 2016 at 02:14:59PM +0300, Ilya Maximets wrote: >>> Hmm, how about this fixup: >>> -- >>> diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c >>>

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Ilya Maximets
On 21.07.2016 13:37, Ilya Maximets wrote: > > > On 21.07.2016 13:13, Yuanhan Liu wrote: >> On Thu, Jul 21, 2016 at 12:45:32PM +0300, Ilya Maximets wrote: >>> On 21.07.2016 12:37, Yuanhan Liu wrote: On Thu, Jul 21, 2016 at 11:21:15AM +0300, Ilya Maximets wrote: > If something abnormal

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Ilya Maximets
On 21.07.2016 13:13, Yuanhan Liu wrote: > On Thu, Jul 21, 2016 at 12:45:32PM +0300, Ilya Maximets wrote: >> On 21.07.2016 12:37, Yuanhan Liu wrote: >>> On Thu, Jul 21, 2016 at 11:21:15AM +0300, Ilya Maximets wrote: If something abnormal happened to QEMU, 'connect()' can block calling

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Ilya Maximets
On 21.07.2016 12:37, Yuanhan Liu wrote: > On Thu, Jul 21, 2016 at 11:21:15AM +0300, Ilya Maximets wrote: >> If something abnormal happened to QEMU, 'connect()' can block calling >> thread (e.g. main thread of OVS) forever or for a really long time. >> This can break whole application or block the

[dpdk-dev] [PATCH] vhost: fix connect hang in client mode

2016-07-21 Thread Ilya Maximets
If something abnormal happened to QEMU, 'connect()' can block calling thread (e.g. main thread of OVS) forever or for a really long time. This can break whole application or block the reconnection thread. Example with OVS: ovs_rcu(urcu2)|WARN|blocked 512000 ms waiting for main to quiesce