diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2022-11-17 16:58:44 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-11-25 01:34:46 +0100 |
commit | ff27fd63cdd95490e2f9f4e67dbf70324ed6ed9b (patch) | |
tree | d31dd7d923497ec221773f92515403abf7348bde /tcp_splice.c | |
parent | 3cf027bd590d1a42dacc0d52dbbc298994902c9b (diff) | |
download | passt-ff27fd63cdd95490e2f9f4e67dbf70324ed6ed9b.tar passt-ff27fd63cdd95490e2f9f4e67dbf70324ed6ed9b.tar.gz passt-ff27fd63cdd95490e2f9f4e67dbf70324ed6ed9b.tar.bz2 passt-ff27fd63cdd95490e2f9f4e67dbf70324ed6ed9b.tar.lz passt-ff27fd63cdd95490e2f9f4e67dbf70324ed6ed9b.tar.xz passt-ff27fd63cdd95490e2f9f4e67dbf70324ed6ed9b.tar.zst passt-ff27fd63cdd95490e2f9f4e67dbf70324ed6ed9b.zip |
tcp: Add connection union type
Currently, the tables for spliced and non-spliced connections are entirely
separate, with different types in different arrays. We want to unify them.
As a first step, create a union type which can represent either a spliced
or non-spliced connection. For them to be distinguishable, the individual
types need to have a common header added, with a bit indicating which type
this structure is.
This comes at the cost of increasing the size of tcp_tap_conn to over one
(64 byte) cacheline. This isn't ideal, but it makes things simpler for now
and we'll re-optimize this later.
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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tcp_splice.c b/tcp_splice.c index cbfab01..d8be91b 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -46,6 +46,7 @@ #include <sys/epoll.h> #include <sys/types.h> #include <sys/socket.h> +#include <assert.h> #include "util.h" #include "passt.h" @@ -554,6 +555,7 @@ void tcp_sock_handler_splice(struct ctx *c, union epoll_ref ref, } conn = CONN(c->tcp.splice_conn_count++); + conn->c.spliced = true; conn->a = s; conn->flags = ref.r.p.tcp.tcp.v6 ? SPLICE_V6 : 0; |