[ovs-dev] [PATCH 09/13] Upstream VXLAN: Add VXLAN socket create API

Jesse Gross jesse at nicira.com
Mon Dec 17 23:11:39 UTC 2012


On Thu, Nov 22, 2012 at 7:57 AM, Pravin B Shelar <pshelar at nicira.com> wrote:
> From: Pravin Shelar <pshelar at nicira.com>
>
> export vxlan_create_socket() so that other modules, like Open vSwitch,
> can have configurable destination port for VXLAN.
>
> Signed-off-by: Pravin B Shelar <pshelar at nicira.com>

This seems like it exposes a little more of the implementation details
than is ideal.  It actually might be a good reason for using the
protocol specific registration code that I was talking about earlier
since we could just include a port number there.

Also, how are you planning on handling this on transmit?  It doesn't
look to me like any of the transmit code is exposed currently but we'd
have to figure out how to pass the port number there as well (and also
figure out how to deal with the source port range since we don't
currently allow that to be configured).

> diff --git a/include/net/vxlan.h b/include/net/vxlan.h
> new file mode 100644
> index 0000000..fbb1a2d
> --- /dev/null
> +++ b/include/net/vxlan.h
> @@ -0,0 +1,17 @@
> +#ifndef __LINUX_VXALN_H
> +#define __LINUX_VXLAN_H
> +
> +#define VXLAN_N_VID    (1u << 24)
> +#define VXLAN_VID_MASK (VXLAN_N_VID - 1)
> +/* VLAN + IP header + UDP + VXLAN */
> +#define VXLAN_HEADROOM (20 + 8 + 8 + 14)
> +
> +#define VXLAN_FLAGS 0x08000000 /* struct vxlanhdr.vx_flags required value. */
> +/* VXLAN protocol header */
> +struct vxlanhdr {
> +       __be32 vx_flags;
> +       __be32 vx_vni;
> +};
> +
> +struct socket *vxlan_create_socket(struct net *net, int portno);
> +#endif

Do we need to expose all the structs and constants?  I think the only
thing required by this change is the function call.



More information about the dev mailing list