]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Remove a useless lock for CRYPTO frames
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 3 Nov 2021 17:39:59 +0000 (18:39 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 5 Nov 2021 14:20:04 +0000 (15:20 +0100)
->frms_rwlock is an old lock supposed to be used when several threads
could handle the same connection. This is no more the case since this
commit:
 "MINOR: quic: Attach the QUIC connection to a thread."

include/haproxy/xprt_quic-t.h
src/xprt_quic.c

index 7e843ab0979253544b4ac07def409c133554bd66..df4f5b4eb3dbd9b38633deca3210551f6915708e 100644 (file)
@@ -551,8 +551,6 @@ struct quic_enc_level {
                struct {
                        uint64_t offset;
                        struct eb_root frms;
-                       /* <frms> must be protected from concurrent accesses */
-                       __decl_thread(HA_RWLOCK_T frms_rwlock);
                } crypto;
        } rx;
        struct {
index af694cdf72a477a66e3ed4f1d76c1b6a320d8b63..ddd60815e20e217132f8e61b082966f0867a50a0 100644 (file)
@@ -2649,7 +2649,6 @@ static inline int qc_treat_rx_crypto_frms(struct quic_enc_level *el,
        struct eb64_node *node;
 
        TRACE_ENTER(QUIC_EV_CONN_RXCDATA, ctx->conn);
-       HA_RWLOCK_WRLOCK(QUIC_LOCK, &el->rx.crypto.frms_rwlock);
        node = eb64_first(&el->rx.crypto.frms);
        while (node) {
                struct quic_rx_crypto_frm *cf;
@@ -2666,12 +2665,10 @@ static inline int qc_treat_rx_crypto_frms(struct quic_enc_level *el,
                eb64_delete(&cf->offset_node);
                pool_free(pool_head_quic_rx_crypto_frm, cf);
        }
-       HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &el->rx.crypto.frms_rwlock);
        TRACE_LEAVE(QUIC_EV_CONN_RXCDATA, ctx->conn);
        return 1;
 
  err:
-       HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &el->rx.crypto.frms_rwlock);
        TRACE_DEVEL("leaving in error", QUIC_EV_CONN_RXCDATA, ctx->conn);
        return 0;
 }
@@ -2878,7 +2875,6 @@ static int quic_conn_enc_level_init(struct quic_conn *qc,
        MT_LIST_INIT(&qel->rx.pqpkts);
        qel->rx.crypto.offset = 0;
        qel->rx.crypto.frms = EB_ROOT_UNIQUE;
-       HA_RWLOCK_INIT(&qel->rx.crypto.frms_rwlock);
 
        /* Allocate only one buffer. */
        qel->tx.crypto.bufs = malloc(sizeof *qel->tx.crypto.bufs);