[ovs-dev] [PATCH 20/26] ofproto-dpif-xlate: Move initialization of 'in_port' closer to first use.

Jarno Rajahalme jrajahalme at nicira.com
Fri Jul 31 21:34:17 UTC 2015


Acked-by: Jarno Rajahalme <jrajahalme at nicira.com>

> On Jul 29, 2015, at 11:42 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
> This seems to be a little clearer to me.
> 
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
> 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 2c9092d..be0fd13 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) {
> -- 
> 2.1.3
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev




More information about the dev mailing list