diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-05-21 16:37:45 +1000 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-05-26 12:21:49 +0200 |
| commit | da0096964cb79752ef152f7d760b3f27997fc59d (patch) | |
| tree | 00e89c0f25b56249a961edfdbcc25369a4a7deea /test/tcp | |
| parent | ac9814efacd984f20da07318d2dcc8bffdc4e669 (diff) | |
| download | passt-da0096964cb79752ef152f7d760b3f27997fc59d.tar passt-da0096964cb79752ef152f7d760b3f27997fc59d.tar.gz passt-da0096964cb79752ef152f7d760b3f27997fc59d.tar.bz2 passt-da0096964cb79752ef152f7d760b3f27997fc59d.tar.lz passt-da0096964cb79752ef152f7d760b3f27997fc59d.tar.xz passt-da0096964cb79752ef152f7d760b3f27997fc59d.tar.zst passt-da0096964cb79752ef152f7d760b3f27997fc59d.zip | |
tcp_splice: Simplify tracking of read/written bytes
For each each direction of each spliced connection, we keep track of how
many bytes we've read from one socket and written to the other. However,
we never actually care about the absolute values of these, only the
difference between them, which represents how much data is currently "in
flight" in the splicing pipe.
Simplify the handling by having a single variable tracking the number of
bytes in the pipe.
As a bonus, the new scheme makes it clearer that we don't need to worry
about overflows: pending can never become larger than the maximum pipe
bufffer size, well within 32-bits.
I _think_ the old scheme was safe in the case of overflow - again under
the assumption that read/written can never be further apart than the pipe
buffer size. However, it's much harder to reason about this case. It's
certainly plausible that an overflow could occur - sending 4GiB through
a local socket is entirely achievable.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/tcp')
0 files changed, 0 insertions, 0 deletions
