Re: [PATCH net 5/6] net: mvneta: The mvneta_percpu_elect function should be atomic

2016-02-01 Thread Gregory CLEMENT
Hi David, On sam., janv. 30 2016, David Miller wrote: > From: Gregory CLEMENT > Date: Fri, 29 Jan 2016 17:26:06 +0100 > >> @@ -370,6 +370,8 @@ struct mvneta_port { >> struct net_device *dev; >> struct notifier_block cpu_notifier; >> int rxq_def; >> +/* protect */ >> +s

Re: [PATCH net 5/6] net: mvneta: The mvneta_percpu_elect function should be atomic

2016-01-29 Thread David Miller
From: Gregory CLEMENT Date: Fri, 29 Jan 2016 17:26:06 +0100 > @@ -370,6 +370,8 @@ struct mvneta_port { > struct net_device *dev; > struct notifier_block cpu_notifier; > int rxq_def; > + /* protect */ > + spinlock_t lock; > > /* Core clock */ > struct clk *

[PATCH net 5/6] net: mvneta: The mvneta_percpu_elect function should be atomic

2016-01-29 Thread Gregory CLEMENT
Electing a CPU must be done in an atomic way: it should be done after or before the removal/insertion of a CPU and this function is not reentrant. During the loop of mvneta_percpu_elect we associates the queues to the CPUs, if there is a topology change during this loop, then the mapping between t