summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTianyu Li <tianyu.li@arm.com>2021-08-26 09:43:42 +0800
committerTianyu Li <tianyu.li@arm.com>2021-08-26 10:28:17 +0800
commitc6b6816bed8a4fa2baa396bc0af56e4ac373d713 (patch)
treeffeba68e517c6b803ff0faf650c5f243c51a7edb /src
parentee04de552d1749948e8802c2c6a87646f3b81625 (diff)
acl: fix prefetch out of struct bound on Arm
fa_session_t *sess; CLIB_PREFETCH (sess, 2 * CLIB_CACHE_LINE_BYTES, STORE); sizeof(fa_session_t) is 128 bytes i) on 64B cacheline size Arm machine, above CLIB_PREFETCH () macro will be expand to __builtin_prefetch(sess) __builtin_prefetch(sess + 64) __builtin_prefetch(sess + 128) << prefetch is out of range of *sess. __builtin_prefetch(sess + 192) << ii) on 128B cacheline size Arm machine, CLIB_PREFETCH () expands to __builtin_prefetch(sess) __builtin_prefetch(sess + 128) << still out of bound Solution: Change to CLIB_PREFETCH (sess, sizeof(*sess), STORE); Type: fix Signed-off-by: Tianyu Li <tianyu.li@arm.com> Reviewed-by: Lijian Zhang <lijian.zhang@arm.com> Change-Id: I4b3d4fc55747f3d9ad1bcf24f8834601a03ef55e
Diffstat (limited to 'src')
-rw-r--r--src/plugins/acl/dataplane_node.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/acl/dataplane_node.c b/src/plugins/acl/dataplane_node.c
index 1a050f54b14..4bef8f07770 100644
--- a/src/plugins/acl/dataplane_node.c
+++ b/src/plugins/acl/dataplane_node.c
@@ -176,7 +176,7 @@ prefetch_session_entry (acl_main_t * am, fa_full_session_id_t f_sess_id)
{
fa_session_t *sess = get_session_ptr_no_check (am, f_sess_id.thread_index,
f_sess_id.session_index);
- CLIB_PREFETCH (sess, 2 * CLIB_CACHE_LINE_BYTES, STORE);
+ CLIB_PREFETCH (sess, sizeof (*sess), STORE);
}
always_inline u8