From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v3] net/vhost: fix vhost invalid state Date: Thu, 12 Apr 2018 09:40:38 +0200 Message-ID: References: <1523443993-176139-1-git-send-email-junjie.j.chen@intel.com> <1523466152-181190-1-git-send-email-junjie.j.chen@intel.com> <75c33a22-9b4c-f293-07ee-daad99f3cad0@intel.com> <6288ba60-eebb-a743-aa1d-a61c32a07c58@redhat.com> <2c907472-444b-e8b6-2437-6fdcbcc21979@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" To: "Chen, Junjie J" , "Tan, Jianfeng" , "mtetsuyah@gmail.com" Return-path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 919901BBA8 for ; Thu, 12 Apr 2018 09:40:41 +0200 (CEST) In-Reply-To: <2c907472-444b-e8b6-2437-6fdcbcc21979@redhat.com> Content-Language: en-US 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 04/12/2018 09:35 AM, Maxime Coquelin wrote: > > > On 04/12/2018 09:34 AM, Chen, Junjie J wrote: >>> >>> >>> >>> On 04/12/2018 09:21 AM, Tan, Jianfeng wrote: >>>> >>>> >>>> On 4/12/2018 1:02 AM, Junjie Chen wrote: >>>>> dev_start sets *dev_attached* after setup queues, this sets device to >>>>> invalid state since no frontend is attached. Also destroy_device set >>>>> *started* to zero which makes *allow_queuing* always zero until >>>>> dev_start get called again. Actually, we should not determine queues >>>>> existence by >>>>> *dev_attached* but by queues pointers or other separated variable(s). >>>>> >>>>> Fixes: 30a701a53737 ("net/vhost: fix crash when creating vdev >>>>> dynamically") >>>>> >>>>> Signed-off-by: Junjie Chen >>>>> Tested-by: Jens Freimann >>>> >>>> Overall, looks great to me except a nit below. >>>> >>>> Reviewed-by: Jianfeng Tan >>> >>> Thanks Jianfeng, I can handle the small change while applying. >>> >>> Can you confirm that it is implied that the queue are already >>> allocated, else we >>> wouldn't find the internal resource and quit earlier (in case of >>> eth_dev_close >>> called twice for example)? >> >> That is required, otherwise it generate segfault if we close device >> before queue setup. For example we >> execute following steps in testpmd: >> 1. port attach >> 2. ctrl+D > > Thanks for confirming Junjie, I will apply it as is then. > > Reviewed-by: Maxime Coquelin > Applied to dpdk-next-virtio/master Thanks, Maxime