diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2023-09-22 23:35:08 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-10-04 23:39:58 +0200 |
commit | a469fc393fa1dfadc7c51c2729550597ee171a8e (patch) | |
tree | b8252a1d499ec87a2f20ffb187c53c7d17c77bcc /tap.h | |
parent | d3192f67c492f6caa3d0779ae016c34e3d847b22 (diff) | |
download | passt-a469fc393fa1dfadc7c51c2729550597ee171a8e.tar passt-a469fc393fa1dfadc7c51c2729550597ee171a8e.tar.gz passt-a469fc393fa1dfadc7c51c2729550597ee171a8e.tar.bz2 passt-a469fc393fa1dfadc7c51c2729550597ee171a8e.tar.lz passt-a469fc393fa1dfadc7c51c2729550597ee171a8e.tar.xz passt-a469fc393fa1dfadc7c51c2729550597ee171a8e.tar.zst passt-a469fc393fa1dfadc7c51c2729550597ee171a8e.zip |
tcp, tap: Don't increase tap-side sequence counter for dropped frames
...so that we'll retry sending them, instead of more-or-less silently
dropping them. This happens quite frequently if our sending buffer on
the UNIX domain socket is heavily constrained (for instance, by the
208 KiB default memory limit).
It might be argued that dropping frames is part of the expected TCP
flow: we don't dequeue those from the socket anyway, so we'll
eventually retransmit them.
But we don't need the receiver to tell us (by the way of duplicate or
missing ACKs) that we couldn't send them: we already know as
sendmsg() reports that. This seems to considerably increase
throughput stability and throughput itself for TCP connections with
default wmem_max values.
Unfortunately, the 16 bits left as padding in the frame descriptors
we use internally aren't enough to uniquely identify for which
connection we should update sequence numbers: create a parallel
array of pointers to sequence numbers and L4 lengths, of
TCP_FRAMES_MEM size, and go through it after calling sendmsg().
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tap.h')
-rw-r--r-- | tap.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -73,7 +73,7 @@ void tap_icmp6_send(const struct ctx *c, const struct in6_addr *src, const struct in6_addr *dst, const void *in, size_t len); int tap_send(const struct ctx *c, const void *data, size_t len); -void tap_send_frames(const struct ctx *c, const struct iovec *iov, size_t n); +size_t tap_send_frames(const struct ctx *c, const struct iovec *iov, size_t n); void tap_update_mac(struct tap_hdr *taph, const unsigned char *eth_d, const unsigned char *eth_s); void tap_listen_handler(struct ctx *c, uint32_t events); |