1
0
Fork 0
mirror of https://passt.top/passt synced 2025-05-21 00:35:34 +02:00

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>
This commit is contained in:
David Gibson 2023-11-30 13:02:16 +11:00 committed by Stefano Brivio
parent 31bab5f2d9
commit ecea8d36ff
3 changed files with 10 additions and 10 deletions

View file

@ -76,8 +76,8 @@ enum epoll_type {
* union epoll_ref - Breakdown of reference for epoll fd bookkeeping
* @type: Type of fd (tells us what to do with events)
* @fd: File descriptor number (implies < 2^24 total descriptors)
* @tcp: TCP-specific reference part (connected sockets)
* @tcp_listen: TCP-specific reference part (listening sockets)
* @flow: Index of the flow this fd is linked to
* @tcp_listen: TCP-specific reference part for listening sockets
* @udp: UDP-specific reference part
* @icmp: ICMP-specific reference part
* @data: Data handled by protocol handlers
@ -90,7 +90,7 @@ union epoll_ref {
#define FD_REF_MAX ((int)MAX_FROM_BITS(FD_REF_BITS))
int32_t fd:FD_REF_BITS;
union {
union tcp_epoll_ref tcp;
uint32_t flow;
union tcp_listen_epoll_ref tcp_listen;
union udp_epoll_ref udp;
union icmp_epoll_ref icmp;