From 614ec445172f05128b54e20ba6aebc1f35668b67 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Wed, 6 Jun 2012 15:06:15 -0700 Subject: [PATCH] ofproto-dpif: Avoid calling eth_addr_is_reserved(). 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 --- 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 e171b3cf..962df157 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; } -- 2.30.2