git: 88b187401d51 - main - iflib: Simplify CACHE_PTR_NEXT
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 31 Jan 2025 20:45:34 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=88b187401d5186e7274a9f064efa8a16d5fa76ea
commit 88b187401d5186e7274a9f064efa8a16d5fa76ea
Author: Alfredo Mazzinghi <am2419@cl.cam.ac.uk>
AuthorDate: 2025-01-31 20:40:48 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2025-01-31 20:41:45 +0000
iflib: Simplify CACHE_PTR_NEXT
Reviewed by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Obtained from: CheriBSD
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D48446
---
sys/net/iflib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index 1ae2207c9d13..4c626edd8f31 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -275,7 +275,7 @@ iflib_get_extra_msix_vectors_sysctl(if_ctx_t ctx)
#define IP_ALIGNED(m) ((((uintptr_t)(m)->m_data) & 0x3) == 0x2)
#define CACHE_PTR_INCREMENT (CACHE_LINE_SIZE / sizeof(void *))
-#define CACHE_PTR_NEXT(ptr) ((void *)(((uintptr_t)(ptr) + CACHE_LINE_SIZE - 1) & (CACHE_LINE_SIZE - 1)))
+#define CACHE_PTR_NEXT(ptr) ((void *)(roundup2(ptr, CACHE_LINE_SIZE)))
#define LINK_ACTIVE(ctx) ((ctx)->ifc_link_state == LINK_STATE_UP)
#define CTX_IS_VF(ctx) ((ctx)->ifc_sctx->isc_flags & IFLIB_IS_VF)