On Mon, Jul 18, 2016 at 06:37:04PM +0800, Yang, Yi wrote:
> On Mon, Jul 18, 2016 at 03:15:13PM +0900, Simon Horman wrote:
> > Hi Johnson,
> > 
> > On Wed, Jul 13, 2016 at 01:28:48AM +0800, Johnson Li wrote:
> > > Signed-off-by: Johnson Li <johnson...@intel.com>
> > 
> > * Regarding the action set (which we discussed briefly off-list):
> > 
> >   I think that you need to update ofpacts_execute_action_set(), though
> >   possibly not in this patch, for push/pop_nsh to be usable in write
> >   actions. However, its not clear to me at which position of that function
> >   push/pop_nsh because as far as I know this has not been defined by
> >   OpenFlow.
> > 
> > * Regarding the implementation of push/pop_nsh in this patch:
> > 
> >   In general translation occurs in two phases in OvS.
> > 
> >   1. Composition: This generally involves updating fields of
> >      ctx->xin->flow to new desired values and ctx->wc to indicate
> >      which fields have been accessed so that masks for megaflows
> >      can be calculated correctly.
> > 
> >      For simple cases such as OFPACT_SET_IP_TTL this is open-coded
> >      in do_xlate_actions. For more complex cases helpers are provided,
> >      e.g.  OFPACT_PUSH_MPLS (though that is not very complex)
> > 
> >   2. Commit: Here differences between ctx->in->flow and ctx->base_flow,
> >      which are the same before translation starts, are compared. And any
> >      differences are resolved by writing actions to ctx->odp_actions.
> >      base_flow is then reset for cases where translation continues.
> > 
> >      This is performed by commit_odp_actions(), e.g. when called via
> >      xlate_commit_actions().
> > 
> > There are exceptions to the above and in some cases actions are written
> > directly to ctx->odp_actions, but I'm not sure that push/pop_nsh needs to
> > be such an exception.
> 
> Simon, very good guide, do push_eth and pop_eth also need to follow
> this?

Not exactly.

As of v12 of the patch-set there are two phases, compose and commit.
This was not the case in previous versions and was the source of some bugs.

The composition phase is not done directly in do_xlate_actions(). Rather it
is done as required in compose_output_action__() and
execute_controller_action() by setting flow->base_layer. This implements
automatic placement of push/pop_eth actions as they are required for
output.

This can be seen in "[PATCH v12 2/3] userspace: add layer 3 flow and
switching support"

The commit phase is provided by commit_ether_action() which also handles
modification of ethernet addresses other than by push/pop_eth.

This can be seen in "PATCH v12 1/3] userspace: add support for pop_eth and
push_eth action"

[snip]
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to