On Tue, Mar 19, 2013 at 7:57 AM, Simon Horman <ho...@verge.net.au> wrote: > On Tue, Mar 19, 2013 at 10:35:40AM +0900, Simon Horman wrote: >> On Mon, Mar 18, 2013 at 08:54:49AM -0700, Jesse Gross wrote: >> > On Mon, Mar 18, 2013 at 12:37 AM, Simon Horman <ho...@verge.net.au> wrote: >> > > * Update the order in which actions are committed and thus >> > > appear in the datapath such that MPLS actions appear after >> > > l3 and l4 (nw and port) actions. >> > > >> > > In the case where an mpls_push action is present it should ensure >> > > that l3 and l4 actions occur first, which seems logical as >> > > once a mpls_push has occur the frame will be MPLS rather >> > > than IPv4 or IPv6. >> > > >> > > In the case where there is an mpls_pop action is present this should >> > > not make any difference as the frame will have been MPLS to start with >> > > and thus not satisfy the pre-requisites for l3 or l4 actions. >> > > >> > > * Update commit_set_nw_action() to use the base ethertype when >> > > considering >> > > eligibility to commit l3 (nw) actions. This allows l3 actions to be >> > > applied so long as the frame was originally IPv4 or IPv6, even if >> > > an mpls_push action will be applied and thus flow indicates the >> > > frame will be MPLS. >> > > >> > > Signed-off-by: Simon Horman <ho...@verge.net.au> >> > >> > I think this is the right path although I'm not sure that it fully >> > handles L4 ports correctly if you push an MPLS label, output, and then >> > set a port number. We should ignore the last set but I think we will >> > attempt to do it anyways since we originally had an unlabeled packet. >> > Maybe we should sanitize the flow a little more when we push a label. >> >> I think this can be handled by adding some constraints in >> do_xlate_actions(). Something like this: > > Scratch that. I think your suggestion is sound.
Hmm, thinking about this some more, I think your first version of this is actually more natural. For one thing, it avoids exposing implementation details of the action composition. For example, given these two action lists: * push_mpls, set_port, output * set_port, push_mpls, output The first version will produce different results (correctly) while the second one will be the same. The only thing is that I think we just want to make the action conditional on the EtherType, rather than jumping to 'out' since the latter will terminate future action processing. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev