From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id E230DF957 for ; Mon, 27 Mar 2017 03:51:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490579477; x=1522115477; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=aDicVgKmjDdqPsJ6bOOeOPAMnPHg56SEsIN58srEq4c=; b=enmn8lyvHLDeq39nt2q2NWX50oKpqkDSVxWMbPkCo8ahLDIdf4nrW2iJ hxuo/nMzf1jteZ6og10rilRadWuHoA==; Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2017 18:51:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="948434103" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 26 Mar 2017 18:51:15 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 26 Mar 2017 18:51:14 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 26 Mar 2017 18:51:15 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.253]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.46]) with mapi id 14.03.0248.002; Mon, 27 Mar 2017 09:51:13 +0800 From: "Tan, Jianfeng" To: Yuanhan Liu CC: "dev@dpdk.org" , "david.marchand@6wind.com" Thread-Topic: [PATCH 4/5] net/virtio-user: add lsc support with vhost-user adapter Thread-Index: AQHSlEdz4F2O837ZOEiyIZVPuKJeWaGYQnAAgA/NilA= Date: Mon, 27 Mar 2017 01:51:13 +0000 Message-ID: References: <1488563803-87754-1-git-send-email-jianfeng.tan@intel.com> <1488563803-87754-5-git-send-email-jianfeng.tan@intel.com> <20170317082912.GI18844@yliu-dev.sh.intel.com> In-Reply-To: <20170317082912.GI18844@yliu-dev.sh.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 4/5] net/virtio-user: add lsc support with vhost-user adapter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 01:51:17 -0000 > -----Original Message----- > From: Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] > Sent: Friday, March 17, 2017 4:29 PM > To: Tan, Jianfeng > Cc: dev@dpdk.org; david.marchand@6wind.com > Subject: Re: [PATCH 4/5] net/virtio-user: add lsc support with vhost-user > adapter >=20 > On Fri, Mar 03, 2017 at 05:56:42PM +0000, Jianfeng Tan wrote: > > So far, virtio-user with vhost-user as the backend can only support > > client mode. So when vhost user backend is down, i.e., unix socket > > connection is broken and cannot be re-connected. We will force the > > link state to be down. > > > > Signed-off-by: Jianfeng Tan > > static void > > virtio_user_read_dev_config(struct virtio_hw *hw, size_t offset, > > void *dst, int length) > > @@ -63,8 +77,27 @@ virtio_user_read_dev_config(struct virtio_hw *hw, > size_t offset, > > return; > > } > > > > - if (offset =3D=3D offsetof(struct virtio_net_config, status)) > > + if (offset =3D=3D offsetof(struct virtio_net_config, status)) { > > + char buf[128]; > > + > > + if (dev->vhostfd >=3D 0) { > > + int flags; > > + int r; > > + > > + flags =3D fcntl(dev->vhostfd, F_GETFL); > > + fcntl(dev->vhostfd, F_SETFL, flags | O_NONBLOCK); > > + r =3D recv(dev->vhostfd, buf, 128, 0); >=20 > I think you need specify flag MSG_PEEK, to not consume the data if > there any? Thanks for catching this issue, I'll fix it in next version. Thanks, Jianfeng