[ovs-dev] [PATCH] ofproto-dpif-xlate: Fix a bug.

Alex Wang alexw at nicira.com
Thu May 22 00:27:19 UTC 2014


Hey Joe,

Could you review this patch, when you are available?

Thanks,
Alex Wang,


On Wed, May 21, 2014 at 5:27 PM, Alex Wang <alexw at nicira.com> wrote:

> Commit b256dc525c8 (ofproto-dpif-xlate: Cache xlate_actions() effects.)
> caches the variables needed for refreshing mac-learning table in
> xlate_normal().  Wherein, the cache entry always records reference to
> the original 'ofproto'.
>
> When patch port is used to connect two 'ofproto's, packet goes through the
> patch port will have two mac-learning cache entries created for each
> 'ofproto'.  So, each entry should reference to the corresponding 'ofproto'.
> However, due to the bug mentioned above, all cache entries will refer to
> the
> same 'ofproto'.  Subsequently, the mac-learning tables can be corrupted,
> which
> causes connection loss.
>
> This commit fixes the bug by making each cache entry refer to the correct
> 'ofproto'.
>
> Signed-off-by: Alex Wang <alexw at nicira.com>
> ---
>  ofproto/ofproto-dpif-xlate.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
> index a87db54..63b4741 100644
> --- a/ofproto/ofproto-dpif-xlate.c
> +++ b/ofproto/ofproto-dpif-xlate.c
> @@ -1570,7 +1570,7 @@ xlate_normal(struct xlate_ctx *ctx)
>
>          /* Save enough info to update mac learning table later. */
>          entry = xlate_cache_add_entry(ctx->xin->xcache, XC_NORMAL);
> -        entry->u.normal.ofproto = ctx->xin->ofproto;
> +        entry->u.normal.ofproto = ctx->xbridge->ofproto;
>          entry->u.normal.flow = xmemdup(flow, sizeof *flow);
>          entry->u.normal.vlan = vlan;
>      }
> --
> 1.7.9.5
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140521/0d59da37/attachment-0005.html>


More information about the dev mailing list