Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-07 Thread Maxime Coquelin
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_r

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-07 Thread Yuanhan Liu
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? -

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-06 Thread Tiwei Bie
On Wed, Sep 06, 2017 at 10:02:29PM +0200, Maxime Coquelin wrote: > On 09/06/2017 09:30 AM, Tiwei Bie wrote: > > On Wed, Sep 06, 2017 at 09:15:47AM +0200, Maxime Coquelin wrote: > > > Hi Tiwei, > > > > > > On 09/06/2017 03:15 AM, Tiwei Bie wrote: > > > > On Tue, Sep 05, 2017 at 01:00:42PM +0200, Ma

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-06 Thread Maxime Coquelin
On 09/06/2017 09:30 AM, Tiwei Bie wrote: On Wed, Sep 06, 2017 at 09:15:47AM +0200, Maxime Coquelin wrote: Hi Tiwei, On 09/06/2017 03:15 AM, Tiwei Bie wrote: On Tue, Sep 05, 2017 at 01:00:42PM +0200, Maxime Coquelin wrote: On 09/05/2017 12:07 PM, Tiwei Bie wrote: On Tue, Sep 05, 2017 at 11:

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-06 Thread Maxime Coquelin
Hi Stephen, On 09/06/2017 04:59 AM, Stephen Hemminger wrote: This lock has currently two purposes: 1. Prevent referencing freed virtio_dev struct in case of numa_realloc. 2. Protect vring pages against invalidation. For 2., it can be fixed by using the per-vq IOTLB lock (it was not the case in

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-06 Thread Tiwei Bie
On Wed, Sep 06, 2017 at 09:15:47AM +0200, Maxime Coquelin wrote: > Hi Tiwei, > > On 09/06/2017 03:15 AM, Tiwei Bie wrote: > > On Tue, Sep 05, 2017 at 01:00:42PM +0200, Maxime Coquelin wrote: > > > On 09/05/2017 12:07 PM, Tiwei Bie wrote: > > > > On Tue, Sep 05, 2017 at 11:24:14AM +0200, Maxime Coq

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-06 Thread Maxime Coquelin
Hi Tiwei, On 09/06/2017 03:15 AM, Tiwei Bie wrote: On Tue, Sep 05, 2017 at 01:00:42PM +0200, Maxime Coquelin wrote: On 09/05/2017 12:07 PM, Tiwei Bie wrote: On Tue, Sep 05, 2017 at 11:24:14AM +0200, Maxime Coquelin wrote: On 09/05/2017 06:45 AM, Tiwei Bie wrote: On Thu, Aug 31, 2017 at 11:50

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-05 Thread Stephen Hemminger
> > > This lock has currently two purposes: > > > 1. Prevent referencing freed virtio_dev struct in case of numa_realloc. > > > 2. Protect vring pages against invalidation. > > > > > > For 2., it can be fixed by using the per-vq IOTLB lock (it was not the > > > case in my early prototypes that had

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-05 Thread Tiwei Bie
On Tue, Sep 05, 2017 at 01:00:42PM +0200, Maxime Coquelin wrote: > On 09/05/2017 12:07 PM, Tiwei Bie wrote: > > On Tue, Sep 05, 2017 at 11:24:14AM +0200, Maxime Coquelin wrote: > > > On 09/05/2017 06:45 AM, Tiwei Bie wrote: > > > > On Thu, Aug 31, 2017 at 11:50:05AM +0200, Maxime Coquelin wrote: >

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-05 Thread Maxime Coquelin
On 09/05/2017 12:07 PM, Tiwei Bie wrote: On Tue, Sep 05, 2017 at 11:24:14AM +0200, Maxime Coquelin wrote: On 09/05/2017 06:45 AM, Tiwei Bie 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 awar

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-05 Thread Tiwei Bie
On Tue, Sep 05, 2017 at 11:24:14AM +0200, Maxime Coquelin wrote: > On 09/05/2017 06:45 AM, Tiwei Bie 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. This case might be theo

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-05 Thread Maxime Coquelin
On 09/05/2017 06:45 AM, Tiwei Bie 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. This case might be theoretical, but it will be needed anyway to protect vrings pages against invalida

Re: [dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-09-04 Thread Tiwei Bie
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. This case might be theoretical, > but it will be needed anyway to protect vrings pages against > invalidation. > > The virtio_net devs are now

[dpdk-dev] [PATCH 03/21] vhost: protect virtio_net device struct

2017-08-31 Thread Maxime Coquelin
virtio_net device might be accessed while being reallocated in case of NUMA awareness. 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 devic