The original developer of the BSD port (Gaetano Catalli) also implemented a
threaded version of the userspace datapath to increase performance.  As
with the original port, the threading work was done against Open vSwitch
1.1.0pre2.  Giuseppe Lettieri and I have ported it forward, and it's
functional and generally passes unit tests (with a few caveats).  The
threaded datapath has shown about 10x improvement in throughput in some
tests, when compared to the current userspace datapath.

There are still a few issues to work through, but I wanted to present the
patch now for discussion of the general approach.  The threaded patches are
available in the bsd-port-threaded branch in this repo:
https://github.com/emaste/openvswitch/tree/bsd-port-threaded

Or as a diff:
http://people.freebsd.org/~emaste/openvswitch/threaded.diff

The patch introduces a configure option to enable threaded mode:
--enable-threaded, and the changes are largely confined to #ifdef THREADED
blocks.  Two mutexes are added to dp_netdev: one for the flow table, and
one for the port list.  (I've also added a mutex over most of lib/vlog.c,
although a less conservative approach may be possible.)

Significant outstanding issues are:
1. Buffer ownership and management isn't really correct right now,
apparently done due to a desire to avoid extra copies.  This seems to be a
consequence of the standard BPF / libpcap interface.
2. The patch needs a better method of ensuring flows aren't deleted while
there may be a reference in the datapath thread.
3. The datapath thread waits in poll() with each port's file descriptor in
the fd array.  However there's currently no fd to signal a bridge
reconfiguration, so the poll() has to timeout before the thread will pick
up the new config on the next time through its loop.

In any case, I wanted to post the current patch for discussion and review
while working on the remaining issues.  I'm very interested in your
thoughts and comments.

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

Reply via email to