[ovs-dev] [PATCH] ovs-ofctl: batch together OFPC_ADD requests in add-flows command

Ben Pfaff blp at nicira.com
Fri Mar 6 04:26:40 UTC 2015


On Thu, Mar 05, 2015 at 06:12:33PM -0800, Ansis Atteka wrote:
> On Thu, Mar 5, 2015 at 8:59 AM, Ben Pfaff <blp at nicira.com> wrote:
> > On Wed, Mar 04, 2015 at 11:54:42AM -0800, Ansis Atteka wrote:
> >> Until now "ovs-ofctl add-flows ..." command sent each OFPC_ADD
> >> request one by one accompanied with a barrier request.  This
> >> meant that before ovs-ofctl could send next OFPC_ADD request
> >> it had to wait for a barrier response that was sent together
> >> with previous OFPC_ADD request.
> >>
> >> After this patch ovs-ofctl batches together all OFPC_ADD requests
> >> and sends only a single barrier request for the last OFPC_ADD
> >> request.  As a result of this patch, ovs-ofctl was able to insert
> >> 60K flows in 1 second instead of 7 seconds.  This is especially
> >> helpful when restarting ovs-vswitchd.
> >>
> >> One possible side effect of this patch is that ovs-ofctl
> >> might ignore some error messages that resulted in failed
> >> OFPC_ADD.
> >
> > That's a really nice speedup!
> >
> > However I'm worried about ignoring error messages.  Why not report all
> > of the errors, instead of ignoring them?
> 
> Reporting all errors (i.e. printing the actual OF message replies)
> might scare some users by flooding their consoles, if there would be a
> lot of flow-adds that failed. However, I think it might be good idea,
> as you suggested offline, to print amount of flow-adds that failed.
> 
> Will think about this a little more.

Other options:

        * Print the first N errors, following by "Suppressed <number>
          additional errors."

        * Send the flow-mods in batches of N, then send a barrier and
          wait for replies, and if there were any errors print them (up
          to N of them) and stop, otherwise go on to the next batch.



More information about the dev mailing list