[ovs-dev] [PATCH] ofproto-dpif-xlate: Don't consider mirrors used when excluded by VLAN.
Ben Pfaff
blp at ovn.org
Tue Jan 19 16:57:19 UTC 2016
Mirroring is supposed to happen at most once for any destination on a given
packet, so the implementation keeps track of which mirrors have already
been used. However, until this commit it did that incorrectly: it
considered a mirror "used" even if it had been rejected on the basis of
VLAN. This commit fixes the problem.
Reported-by: Huanle Han <hanxueluo at gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2016-January/064531.html
Fixes: 7efbc3b7c4006c (ofproto-dpif-xlate: Rewrite mirroring to better fit flow translation.)
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
ofproto/ofproto-dpif-xlate.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 9a067d1..bc4d850 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -1622,9 +1622,6 @@ mirror_packet(struct xlate_ctx *ctx, struct xbundle *xbundle,
return;
}
- /* Record these mirrors so that we don't mirror to them again. */
- ctx->mirrors |= mirrors;
-
if (ctx->xin->resubmit_stats) {
mirror_update_stats(xbridge->mbridge, mirrors,
ctx->xin->resubmit_stats->n_packets,
@@ -1657,8 +1654,12 @@ mirror_packet(struct xlate_ctx *ctx, struct xbundle *xbundle,
continue;
}
+ /* Record the mirror and its duplicates so that we don't mirror to them
+ * again. */
mirrors &= ~dup_mirrors;
ctx->mirrors |= dup_mirrors;
+
+ /* Send the packet to the mirror. */
if (out) {
struct xlate_cfg *xcfg = ovsrcu_get(struct xlate_cfg *, &xcfgp);
struct xbundle *out_xbundle = xbundle_lookup(xcfg, out);
--
2.1.3
More information about the dev
mailing list