From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id DA5E63989 for ; Thu, 21 Jul 2016 15:52:38 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 21 Jul 2016 06:52:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,399,1464678000"; d="scan'208";a="850610600" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga003.jf.intel.com with ESMTP; 21 Jul 2016 06:52:06 -0700 Date: Thu, 21 Jul 2016 21:56:15 +0800 From: Yuanhan Liu To: Ilya Maximets Cc: dev@dpdk.org, Huawei Xie , Dyasly Sergey , Heetae Ahn , Thomas Monjalon Message-ID: <20160721135615.GL28708@yliu-dev.sh.intel.com> References: <1469089275-15209-1-git-send-email-i.maximets@samsung.com> <1469107175-1216-1-git-send-email-i.maximets@samsung.com> <20160721133558.GK28708@yliu-dev.sh.intel.com> <5790D17D.8080402@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5790D17D.8080402@samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v3] vhost: fix connect hang in client mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2016 13:52:39 -0000 On Thu, Jul 21, 2016 at 04:43:25PM +0300, Ilya Maximets wrote: > > > On 21.07.2016 16:35, Yuanhan Liu wrote: > > On Thu, Jul 21, 2016 at 04:19:35PM +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: > >> > >> ovs_rcu(urcu2)|WARN|blocked 512000 ms waiting for main to quiesce > >> (gdb) bt > >> #0 connect () from /lib64/libpthread.so.0 > >> #1 vhost_user_create_client (vsocket=0xa816e0) > >> #2 rte_vhost_driver_register > >> #3 netdev_dpdk_vhost_user_construct > >> #4 netdev_open (name=0xa664b0 "vhost1") > >> [...] > >> #11 main > >> > >> Fix that by setting non-blocking mode for client sockets for connection. > >> > >> Fixes: 64ab701c3d1e ("vhost: add vhost-user client mode") > >> > >> Signed-off-by: Ilya Maximets > > > > Acked-by: Yuanhan Liu > > > > One help I'd like to ask is that I'd appriciate if you could do the test > > to make sure that your 2 (latest) patches fix the two issues you reported. > > > > You might have already done that; I just want to make sure. > > I've performed the test with 'ofport_request' script before sending patches. > And currently test still works. No leaks of descriptors, no hangs, > no QEMU crashes observed. > Sometimes network device breaks on QEMU side, but it's QEMU issue. In this > case I'm receiving following message from DPDK's vhost: > > VHOST_CONFIG: vhost-user client: socket created, fd: 28 > VHOST_CONFIG: failed to connect to /vhost1: Resource temporarily unavailable > VHOST_CONFIG: /vhost1: reconnecting... > > Before the 'hang' patch there was hang of main thread. > > After QEMU restart all works normally. OVS restart not required. Good to know and appreciate that! --yliu