From fc8f0f8c48ef12edbf60f74f37024917f5812385 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 28 Sep 2023 11:21:02 +1000 Subject: siphash: Use incremental rather than all-at-once siphash functions We have a bunch of variants of the siphash functions for different data sizes. The callers, in tcp.c, need to pack the various values they want to hash into a temporary structure, then call the appropriate version. We can avoid the copy into the temporary by directly using the incremental siphash functions. The length specific hash functions also have an undocumented constraint that the data pointer they take must, in fact, be aligned to avoid unaligned accesses, which may cause crashes on some architectures. So, prefer the incremental approach and remove the length-specific functions. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- tcp_splice.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tcp_splice.c') diff --git a/tcp_splice.c b/tcp_splice.c index be01908..a572aca 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -52,6 +52,7 @@ #include "passt.h" #include "log.h" #include "tcp_splice.h" +#include "siphash.h" #include "inany.h" #include "tcp_conn.h" -- cgit v1.2.3