From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH] vhost: remove a hack on queue allocation Date: Sat, 1 Apr 2017 16:35:21 +0800 Message-ID: <20170401083521.GX18844@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> <20170322085612.GP18844@yliu-dev.sh.intel.com> <20170401083258.GW18844@yliu-dev.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Maxime Coquelin To: dev@dpdk.org Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1A87B2B91 for ; Sat, 1 Apr 2017 10:37:55 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20170401083258.GW18844@yliu-dev.sh.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Sat, Apr 01, 2017 at 04:32:58PM +0800, Yuanhan Liu wrote: > On Wed, Mar 22, 2017 at 04:56:12PM +0800, Yuanhan Liu wrote: > > 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. > > Reworked, as there is a silly error that cause crash. Re-applied. --yliu > -- >8 -- > >From 269ba9b3a6a1671f463b9f9d4cc0d51954f7a2f5 Mon Sep 17 00:00:00 2001 > From: Yuanhan Liu > Date: Thu, 2 Mar 2017 14:16:07 +0800 > Subject: [PATCH v3] vhost: remove a hack on queue allocation