1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2020 Mellanox Technologies, Ltd
11 * GENEVE-related definitions
15 #include <rte_byteorder.h>
21 /** GENEVE default port. */
22 #define RTE_GENEVE_DEFAULT_PORT 6081
25 * GENEVE protocol header. (draft-ietf-nvo3-geneve-09)
27 * 2-bits version (must be 0).
28 * 6-bits option length in four byte multiples, not including the eight
29 * bytes of the fixed tunnel header.
30 * 1-bit control packet.
31 * 1-bit critical options in packet.
33 * 16-bits Protocol Type. The protocol data unit after the Geneve header
34 * following the EtherType convention. Ethernet itself is represented by
36 * 24-bits Virtual Network Identifier (VNI). Virtual network unique identified.
37 * 8-bits reserved bits (must be 0 on transmission and ignored on receipt).
38 * More-bits (optional) variable length options.
41 struct rte_geneve_hdr {
42 #if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
43 uint8_t ver:2; /**< Version. */
44 uint8_t opt_len:6; /**< Options length. */
45 uint8_t oam:1; /**< Control packet. */
46 uint8_t critical:1; /**< Critical packet. */
47 uint8_t reserved1:6; /**< Reserved. */
49 uint8_t opt_len:6; /**< Options length. */
50 uint8_t ver:2; /**< Version. */
51 uint8_t reserved1:6; /**< Reserved. */
52 uint8_t critical:1; /**< Critical packet. */
53 uint8_t oam:1; /**< Control packet. */
55 rte_be16_t proto; /**< Protocol type. */
56 uint8_t vni[3]; /**< Virtual network identifier. */
57 uint8_t reserved2; /**< Reserved. */
58 uint32_t opts[]; /**< Variable length options. */
61 /* GENEVE ETH next protocol types */
62 #define RTE_GENEVE_TYPE_ETH 0x6558 /**< Ethernet Protocol. */
68 #endif /* RTE_GENEVE_H_ */