DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] eal: add macro to mark variable mostly read only
@ 2018-04-18 15:30 Pavan Nikhilesh
  2018-04-18 15:30 ` [dpdk-dev] [PATCH 2/2] drivers: mark logtype variables as read mostly Pavan Nikhilesh
  2018-04-18 17:43 ` [dpdk-dev] [PATCH 1/2] eal: add macro to mark variable mostly read only Ferruh Yigit
  0 siblings, 2 replies; 10+ messages in thread
From: Pavan Nikhilesh @ 2018-04-18 15:30 UTC (permalink / raw)
  To: thomas, jerin.jacob, techboard; +Cc: dev, Pavan Nikhilesh

Add macro to mark a variable to be mostly read only and place it in a
separate section.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---

 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-19 15:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18 15:30 [dpdk-dev] [PATCH 1/2] eal: add macro to mark variable mostly read only Pavan Nikhilesh
2018-04-18 15:30 ` [dpdk-dev] [PATCH 2/2] drivers: mark logtype variables as read mostly Pavan Nikhilesh
2018-04-18 17:43 ` [dpdk-dev] [PATCH 1/2] eal: add macro to mark variable mostly read only Ferruh Yigit
2018-04-18 17:55   ` Pavan Nikhilesh
2018-04-18 18:03     ` Ferruh Yigit
2018-04-19  9:20       ` Pavan Nikhilesh
2018-04-19 12:09         ` Bruce Richardson
2018-04-19 15:18           ` Pavan Nikhilesh
2018-04-19 15:37             ` Bruce Richardson
2018-04-19 15:55               ` Pavan Nikhilesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).