From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03A4AC04B936; Thu, 7 Sep 2017 14:01:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 03A4AC04B936 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=maxime.coquelin@redhat.com Received: from [10.36.112.11] (unknown [10.36.112.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8B7A768D65; Thu, 7 Sep 2017 14:01:23 +0000 (UTC) To: Yuanhan Liu Cc: dev@dpdk.org, jfreiman@redhat.com, tiwei.bie@intel.com, mst@redhat.com, vkaplans@redhat.com, jasowang@redhat.com References: <20170831095023.21037-1-maxime.coquelin@redhat.com> <20170831095023.21037-4-maxime.coquelin@redhat.com> <20170907134434.GB9736@yliu-home> From: Maxime Coquelin Message-ID: Date: Thu, 7 Sep 2017 16:01:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170907134434.GB9736@yliu-home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 07 Sep 2017 14:01:35 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 14:01:36 -0000 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