@@ -32,28 +32,30 @@ typedef union {
/* All input flags */
uint32_t all;
- /* Bitfield flags for each protocol */
- uint32_t l2:1; /**< known L2 protocol present */
- uint32_t l3:1; /**< known L3 protocol present */
- uint32_t l4:1; /**< known L4 protocol present */
-
- uint32_t eth:1; /**< Ethernet */
- uint32_t jumbo:1; /**< Jumbo frame */
- uint32_t vlan:1; /**< VLAN hdr found */
- uint32_t vlan_qinq:1; /**< Stacked VLAN found, QinQ */
-
- uint32_t arp:1; /**< ARP */
-
- uint32_t ipv4:1; /**< IPv4 */
- uint32_t ipv6:1; /**< IPv6 */
- uint32_t ipfrag:1; /**< IP fragment */
- uint32_t ipopt:1; /**< IP optional headers */
- uint32_t ipsec; /**< IPSec decryption may be needed */
-
- uint32_t udp:1; /**< UDP */
- uint32_t tcp:1; /**< TCP */
- uint32_t sctp:1; /**< SCTP */
- uint32_t icmp:1; /**< ICMP */
+ struct {
+ /* Bitfield flags for each protocol */
+ uint32_t l2:1; /**< known L2 protocol present */
+ uint32_t l3:1; /**< known L3 protocol present */
+ uint32_t l4:1; /**< known L4 protocol present */
+
+ uint32_t eth:1; /**< Ethernet */
+ uint32_t jumbo:1; /**< Jumbo frame */
+ uint32_t vlan:1; /**< VLAN hdr found */
+ uint32_t vlan_qinq:1; /**< Stacked VLAN found, QinQ */
+
+ uint32_t arp:1; /**< ARP */
+
+ uint32_t ipv4:1; /**< IPv4 */
+ uint32_t ipv6:1; /**< IPv6 */
+ uint32_t ipfrag:1; /**< IP fragment */
+ uint32_t ipopt:1; /**< IP optional headers */
+ uint32_t ipsec:1; /**< IPSec decryption may be needed */
+
+ uint32_t udp:1; /**< UDP */
+ uint32_t tcp:1; /**< TCP */
+ uint32_t sctp:1; /**< SCTP */
+ uint32_t icmp:1; /**< ICMP */
+ };
} input_flags_t;
ODP_ASSERT(sizeof(input_flags_t) == sizeof(uint32_t), INPUT_FLAGS_SIZE_ERROR);
@@ -65,12 +67,14 @@ typedef union {
/* All error flags */
uint32_t all;
- /* Bitfield flags for each detected error */
- uint32_t frame_len:1; /**< Frame length error */
- uint32_t l2_chksum:1; /**< L2 checksum error, checks TBD */
- uint32_t ip_err:1; /**< IP error, checks TBD */
- uint32_t tcp_err:1; /**< TCP error, checks TBD */
- uint32_t udp_err:1; /**< UDP error, checks TBD */
+ struct {
+ /* Bitfield flags for each detected error */
+ uint32_t frame_len:1; /**< Frame length error */
+ uint32_t l2_chksum:1; /**< L2 checksum error, checks TBD */
+ uint32_t ip_err:1; /**< IP error, checks TBD */
+ uint32_t tcp_err:1; /**< TCP error, checks TBD */
+ uint32_t udp_err:1; /**< UDP error, checks TBD */
+ };
} error_flags_t;
ODP_ASSERT(sizeof(error_flags_t) == sizeof(uint32_t), ERROR_FLAGS_SIZE_ERROR);
@@ -82,8 +86,10 @@ typedef union {
/* All output flags */
uint32_t all;
- /* Bitfield flags for each output option */
- uint32_t l4_chksum:1; /**< Request L4 checksum calculation */
+ struct {
+ /* Bitfield flags for each output option */
+ uint32_t l4_chksum:1; /**< Request L4 checksum calculation */
+ };
} output_flags_t;
ODP_ASSERT(sizeof(output_flags_t) == sizeof(uint32_t), OUTPUT_FLAGS_SIZE_ERROR);
Fixed bitfield bugs found by Bala. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> --- .../linux-generic/include/odp_packet_internal.h | 66 ++++++++++++---------- 1 file changed, 36 insertions(+), 30 deletions(-)