Skip to content

Commit

Permalink
examples/bpf: fix build
Browse files Browse the repository at this point in the history
[ upstream commit 9a71086 ]

Example BPF programs t2.c, t3.c in folder examples/bpf are
failing to compile with latest dpdk.org master.
The reason is changes in some core DPDK header files, that causes
now inclusion of x86 specific headers.
To overcome the issue, minimize inclusion of DPDK header files
into BPF source code.

Bugzilla ID: 321

Fixes: 9dfc06c ("test/bpf: add samples")

Reported-by: Michel Machado <michel@digirati.com.br>
Suggested-by: Michel Machado <michel@digirati.com.br>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
  • Loading branch information
kananyev authored and kevintraynor committed Sep 4, 2019
1 parent 9878db5 commit 60954fd
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions test/bpf/mbuf.h
Expand Up @@ -13,7 +13,6 @@

#include <stdint.h>
#include <rte_common.h>
#include <rte_memory.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -364,6 +363,23 @@ typedef struct {
volatile int16_t cnt; /**< An internal counter value. */
} rte_atomic16_t;

#define RTE_CACHE_LINE_MIN_SIZE 64 /**< Minimum Cache line size. */

/**
* Force minimum cache line alignment.
*/
#define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)

/**
* IO virtual address type.
* When the physical addressing mode (IOVA as PA) is in use,
* the translation from an IO virtual address (IOVA) to a physical address
* is a direct mapping, i.e. the same value.
* Otherwise, in virtual mode (IOVA as VA), an IOMMU may do the translation.
*/
typedef uint64_t rte_iova_t;
#define RTE_BAD_IOVA ((rte_iova_t)-1)

/**
* The generic rte_mbuf, containing a packet mbuf.
*/
Expand All @@ -377,7 +393,11 @@ struct rte_mbuf {
* same mbuf cacheline0 layout for 32-bit and 64-bit. This makes
* working on vector drivers easier.
*/
phys_addr_t buf_physaddr __rte_aligned(sizeof(phys_addr_t));
RTE_STD_C11
union {
rte_iova_t buf_iova;
rte_iova_t buf_physaddr; /**< deprecated */
} __rte_aligned(sizeof(rte_iova_t));

/* next 8 bytes are initialised on RX descriptor rearm */
MARKER64 rearm_data;
Expand Down

0 comments on commit 60954fd

Please sign in to comment.