[ovs-dev] [PATCH] ofproto-dpif: Maintain tun_id across action lists.

Ben Pfaff blp at nicira.com
Wed Jan 16 00:20:05 UTC 2013


On Tue, Jan 15, 2013 at 04:12:38PM -0800, Jesse Gross wrote:
> On Tue, Jan 15, 2013 at 3:32 PM, Ben Pfaff <blp at nicira.com> wrote:
> > This makes action_xlate_ctx_init() kind of hard to understand so a
> > comment might be warranted.
> 
> I added a comment documenting behavior of the various transformations
> (normal, VLAN splinters, and tunnels) and applied this to master.

I want to highlight that comment because it is completely awesome:

    /* Flow initialization rules:
     * - 'base_flow' must match the kernel's view of the packet at the
     *   time that action processing starts.  'flow' represents any
     *   transformations we wish to make through actions.
     * - By default 'base_flow' and 'flow' are the same since the input
     *   packet matches the output before any actions are applied.
     * - When using VLAN splinters, 'base_flow''s VLAN is set to the value
     *   of the received packet as seen by the kernel.  If we later output
     *   to another device without any modifications this will cause us to
     *   insert a new tag since the original one was stripped off by the
     *   VLAN device.
     * - Tunnel 'flow' is largely cleared when transitioning between
     *   the input and output stages since it does not make sense to output
     *   a packet with the exact headers that it was received with (i.e.
     *   the destination IP is us).  The one exception is the tun_id, which
     *   is preserved to allow use in later resubmit lookups and loads into
     *   registers.
     * - Tunnel 'base_flow' is completely cleared since that is what the
     *   kernel does.  If we wish to maintain the original values an action
     *   needs to be generated. */

Thanks Jesse!



More information about the dev mailing list