Skip to content

Commit

Permalink
ofproto-dpif-xlate: Move initialization of 'in_port' closer to first …
Browse files Browse the repository at this point in the history
…use.

This seems to be a little clearer to me.

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
blp committed Jul 31, 2015
1 parent 2031ef9 commit 14d2b8b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ofproto/ofproto-dpif-xlate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 14d2b8b

Please sign in to comment.