Skip to content

Commit

Permalink
ofproto-dpif-xlate: Fix revalidation in execute_controller_action().
Browse files Browse the repository at this point in the history
If there's no actual packet (e.g. during revalidation),
execute_controller_action() exits right away, without calling
commit_odp_actions().

commit_odp_actions() might have an influence on slow_path reason
(which is included in the generated ODP actions), meaning that the
revalidation will not generate the same actions than the original
translation.

Fix the problem by making execute_controller_action() call
commit_odp_actions() even without a packet.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
  • Loading branch information
ddiproietto committed Dec 11, 2015
1 parent 58c9bc3 commit bfa6832
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ofproto/ofproto-dpif-xlate.c
Expand Up @@ -2369,16 +2369,16 @@ execute_controller_action(struct xlate_ctx *ctx, int len,
struct pkt_metadata md = PKT_METADATA_INITIALIZER(0);

ctx->xout->slow |= SLOW_CONTROLLER;
ctx->xout->slow |= commit_odp_actions(&ctx->xin->flow, &ctx->base_flow,
&ctx->xout->odp_actions,
&ctx->xout->wc);

if (!ctx->xin->packet) {
return;
}

packet = ofpbuf_clone(ctx->xin->packet);

ctx->xout->slow |= commit_odp_actions(&ctx->xin->flow, &ctx->base_flow,
&ctx->xout->odp_actions,
&ctx->xout->wc);

odp_execute_actions(NULL, packet, false, &md,
ofpbuf_data(&ctx->xout->odp_actions),
ofpbuf_size(&ctx->xout->odp_actions), NULL);
Expand Down

0 comments on commit bfa6832

Please sign in to comment.