From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 5DB0C6CB5 for ; Mon, 9 May 2016 18:47:07 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 09 May 2016 09:47:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,601,1455004800"; d="scan'208";a="802366483" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 09 May 2016 09:47:06 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 9 May 2016 09:47:05 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 9 May 2016 09:47:05 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.148]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.58]) with mapi id 14.03.0248.002; Tue, 10 May 2016 00:47:03 +0800 From: "Xie, Huawei" To: Yuanhan Liu , "dev@dpdk.org" Thread-Topic: [PATCH 3/6] vhost: add reconnect ability Thread-Index: AdGqEmkihUidSdHvRW+kJ57Rlmlc4A== Date: Mon, 9 May 2016 16:47:02 +0000 Message-ID: References: <1462603224-29510-1-git-send-email-yuanhan.liu@linux.intel.com> <1462603224-29510-4-git-send-email-yuanhan.liu@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 3/6] vhost: add reconnect ability 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: Mon, 09 May 2016 16:47:07 -0000 On 5/7/2016 2:36 PM, Yuanhan Liu wrote:=0A= > +static void *=0A= > +vhost_user_client_reconnect(void *arg)=0A= > +{=0A= > + struct reconnect_info *reconn =3D arg;=0A= > + int ret;=0A= > +=0A= > + RTE_LOG(ERR, VHOST_CONFIG, "reconnecting...\n");=0A= > + while (1) {=0A= > + ret =3D connect(reconn->fd, (struct sockaddr *)&reconn->un,=0A= > + sizeof(reconn->un));=0A= > + if (ret =3D=3D 0)=0A= > + break;=0A= > + sleep(1);=0A= > + }=0A= > +=0A= > + vhost_user_add_connection(reconn->fd, reconn->vsocket);=0A= > + free(reconn);=0A= > +=0A= > + return NULL;=0A= > +}=0A= > +=0A= =0A= We could create hundreds of vhost-user ports in OVS. Wihout connections=0A= with QEMU established, those ports are just inactive. This works fine in=0A= server mode.=0A= With client modes, do we need to create hundreds of vhost threads? This=0A= would be too interruptible.=0A= How about we create only one thread and do the reconnections for all the=0A= unconnected socket?=0A= =0A=