On Fri, Sep 09, 2011 at 05:46:20PM -0700, Ethan Jackson wrote:
> > +/* Optimized flow revalidation.
> > + *
> > + * It's a difficult problem, in general, to tell which facets need to have
> > + * their actions recalculated whenever the OpenFlow flow table changes. ?We
> > + * don't try to solve that general problem: for most kinds of OpenFlow flow
> > + * table changes, we recalculate the actions for every facet. ?This is
> > + * relatively expensive, but it's good enough if the OpenFlow flow table
> > + * doesn't change very often.
> > + *
> > + * However, we can expect one particular kind of OpenFlow flow table 
> > change to
> > + * happen frequently: changes caused by MAC learning. ?To avoid wasting a 
> > lot
> > + * of CPU on revalidating every facet whenever MAC learning modifies the 
> > flow
> > + * table, we add a special case that applies to flow tables in which every 
> > rule
> > + * has the same form (that is, the same wildcards), except that the table 
> > is
> > + * also allowed to have a single "catch-all" flow that matches all 
> > packets. ?We
> > + * optimize this case by tagging all of the facets that resubmit into the 
> > table
> > + * and invalidating the same tag whenever a flow changes in that table.
> > + */
> 
> I think this comment needs to more explicitly point out that these special
> tables cause revalidation on a per rule basis not on a per table basis.  When
> I first read it, I thought the optimization was to revalidate all flows which
> hit the table whenever any rule in the table changed.

I applied this, does it help?  Or you can suggest better wording.

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index b9a27ae..93bc0d2 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4034,8 +4034,10 @@ done:
  * has the same form (that is, the same wildcards), except that the table is
  * also allowed to have a single "catch-all" flow that matches all packets.  We
  * optimize this case by tagging all of the facets that resubmit into the table
- * and invalidating the same tag whenever a flow changes in that table.
- */
+ * and invalidating the same tag whenever a flow changes in that table.  The
+ * end result is that we revalidate just the facets that need it (and sometimes
+ * a few more, but not all of the facets or even all of the facets that
+ * resubmit to the table modified by MAC learning). */
 
 /* Calculates the tag to use for 'flow' and wildcards 'wc' when it is inserted
  * into an OpenFlow table with the given 'basis'. */
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to