On Tue, Oct 4, 2011 at 1:20 PM, Pravin B Shelar <[email protected]> wrote:
> Following patch fixes tunnel hashing bug by using correct key length.
> This bug was introduced by commit f686a33af8cb41ee228e6a35410c9a488fba3eb1
>
> Signed-off-by: Pravin B Shelar <[email protected]>
Can you describe the problem a little more and also provide the
subject line of the patch when giving git commits (like
f686a33af8cb41ee228e6a35410c9a488fba3eb1 "datapath: Fix tunnel
hashing.")?
> diff --git a/datapath/tunnel.c b/datapath/tunnel.c
> index 100794e..81b97d3 100644
> --- a/datapath/tunnel.c
> +++ b/datapath/tunnel.c
> @@ -1512,6 +1512,9 @@ int tnl_init(void)
> {
> int i;
>
> + BUILD_BUG_ON(PORT_KEY_LEN !=
> + (offsetof(struct port_lookup_key, tunnel_type) + sizeof(u32)));
You can use FIELD_SIZEOF instead of having a magical type.
> diff --git a/datapath/tunnel.h b/datapath/tunnel.h
> index b3e21fa..7149319 100644
> --- a/datapath/tunnel.h
> +++ b/datapath/tunnel.h
> @@ -58,6 +58,8 @@ struct port_lookup_key {
> u32 tunnel_type;
> };
>
> +#define PORT_KEY_LEN 20
I would just put the computed version here instead of a static
definition and a check.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev