diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2022-11-17 16:58:49 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-11-25 01:35:00 +0100 |
commit | 433604a581604fe8acfa9a9022b9c29305642ab7 (patch) | |
tree | dff0150f556e9d7cc940c6d736ca6f9d28630403 /tcp_splice.c | |
parent | 34476511f724d52ef4d944627ee741e33c1ba3d7 (diff) | |
download | passt-433604a581604fe8acfa9a9022b9c29305642ab7.tar passt-433604a581604fe8acfa9a9022b9c29305642ab7.tar.gz passt-433604a581604fe8acfa9a9022b9c29305642ab7.tar.bz2 passt-433604a581604fe8acfa9a9022b9c29305642ab7.tar.lz passt-433604a581604fe8acfa9a9022b9c29305642ab7.tar.xz passt-433604a581604fe8acfa9a9022b9c29305642ab7.tar.zst passt-433604a581604fe8acfa9a9022b9c29305642ab7.zip |
tcp: Unify the IN_EPOLL flag
There is very little common between the tcp_tap_conn and tcp_splice_conn
structures. However, both do have an IN_EPOLL flag which has the same
meaning in each case, though it's stored in a different location.
Simplify things slightly by moving this bit into the common header of the
two structures.
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 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tcp_splice.c b/tcp_splice.c index 0ac316d..7a06252 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -83,8 +83,8 @@ static const char *tcp_splice_event_str[] __attribute((__unused__)) = { /* Display strings for connection flags */ static const char *tcp_splice_flag_str[] __attribute((__unused__)) = { - "SPLICE_V6", "SPLICE_IN_EPOLL", "RCVLOWAT_SET_A", "RCVLOWAT_SET_B", - "RCVLOWAT_ACT_A", "RCVLOWAT_ACT_B", "CLOSING", + "SPLICE_V6", "RCVLOWAT_SET_A", "RCVLOWAT_SET_B", "RCVLOWAT_ACT_A", + "RCVLOWAT_ACT_B", "CLOSING", }; /** @@ -164,7 +164,7 @@ static void conn_flag_do(const struct ctx *c, struct tcp_splice_conn *conn, static int tcp_splice_epoll_ctl(const struct ctx *c, struct tcp_splice_conn *conn) { - int m = (conn->flags & SPLICE_IN_EPOLL) ? EPOLL_CTL_MOD : EPOLL_CTL_ADD; + int m = conn->c.in_epoll ? EPOLL_CTL_MOD : EPOLL_CTL_ADD; union epoll_ref ref_a = { .r.proto = IPPROTO_TCP, .r.s = conn->a, .r.p.tcp.tcp.splice = 1, .r.p.tcp.tcp.index = CONN_IDX(conn), @@ -188,7 +188,7 @@ static int tcp_splice_epoll_ctl(const struct ctx *c, epoll_ctl(c->epollfd, m, conn->b, &ev_b)) goto delete; - conn->flags |= SPLICE_IN_EPOLL; /* No need to log this */ + conn->c.in_epoll = true; return 0; |