]> git.ipfire.org Git - thirdparty/linux.git/commit
libeth: xdp, xsk: access adjacent u32s as u64 where applicable
authorAlexander Lobakin <aleksander.lobakin@intel.com>
Thu, 12 Jun 2025 16:02:34 +0000 (18:02 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 16 Jun 2025 18:40:15 +0000 (11:40 -0700)
commit80bae9df2108cb72a060ee5235614d7c072af1de
tree57f41ffd77c44638e528d3d37eb9ed6204e1c141
parent3ced71a8b39e84f91a4fa9d42e85815515f9b1bc
libeth: xdp, xsk: access adjacent u32s as u64 where applicable

On 64-bit systems, writing/reading one u64 is faster than two u32s even
when they're are adjacent in a struct. The compilers won't guarantee
they will combine those; I observed both successful and unsuccessful
attempts with both GCC and Clang, and it's not easy to say what it
depends on.
There's a few places in libeth_xdp winning up to several percent from
combined access (both performance and object code size, especially
when unrolling). Add __LIBETH_WORD_ACCESS and use it there on LE.
Drivers are free to optimize HW-specific callbacks under the same
definition.

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
include/net/libeth/xdp.h
include/net/libeth/xsk.h