DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ring: use aligned memzone allocation
@ 2017-06-02 20:03 Daniel Verkamp
  2017-06-02 20:12 ` [dpdk-dev] [PATCH v2] " Daniel Verkamp
  0 siblings, 1 reply; 42+ messages in thread
From: Daniel Verkamp @ 2017-06-02 20:03 UTC (permalink / raw)
  To: dev; +Cc: Daniel Verkamp

rte_memzone_reserve() provides cache line alignment, but
struct rte_ring may require more than cache line alignment: on x86-64,
it needs 128-byte alignment due to PROD_ALIGN and CONS_ALIGN, which are
128 bytes, but cache line size is 64 bytes.

Fixes runtime warnings with UBSan enabled.

Fixes: d9f0d3a1ffd4 ("ring: remove split cacheline build setting")

Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
---
 lib/librte_ring/rte_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c
index 5f98c33..ee42343 100644
--- a/lib/librte_ring/rte_ring.c
+++ b/lib/librte_ring/rte_ring.c
@@ -189,7 +189,7 @@ rte_ring_create(const char *name, unsigned count, int socket_id,
 	/* reserve a memory zone for this ring. If we can't get rte_config or
 	 * we are secondary process, the memzone_reserve function will set
 	 * rte_errno for us appropriately - hence no check in this this function */
-	mz = rte_memzone_reserve(mz_name, ring_size, socket_id, mz_flags);
+	mz = rte_memzone_reserve_aligned(mz_name, ring_size, socket_id, mz_flags, __alignof__(*r));
 	if (mz != NULL) {
 		r = mz->addr;
 		/* no need to check return value here, we already checked the
-- 
2.9.4

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

end of thread, other threads:[~2017-07-01 11:25 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-02 20:03 [dpdk-dev] [PATCH] ring: use aligned memzone allocation Daniel Verkamp
2017-06-02 20:12 ` [dpdk-dev] [PATCH v2] " Daniel Verkamp
2017-06-02 20:51   ` Ananyev, Konstantin
2017-06-02 22:24     ` Verkamp, Daniel
2017-06-03 10:00       ` Ananyev, Konstantin
2017-06-05 16:21         ` Verkamp, Daniel
2017-06-06  9:59           ` Ananyev, Konstantin
2017-06-06 12:42             ` Bruce Richardson
2017-06-06 13:19               ` Ananyev, Konstantin
2017-06-06 14:56                 ` Bruce Richardson
2017-06-08 12:45                   ` Olivier Matz
2017-06-08 13:20                     ` Bruce Richardson
2017-06-08 14:05                       ` Olivier Matz
2017-06-08 14:11                         ` Bruce Richardson
2017-06-08 14:50                           ` Ananyev, Konstantin
2017-06-08 15:24                             ` Bruce Richardson
2017-06-08 15:35                               ` Ananyev, Konstantin
2017-06-08 16:03                                 ` Bruce Richardson
2017-06-08 16:12                                   ` Ananyev, Konstantin
2017-06-08 16:20                                     ` Richardson, Bruce
2017-06-08 16:42                                       ` Ananyev, Konstantin
2017-06-09  9:02                                         ` Bruce Richardson
2017-06-12  9:02                                           ` Olivier Matz
2017-06-12  9:56                                             ` Bruce Richardson
2017-06-30 11:35                                               ` Olivier Matz
2017-06-09 12:47                 ` Yerden Zhumabekov
2017-06-09 17:16                   ` Stephen Hemminger
2017-06-09 17:28                     ` Jerin Jacob
2017-06-10  8:16                       ` Ananyev, Konstantin
2017-06-12  3:07                         ` Jerin Jacob
2017-06-12 10:18                           ` Ananyev, Konstantin
2017-06-12 10:34                             ` Jerin Jacob
2017-06-12 11:09                               ` Bruce Richardson
2017-06-12 11:41                                 ` Jerin Jacob
2017-06-12 12:17                                   ` Ananyev, Konstantin
2017-06-12 12:42                                     ` Jerin Jacob
2017-06-12 12:51                                       ` Ananyev, Konstantin
2017-06-12 13:06                                         ` Bruce Richardson
2017-06-12 13:20                                         ` Jerin Jacob
2017-06-30 11:36   ` Olivier Matz
2017-07-01 11:14     ` Thomas Monjalon
2017-07-01 11:25       ` Thomas Monjalon

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).