aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJere Leppänen <jere.leppanen@nokia.com>2024-03-20 17:49:26 +0200
committerMatias Elo <matias.elo@nokia.com>2024-04-16 16:49:46 +0300
commita511101ed0d42342bc0b1225bd9c7f2203031dec (patch)
tree801dadbb6348623184c7ea7b22e4c8ad31f83836
parent3f6ca9ce241b1f02bf60c72337b03f7fda7e6c6b (diff)
test: performance: cpu_bench: use unaligned type when accessing packet data
Packet data may not be aligned. Use unaligned type when accessing packet data in order to avoid undefined behavior. Fixes multiple GCC undefined sanitizer errors, for example: odp_cpu_bench.c:206:11: runtime error: store to misaligned address 0x7fde78bda1aa for type 'uint32_t', which requires 4 byte alignment Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
-rw-r--r--test/performance/odp_cpu_bench.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/performance/odp_cpu_bench.c b/test/performance/odp_cpu_bench.c
index 5106f3362..674015d8a 100644
--- a/test/performance/odp_cpu_bench.c
+++ b/test/performance/odp_cpu_bench.c
@@ -190,7 +190,7 @@ static void sig_handler(int signo ODP_UNUSED)
static inline void init_packet(odp_packet_t pkt, uint32_t seq, uint16_t group)
{
- uint32_t *payload;
+ odp_una_u32_t *payload;
test_hdr_t *hdr;
odp_packet_parse_param_t param;
@@ -222,7 +222,7 @@ static inline odp_queue_t work_on_event(odp_event_t event)
odph_udphdr_t *udp_hdr;
test_hdr_t *hdr;
lookup_entry_t *lookup_entry;
- uint32_t *payload;
+ odp_una_u32_t *payload;
uint32_t crc;
uint32_t pkt_len;
uint8_t *data;