From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D989BA0613 for ; Tue, 30 Jul 2019 12:19:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C55081BEF1; Tue, 30 Jul 2019 12:19:39 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 3B4421BEF1; Tue, 30 Jul 2019 12:19:38 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2019 03:19:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,326,1559545200"; d="scan'208";a="162532082" Received: from sivswdev08.ir.intel.com ([10.237.217.47]) by orsmga007.jf.intel.com with ESMTP; 30 Jul 2019 03:19:36 -0700 From: Konstantin Ananyev To: dev@dpdk.org Cc: Konstantin Ananyev , stable@dpdk.org Date: Tue, 30 Jul 2019 11:19:27 +0100 Message-Id: <20190730101927.1665-1-konstantin.ananyev@intel.com> X-Mailer: git-send-email 2.18.0 Subject: [dpdk-stable] [PATCH] examples/bpf: fix compilation issue X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Example BPF programs t1.c, 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: 9dfc06c26a8b ("test/bpf: add samples") Cc: stable@dpdk.org Reported-by: Michel Machado Suggested-by: Michel Machado Signed-off-by: Konstantin Ananyev --- examples/bpf/mbuf.h | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/examples/bpf/mbuf.h b/examples/bpf/mbuf.h index b623d8694..e41c3d26e 100644 --- a/examples/bpf/mbuf.h +++ b/examples/bpf/mbuf.h @@ -13,7 +13,6 @@ #include #include -#include #ifdef __cplusplus extern "C" { @@ -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. */ @@ -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; -- 2.17.1