[ovs-dev] [PATCH v2 2/4] ofproto-dpif-xlate: Make clone save "was_mpls".

Ben Pfaff blp at ovn.org
Fri Jan 6 04:55:46 UTC 2017


This seems like it's an optimization rather than a correctness issue, but
in general it's best to make "clone" like patch ports where there is no
reason to depart from its design, since we know that patch ports work well.

Reported-by: Mickey Spiegel <mickeys.dev at gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/326981.html
Fixes: 7ae62a676d3a ("ofp-actions: Add clone action.")
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev at gmail.com>
---
 ofproto/ofproto-dpif-xlate.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 36b7ac0..ceeaac6 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -4316,6 +4316,7 @@ xlate_sample_action(struct xlate_ctx *ctx,
 static void
 compose_clone_action(struct xlate_ctx *ctx, const struct ofpact_nest *oc)
 {
+    bool old_was_mpls = ctx->was_mpls;
     bool old_conntracked = ctx->conntracked;
     struct flow old_flow = ctx->xin->flow;
 
@@ -4342,6 +4343,10 @@ compose_clone_action(struct xlate_ctx *ctx, const struct ofpact_nest *oc)
     /* The clone's conntrack execution should have no effect on the original
      * packet. */
     ctx->conntracked = old_conntracked;
+
+    /* Popping MPLS from the clone should have no effect on the original
+     * packet. */
+    ctx->was_mpls = old_was_mpls;
 }
 
 static bool
-- 
2.10.2



More information about the dev mailing list