Re: [ovs-dev] [PATCH] dpif-netdev: fix race for queues between pmd threads

2015-07-27 Thread Ilya Maximets
Ok. I will. Thanks to you. On 27.07.2015 14:12, Daniele Di Proietto wrote: > That looks better to me. Minor comment: we usually prefer > 'sizeof *pmds' to 'sizeof(struct dp_netdev_pmd_thread*)' > > https://github.com/openvswitch/ovs/blob/master/CodingStyle.md#user-content- > expressions > > Wo

Re: [ovs-dev] [PATCH] dpif-netdev: fix race for queues between pmd threads

2015-07-27 Thread Daniele Di Proietto
That looks better to me. Minor comment: we usually prefer 'sizeof *pmds' to 'sizeof(struct dp_netdev_pmd_thread*)' https://github.com/openvswitch/ovs/blob/master/CodingStyle.md#user-content- expressions Would you mind changing that, updating the commit message and resending to the list? Thanks!

Re: [ovs-dev] [PATCH] dpif-netdev: fix race for queues between pmd threads

2015-07-27 Thread Ilya Maximets
Previous diff was completely wrong. Sorry. @@ -2971,6 +2970,7 @@ dp_netdev_set_pmds_on_numa(struct dp_netdev *dp, int numa_id) * pmd threads for the numa node. */ if (!n_pmds) { int can_have, n_unpinned, i; +struct dp_netdev_pmd_thread **pmds; n_unpinned = o

Re: [ovs-dev] [PATCH] dpif-netdev: fix race for queues between pmd threads

2015-07-27 Thread Ilya Maximets
Sorry, without dp_netdev_reload_pmds(dp) at the end. On 27.07.2015 10:58, Ilya Maximets wrote: > Yes, I think, this way is better. But it may be more simple > if we just keep all the dp_netdev_pmd_thread structures. > There is no need to search over all pmd threads on system. > > Like this: > >

Re: [ovs-dev] [PATCH] dpif-netdev: fix race for queues between pmd threads

2015-07-27 Thread Ilya Maximets
Yes, I think, this way is better. But it may be more simple if we just keep all the dp_netdev_pmd_thread structures. There is no need to search over all pmd threads on system. Like this: diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 79c4612..8e4c025 100644 --- a/lib/dpif-netdev.c +++ b

Re: [ovs-dev] [PATCH] dpif-netdev: fix race for queues between pmd threads

2015-07-24 Thread Daniele Di Proietto
That's a bad race condition, thanks for reporting it! Regarding the fix, I agree that reloading the threads would restore the correct mapping, but it would still allow the threads to run with the incorrect mapping for a brief interval. How about postponing the actual threads creation until all th

[ovs-dev] [PATCH] dpif-netdev: fix race for queues between pmd threads

2015-07-24 Thread Ilya Maximets
Currently pmd threads select queues in pmd_load_queues() according to get_n_pmd_threads_on_numa(). This behavior leads to race between pmds, beacause dp_netdev_set_pmds_on_numa() starts them one by one and current number of threads changes incrementally. As a result we may have the following situa