From 433604a581604fe8acfa9a9022b9c29305642ab7 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 17 Nov 2022 16:58:49 +1100 Subject: 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 Signed-off-by: Stefano Brivio --- tcp_conn.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tcp_conn.h') diff --git a/tcp_conn.h b/tcp_conn.h index 7c450a0..faa63dc 100644 --- a/tcp_conn.h +++ b/tcp_conn.h @@ -14,9 +14,11 @@ /** * struct tcp_conn_common - Common fields for spliced and non-spliced * @spliced: Is this a spliced connection? + * @in_epoll: Is the connection in the epoll set? */ struct tcp_conn_common { bool spliced :1; + bool in_epoll :1; }; extern const char *tcp_common_flag_str[]; @@ -90,10 +92,9 @@ struct tcp_tap_conn { #define STALLED BIT(0) #define LOCAL BIT(1) #define WND_CLAMPED BIT(2) -#define IN_EPOLL BIT(3) -#define ACTIVE_CLOSE BIT(4) -#define ACK_TO_TAP_DUE BIT(5) -#define ACK_FROM_TAP_DUE BIT(6) +#define ACTIVE_CLOSE BIT(3) +#define ACK_TO_TAP_DUE BIT(4) +#define ACK_FROM_TAP_DUE BIT(5) unsigned int hash_bucket :TCP_HASH_BUCKET_BITS; @@ -170,12 +171,11 @@ struct tcp_splice_conn { uint8_t flags; #define SPLICE_V6 BIT(0) -#define SPLICE_IN_EPOLL BIT(1) -#define RCVLOWAT_SET_A BIT(2) -#define RCVLOWAT_SET_B BIT(3) -#define RCVLOWAT_ACT_A BIT(4) -#define RCVLOWAT_ACT_B BIT(5) -#define CLOSING BIT(6) +#define RCVLOWAT_SET_A BIT(1) +#define RCVLOWAT_SET_B BIT(2) +#define RCVLOWAT_ACT_A BIT(3) +#define RCVLOWAT_ACT_B BIT(4) +#define CLOSING BIT(5) uint32_t a_read; uint32_t a_written; -- cgit v1.2.3