[ovs-dev] [urcu 8/8] dpif-netdev: Use RCU to protect data.

2014-03-05 Thread Ben Pfaff
Signed-off-by: Ben Pfaff --- lib/dpif-netdev.c | 150 -- 1 file changed, 43 insertions(+), 107 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index e97e4ce..efff796 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -49,

[ovs-dev] [urcu 6/8] ovs-thread: Replace ovsthread_counter by more general ovsthread_stats.

2014-03-05 Thread Ben Pfaff
This allows clients to do more than just increment a counter. The following commit will make the first use of that feature. Signed-off-by: Ben Pfaff --- lib/dpif-netdev.c | 75 +++-- lib/ovs-thread.c | 91 +++--

[ovs-dev] [urcu 3/8] ovs-rcu: New library.

2014-03-05 Thread Ben Pfaff
RCU allows multiple threads to read objects in parallel without any performance penalty. The following commit will introduce the first use. Signed-off-by: Ben Pfaff --- lib/automake.mk | 2 + lib/ovs-rcu.c | 293 ++ lib/ovs

[ovs-dev] [urcu 5/8] util: New functions for allocating memory while avoiding false sharing.

2014-03-05 Thread Ben Pfaff
This factors code out of fat-rwlock, making it easily usable by other code. Signed-off-by: Ben Pfaff --- lib/fat-rwlock.c | 29 ++--- lib/util.c | 65 +++- lib/util.h | 6 +- 3 files changed, 71 insertions(+

[ovs-dev] [urcu 7/8] dpif-netdev: Use ovsthread_stats for flow stats.

2014-03-05 Thread Ben Pfaff
This should scale better than a single mutex, though still not ideally. Signed-off-by: Ben Pfaff --- lib/dpif-netdev.c | 99 +-- 1 file changed, 74 insertions(+), 25 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index cb1beb7

[ovs-dev] [urcu 2/8] ovs-atomic: Add support for atomic pointer types.

2014-03-05 Thread Ben Pfaff
The upcoming RCU library will use these. Signed-off-by: Ben Pfaff --- lib/ovs-atomic-clang.h| 4 +++- lib/ovs-atomic-gcc4+.h| 2 ++ lib/ovs-atomic-gcc4.7+.h | 4 +++- lib/ovs-atomic-pthreads.h | 1 + lib/ovs-atomic.h | 23 +++ 5 files changed, 32 inserti

[ovs-dev] [urcu 1/8] ovs-atomic: Refactor declarations for GCC 4+, pthreads implementations.

2014-03-05 Thread Ben Pfaff
This makes it possible to add new uses of the underlying types for these declarations without the "typedef" wrappers. The following commit will make use of that feature. Signed-off-by: Ben Pfaff --- lib/ovs-atomic-gcc4+.h| 56 +-- lib/ovs-atomic-pthre

[ovs-dev] [urcu 4/8] ofproto: Use RCU to protect rule_actions.

2014-03-05 Thread Ben Pfaff
Signed-off-by: Ben Pfaff --- ofproto/connmgr.c| 5 +- ofproto/ofproto-dpif-xlate.c | 2 - ofproto/ofproto-dpif.c | 2 - ofproto/ofproto-provider.h | 19 --- ofproto/ofproto.c| 120 ++- 5 files changed, 63 insertion

[ovs-dev] [urcu 0/8] implement userspace RCU and add a few simple users

2014-03-05 Thread Ben Pfaff
The first three patches in this series implement an RCU library within Open vSwitch. The library is self-contained; it does not depend on liburcu or another external library. (This is the primary difference between this series and the previous RFC version.) The fourth patch adds one simple user

Re: [ovs-dev] [PATCH 3/5] datapath: Allow each vport to have an array of 'port_id's.

2014-03-05 Thread Alex Wang
On Wed, Mar 5, 2014 at 10:43 AM, Ben Pfaff wrote: > On Thu, Feb 27, 2014 at 11:44:24AM -0800, Alex Wang wrote: > > In order to allow handlers directly read upcalls from datapath, > > we need to support per-handler netlink socket for each vport in > > datapath. This commit makes this happen. Als

Re: [ovs-dev] [PATCH 2/5] dpif-netdev: Implement the API functions to allow multiple handler threads read upcall.

2014-03-05 Thread Alex Wang
Hey Ben, > It would be nice to add a sentence or two to the commit message > explaining why we think it's OK to drop the distinction between the > two queues we had before (as already discussed). > Yes, I'll do that, > The choice of hash function, in flow_hash_5tuple(), seems curious. I >

[ovs-dev] [PATCHv6] upcall: Configure datapath max-idle through ovs-vsctl.

2014-03-05 Thread Joe Stringer
This patch adds a new configuration option, "max-idle" to the Open_vSwitch "other-config" column. This sets how long datapath flows are cached in the datapath before revalidators expire them. Signed-off-by: Joe Stringer --- v6: Shift documentation to ofproto-provider.h. v5: Rebase. v4: Remove ex

[ovs-dev] [PATCH V2] dpif: Change dpif API to allow multiple handler threads read upcall.

2014-03-05 Thread Alex Wang
This commit changes the API in 'dpif-provider.h' to allow multiple handler threads call dpif_recv() simultaneously. Signed-off-by: Alex Wang --- PATCH -> V2: - fold in Ben's clarification. - refine the comments. - invoke dpif_handlers_set() in udpif_set_threads(). this is a bug. the previous

[ovs-dev] [PATCH] ofproto-dpif: Remove the flow_dumper thread.

2014-03-05 Thread Joe Stringer
From: Ethan Jackson Previously, we had a separate flow_dumper thread that fetched flows from the datapath to distribute to revalidator threads. This patch takes the logic for dumping and pushes it into the revalidator threads, resulting in simpler code with similar performance to the current code

Re: [ovs-dev] [PATCH 1/5] dpif: Change dpif API to allow multiple handler threads read upcall.

2014-03-05 Thread Ben Pfaff
On Wed, Mar 05, 2014 at 04:09:38PM -0800, Alex Wang wrote: > For some reason, the context didn't show up. But I think I know where you > are talking > about. lib/dpif.c > > Please let me know if there is need to modify and refine. I'd like to go > over and over > to make the API and comments com

Re: [ovs-dev] [PATCH 1/5] dpif: Change dpif API to allow multiple handler threads read upcall.

2014-03-05 Thread Alex Wang
Thanks Ben for the review~, For some reason, the context didn't show up. But I think I know where you are talking about. lib/dpif.c Please let me know if there is need to modify and refine. I'd like to go over and over to make the API and comments comprehensible. ;D The comment on dpif_port_g

Re: [ovs-dev] [PATCHv5 2/2] ofproto-dpif: Remove the flow_dumper thread.

2014-03-05 Thread Joe Stringer
On 5 March 2014 11:08, Ben Pfaff wrote: > That's fine with me. > OK, I'll send a fresh revision. ___ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev

Re: [ovs-dev] [PATCHv5 2/2] ofproto-dpif: Remove the flow_dumper thread.

2014-03-05 Thread Ben Pfaff
On Wed, Mar 05, 2014 at 11:03:24AM -0800, Joe Stringer wrote: > On 5 March 2014 10:50, Ben Pfaff wrote: > > > On Wed, Mar 05, 2014 at 10:47:33AM -0800, Joe Stringer wrote: > > > On 4 March 2014 14:49, Ben Pfaff wrote: > > > > If we were to maintain the ukeys hmaps separately, then we wouldn't >

Re: [ovs-dev] [PATCHv5 2/2] ofproto-dpif: Remove the flow_dumper thread.

2014-03-05 Thread Joe Stringer
On 5 March 2014 10:50, Ben Pfaff wrote: > On Wed, Mar 05, 2014 at 10:47:33AM -0800, Joe Stringer wrote: > > On 4 March 2014 14:49, Ben Pfaff wrote: > > > If we were to maintain the ukeys hmaps separately, then we wouldn't > > > have to have the same number of hmaps as threads. That seems, > > >

Re: [ovs-dev] [PATCHv5 2/2] ofproto-dpif: Remove the flow_dumper thread.

2014-03-05 Thread Ben Pfaff
On Wed, Mar 05, 2014 at 10:47:33AM -0800, Joe Stringer wrote: > On 4 March 2014 14:49, Ben Pfaff wrote: > > > After studying the code for a while, I think I see something odd. > > Each 'ukeys' hmap is associated with a revalidator thread, but the > > hmaps have barely any relationship with their

Re: [ovs-dev] [PATCHv5 2/2] ofproto-dpif: Remove the flow_dumper thread.

2014-03-05 Thread Joe Stringer
On 4 March 2014 14:49, Ben Pfaff wrote: > After studying the code for a while, I think I see something odd. > Each 'ukeys' hmap is associated with a revalidator thread, but the > hmaps have barely any relationship with their owning thread. Except > during the "sweep", it's not more likely, for e

Re: [ovs-dev] [PATCH 4/5] dpif-linux: Implement the API functions to allow multiple handler threads read upcall.

2014-03-05 Thread Ben Pfaff
On Thu, Feb 27, 2014 at 11:44:25AM -0800, Alex Wang wrote: > Signed-off-by: Alex Wang This one has a few rejects against master. Since it's a pretty sophisticated patch, I'd prefer to wait until it can be rebased to take a look. Thanks, Ben. ___ dev

Re: [ovs-dev] [PATCH 3/5] datapath: Allow each vport to have an array of 'port_id's.

2014-03-05 Thread Ben Pfaff
On Thu, Feb 27, 2014 at 11:44:24AM -0800, Alex Wang wrote: > In order to allow handlers directly read upcalls from datapath, > we need to support per-handler netlink socket for each vport in > datapath. This commit makes this happen. Also, it is guaranteed > that the newer datapath is compatible

Re: [ovs-dev] [PATCH 2/5] dpif-netdev: Implement the API functions to allow multiple handler threads read upcall.

2014-03-05 Thread Ben Pfaff
On Thu, Feb 27, 2014 at 11:44:23AM -0800, Alex Wang wrote: > Signed-off-by: Alex Wang It would be nice to add a sentence or two to the commit message explaining why we think it's OK to drop the distinction between the two queues we had before (as already discussed). The choice of hash function,

Re: [ovs-dev] [PATCH 1/5] dpif: Change dpif API to allow multiple handler threads read upcall.

2014-03-05 Thread Ben Pfaff
On Thu, Feb 27, 2014 at 11:44:22AM -0800, Alex Wang wrote: > This commit changes the API in 'dpif-provider.h' to allow multiple > handler threads call dpif_recv() simultaneously. > > Signed-off-by: Alex Wang The comment on dpif_port_get_pid() says that the 'hash' parameter should be a 5-tuple ha

Re: [ovs-dev] [PATCH v2 1/2] timeval: clock_gettime() for Windows.

2014-03-05 Thread Ben Pfaff
On Tue, Mar 04, 2014 at 09:32:52AM -0800, Gurucharan Shetty wrote: > QueryPerformanceCounter() retrieves the current value of the performance > counter, which is a high resolution (<1us) time stamp that can be used for > time-interval measurements. So, use it for MONOTONIC clock. > > The GetSystem