Currently, we have a single thread (the 'flow_dumper') that fetches the flows
from the datapath and distributes them to revalidator threads. To clean up the
code (and provide a small performance benefit), we are looking at removing this
flow_dumper thread, and have each revalidator fetch flows from the datapath
instead.

This patchset provides groundwork for that, by allowing threaded execution of
flow_dump_next() as part of the same flow dump operation. The lifetime of a
flow dump operation is planned as follows:-

1) A 'leader' thread will call flow_dump_start() to initialize the state.
2) Multiple threads will call flow_dump_next() with this state, each
   passing their own buffer and output pointers.
3) When each thread's call to flow_dump_next() returns non-zero, it
   will stop iterating.
4) All threads will synchronize to ensure none are still using the state.
5) The 'leader' thread will call flow_dump_done() to uninitialize the state.

Finally, this patchset introduces a new, optional function
dpif_flow_dump_next_may_overwrite(). This provides a way for the caller to know
whether the buffer's contents will be changed next time dpif_flow_dump_next()
is called. The intention is to allow flow deletion to happen in batches, each
time dpif_flow_dump_next() clears the buffer.

Joe Stringer (10):
  netlink: Update comment for nl_dump_start().
  netlink: Explicitly pass buffers to nl_dump_next().
  netlink: Drain sockets with separate ofpbuf.
  dpif-linux: Consolidate buffer usage in flow_dump_next().
  netlink: Remove buffer from 'struct nl_dump'.
  netlink: Make nl_dump_next() thread-safe.
  dpif: Don't fetch actions in dpif_flow_dump_next().
  dpif: Make dpif_flow_dump_next() thread-safe.
  dpif: Don't synchronize flow_dump_next() status.
  dpif: New function dpif_flow_dump_next_may_overwrite().

 lib/dpif-linux.c              |   74 ++++++++++++++-----------------
 lib/dpif-netdev.c             |   81 +++++++++++++++++-----------------
 lib/dpif-provider.h           |   54 ++++++++++++++---------
 lib/dpif.c                    |   63 +++++++++++++-------------
 lib/dpif.h                    |    7 +--
 lib/netdev-linux.c            |   42 ++++++++++++------
 lib/netlink-socket.c          |   98 ++++++++++++++++++++++++-----------------
 lib/netlink-socket.h          |   18 ++++++--
 lib/route-table.c             |   12 +++--
 ofproto/ofproto-dpif-upcall.c |   11 +++--
 ofproto/ofproto-dpif.c        |   23 +++++++---
 utilities/ovs-dpctl.c         |   24 ++++++----
 12 files changed, 288 insertions(+), 219 deletions(-)

-- 
1.7.9.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to