From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 926963777 for ; Wed, 22 Mar 2017 09:41:10 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BFE3C6AADE; Wed, 22 Mar 2017 08:41:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BFE3C6AADE Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=maxime.coquelin@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BFE3C6AADE Received: from [10.36.112.20] (ovpn-112-20.ams2.redhat.com [10.36.112.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1966C7B8C0; Wed, 22 Mar 2017 08:41:09 +0000 (UTC) To: Yuanhan Liu , dev@dpdk.org References: <1488434385-7605-1-git-send-email-yuanhan.liu@linux.intel.com> <1488435367-22170-1-git-send-email-yuanhan.liu@linux.intel.com> From: Maxime Coquelin Message-ID: <1042e46c-733f-929d-b299-9ac7abf174cb@redhat.com> Date: Wed, 22 Mar 2017 09:41:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1488435367-22170-1-git-send-email-yuanhan.liu@linux.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 22 Mar 2017 08:41:10 +0000 (UTC) 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:41:10 -0000 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, Maxime