]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: quic: use a global CID trees list
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Apr 2023 09:10:54 +0000 (11:10 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Apr 2023 14:54:17 +0000 (16:54 +0200)
commite83f937cc1b59035b27aa4355efe028ef6ac8ce8
tree29fe429c3c8bf236cda0abbfae9546f656323dcc
parent66947283ba84b43f4f346924a35c7ba85e365c7e
MEDIUM: quic: use a global CID trees list

Previously, quic_connection_id were stored in a per-thread tree list.
Datagram were first dispatched to the correct thread using the encoded
TID before a tree lookup was done.

Remove these trees and replace it with a global trees list of 256
entries. A CID is using the list index corresponding to its first byte.
On datagram dispatch, CID is lookup on its tree and TID is retrieved
using new member quic_connection_id.tid. As such, a read-write lock
protects each list instances. With 256 entries, it is expected that
contention should be reduced.

A new structure quic_cid_tree served as a tree container associated with
its read-write lock. An API is implemented to ensure lock safety for
insert/lookup/delete operation.

This patch is a step forward to be able to break the affinity between a
CID and a TID encoded thread. This is required to be able to migrate a
quic_conn after accept to select thread based on their load.

This should be backported up to 2.7 after a period of observation.
include/haproxy/proto_quic.h
include/haproxy/quic_conn-t.h
include/haproxy/quic_conn.h
include/haproxy/thread.h
src/proto_quic.c
src/quic_conn.c
src/quic_sock.c
src/thread.c