diff options
| author | Laurent Vivier <lvivier@redhat.com> | 2025-10-21 23:01:13 +0200 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2025-10-30 15:32:50 +0100 |
| commit | dd5302dd7bf518aa2c50a9819ee06ea2d6fd0061 (patch) | |
| tree | 3bad20da87579b02e9f848ebbbfbc89b51ea4370 /test | |
| parent | 05972c7c4daf0b2479a415bf7240944b999d9081 (diff) | |
| download | passt-dd5302dd7bf518aa2c50a9819ee06ea2d6fd0061.tar passt-dd5302dd7bf518aa2c50a9819ee06ea2d6fd0061.tar.gz passt-dd5302dd7bf518aa2c50a9819ee06ea2d6fd0061.tar.bz2 passt-dd5302dd7bf518aa2c50a9819ee06ea2d6fd0061.tar.lz passt-dd5302dd7bf518aa2c50a9819ee06ea2d6fd0061.tar.xz passt-dd5302dd7bf518aa2c50a9819ee06ea2d6fd0061.tar.zst passt-dd5302dd7bf518aa2c50a9819ee06ea2d6fd0061.zip | |
tcp, flow: Replace per-connection in_epoll flag with an epollid in flow_common
The in_epoll boolean flag in tcp_tap_conn and tcp_splice_conn only tracked
whether a connection was registered with epoll, not which epoll instance.
This limited flexibility for future multi-epoll support.
Replace the boolean with an epollid field in flow_common that identifies
which epoll instance the flow is registered with.
Use FLOW_EPOLLID_INVALID to indicate when a flow is not registered with
any epoll instance. An epoll_id_to_fd[] mapping table translates
epoll ids to their corresponding epoll file descriptors.
Add helper functions:
- flow_in_epoll() to check if a flow is registered with epoll
- flow_epollfd() to retrieve the epoll fd for a flow's thread
- flow_epollid_register() to register an epoll fd with an epollid
- flow_epollid_set() to set the epollid of a flow
- flow_epollid_clear() to reset the epoll id of a flow
This change also simplifies tcp_timer_ctl() and conn_flag_do() by removing
the need to pass the context 'c', since the epoll fd is now directly
accessible from the flow structure via flow_epollfd().
Add a defensive check at the beginning of tcp_flow_repair_queue() to
avoid a false positive with "make clang-tidy":
error: The 1st argument to 'send' is < 0 but should be >= 0
3230 | ssize_t rc = send(conn->sock, p, MIN(len, chunk), 0);
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions
