]> www.infradead.org Git - users/jedix/linux-maple.git/commit
libeth: add cacheline / struct layout assertion helpers
authorAlexander Lobakin <aleksander.lobakin@intel.com>
Thu, 20 Jun 2024 13:53:36 +0000 (15:53 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 10 Jul 2024 17:29:53 +0000 (10:29 -0700)
commit62c884256ea1f898b00f20729a306a4eeb1840b1
tree69044ada726fdf209c9d4017a21c3d41062df779
parent39daa09d34ada1bc7227d68def63e0a2105b5496
libeth: add cacheline / struct layout assertion helpers

Add helpers to assert struct field layout, a bit more crazy and
networking-specific than in <linux/cache.h>. They assume you have
3 CL-aligned groups (read-mostly, read-write, cold) in a struct
you want to assert, and nothing besides them.
For 64-bit with 64-byte cachelines, the assertions are as strict
as possible, as the size can then be easily predicted.
For the rest, make sure they don't cross the specified bound.

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
include/net/libeth/cache.h [new file with mode: 0644]