From: Ivan Malov Date: Fri, 12 Mar 2021 11:07:38 +0000 (+0300) Subject: net: clarify endianness of 32-bit fields in VXLAN headers X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=694d6ad392109ba23eca4acb283a64b8b3bb4fc5;p=dpdk.git net: clarify endianness of 32-bit fields in VXLAN headers These fields have network byte order. Highlight it using dedicated type. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton Reviewed-by: Ferruh Yigit --- diff --git a/lib/librte_net/rte_vxlan.h b/lib/librte_net/rte_vxlan.h index 2ad6061657..929fa7a1dd 100644 --- a/lib/librte_net/rte_vxlan.h +++ b/lib/librte_net/rte_vxlan.h @@ -13,6 +13,7 @@ #include +#include #include @@ -30,8 +31,8 @@ extern "C" { * Reserved fields (24 bits and 8 bits) */ struct rte_vxlan_hdr { - uint32_t vx_flags; /**< flag (8) + Reserved (24). */ - uint32_t vx_vni; /**< VNI (24) + Reserved (8). */ + rte_be32_t vx_flags; /**< flag (8) + Reserved (24). */ + rte_be32_t vx_vni; /**< VNI (24) + Reserved (8). */ } __rte_packed; /** VXLAN tunnel header length. */ @@ -48,7 +49,7 @@ struct rte_vxlan_gpe_hdr { uint8_t vx_flags; /**< flag (8). */ uint8_t reserved[2]; /**< Reserved (16). */ uint8_t proto; /**< next-protocol (8). */ - uint32_t vx_vni; /**< VNI (24) + Reserved (8). */ + rte_be32_t vx_vni; /**< VNI (24) + Reserved (8). */ } __rte_packed; /** VXLAN-GPE tunnel header length. */