Skip to content

Commit

Permalink
net/gve/base: fix build with Fedora Rawhide
Browse files Browse the repository at this point in the history
Currently, a number of integer types are typedef'd to their corresponding
userspace or RTE values. This can be problematic if these types are
already defined somewhere else, as it would cause type collisions.
This patch changes the typedefs to #define macros which are only defined
if the types are not defined already.

Note: this was reported by OBS CI on 2024/10/17, when compiling DPDK
in Fedora Rawhide.

Fixes: c9ba2ca ("net/gve/base: add OS-specific implementation")
Fixes: abf1242 ("net/gve: add struct members and typedefs for DQO")
Cc: stable@dpdk.org

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
  • Loading branch information
josh8551021 authored and david-marchand committed Oct 18, 2024
1 parent fe8eba6 commit f0d9e78
Showing 1 changed file with 36 additions and 12 deletions.
48 changes: 36 additions & 12 deletions drivers/net/gve/base/gve_osdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,46 @@
#include <sys/utsname.h>
#endif

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
#ifndef u8
#define u8 uint8_t
#endif
#ifndef u16
#define u16 uint16_t
#endif
#ifndef u32
#define u32 uint32_t
#endif
#ifndef u64
#define u64 uint64_t
#endif

typedef rte_be16_t __sum16;
#ifndef __sum16
#define __sum16 rte_be16_t
#endif

typedef rte_be16_t __be16;
typedef rte_be32_t __be32;
typedef rte_be64_t __be64;
#ifndef __be16
#define __be16 rte_be16_t
#endif
#ifndef __be32
#define __be32 rte_be32_t
#endif
#ifndef __be64
#define __be64 rte_be64_t
#endif

typedef rte_le16_t __le16;
typedef rte_le32_t __le32;
typedef rte_le64_t __le64;
#ifndef __le16
#define __le16 rte_le16_t
#endif
#ifndef __le32
#define __le32 rte_le32_t
#endif
#ifndef __le64
#define __le64 rte_le64_t
#endif

typedef rte_iova_t dma_addr_t;
#ifndef dma_addr_t
#define dma_addr_t rte_iova_t
#endif

#define ETH_MIN_MTU RTE_ETHER_MIN_MTU
#define ETH_ALEN RTE_ETHER_ADDR_LEN
Expand Down

0 comments on commit f0d9e78

Please sign in to comment.