From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH 03/21] vhost: protect virtio_net device struct Date: Thu, 7 Sep 2017 16:01:21 +0200 Message-ID: References: <20170831095023.21037-1-maxime.coquelin@redhat.com> <20170831095023.21037-4-maxime.coquelin@redhat.com> <20170907134434.GB9736@yliu-home> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, jfreiman@redhat.com, tiwei.bie@intel.com, mst@redhat.com, vkaplans@redhat.com, jasowang@redhat.com To: Yuanhan Liu Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id D29137D4E for ; Thu, 7 Sep 2017 16:01:35 +0200 (CEST) In-Reply-To: <20170907134434.GB9736@yliu-home> 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 09/07/2017 03:44 PM, Yuanhan Liu wrote: > On Thu, Aug 31, 2017 at 11:50:05AM +0200, Maxime Coquelin wrote: >> virtio_net device might be accessed while being reallocated >> in case of NUMA awareness. > > From data path? data path won't be enabled until all are ready, which is > at a stage after numa_realloc(). Or, am I miss something? Right, I just thought that Qemu could add queues after enabling the first ones. Anyway, I removed this patch from the v2 I'm preparing. Maxime > --yliu > >> This case might be theoretical, >> but it will be needed anyway to protect vrings pages against >> invalidation. >> >> The virtio_net devs are now protected with a readers/writers >> lock, so that before reallocating the device, it is ensured >> that it is not being referenced by the processing threads. >> >> Signed-off-by: Maxime Coquelin