Files
cryptsetup/lib/crypto_backend
Eric Biggers 209e6167b5 Exclude cipher allocation time from benchmark
For each 1 MiB of data en/decrypted, 'cryptsetup benchmark' is setting
up a new AF_ALG socket, which involves 4 system calls and is included in
the data en/decryption time.  With high-speed ciphers (e.g. VAES
optimized AES-XTS) this can measure well over 10000 AF_ALG socket setups
per second.  This is not representative of dm-crypt, which only
allocates a cipher when the dm-crypt device is created.

Therefore, allocate the AF_ALG socket once, before doing the benchmark.

On AMD Ryzen 9 9950X this increases the 'cryptsetup benchmark' result of
AES-256-XTS slightly, from 14000 MiB/s to 14600 MiB/s.

Note that an in-kernel benchmark of the crypto API with the same block
size (65536 bytes) gives 34100 MiB/s, so AF_ALG still takes more time
than the en/decryption itself -- this cannot easily be addressed though.

Signed-off-by: Eric Biggers <ebiggers@google.com>
2024-09-17 10:31:10 -07:00
..
2024-06-03 16:38:15 +00:00
2024-06-03 16:38:15 +00:00
2024-06-03 16:39:06 +00:00
2024-06-03 16:38:15 +00:00
2024-06-03 16:38:15 +00:00
2024-07-14 17:12:03 +08:00
2024-06-03 16:38:15 +00:00
2024-07-14 17:12:03 +08:00
2024-06-03 16:38:15 +00:00
2024-06-03 16:38:15 +00:00
2024-06-03 16:38:15 +00:00
2024-06-03 16:38:15 +00:00