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;
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);
}
* not if we are just revalidating. */
bool may_learn;
+ /* If the caller of xlate_actions() doesn't need the flow_wildcards
+ * contained in struct xlate_out. 'skip_wildcards' can be set to true
+ * disabling the expensive wildcard computation. When true, 'wc' in struct
+ * xlate_out is undefined and should not be read. */
+ bool skip_wildcards;
+
/* The rule initiating translation or NULL. If both 'rule' and 'ofpacts'
* are NULL, xlate_actions() will do the initial rule lookup itself. */
struct rule_dpif *rule;