[ovs-dev] [PATCH] ofproto: Avoid user->kernel->user round-trip for many controller actions.

Ben Pfaff blp at nicira.com
Thu Aug 5 18:05:15 UTC 2010


On Thu, Aug 05, 2010 at 01:41:24PM -0400, Jesse Gross wrote:
> On Wed, Aug 4, 2010 at 2:09 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
> > +        copy = ofpbuf_new(DPIF_RECV_MSG_PADDING + sizeof(struct odp_msg)
> > +                          + packet->size);
> > +        ofpbuf_reserve(copy, DPIF_RECV_MSG_PADDING);
> > +        msg = ofpbuf_put_uninit(copy, sizeof *msg);
> > +        msg->type = _ODPL_ACTION_NR;
> > +        msg->length = sizeof(struct odp_msg) + packet->size;
> > +        msg->port = in_port;
> > +        msg->reserved = 0;
> > +        msg->arg = actions[0].controller.arg;
> > +        ofpbuf_put(copy, packet->data, packet->size);
> 
> How common is it that sending to the controller is the only action?  It
> seems like that might be a fairly common scenario here.  If so, it would be
> ideal if we could avoid copying the packet an additional time here.  I don't
> know if it is worth it though seeing as this is already a fairly narrow use
> case (first packet to the controller).

I was looking at that as a possibly fairly risky micro-optimization on
top of what seems to be a valuable optimization that avoids multiple
user<->kernel trips and trips through the main loop.  It is worth
considering, I guess.

If you think it's valuable, then I'll make a followup patch that adds
that optimization too.

Did you see any problems with this one?




More information about the dev mailing list