[ovs-dev] [PATCH] Add VxLAN-GBP support for user space data path

Li, Johnson johnson.li at intel.com
Wed Apr 20 02:59:48 UTC 2016


> -----Original Message-----
> From: Jesse Gross [mailto:jesse at kernel.org]
> Sent: Tuesday, April 19, 2016 11:22 PM
> To: Li, Johnson <johnson.li at intel.com>
> Cc: ovs dev <dev at openvswitch.org>
> Subject: Re: [ovs-dev] [PATCH] Add VxLAN-GBP support for user space data
> path
> 
> On Tue, Apr 19, 2016 at 3:20 AM, Johnson.Li <johnson.li at intel.com> wrote:
> > diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index
> > e398562..e6b35ed 100644
> > --- a/lib/netdev-vport.c
> > +++ b/lib/netdev-vport.c
> > @@ -1297,10 +1298,16 @@ netdev_vxlan_pop_header(struct dp_packet
> *packet)
> >          return EINVAL;
> >      }
> >
> > -    if (get_16aligned_be32(&vxh->vx_flags) != htonl(VXLAN_FLAGS) ||
> > -       (get_16aligned_be32(&vxh->vx_vni) & htonl(0xff))) {
> > -        VLOG_WARN_RL(&err_rl, "invalid vxlan flags=%#x vni=%#x\n",
> > -                     ntohl(get_16aligned_be32(&vxh->vx_flags)),
> > +    vxh_flags = get_16aligned_be32(&vxh->vx_flags);
> > +    if ((vxh_flags & htonl(VXLAN_GBP_FLAGS)) ==
> > + htonl(VXLAN_GBP_FLAGS)) {
> 
> There are many overlapping extensions to VXLAN. We should only try to
> parse these flags when the GBP extensions is actually turned on.
> 
> > +        tnl->gbp_id = htons(ntohl(vxh_flags) & 0xFFFF); /*
> > + VXLAN_GBP_ID_MASK */
> 
> There is a field called tnl->gbp_flags which should presumably also be
> populated here (and on transmit).
> 
Ok, I will try to check each flag individually and store them into the tnl->gbl_flags.
> > diff --git a/lib/packets.h b/lib/packets.h index 8139a6b..d9a149d
> > 100644
> > --- a/lib/packets.h
> > +++ b/lib/packets.h
> > @@ -1002,6 +1002,7 @@ struct vxlanhdr {  };
> >
> >  #define VXLAN_FLAGS 0x08000000  /* struct vxlanhdr.vx_flags required
> > value. */
> > +#define VXLAN_GBP_FLAGS 0x88000000  /* Group Based Policy */
> 
> Can you please break these down into individual flags so that it is easier to
> tell what is going on (and you could use them in parsing as well)?
> 
> Can you also please add some test cases?
I will, Thanks for your advice.


More information about the dev mailing list