]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: quic: implement GSO fallback mechanism
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 10 Jul 2024 08:54:43 +0000 (10:54 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 11 Jul 2024 09:02:44 +0000 (11:02 +0200)
commitd0ea173e35342cabc806ba4c2597acc195e86eb2
treedf0ab506ec2806e82d2625926f3c596f08317147
parentaf22792a43dc88af252f2c9e95ad78063be94049
MEDIUM: quic: implement GSO fallback mechanism

UDP GSO on Linux is not implemented in every network devices. For
example, this is not available for veth devices frequently used in
container environment. In such case, EIO is reported on send()
invocation.

It is impossible to test at startup for proper GSO support in this case
as a listener may be bound on multiple network interfaces. Furthermore,
network interfaces may change during haproxy lifetime.

As such, the only option is to react on send syscall error when GSO is
used. The purpose of this patch is to implement a fallback when
encountering such conditions. Emission can be retried immediately by
trying to send each prepared datagrams individually.

To support this, qc_send_ppkts() is able to iterate over each datagram
in a so-called non-GSO fallback mode. Between each emission, a datagram
header is rewritten in front of the buffer which allows the sending loop
to proceed until last datagram is emitted.

To complement this, quic_conn listener is flagged on first GSO send
error with value LI_F_UDP_GSO_NOTSUPP. This completely disables GSO for
all future emission with QUIC connections using this listener.

For the moment, non-GSO fallback mode is activated when EIO is reported
after GSO has been set. This is the error reported for the veth usage
described above.
include/haproxy/listener-t.h
src/quic_sock.c
src/quic_tx.c