ofproto-dpif-xlate: Do not execute resubmit again after recirculation.
authorBen Pfaff <blp@ovn.org>
Wed, 27 Jan 2016 17:14:18 +0000 (09:14 -0800)
committerBen Pfaff <blp@ovn.org>
Thu, 28 Jan 2016 00:22:49 +0000 (16:22 -0800)
commit6b1c573408f8771e428707278f86c5b3b076982a
treea0506aaa952391d0abf77a3bc26935b41c7d2473
parent0e8b74796308925a158fef42befd7acf798c3602
ofproto-dpif-xlate: Do not execute resubmit again after recirculation.

Consider the following flow table:

    table=0 actions=resubmit(,1),2
    table=1 actions=debug_recirc

When debug_recirc triggers recirculation and we later resume processing,
only the output to port 2 should be executed, because the effects of
"resubmit" have already taken place.  However, until now, the "resubmit"
was added to the actions to execute post-recirculation, resulting in an
infinite loop.

Now consider this flow table (as seen in the "MPLS handling" test in
ofproto-dpif.at):

    table=0 actions=pop_mpls(0x0806),resubmit(,1)
    table=1 ip,nw_dst=1.2.3.4 actions=controller

Here, we do want to add the "resubmit" to the actions to execute
post-recirculation, since the "resubmit" cannot be processed until after
recirculation makes the nw_dst field available.

This commit fixes the problem in both cases.

Found when testing a feature based on recirculation.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
ofproto/ofproto-dpif-xlate.c
tests/ofproto-dpif.at