diff options
| author | Laurent Vivier <lvivier@redhat.com> | 2026-01-09 17:54:37 +0100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-01-14 01:07:51 +0100 |
| commit | 23da651ab08e564b84c532f6f93b0817d2ae850f (patch) | |
| tree | 013bf6f9bf4baee9b6fec6c94cf858b2bc01d149 /test/tcp/git: | |
| parent | e0fdfccc1c1a56c58a96d7fd6cc5d532cd780b6f (diff) | |
| download | passt-23da651ab08e564b84c532f6f93b0817d2ae850f.tar passt-23da651ab08e564b84c532f6f93b0817d2ae850f.tar.gz passt-23da651ab08e564b84c532f6f93b0817d2ae850f.tar.bz2 passt-23da651ab08e564b84c532f6f93b0817d2ae850f.tar.lz passt-23da651ab08e564b84c532f6f93b0817d2ae850f.tar.xz passt-23da651ab08e564b84c532f6f93b0817d2ae850f.tar.zst passt-23da651ab08e564b84c532f6f93b0817d2ae850f.zip | |
tcp_splice: Refactor tcp_splice_conn_epoll_events() to per-side computation
The function tcp_splice_conn_epoll_events() currently takes an array of
struct epoll_event and fills in the .events field for both sides using
flow_foreach_sidei() loops.
This works, but the function is doing two conceptually separate things
at once: computing events for side 0 and computing events for side 1.
The OUT_WAIT handling is particularly subtle, as it has cross-side
effects: when OUT_WAIT(sidei) is set, we add EPOLLOUT to ev[sidei] but
also remove EPOLLIN from ev[!sidei].
Refactor to make the function compute events for a single side at a
time, taking sidei as a parameter and returning uint32_t. This makes
the logic more focused and easier to follow. The cross-side effects of
OUT_WAIT are preserved by checking both OUT_WAIT(sidei) and
OUT_WAIT(!sidei) within each call.
The caller tcp_splice_epoll_ctl() now invokes the function twice, once
for each side, making the two-sided nature of the operation explicit.
No functional change.
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/tcp/git:')
0 files changed, 0 insertions, 0 deletions
