From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C05DE11C5 for ; Wed, 22 Mar 2017 09:58:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490173103; x=1521709103; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=QeQ8U/wtzkZOdm/uLxNbW1m+bB1FtDQrkrLg1srMMto=; b=XHALhx4+CHvA8rgVIp8EbzsV9isZnTa5YZKGz085RROmMkYhchNaBPYW /UbKZSKZAgq/gX4ovzz4/u61U+ijOQ==; Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Mar 2017 01:58:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,204,1486454400"; d="scan'208";a="946946997" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga003.jf.intel.com with ESMTP; 22 Mar 2017 01:58:21 -0700 Date: Wed, 22 Mar 2017 16:56:12 +0800 From: Yuanhan Liu To: Maxime Coquelin Cc: dev@dpdk.org Message-ID: <20170322085612.GP18844@yliu-dev.sh.intel.com> References: <1488434385-7605-1-git-send-email-yuanhan.liu@linux.intel.com> <1488435367-22170-1-git-send-email-yuanhan.liu@linux.intel.com> <1042e46c-733f-929d-b299-9ac7abf174cb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1042e46c-733f-929d-b299-9ac7abf174cb@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] vhost: remove a hack on queue allocation 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: Wed, 22 Mar 2017 08:58:25 -0000 On Wed, Mar 22, 2017 at 09:41:07AM +0100, Maxime Coquelin wrote: > > > On 03/02/2017 07:16 AM, Yuanhan Liu wrote: > >We used to allocate queues based on the index from SET_VRING_CALL > >request: if corresponding queue hasn't been allocated, allocate it. > > > >Though it's pratically right (it's the first per-vring request we > >will get from QEMU for vhost-user negotiation), but it's not technically > >right: it's not documented in the vhost-user spec that it will always > >be the first per-vring request. For example, SET_VRING_ADDR could also > >be the first per-vring request. > > > >Thus, we should not depend the SET_VRING_CALL on queue allocation. > >Instead, we could catch all the per-vring messages at the entrance of > >request handler, and allocate one if it hasn't been allocated before. > > > >By that, we could remove a hack. > > > >Signed-off-by: Yuanhan Liu > >--- > > > >v2: add missing break > >--- > > lib/librte_vhost/vhost_user.c | 61 ++++++++++++++++++++++++++++++++++--------- > > 1 file changed, 48 insertions(+), 13 deletions(-) > > > Reviewed-by: Maxime Coquelin Thanks. Applied to dpdk-next-virtio. --yliu