[ovs-dev] [RFC 7/9] ofproto-dpif: Allow caching of xlate_actions() effects.

Ben Pfaff blp at nicira.com
Fri Mar 28 01:43:14 UTC 2014


On Fri, Mar 28, 2014 at 02:39:39PM +1300, Joe Stringer wrote:
> Looking back through, there was another question I had, relating to the
> below XXX comment:
> 
> On 7 March 2014 14:20, Joe Stringer <joestringer at nicira.com> wrote:
> >
> > @@ -1427,6 +1498,17 @@ xlate_normal(struct xlate_ctx *ctx)
> >      if (ctx->xin->may_learn) {
> >          update_learning_table(ctx->xbridge, flow, wc, vlan, in_xbundle);
> >      }
> > +    if (ctx->xin->xc) {
> > +        struct xc_entry *entry;
> > +
> > +        /* Save enough info to update mac learning table later. */
> > +        entry = xlate_cache_add_entry(ctx->xin->xc, XC_NORMAL);
> > +        /* XXX: Do we need to ref this ofproto somehow? */
> > +        entry->u.normal.ofproto = ctx->xin->ofproto;
> > +        entry->u.normal.flow = xmalloc(sizeof *flow);
> > +        memcpy(entry->u.normal.flow, flow, sizeof *flow);
> > +        entry->u.normal.vlan = vlan;
> > +    }
> 
> 
> There didn't seem to be any refcount mechanism attached to the ofproto, so
> does this mean that it's not swappable at runtime? In other words, do I
> need to worry about it disappearing?

I think that we kill off all the threads that can do xlations before we
destroy the ofproto, so there isn't a need to worry about an ofproto
disappearing.



More information about the dev mailing list