/* Make the packet resemble the flow, so that it gets sent to
* an OpenFlow controller properly, so that it looks correct
* for sFlow, and so that flow_extract() will get the correct
- * vlan_tci if it is called on 'packet'.
- *
- * The allocated space inside 'packet' probably also contains
- * 'key', that is, both 'packet' and 'key' are probably part of
- * a struct dpif_upcall (see the large comment on that
- * structure definition), so pushing data on 'packet' is in
- * general not a good idea since it could overwrite 'key' or
- * free it as a side effect. However, it's OK in this special
- * case because we know that 'packet' is inside a Netlink
- * attribute: pushing 4 bytes will just overwrite the 4-byte
- * "struct nlattr", which is fine since we don't need that
- * header anymore. */
+ * vlan_tci if it is called on 'packet'. */
eth_push_vlan(packet, flow->vlan_tci);
}
/* We can't reproduce 'key' from 'flow'. */
bool has_mirror;
int out_vlan;
- has_mirror = mirror_get(xbridge->mbridge, mirror_mask_ffs(mirrors) - 1,
+ has_mirror = mirror_get(xbridge->mbridge, raw_ctz(mirrors),
&vlans, &dup_mirrors, &out, &out_vlan);
ovs_assert(has_mirror);
return vid ? vid : in_xbundle->vlan;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
return true;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
return vlan == out_xbundle->vlan ? 0 : vlan;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}
ofp_port_t in_port, uint8_t table_id, bool may_packet_in)
{
if (xlate_resubmit_resource_check(ctx)) {
- struct rule_dpif *rule;
ofp_port_t old_in_port = ctx->xin->flow.in_port.ofp_port;
+ bool skip_wildcards = ctx->xin->skip_wildcards;
uint8_t old_table_id = ctx->table_id;
+ struct rule_dpif *rule;
ctx->table_id = table_id;
* original input port (otherwise OFPP_NORMAL and OFPP_IN_PORT will
* have surprising behavior). */
ctx->xin->flow.in_port.ofp_port = in_port;
- rule_dpif_lookup_in_table(ctx->xbridge->ofproto,
- &ctx->xin->flow, &ctx->xout->wc,
+ rule_dpif_lookup_in_table(ctx->xbridge->ofproto, &ctx->xin->flow,
+ !skip_wildcards ? &ctx->xout->wc : NULL,
table_id, &rule);
ctx->xin->flow.in_port.ofp_port = old_in_port;
xlate_ff_group(ctx, group);
break;
default:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
group_dpif_release(group);
}
xin->resubmit_hook = NULL;
xin->report_hook = NULL;
xin->resubmit_stats = NULL;
+ xin->skip_wildcards = false;
}
void
ctx.mpls_depth_delta = 0;
if (!xin->ofpacts && !ctx.rule) {
- rule_dpif_lookup(ctx.xbridge->ofproto, flow, wc, &rule);
+ rule_dpif_lookup(ctx.xbridge->ofproto, flow,
+ !xin->skip_wildcards ? wc : NULL, &rule);
if (ctx.xin->resubmit_stats) {
rule_dpif_credit_stats(rule, ctx.xin->resubmit_stats);
}
ofpacts = actions->ofpacts;
ofpacts_len = actions->ofpacts_len;
} else {
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
ofpbuf_use_stub(&ctx.stack, ctx.init_stack, sizeof ctx.init_stack);
goto out;
case OFPC_FRAG_REASM:
- NOT_REACHED();
+ OVS_NOT_REACHED();
case OFPC_FRAG_NX_MATCH:
/* Nothing to do. */
break;
case OFPC_INVALID_TTL_TO_CONTROLLER:
- NOT_REACHED();
+ OVS_NOT_REACHED();
}
}