From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavan Nikhilesh Subject: [PATCH 1/2] eal: add macro to mark variable mostly read only Date: Wed, 18 Apr 2018 21:00:34 +0530 Message-ID: <20180418153035.5972-1-pbhagavatula@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org, Pavan Nikhilesh To: thomas@monjalon.net, jerin.jacob@caviumnetworks.com, techboard@dpdk.org Return-path: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add macro to mark a variable to be mostly read only and place it in a separate section. Signed-off-by: Pavan Nikhilesh --- Group together mostly read only data to avoid cacheline bouncing, also useful for auditing purposes. lib/librte_eal/common/include/rte_common.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 6c5bc5a76..f2ff2e9e6 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -114,6 +114,11 @@ static void __attribute__((constructor(prio), used)) func(void) */ #define __rte_noinline __attribute__((noinline)) +/** + * Mark a variable to be mostly read only and place it in a separate section. + */ +#define __rte_read_mostly __attribute__((__section__(".read_mostly"))) + /*********** Macros for pointer arithmetic ********/ /** -- 2.17.0