From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH 11/17] vhost: move the device ready check at proper place Date: Tue, 14 Mar 2017 13:37:59 +0100 Message-ID: <08bd20dc-9b92-70ad-1225-7feb042bf81e@redhat.com> References: <1488534682-3494-1-git-send-email-yuanhan.liu@linux.intel.com> <1488534682-3494-12-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Harris James R , Liu Changpeng To: Yuanhan Liu , dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 15402A10 for ; Tue, 14 Mar 2017 13:38:05 +0100 (CET) In-Reply-To: <1488534682-3494-12-git-send-email-yuanhan.liu@linux.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 03/03/2017 10:51 AM, Yuanhan Liu wrote: > Currently, we check vq->desc, vq->kickfd and vq->callfd to know whether > a virtio device is ready or not. However, we only do it when handling > SET_VRING_KICK message, which could be wrong if a vhost-user frontend > send SET_VRING_KICK first and SET_VRING_CALL later. > > To work for all possible vhost-user frontend implementations, we could > move the ready check at the end of vhost-user message handler. > > Meanwhile, since we do the check more often than before, the "virtio > not ready" message is dropped, to not flood the screen. > > Signed-off-by: Yuanhan Liu > --- > lib/librte_vhost/vhost_user.c | 32 ++++++++++++++------------------ > 1 file changed, 14 insertions(+), 18 deletions(-) Makes sense: Reviewed-by: Maxime Coquelin Thanks, Maxime