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 <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
Ivan Malov 2021-03-12 14:07:38 +03:00 committed by Ferruh Yigit
parent a56a262e34
commit 694d6ad392

View File

@ -13,6 +13,7 @@
#include <stdint.h>
#include <rte_byteorder.h>
#include <rte_udp.h>
@ -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. */