]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: quic: respect the threads assigned to a bind line
authorWilly Tarreau <w@1wt.eu>
Thu, 13 Oct 2022 14:14:11 +0000 (16:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Oct 2022 16:08:05 +0000 (18:08 +0200)
commitf5a0c8abf5e8ee35ad4cbe92414e3d25a55d30f8
tree72bcf3632751b46004b09a01ff0d2c63c37dc572
parentec1f8a62cab5666d0aa6b5cd8513b2661ce6d8fd
MEDIUM: quic: respect the threads assigned to a bind line

Right now the QUIC thread mapping derives the thread ID from the CID
by dividing by global.nbthread. This is a problem because this makes
QUIC work on all threads and ignores the "thread" directive on the
bind lines. In addition, only 8 bits are used, which is no more
compatible with the up to 4096 threads we may have in a configuration.

Let's modify it this way:
  - the CID now dedicates 12 bits to the thread ID
  - on output we continue to place the TID directly there.
  - on input, the value is extracted. If it corresponds to a valid
    thread number of the bind_conf, it's used as-is.
  - otherwise it's used as a rank within the current bind_conf's
    thread mask so that in the end we still get a valid thread ID
    for this bind_conf.

The extraction function now requires a bind_conf in order to get the
group and thread mask. It was better to use bind_confs now as the goal
is to make them support multiple listeners sooner or later.
include/haproxy/quic_conn.h
src/quic_conn.c
src/quic_sock.c