Re: [ovs-dev] Threaded userspace datapath

2012-10-01 Thread Jesse Gross
On Sat, Sep 29, 2012 at 12:17 AM, Giuseppe Lettieri wrote: > > Il giorno 29/set/2012, alle ore 01:44, Jesse Gross ha > scritto: > >> Does this actually require changing the main loop? If it really is >> the poll related changes that you mention it seems like they could be >> contained to the ne

Re: [ovs-dev] Threaded userspace datapath

2012-10-01 Thread Jesse Gross
On Sat, Sep 29, 2012 at 7:05 AM, Luigi Rizzo wrote: > jumping in the conversation: last year when Gaetano and I worked on > this code, the main loop had multiple performance issues, including > a) rebuilding from scratch the list of file descriptors on each iteration, > b) ignoring the response fr

Re: [ovs-dev] Threaded userspace datapath

2012-09-29 Thread Luigi Rizzo
jumping in the conversation: last year when Gaetano and I worked on this code, the main loop had multiple performance issues, including a) rebuilding from scratch the list of file descriptors on each iteration, b) ignoring the response from select() and firing all handlers (and perhaps looking a

Re: [ovs-dev] Threaded userspace datapath

2012-09-29 Thread Giuseppe Lettieri
Il giorno 29/set/2012, alle ore 01:44, Jesse Gross ha scritto: > Does this actually require changing the main loop? If it really is > the poll related changes that you mention it seems like they could be > contained to the netdevs and userspace datapath. You could handle a > batch of packets

Re: [ovs-dev] Threaded userspace datapath

2012-09-28 Thread Jesse Gross
On Fri, Sep 28, 2012 at 3:17 PM, Giuseppe Lettieri wrote: > To me, it was that the existing code mostly worked and had already proved to > be a real performance improvement. This coupled with the limited manpower we > could pour on the project. I understand that turning a single-threaded > prog

Re: [ovs-dev] Threaded userspace datapath

2012-09-28 Thread Giuseppe Lettieri
To me, it was that the existing code mostly worked and had already proved to be a real performance improvement. This coupled with the limited manpower we could pour on the project. I understand that turning a single-threaded program into a multi-threaded one looks scary, and with reason. On the

Re: [ovs-dev] Threaded userspace datapath

2012-09-28 Thread Jesse Gross
On Fri, Sep 28, 2012 at 3:49 AM, Giuseppe Lettieri wrote: > Hi all, > > we have finally found the time to finish work on this patch. We have > addressed all the issues that were mentioned in the previous mails, plus > some more that showed up later. We now pass all unit tests on both Linux and > F

Re: [ovs-dev] Threaded userspace datapath

2012-09-28 Thread Ben Pfaff
On Fri, Sep 28, 2012 at 09:23:01AM -0700, Ben Pfaff wrote: > I think that there are now synchronization issues in vlog. The > vlog_write_file() implementation assumes a single-threaded model > (worker_request() isn't thread-safe). We could introduce per-thread > state so that only the main thread

Re: [ovs-dev] Threaded userspace datapath

2012-09-28 Thread Ben Pfaff
On Fri, Sep 28, 2012 at 12:49:16PM +0200, Giuseppe Lettieri wrote: > we have finally found the time to finish work on this patch. We have > addressed all the issues that were mentioned in the previous mails, > plus some more that showed up later. We now pass all unit tests on > both Linux and FreeB

Re: [ovs-dev] Threaded userspace datapath

2012-09-28 Thread Giuseppe Lettieri
Hi all, we have finally found the time to finish work on this patch. We have addressed all the issues that were mentioned in the previous mails, plus some more that showed up later. We now pass all unit tests on both Linux and FreeBSD and we can more confidently offer the patch to your attent

Re: [ovs-dev] Threaded userspace datapath

2012-08-26 Thread Ben Pfaff
On Fri, Aug 24, 2012 at 10:25:02AM +0200, Giuseppe Lettieri wrote: > Il 20/08/2012 20:48, Ed Maste ha scritto: > >>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() ha

Re: [ovs-dev] Threaded userspace datapath

2012-08-24 Thread Giuseppe Lettieri
Il 20/08/2012 20:48, Ed Maste ha scritto: 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 th

Re: [ovs-dev] Threaded userspace datapath

2012-08-20 Thread Ben Pfaff
On Mon, Aug 20, 2012 at 02:48:01PM -0400, Ed Maste wrote: > I've updated the snapshot of the threaded userspace datapath path with > improvements Giuseppe and I have done over the last couple of weeks. > The current patch is available here: > > http://people.freebsd.org/~emaste/openvswitch/threade

Re: [ovs-dev] Threaded userspace datapath

2012-08-20 Thread Ed Maste
I've updated the snapshot of the threaded userspace datapath path with improvements Giuseppe and I have done over the last couple of weeks. The current patch is available here: http://people.freebsd.org/~emaste/openvswitch/threaded-20120820.diff This patch contains a number of minor improvements

Re: [ovs-dev] Threaded userspace datapath

2012-08-15 Thread Ben Pfaff
On Wed, Aug 15, 2012 at 01:16:58PM -0400, Ed Maste wrote: > >>> There may be some confusion about numbering. OpenFlow says that the > >>> port number of the "local port" is 65534 (OFPP_LOCAL). The datapaths, > >>> on the other hand, use port number 0 for the "local port". There is > >>> supposed

Re: [ovs-dev] Threaded userspace datapath

2012-08-15 Thread Ed Maste
>>> There may be some confusion about numbering. OpenFlow says that the >>> port number of the "local port" is 65534 (OFPP_LOCAL). The datapaths, >>> on the other hand, use port number 0 for the "local port". There is >>> supposed to be translation going on at the interface between the >>> datap

Re: [ovs-dev] Threaded userspace datapath

2012-08-15 Thread Ed Maste
On 14 August 2012 21:21, Ed Maste wrote: >> There may be some confusion about numbering. OpenFlow says that the >> port number of the "local port" is 65534 (OFPP_LOCAL). The datapaths, >> on the other hand, use port number 0 for the "local port". There is >> supposed to be translation going on

Re: [ovs-dev] Threaded userspace datapath

2012-08-14 Thread Ed Maste
> There may be some confusion about numbering. OpenFlow says that the > port number of the "local port" is 65534 (OFPP_LOCAL). The datapaths, > on the other hand, use port number 0 for the "local port". There is > supposed to be translation going on at the interface between the > datapath and th

Re: [ovs-dev] Threaded userspace datapath

2012-08-14 Thread Ben Pfaff
On Tue, Aug 14, 2012 at 05:33:00PM +0200, Giuseppe Lettieri wrote: > Il giorno 10/ago/2012, alle ore 19:20, Ben Pfaff ha scritto: > > > ... > >> The datapath thread goes to 100% CPU in my tests, but this is > >> expected, since everything is being done in software and no real I/O > >> is being pe

Re: [ovs-dev] Threaded userspace datapath

2012-08-14 Thread Giuseppe Lettieri
Il giorno 10/ago/2012, alle ore 19:20, Ben Pfaff ha scritto: > ... >> The datapath thread goes to 100% CPU in my tests, but this is >> expected, since everything is being done in software and no real I/O >> is being performed. The main thread goes to ~65%, and this is less >> expected (at least,

Re: [ovs-dev] Threaded userspace datapath

2012-08-10 Thread Ben Pfaff
On Fri, Aug 10, 2012 at 01:38:33PM -0400, Ed Maste wrote: > > We've had good improvements in a similar issue in dpif-linux by > > switching to use "epoll". Can kqueue under FreeBSD do something > > similar? > > Yes, epoll and kqueue basically provide the same functionality. What > do you think a

Re: [ovs-dev] Threaded userspace datapath

2012-08-10 Thread Ed Maste
> We've had good improvements in a similar issue in dpif-linux by > switching to use "epoll". Can kqueue under FreeBSD do something > similar? Yes, epoll and kqueue basically provide the same functionality. What do you think about incorporating something like libevent to abstract that? -Ed

Re: [ovs-dev] Threaded userspace datapath

2012-08-10 Thread Ben Pfaff
On Fri, Aug 10, 2012 at 07:50:40PM +0200, Luigi Rizzo wrote: > On Fri, Aug 10, 2012 at 10:17:04AM -0700, Ben Pfaff wrote: > > On Fri, Aug 10, 2012 at 07:17:13PM +0200, Luigi Rizzo wrote: > > > 1. rebuild the list of file descriptors from scratch at every iteration, > > >looking at all possible

Re: [ovs-dev] Threaded userspace datapath

2012-08-10 Thread Ben Pfaff
On Fri, Aug 10, 2012 at 06:36:46PM +0200, Giuseppe Lettieri wrote: > > I'm very interested in seeing some up-to-date performance numbers > > because introducing threads definitely raises the bar when it comes to > > the need for careful programming, and that's only worthwhile if there > > is a corr

Re: [ovs-dev] Threaded userspace datapath

2012-08-10 Thread Giuseppe Lettieri
Il giorno 09/ago/2012, alle ore 22:56, Ben Pfaff ha scritto: > I'm very interested in seeing some up-to-date performance numbers > because introducing threads definitely raises the bar when it comes to > the need for careful programming, and that's only worthwhile if there > is a correspondingly

Re: [ovs-dev] Threaded userspace datapath

2012-08-09 Thread Ben Pfaff
On Thu, Aug 09, 2012 at 03:25:58PM -0400, Ed Maste wrote: > On 9 August 2012 11:56, Ben Pfaff wrote: > > > I'm curious about the performance improvement. You mentioned a 10x > > performance improvement. How much did CPU usage increase as part of > > that? We already have users who complain whe

Re: [ovs-dev] Threaded userspace datapath

2012-08-09 Thread Ed Maste
On 9 August 2012 11:56, Ben Pfaff wrote: > I'm curious about the performance improvement. You mentioned a 10x > performance improvement. How much did CPU usage increase as part of > that? We already have users who complain when CPU usage spikes to 100%; > I'm not sure that users will be happy

Re: [ovs-dev] Threaded userspace datapath

2012-08-09 Thread Ben Pfaff
On Tue, Aug 07, 2012 at 11:36:56PM -0400, Ed Maste wrote: > 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.

[ovs-dev] Threaded userspace datapath

2012-08-07 Thread Ed Maste
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 functiona