From patchwork Tue Sep 1 07:07:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Changpeng" X-Patchwork-Id: 76197 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E8B11A04AC; Tue, 1 Sep 2020 08:30:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D856E07; Tue, 1 Sep 2020 08:30:56 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id AC07ECF3 for ; Tue, 1 Sep 2020 08:30:54 +0200 (CEST) IronPort-SDR: 2v3RceB/CNITyvqDxJLnkfzQN8u3m6Pkx5KghFGi1NeRtvibdaULgvFPacK5/w1A3T189PiH7K rLrQ/v2wgyqQ== X-IronPort-AV: E=McAfee;i="6000,8403,9730"; a="156372763" X-IronPort-AV: E=Sophos;i="5.76,378,1592895600"; d="scan'208";a="156372763" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2020 23:30:53 -0700 IronPort-SDR: 43Sprr+aaKpMs1pBZ+BQY3r8qlOWlLHZm5pTuWKzRBgs/gomZqeKEKqgJxcilcVSqzvd1xTyTy frK2Hx7ceV0g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,378,1592895600"; d="scan'208";a="325224446" Received: from fedora.sh.intel.com ([10.67.114.173]) by fmsmga004.fm.intel.com with ESMTP; 31 Aug 2020 23:30:51 -0700 From: Changpeng Liu To: dev@dpdk.org Cc: changpeng.liu@intel.com, matan@mellanox.com, maxime.coquelin@redhat.com, chenbo.xia@intel.com, tomasz.zawadzki@intel.com Date: Tue, 1 Sep 2020 15:07:37 +0800 Message-Id: <1598944057-32690-1-git-send-email-changpeng.liu@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dpdk-dev] [PATCH] vhost: return ready when at least 1 vring is configured 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" Commit d0fcc38f "vhost: improve device readiness notifications" needs at least 2 vrings before changing the device state to ready, this is fine for NET device but not correct for BLK device. The number of vring required should be based on the device type, e.g. virtio_scsi device needs at least 3 vrings, and virtio_net needs at least 2 vrings, virtio_blk needs at least 1 vring. So instead of doing it in vhost library it's better that the application who uses this library do this check. Signed-off-by: Changpeng Liu --- 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 c3c924f..4d1883c 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1343,7 +1343,7 @@ vq->enabled; } -#define VIRTIO_DEV_NUM_VQS_TO_BE_READY 2u +#define VIRTIO_DEV_NUM_VQS_TO_BE_READY 1u static int virtio_is_ready(struct virtio_net *dev)