mempool/octeontx: fix natural alignment being optimized out
authorPavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Thu, 18 Jan 2018 13:44:33 +0000 (19:14 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 18 Jan 2018 23:43:56 +0000 (00:43 +0100)
The mbox messages are naturally aligned and in some cases compiler
optimization might disregard natural alignment.
Use volatile key word to force compiler to disable optimizing and
maintain alignment.

Fixes: aecb8e093b52 ("event/octeontx: introduce specialized mbox message copy")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
drivers/mempool/octeontx/octeontx_mbox.c

index 28d8c8b..f8cb6a4 100644 (file)
@@ -61,7 +61,7 @@ struct mbox_ram_hdr {
 };
 
 static inline void
-mbox_msgcpy(uint8_t *d, const uint8_t *s, uint16_t size)
+mbox_msgcpy(volatile uint8_t *d, volatile const uint8_t *s, uint16_t size)
 {
        uint16_t i;