[ovs-dev] [bond megaflow v2 5/5] ofproto/bond: Implement bond megaflow using recirculation

Simon Horman horms at verge.net.au
Wed Mar 19 07:58:51 UTC 2014


On Tue, Mar 11, 2014 at 04:56:21PM -0700, Andy Zhou wrote:
> Infrastructure to enable megaflow support for bond ports using
> recirculation. This patch adds the following features:
> * Generate RECIRC action when bond can benefit from recirculation.
> * Populate post recirculation rules in table 254.
> * Uses post recirculation rules for bond rebalancing
> * Logic to detect whether data path supports recirculation.
> 
> Bond port using recirculation is currently turned off by always
> detect the data path as not supporting recirculation.
> 
> Signed-off-by: Andy Zhou <azhou at nicira.com>
> 
> ---
> v1->v2:  Rewritten

[snip]

> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
> index 75728ce..53350bc 100644
> --- a/ofproto/ofproto-dpif-xlate.c
> +++ b/ofproto/ofproto-dpif-xlate.c

[snip]

> @@ -1800,8 +1824,21 @@ compose_output_action__(struct xlate_ctx *ctx, ofp_port_t ofp_port,
>          ctx->xout->slow |= commit_odp_actions(flow, &ctx->base_flow,
>                                                &ctx->xout->odp_actions,
>                                                &ctx->xout->wc);
> -        nl_msg_put_odp_port(&ctx->xout->odp_actions, OVS_ACTION_ATTR_OUTPUT,
> -                            out_port);
> +
> +        if (ctx->xout->use_recirc) {
> +            struct ovs_action_recirc *act_recirc;
> +            struct xlate_recirc *xr = &ctx->xout->recirc;
> +
> +            act_recirc = (struct ovs_action_recirc *)
> +                nl_msg_put_unspec_uninit(&ctx->xout->odp_actions,
> +                    OVS_ACTION_ATTR_RECIRC, sizeof *act_recirc);

I don't think there is any need to cast the return value
of nl_msg_put_unspec_uninit() as it is void *.

> +            act_recirc->recirc_id = htonl(xr->recirc_id);
> +            act_recirc->hash_alg = xr->hash_alg;
> +            act_recirc->hash_bias = htonl(xr->hash_bias);
> +        } else {
> +            nl_msg_put_odp_port(&ctx->xout->odp_actions, OVS_ACTION_ATTR_OUTPUT,
> +                                out_port);
> +        }
>  
>          ctx->sflow_odp_port = odp_port;
>          ctx->sflow_n_outputs++;

[snip]



More information about the dev mailing list