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 16945A00C3 for ; Thu, 14 May 2020 10:02:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D5721D674; Thu, 14 May 2020 10:02:44 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id CA9E61D674 for ; Thu, 14 May 2020 10:02:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589443362; 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=QM7NkTdmUfadt9y4RbM4DxyLCkkemp2dlmsstKvAgHk=; b=dpAoJ40wA/ZFgCln+C8+qZoTvOq90VfXJ3l2w2qcw27AONCiYmMTHaSubeW3iY4TF1+zRy k+xwOXVRXYnCSY/y+qOdMeycbes5EQ4JfsQJHqlysqbwSzwQqorutCO1DFTzJHoG5B2jqe hdWTSsOASVTL9z8sMemsdCPr+2sJfaM= 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-69-cY6IjMHtP1KBSXntIMbDAQ-1; Thu, 14 May 2020 04:02:40 -0400 X-MC-Unique: cY6IjMHtP1KBSXntIMbDAQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E854D107ACF2; Thu, 14 May 2020 08:02:38 +0000 (UTC) Received: from localhost.localdomain (unknown [10.36.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 750A861F50; Thu, 14 May 2020 08:02:36 +0000 (UTC) From: Maxime Coquelin To: xiaolong.ye@intel.com, shahafs@mellanox.com, matan@mellanox.com, amorenoz@redhat.com, xiao.w.wang@intel.com, viacheslavo@mellanox.com, dev@dpdk.org Cc: jasowang@redhat.com, lulu@redhat.com, Maxime Coquelin , stable@dpdk.org Date: Thu, 14 May 2020 10:02:10 +0200 Message-Id: <20200514080218.1435344-2-maxime.coquelin@redhat.com> In-Reply-To: <20200514080218.1435344-1-maxime.coquelin@redhat.com> References: <20200514080218.1435344-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 1/9] vhost: fix virtio ready flag check X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 9c891d4c01..106b6d7609 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -2784,7 +2784,7 @@ vhost_user_msg_handler(int vid, int fd) return -1; } - 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.25.4