[dpdk-dev,v2] example exception_path: cache align per CPU stats

Message ID 20180213165856.1729-1-dustin@null-ptr.net (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Dustin Lundquist Feb. 13, 2018, 4:58 p.m. UTC
  Align stats structure to cache line to prevent bouncing per CPU stats
structure between cache lines.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Dustin Lundquist <dustin@null-ptr.net>
---
v2:
* Include fixes tag

Verified alignment of lcore_stats array elements using gdb.

 examples/exception_path/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.11.0
  

Comments

Thomas Monjalon Feb. 13, 2018, 6:04 p.m. UTC | #1
13/02/2018 17:58, Dustin Lundquist:
> Align stats structure to cache line to prevent bouncing per CPU stats
> structure between cache lines.
> 
> Fixes: af75078fece3 ("first public release")
> 
> Signed-off-by: Dustin Lundquist <dustin@null-ptr.net>

Acked-by: Remy Horton <remy.horton@intel.com>

Applied, thanks
  

Patch

diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 280a50451..3e5b1e718 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -108,7 +108,7 @@  struct stats {
 	uint64_t rx;
 	uint64_t tx;
 	uint64_t dropped;
-};
+} __rte_cache_aligned;

 /* Array of lcore-specific stats */
 static struct stats lcore_stats[RTE_MAX_LCORE];