]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: fd: make fd_insert() take local thread masks
authorWilly Tarreau <w@1wt.eu>
Thu, 7 Jul 2022 06:29:00 +0000 (08:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Jul 2022 18:16:30 +0000 (20:16 +0200)
fd_insert() was already given a thread group ID and a global thread mask.
Now we're changing the few callers to take the group-local thread mask
instead. It's passed directly into the FD's thread mask. Just like for
previous commit, it must not change anything when a single group is
configured.

src/dns.c
src/fd.c
src/sock.c
src/ssl_sock.c

index a77e71fdfb5316c486bdaad42e508e132380f183..7a5ddae980c595c9fc647dbb35c9566a8c5b8ab5 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -74,7 +74,7 @@ static int dns_connect_nameserver(struct dns_nameserver *ns)
 
        /* Add the fd in the fd list and update its parameters */
        dgram->t.sock.fd = fd;
-       fd_insert(fd, dgram, dgram_fd_handler, tgid, all_threads_mask);
+       fd_insert(fd, dgram, dgram_fd_handler, tgid, tg->threads_enabled);
        fd_want_recv(fd);
        return 0;
 }
index d412c28589d5e617d5433a98f5a16b8b99d548a8..5cb4fa1257889bf375ef13ab6aeebe0f9a4e54ac 100644 (file)
--- a/src/fd.c
+++ b/src/fd.c
@@ -855,8 +855,8 @@ static int init_pollers_per_thread()
        poller_rd_pipe = mypipe[0];
        poller_wr_pipe[tid] = mypipe[1];
        fd_set_nonblock(poller_rd_pipe);
-       fd_insert(poller_rd_pipe, poller_pipe_io_handler, poller_pipe_io_handler, tgid, tid_bit);
-       fd_insert(poller_wr_pipe[tid], poller_pipe_io_handler, poller_pipe_io_handler, tgid, tid_bit);
+       fd_insert(poller_rd_pipe, poller_pipe_io_handler, poller_pipe_io_handler, tgid, ti->ltid_bit);
+       fd_insert(poller_wr_pipe[tid], poller_pipe_io_handler, poller_pipe_io_handler, tgid, ti->ltid_bit);
        fd_want_recv(poller_rd_pipe);
        fd_stop_both(poller_wr_pipe[tid]);
        return 1;
index 43e30df1dba86f83cc8dbd1f0af5485f7ced1f7d..a74e8194b2d11c2b6f85fa9e9499fc17d4edba81 100644 (file)
@@ -703,7 +703,7 @@ void sock_accept_iocb(int fd)
 void sock_conn_ctrl_init(struct connection *conn)
 {
        BUG_ON(conn->flags & CO_FL_FDLESS);
-       fd_insert(conn->handle.fd, conn, sock_conn_iocb, tgid, tid_bit);
+       fd_insert(conn->handle.fd, conn, sock_conn_iocb, tgid, ti->ltid_bit);
 }
 
 /* This completes the release of connection <conn> by removing its FD from the
index 00f024023e7efd99cde8eeba025ad1c68af7135e..1d39826e6925e09fe2a7eec8db988d2bd44f3370 100644 (file)
@@ -824,7 +824,7 @@ static inline void ssl_async_process_fds(struct ssl_sock_ctx *ctx)
 
        /* We add new fds to the fdtab */
        for (i=0 ; i < num_add_fds ; i++) {
-               fd_insert(add_fd[i], ctx, ssl_async_fd_handler, tgid, tid_bit);
+               fd_insert(add_fd[i], ctx, ssl_async_fd_handler, tgid, ti->ltid_bit);
        }
 
        num_add_fds = 0;