From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Junjie J" Subject: Re: [PATCH v3] net/vhost: fix segfault when creating vdev dynamically Date: Tue, 10 Apr 2018 08:11:35 +0000 Message-ID: References: <20180329153544.270488-1-junjie.j.chen@intel.com> <20180330065831.107558-1-junjie.j.chen@intel.com> <20180409123741.f6s4cjlofkvytch6@dhcp-192-241.str.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "Tan, Jianfeng" , "maxime.coquelin@redhat.com" , "mtetsuyah@gmail.com" , "dev@dpdk.org" , "Chen@dpdk.org" To: Jens Freimann Return-path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 4EF951B973 for ; Tue, 10 Apr 2018 10:11:40 +0200 (CEST) In-Reply-To: <20180409123741.f6s4cjlofkvytch6@dhcp-192-241.str.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" Thanks for report, I just summited this patch to fix: https://dpdk.org/dev/patchwork/patch/37765/=20 >=20 > Hi, >=20 > On Fri, Mar 30, 2018 at 02:58:31PM +0800, Junjie Chen wrote: > >When creating vdev dynamically, vhost pmd driver starts directly > >without checking TX/RX queues are ready or not, and thus causes > >segmentation fault when vhost library accesses queues. This patch adds > >a flag to check whether queues are setup or not, and adds queues setup > >into dev_start function to allow user to start them after setting up. >=20 > for me, with this patch vhost enqueue/dequeue code is never called becaus= e >=20 > if (unlikely(rte_atomic32_read(&r->allow_queuing) =3D=3D 0)) >=20 > this check in eth_vhost_rx() is always true. >=20 > When I revert this patch it works as usual. >=20 > My testpmd cmdline is: >=20 > gdb --args $RTE_SDK/install/bin/testpmd -l 0,2,3,4,5 --socket-mem=3D1024 = -n 4 \ > --vdev 'net_vhost0,iface=3D/tmp/vhost-user1' \ > --vdev 'net_vhost1,iface=3D/tmp/vhost-user2' -- \ > --portmask=3Df --rxq=3D1 --txq=3D1 \ > --nb-cores=3D4 --forward-mode=3Dio -i >=20 > After starting testpmd I issue commands "set portlist 0,2,1,3", start my = guest > and start another testpmd issue in the guest. >=20 > Another problem I see: Before this patch I could start testpmd, issue the > portlist command and type "start". If I do this now I get an infinite loo= p of > "VHOST CONFIG device not found" messages. >=20 >=20 > regards, > Jens