aboutgitcodebugslistschat
path: root/tcp_splice.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2023-11-30 13:02:16 +1100
committerStefano Brivio <sbrivio@redhat.com>2023-12-04 09:51:20 +0100
commitecea8d36ff921fc27e2dc8270380d824458cda24 (patch)
treebfb62c93ea9e8c041625d1b6b466954da22ef50c /tcp_splice.c
parent31bab5f2d936c1b3d09ecb8bd9e4aeb0ab9f6bf6 (diff)
downloadpasst-ecea8d36ff921fc27e2dc8270380d824458cda24.tar
passt-ecea8d36ff921fc27e2dc8270380d824458cda24.tar.gz
passt-ecea8d36ff921fc27e2dc8270380d824458cda24.tar.bz2
passt-ecea8d36ff921fc27e2dc8270380d824458cda24.tar.lz
passt-ecea8d36ff921fc27e2dc8270380d824458cda24.tar.xz
passt-ecea8d36ff921fc27e2dc8270380d824458cda24.tar.zst
passt-ecea8d36ff921fc27e2dc8270380d824458cda24.zip
flow,tcp: Generalise TCP epoll_ref to generic flows
TCP uses three different epoll object types: one for connected sockets, one for timers and one for listening sockets. Listening sockets really need information that's specific to TCP, so need their own epoll_ref field. Timers and connected sockets, however, only need the connection (flow) they're associated with. As we expand the use of the flow table, we expect that to be true for more epoll fds. So, rename the "TCP" epoll_ref field to be a "flow" epoll_ref field that can be used both for TCP and for other future cases. 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tcp_splice.c b/tcp_splice.c
index cd0fc70..081ce9c 100644
--- a/tcp_splice.c
+++ b/tcp_splice.c
@@ -128,8 +128,8 @@ static int tcp_splice_epoll_ctl(const struct ctx *c,
{
int m = conn->in_epoll ? EPOLL_CTL_MOD : EPOLL_CTL_ADD;
union epoll_ref ref[SIDES] = {
- { .type = EPOLL_TYPE_TCP, .fd = conn->s[0], .tcp.index = FLOW_IDX(conn) },
- { .type = EPOLL_TYPE_TCP, .fd = conn->s[1], .tcp.index = FLOW_IDX(conn) }
+ { .type = EPOLL_TYPE_TCP, .fd = conn->s[0], .flow = FLOW_IDX(conn) },
+ { .type = EPOLL_TYPE_TCP, .fd = conn->s[1], .flow = FLOW_IDX(conn) }
};
struct epoll_event ev[SIDES] = { { .data.u64 = ref[0].u64 },
{ .data.u64 = ref[1].u64 } };