Subject: Re: [PATCH v1 1/6] net: Generalize udp based tunnel offload

From: Alexander Duyck <[email-masked]>
Date: Mon, 23 Nov 2015 21:41:25 -0800

On 11/23/2015 01:02 PM, Anjali Singhai Jain wrote:
> Replace add/del ndo ops for vxlan_port with tunnel_port so that all UDP
> based tunnels can use the same ndo op. Add a parameter to pass tunnel
> type to the ndo_op.
>
> Change all drivers to use the generalized udp tunnel offload
>
> Patch was compile tested with x86_64_defconfig.
>
> Signed-off-by: Kiran Patil <[email-masked]>
> Signed-off-by: Anjali Singhai Jain <[email-masked]>
> ---

[...]

> diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h
> index cb2f89f..72415aa 100644
> --- a/include/net/udp_tunnel.h
> +++ b/include/net/udp_tunnel.h
> @@ -9,6 +9,12 @@
>   #include <net/addrconf.h>
>   #endif
>
> +enum udp_tunnel_type {
> +	UDP_TUNNEL_UNSPEC,
> +	UDP_TUNNEL_VXLAN,
> +	UDP_TUNNEL_GENEVE,
> +};
> +
>   struct udp_port_cfg {
>   	u8			family;
>
>

I'm not a fan of UDP_TUNNEL_UNSPEC.  If you are going to implement a 
"tunnel type" field it should specify tunnel type 1:1, not just 
generically refer to UNSPEC for everything that isn't VXLAN or GENEVE. 
This way we can avoid any issues with anyone implementing an offload 
that later relies on their tunnel type value being equal to 0.

- Alex