From 14d2b8b2f1a52ea440e61b84738193d5357c1af8 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 29 Jul 2015 14:20:16 -0700 Subject: [PATCH] ofproto-dpif-xlate: Move initialization of 'in_port' closer to first use. This seems to be a little clearer to me. Signed-off-by: Ben Pfaff Acked-by: Jarno Rajahalme --- ofproto/ofproto-dpif-xlate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 2c9092d1fb2..be0fd13899d 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -4793,13 +4793,8 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) xlate_wc_init(&ctx); } - struct xport *in_port; - COVERAGE_INC(xlate_actions); - /* The in_port of the original packet before recirculation. */ - in_port = get_ofp_port(xbridge, flow->in_port.ofp_port); - if (xin->recirc) { const struct recirc_id_node *recirc = xin->recirc; @@ -4902,6 +4897,11 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) orig_flow = *flow; } + /* Get the proximate input port of the packet. (If xin->recirc, + * flow->in_port is the ultimate input port of the packet.) */ + struct xport *in_port = get_ofp_port(xbridge, + ctx.base_flow.in_port.ofp_port); + /* Tunnel stats only for non-recirculated packets. */ if (!xin->recirc && in_port && in_port->is_tunnel) { if (ctx.xin->resubmit_stats) {