From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A20B5A00C5; Mon, 6 Jul 2020 13:25:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A86781D942; Mon, 6 Jul 2020 13:25:18 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id A0F841D935 for ; Mon, 6 Jul 2020 13:25:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594034716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PNIRPz3UZAX9NiPahml8ZjpmF2PJ0/tJT3o/wz5pZW0=; b=AUXC0T4tV8iqJmx2ZI3IUzxzDW5sgCdiAz2IFzdb4jUavG7S4sWQBOcJ6J2/FdOAhfyHt5 STWbxZbpMmQNCUh7FgfryfAA9+qRWFEZPDbkag4Z9W2F6e2eoH7EpyxD2SHxZAByxv7vhA BIHPicpnjPC+JR7Qnjy6atGESIhneO4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-352-0QxaxmfgPPiUOI2gIdDPvQ-1; Mon, 06 Jul 2020 07:25:14 -0400 X-MC-Unique: 0QxaxmfgPPiUOI2gIdDPvQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81FD88015F7; Mon, 6 Jul 2020 11:25:12 +0000 (UTC) Received: from amorenoz.users.ipa.redhat.com (ovpn-112-91.ams2.redhat.com [10.36.112.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F47960CC0; Mon, 6 Jul 2020 11:25:10 +0000 (UTC) From: Adrian Moreno To: dev@dpdk.org, chenbo.xia@intel.com, xiaolong.ye@intel.com, shahafs@mellanox.com, matan@mellanox.com, maxime.coquelin@redhat.com, xiao.w.wang@intel.com, viacheslavo@mellanox.com Cc: jasowang@redhat.com, lulu@redhat.com, stable@dpdk.org Date: Mon, 6 Jul 2020 13:24:45 +0200 Message-Id: <20200706112452.1474533-2-amorenoz@redhat.com> In-Reply-To: <20200706112452.1474533-1-amorenoz@redhat.com> References: <20200706112452.1474533-1-amorenoz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amorenoz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 1/8] vhost: fix virtio ready flag check 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Maxime Coquelin Before checking whether the device is ready is done a check on whether the RUNNING flag is set. Then the READY flag is set if virtio_is_ready() returns true. While it seems to not cause any issue, it makes more sense to check whether the READY flag is set and not the RUNNING one. Fixes: c0674b1bc898 ("vhost: move the device ready check at proper place") Cc: stable@dpdk.org Signed-off-by: Maxime Coquelin --- lib/librte_vhost/vhost_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 6039a8fdb..5750dde6d 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -2825,7 +2825,7 @@ vhost_user_msg_handler(int vid, int fd) } - if (!(dev->flags & VIRTIO_DEV_RUNNING) && virtio_is_ready(dev)) { + if (!(dev->flags & VIRTIO_DEV_READY) && virtio_is_ready(dev)) { dev->flags |= VIRTIO_DEV_READY; if (!(dev->flags & VIRTIO_DEV_RUNNING)) { -- 2.26.2