From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 32D981B344; Sun, 11 Feb 2018 05:21:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Feb 2018 20:21:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,493,1511856000"; d="scan'208";a="17055356" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga008.fm.intel.com with ESMTP; 10 Feb 2018 20:21:22 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sat, 10 Feb 2018 20:21:22 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.130]) with mapi id 14.03.0319.002; Sun, 11 Feb 2018 12:21:21 +0800 From: "Tan, Jianfeng" To: "Kulasek, TomaszX" , "yliu@fridaylinux.org" CC: "dev@dpdk.org" , "stable@dpdk.org" , "Liu, Changpeng" Thread-Topic: [dpdk-dev] [PATCH] vhost: fix wait for valid descriptor Thread-Index: AQHTocyB28Cj5no5KUqy8QwFDgoxO6OemoUA Date: Sun, 11 Feb 2018 04:21:20 +0000 Message-ID: References: <20180209173455.14116-1-tomaszx.kulasek@intel.com> In-Reply-To: <20180209173455.14116-1-tomaszx.kulasek@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] vhost: fix wait for valid descriptor 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: Sun, 11 Feb 2018 04:21:25 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tomasz Kulasek > Sent: Saturday, February 10, 2018 1:35 AM > To: yliu@fridaylinux.org > Cc: dev@dpdk.org; yuanhan.liu@linux.intel.com; stable@dpdk.org; Liu, > Changpeng > Subject: [dpdk-dev] [PATCH] vhost: fix wait for valid descriptor >=20 > For each virt queue's kickfd and callfd, there are 2 invalid > status: VIRTIO_UNINITIALIZED_EVENTFD and VIRTIO_INVALID_EVENTFD. > Don't set the virt queue to ready status until got the valid > descriptor. Cannot remember why we introduce two invalid status. If we treat "VIRTIO_INVALID_EVENTFD" as an indicator to judge if device is = ready, then defining one status (invalid) is enough. Thanks, Jianfeng >=20 > This is safe for polling mode drivers in Guest OS, the backend > vhost process will not post notification to interrupt vector for > PMD mode in guest, but the interrupt vector still valid. >=20 > Fixes: e049ca6d10e0 ("vhost-user: prepare multiple queue setup") > Cc: yuanhan.liu@linux.intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Changpeng Liu > Signed-off-by: Tomasz Kulasek > --- > lib/librte_vhost/vhost_user.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.= c > index 65ee33919..4508f697b 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -766,7 +766,9 @@ vq_is_ready(struct vhost_virtqueue *vq) > { > return vq && vq->desc && vq->avail && vq->used && > vq->kickfd !=3D VIRTIO_UNINITIALIZED_EVENTFD && > - vq->callfd !=3D VIRTIO_UNINITIALIZED_EVENTFD; > + vq->callfd !=3D VIRTIO_UNINITIALIZED_EVENTFD && > + vq->kickfd !=3D VIRTIO_INVALID_EVENTFD && > + vq->callfd !=3D VIRTIO_INVALID_EVENTFD; > } >=20 > static int > -- > 2.14.1