1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-14 19:35:35 +02:00

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>
This commit is contained in:
David Gibson 2022-11-17 16:58:49 +11:00 committed by Stefano Brivio
parent 34476511f7
commit 433604a581
3 changed files with 19 additions and 19 deletions

View file

@ -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;