From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH 03/21] vhost: protect virtio_net device struct Date: Thu, 7 Sep 2017 21:44:34 +0800 Message-ID: <20170907134434.GB9736@yliu-home> References: <20170831095023.21037-1-maxime.coquelin@redhat.com> <20170831095023.21037-4-maxime.coquelin@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, jfreiman@redhat.com, tiwei.bie@intel.com, mst@redhat.com, vkaplans@redhat.com, jasowang@redhat.com To: Maxime Coquelin Return-path: Received: from mail-pf0-f174.google.com (mail-pf0-f174.google.com [209.85.192.174]) by dpdk.org (Postfix) with ESMTP id 48604199A9 for ; Thu, 7 Sep 2017 15:44:43 +0200 (CEST) Received: by mail-pf0-f174.google.com with SMTP id e1so3785930pfk.1 for ; Thu, 07 Sep 2017 06:44:43 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20170831095023.21037-4-maxime.coquelin@redhat.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 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? --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