[ovs-dev] [PATCH 1/5] vxlan: Group Policy extension

Thomas Graf tgraf at suug.ch
Thu Jan 15 03:20:28 UTC 2015


On 01/14/15 at 07:06pm, Tom Herbert wrote:
> > +struct vxlan_metadata {
> > +       __be32          vni;
> > +       u32             gbp;
> 
> Should this be __be32 also and use ntohl/htonl when setting to/from skb->mark?

The bitmask is stored in host byte order in vxlan_metadata to be
compatible with skb->mark and converted to network byte order on
the wire, see:

        gbp = (struct vxlanhdr_gbp *)vxh;
        md.gbp = ntohs(gbp->policy_id);

and:

	gbp->policy_id = htons(md->gbp & VXLAN_GBP_ID_MASK);



More information about the dev mailing list