]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: remove TID ref from quic_conn
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 13 Apr 2023 09:48:38 +0000 (11:48 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Apr 2023 14:20:47 +0000 (16:20 +0200)
Remove <tid> member in quic_conn. This is moved to quic_connection_id
instance.

For the moment, this change has no impact. Indeed, qc.tid reference
could easily be replaced by tid as all of this work was already done on
the connection thread. However, it is planified to support quic_conn
thread migration in the future, so removal of qc.tid will simplify this.

This should be backported up to 2.7.

include/haproxy/quic_conn-t.h
src/quic_conn.c
src/quic_sock.c

index 5e6b5d6c093ab4573bbd2e1b0e0982c593a0a9ce..d366a0b4880a19f0b2d48d0c0d42d24b578d06d0 100644 (file)
@@ -646,8 +646,6 @@ struct quic_conn {
        int fd;
        /* QUIC transport parameters TLS extension */
        int tps_tls_ext;
-       /* Thread ID this connection is attached to */
-       int tid;
        int state;
        enum qc_mux_state mux_state; /* status of the connection/mux layer */
        struct quic_err err;
index 710f236b6093115be033e275e7d11dc0be18a68e..e1725e5c9b1b8b2f285f8d9d740e24af98994f8a 100644 (file)
@@ -5573,11 +5573,6 @@ static struct quic_conn *qc_new_conn(const struct quic_version *qv, int ipv4,
        qc->wait_event.tasklet->process = quic_conn_io_cb;
        qc->wait_event.tasklet->context = qc;
        qc->wait_event.events = 0;
-       /* Set tasklet tid based on the SCID selected by us for this
-        * connection. The upper layer will also be binded on the same thread.
-        */
-       qc->tid = quic_get_cid_tid(qc->scid.data, &l->rx);
-       qc->wait_event.tasklet->tid = qc->tid;
        qc->subs = NULL;
 
        if (qc_conn_alloc_ssl_ctx(qc) ||
@@ -5715,7 +5710,7 @@ static int quic_conn_init_timer(struct quic_conn *qc)
        /* Attach this task to the same thread ID used for the connection */
        TRACE_ENTER(QUIC_EV_CONN_NEW, qc);
 
-       qc->timer_task = task_new_on(qc->tid);
+       qc->timer_task = task_new_here();
        if (!qc->timer_task) {
                TRACE_ERROR("timer task allocation failed", QUIC_EV_CONN_NEW, qc);
                goto leave;
@@ -8419,7 +8414,7 @@ static int cli_io_handler_dump_quic(struct appctx *appctx)
                }
 
                /* CIDs */
-               chunk_appendf(&trash, "* %p[%02u]: scid=", qc, qc->tid);
+               chunk_appendf(&trash, "* %p[%02u]: scid=", qc, ctx->thr);
                for (cid_len = 0; cid_len < qc->scid.len; ++cid_len)
                        chunk_appendf(&trash, "%02x", qc->scid.data[cid_len]);
                while (cid_len++ < 20)
index 6dde545e9be3c9350ed5bc2189b5e44316d017db..905ecab85f89c4d194e929bffe0c4f73a8163e56 100644 (file)
@@ -879,8 +879,8 @@ struct quic_accept_queue *quic_accept_queues;
  */
 void quic_accept_push_qc(struct quic_conn *qc)
 {
-       struct quic_accept_queue *queue = &quic_accept_queues[qc->tid];
-       struct li_per_thread *lthr = &qc->li->per_thr[qc->tid];
+       struct quic_accept_queue *queue = &quic_accept_queues[tid];
+       struct li_per_thread *lthr = &qc->li->per_thr[tid];
 
        /* early return if accept is already in progress/done for this
         * connection
@@ -904,7 +904,7 @@ void quic_accept_push_qc(struct quic_conn *qc)
        MT_LIST_APPEND(&lthr->quic_accept.conns, &qc->accept_list);
 
        /* 3. wake up the queue tasklet */
-       tasklet_wakeup(quic_accept_queues[qc->tid].tasklet);
+       tasklet_wakeup(quic_accept_queues[tid].tasklet);
 }
 
 /* Tasklet handler to accept QUIC connections. Call listener_accept on every