On Fri, Jan 30, 2015 at 6:36 AM, Thomas Graf <tg...@noironetworks.com> wrote: > Upstream commit: > openvswitch: Support VXLAN Group Policy extension > > Introduces support for the group policy extension to the VXLAN virtual > port. The extension is disabled by default and only enabled if the user > has provided the respective configuration. > > ovs-vsctl add-port br0 vxlan0 -- \ > set Interface vxlan0 type=vxlan options:exts=gbp > > The configuration interface to enable the extension is based on a new > attribute OVS_VXLAN_EXT_GBP nested inside OVS_TUNNEL_ATTR_EXTENSION > which can carry additional extensions as needed in the future. > > The group policy metadata is stored as binary blob (struct ovs_vxlan_opts) > internally just like Geneve options but transported as nested Netlink > attributes to user space. > > Renames the existing TUNNEL_OPTIONS_PRESENT to TUNNEL_GENEVE_OPT with the > binary value kept intact, a new flag TUNNEL_VXLAN_OPT is introduced. > > The attributes OVS_TUNNEL_KEY_ATTR_VXLAN_OPTS and existing > OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS are implemented mutually exclusive. > > Signed-off-by: Thomas Graf <tg...@suug.ch> > Signed-off-by: David S. Miller <da...@davemloft.net> > > Upstream: 1dd144 ("openvswitch: Support VXLAN Group Policy extension") > Signed-off-by: Thomas Graf <tg...@noironetworks.com> > --- > datapath/Modules.mk | 3 +- > datapath/flow_netlink.c | 114 > +++++++++++++++++++--- > datapath/linux/compat/include/linux/openvswitch.h | 10 ++ > datapath/linux/compat/include/net/ip_tunnels.h | 16 ++- > datapath/vport-geneve.c | 6 +- > datapath/vport-vxlan.c | 82 +++++++++++++++- > datapath/vport-vxlan.h | 11 +++ > 7 files changed, 223 insertions(+), 19 deletions(-) > create mode 100644 datapath/vport-vxlan.h > ....
> --- a/datapath/vport-vxlan.c > +++ b/datapath/vport-vxlan.c > @@ -41,6 +41,7 @@ > > #include "datapath.h" > #include "vport.h" > +#include "vport-vxlan.h" > > /** > * struct vxlan_port - Keeps track of open UDP ports > @@ -50,6 +51,7 @@ > struct vxlan_port { > struct vxlan_sock *vs; > char name[IFNAMSIZ]; > + u32 exts; /* VXLAN_F_* in <net/vxlan.h> */ > }; > > static inline struct vxlan_port *vxlan_vport(const struct vport *vport) > @@ -61,16 +63,26 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct > sk_buff *skb, > struct vxlan_metadata *md) > { > struct ovs_tunnel_info tun_info; > + struct vxlan_port *vxlan_port; > struct vport *vport = vs->data; > struct iphdr *iph; > + struct ovs_vxlan_opts opts = { > + .gbp = md->gbp, > + }; > __be64 key; > + __be16 flags; > + > + flags = TUNNEL_KEY; > + vxlan_port = vxlan_vport(vport); > + if (vxlan_port->exts & VXLAN_F_GBP) > + flags |= TUNNEL_VXLAN_OPT; > This does not allow GBP and non-GBP tunnel share vxlan port, since OVS we have single vport shared between all vxlan end-points for given UDP port. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev