ofproto-dpif-xlate: Add xlate_normal_flood()
authorFlavio Leitner <fbl@redhat.com>
Fri, 11 Apr 2014 21:34:15 +0000 (18:34 -0300)
committerBen Pfaff <blp@nicira.com>
Mon, 19 May 2014 22:57:25 +0000 (15:57 -0700)
This is also needed for multicast snooping.

Acked-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif-xlate.c

index 86566ad..a87db54 100644 (file)
@@ -1481,6 +1481,23 @@ update_learning_table(const struct xbridge *xbridge,
     }
 }
 
+static void
+xlate_normal_flood(struct xlate_ctx *ctx, struct xbundle *in_xbundle,
+                   uint16_t vlan)
+{
+    struct xbundle *xbundle;
+
+    LIST_FOR_EACH (xbundle, list_node, &ctx->xbridge->xbundles) {
+        if (xbundle != in_xbundle
+            && xbundle_includes_vlan(xbundle, vlan)
+            && xbundle->floodable
+            && !xbundle_mirror_out(ctx->xbridge, xbundle)) {
+            output_normal(ctx, xbundle, vlan);
+        }
+    }
+    ctx->xout->nf_output_iface = NF_OUT_FLOOD;
+}
+
 static void
 xlate_normal(struct xlate_ctx *ctx)
 {
@@ -1575,18 +1592,8 @@ xlate_normal(struct xlate_ctx *ctx)
             xlate_report(ctx, "learned port is input port, dropping");
         }
     } else {
-        struct xbundle *xbundle;
-
         xlate_report(ctx, "no learned MAC for destination, flooding");
-        LIST_FOR_EACH (xbundle, list_node, &ctx->xbridge->xbundles) {
-            if (xbundle != in_xbundle
-                && xbundle_includes_vlan(xbundle, vlan)
-                && xbundle->floodable
-                && !xbundle_mirror_out(ctx->xbridge, xbundle)) {
-                output_normal(ctx, xbundle, vlan);
-            }
-        }
-        ctx->xout->nf_output_iface = NF_OUT_FLOOD;
+        xlate_normal_flood(ctx, in_xbundle, vlan);
     }
 }