eth_addr_is_reserved() is a bit more expensive than it used to be,
so it makes sense to avoid calling it when convenient as an
optimization.

Signed-off-by: Ethan Jackson <[email protected]>
---
 ofproto/ofproto-dpif.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index e171b3c..962df15 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -5930,8 +5930,8 @@ add_mirror_actions(struct action_xlate_ctx *ctx, const 
struct flow *orig_flow)
         ctx->mirrors |= m->dup_mirrors;
         if (m->out) {
             output_normal(ctx, m->out, vlan);
-        } else if (!eth_addr_is_reserved(orig_flow->dl_dst)
-                   && vlan != m->out_vlan) {
+        } else if (vlan != m->out_vlan
+                   && !eth_addr_is_reserved(orig_flow->dl_dst)) {
             struct ofbundle *bundle;
 
             HMAP_FOR_EACH (bundle, hmap_node, &ofproto->bundles) {
@@ -6089,7 +6089,7 @@ is_admissible(struct ofproto_dpif *ofproto, const struct 
flow *flow,
 
     /* Drop frames for reserved multicast addresses
      * only if forward_bpdu option is absent. */
-    if (eth_addr_is_reserved(flow->dl_dst) && !ofproto->up.forward_bpdu) {
+    if (!ofproto->up.forward_bpdu && eth_addr_is_reserved(flow->dl_dst)) {
         return false;
     }
 
-- 
1.7.10.2

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to