From: Barry Spinney <[email protected]> Reordered the odph_vlanhdr_t to be more aligned with how fast path code parses headers like this. This change then required a change to odp_classification_common.c.
Signed-off-by: Barry Spinney <[email protected]> Signed-off-by: Bill Fischofer <[email protected]> --- helper/include/odp/helper/eth.h | 12 ++++++++---- helper/include/odp/helper/ip.h | 3 +++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/helper/include/odp/helper/eth.h b/helper/include/odp/helper/eth.h index 4597009..c2408ef 100644 --- a/helper/include/odp/helper/eth.h +++ b/helper/include/odp/helper/eth.h @@ -64,7 +64,7 @@ ODP_STATIC_ASSERT(sizeof(odph_ethaddr_t) == ODPH_ETHADDR_LEN, typedef struct ODP_PACKED { odph_ethaddr_t dst; /**< Destination address */ odph_ethaddr_t src; /**< Source address */ - odp_u16be_t type; /**< Type */ + odp_u16be_t type; /**< EtherType */ } odph_ethhdr_t; /** @internal Compile time assert */ @@ -72,12 +72,16 @@ ODP_STATIC_ASSERT(sizeof(odph_ethhdr_t) == ODPH_ETHHDR_LEN, "ODPH_ETHHDR_T__SIZE_ERROR"); /** - * VLAN header + * IEEE 802.1Q VLAN header * - * @todo Check usage of tpid vs ethertype. Check outer VLAN TPID. + * This field is present when the EtherType (the odph_ethhdr_t type field) of + * the preceding ethernet header is ODPH_ETHTYPE_VLAN. The inner EtherType + * (the odph_vlanhdr_t type field) then indicates what comes next. Note that + * the so called TPID field isn't here because it overlaps with the + * odph_ethhdr_t type field. */ typedef struct ODP_PACKED { - odp_u16be_t tpid; /**< Tag protocol ID (located after ethhdr.src) */ + odp_u16be_t tpid; /**< Tag protocol ID (located after ethhdr.src */ odp_u16be_t tci; /**< Priority / CFI / VLAN ID */ } odph_vlanhdr_t; diff --git a/helper/include/odp/helper/ip.h b/helper/include/odp/helper/ip.h index f1f8cab..4cfc00f 100644 --- a/helper/include/odp/helper/ip.h +++ b/helper/include/odp/helper/ip.h @@ -152,6 +152,9 @@ static inline odp_u16sum_t odph_ipv4_csum_update(odp_packet_t pkt) /** IPv6 header length */ #define ODPH_IPV6HDR_LEN 40 +/** IPv6 address length in bytes */ +#define ODPH_IPV6ADDR_LEN 16 + /** The following constants can be used to access the three subfields * of the 4 byte ver_tc_flow field - namely the four bit Version subfield, * the eight bit Traffic Class subfield (TC) and the twenty bit Flow Label -- 2.5.0 _______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
