From bfa68329d48afd8399c392bdbd3bd8a417655067 Mon Sep 17 00:00:00 2001 From: Daniele Di Proietto Date: Fri, 4 Dec 2015 14:04:26 -0800 Subject: [PATCH] ofproto-dpif-xlate: Fix revalidation in execute_controller_action(). 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 Acked-by: Jarno Rajahalme --- ofproto/ofproto-dpif-xlate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index d570fb2f14c..df848e5071a 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -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);