Looks good, thanks.

Ethan

On Tue, Mar 20, 2012 at 15:44, Ben Pfaff <b...@nicira.com> wrote:
> This code in xlate_table_action() is supposed to tag flows in tables that
> have special forms so that changes do not require revalidating every flow.
> When rule->tag is nonzero, its value can be used, because we know in this
> case that rule->cr.wc is the same as table->other_table->wc and that thus
> rule->tag caches the return value of the rule_calculate_tag() expression.
> When rule->tag is zero (a "catchall" rule) we need to calculate the tag
> manually because we have no way to cache it in that case.
>
> I discovered this bug by running an "hping3" between a couple of VMs plus
> the following commands on OVS in the middle:
>
>    ovs-ofctl del-flows br0
>    ovs-ofctl add-flow br0 "table=0 actions=learn(table=1, \
>              idle_timeout=600, NXM_OF_VLAN_TCI[0..11], \
>              NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], \
>              output:NXM_OF_IN_PORT[], fin_idle_timeout=10), resubmit(,1)"
>    ovs-ofctl add-flow br0 "table=1 priority=0 actions=flood"
>
> Without this patch, flows don't get properly invalidated upon initial MAC
> learning, so one sees warnings like the following:
>
>    in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),
>    eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,
>    ttl=64,frag=no),tcp(src=13966,dst=0): inconsistency in subfacet
>    (actions were: 3,0,1) (correct actions: 1)
>
> This patch fixes the problem and thus avoids these warnings.
>
> Signed-off-by: Ben Pfaff <b...@nicira.com>
> ---
>  ofproto/ofproto-dpif.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
> index 0ffc4e8..a2021f9 100644
> --- a/ofproto/ofproto-dpif.c
> +++ b/ofproto/ofproto-dpif.c
> @@ -4414,7 +4414,7 @@ xlate_table_action(struct action_xlate_ctx *ctx,
>         if (table_id > 0 && table_id < N_TABLES) {
>             struct table_dpif *table = &ofproto->tables[table_id];
>             if (table->other_table) {
> -                ctx->tags |= (rule
> +                ctx->tags |= (rule && rule->tag
>                               ? rule->tag
>                               : rule_calculate_tag(&ctx->flow,
>                                                    &table->other_table->wc,
> --
> 1.7.2.5
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to