When we configured bond that use recirc and configure mirror, we
observed that mirror destination is duplicated output.  This is
because bond's frozen_state is not updated to reflect the mirror
already composed the output, and when the companion recirc flow
need to decide its action, the mirror again take effects, causing
duplicate output.

Signed-off-by: Shuang Huang <[email protected]>
---
 ofproto/ofproto-dpif-xlate.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index c4014d7..d4f10b7 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -2453,6 +2453,16 @@ output_normal(struct xlate_ctx *ctx, const struct 
xbundle *out_xbundle,                                                           
                                 
     compose_output_action(ctx, xport->ofp_port, use_recirc ? &xr : NULL,
                           false, false);
     memcpy(&ctx->xin->flow.vlans, &old_vlans, sizeof(old_vlans));
+    /* Store mirrors for bond that use recirc to avoid duplicate output */
+    if (use_recirc) {
+        struct recirc_id_node *node = CONST_CAST(
+            struct recirc_id_node *, recirc_id_node_find(xr.recirc_id));
+        if (node) {
+            struct frozen_state *state =
+                CONST_CAST(struct frozen_state *, &node->state);
+            state->mirrors = ctx->mirrors;
+        }
+    }
 }

 /* A VM broadcasts a gratuitous ARP to indicate that it has resumed after
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to