On Tue, Apr 19, 2016 at 3:20 AM, Johnson.Li <johnson...@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). > 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? _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev