aboutgitcodebugslistschat
path: root/tcp_splice.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-09-28 11:21:02 +1000
committerStefano Brivio <sbrivio@redhat.com>2023-09-30 12:40:53 +0200
commitfc8f0f8c48ef12edbf60f74f37024917f5812385 (patch)
tree470cc57b733611a8447b725635fa5d9e18b7315d /tcp_splice.c
parent04b10a8d907d8ceb09e3adb4885c02f546841bbc (diff)
downloadpasst-fc8f0f8c48ef12edbf60f74f37024917f5812385.tar
passt-fc8f0f8c48ef12edbf60f74f37024917f5812385.tar.gz
passt-fc8f0f8c48ef12edbf60f74f37024917f5812385.tar.bz2
passt-fc8f0f8c48ef12edbf60f74f37024917f5812385.tar.lz
passt-fc8f0f8c48ef12edbf60f74f37024917f5812385.tar.xz
passt-fc8f0f8c48ef12edbf60f74f37024917f5812385.tar.zst
passt-fc8f0f8c48ef12edbf60f74f37024917f5812385.zip
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 <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_splice.c')
-rw-r--r--tcp_splice.c1
1 files changed, 1 insertions, 0 deletions
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"