DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fix 64bit address alignment in 32-bit builds
@ 2017-04-28  8:15 Bruce Richardson
  2017-04-28  8:19 ` Bruce Richardson
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Bruce Richardson @ 2017-04-28  8:15 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

On i686 builds, the uint64_t type is 64-bits in size but is aligned to
32-bits only. This causes mbuf fields for rearm_data to not be 16-byte
aligned on 32-bit builds, which causes errors with some vector PMDs which
expect the rearm data to be aligned as on 64-bit.

Given that we cannot use the extra space in the data structures anyway, as
it's already used on 64-bit builds, we can just force alignment of physical
address structure members to 8-bytes in all cases. This has no effect on
64-bit systems, but fixes the updated PMDs on 32-bit.

Fixes: f4356d7ca168 ("net/i40e: eliminate mbuf write on rearm")
Fixes: f160666a1073 ("net/ixgbe: eliminate mbuf write on rearm")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_eal/common/include/rte_memory.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index 4aa5d1f..ad14875 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -98,7 +98,8 @@ enum rte_page_sizes {
  */
 #define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
 
-typedef uint64_t phys_addr_t; /**< Physical address definition. */
+/** Physical address definition. */
+typedef uint64_t phys_addr_t __rte_aligned(sizeof(uint64_t));
 #define RTE_BAD_PHYS_ADDR ((phys_addr_t)-1)
 
 /**
-- 
2.9.3

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

end of thread, other threads:[~2017-04-30 19:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-28  8:15 [dpdk-dev] [PATCH] eal: fix 64bit address alignment in 32-bit builds Bruce Richardson
2017-04-28  8:19 ` Bruce Richardson
2017-04-28  8:56 ` Thomas Monjalon
2017-04-28  9:03   ` Bruce Richardson
2017-04-28  9:21     ` Thomas Monjalon
2017-04-28  9:32       ` Bruce Richardson
2017-04-28  9:56         ` Olivier Matz
2017-04-28 10:14           ` Bruce Richardson
2017-04-28 13:10 ` [dpdk-dev] [PATCH v2] mbuf: " Bruce Richardson
2017-04-30 19:40   ` 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).