]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Rename ->rx.rwlock of quic_enc_level struct to ->rx.pkts_rwlock
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 26 Jul 2021 14:38:14 +0000 (16:38 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Sep 2021 13:27:25 +0000 (15:27 +0200)
As there are at two RW lock in this structure, let's the name of this lock
be more explicit.

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

index 41d585c04a4b9d4fb542f0a1b7ac2eb620e1f524..407071402e0c73de4d51b9e3d4d0b11da62778eb 100644 (file)
@@ -537,8 +537,8 @@ struct quic_enc_level {
                /* The packets received by the listener I/O handler
                   with header protection removed. */
                struct eb_root pkts;
-               /* <pkts> must be protected from concurrent accesses */
-               __decl_thread(HA_RWLOCK_T rwlock);
+               /* <pkts> root must be protected from concurrent accesses */
+               __decl_thread(HA_RWLOCK_T pkts_rwlock);
                /* Liste of QUIC packets with protected header. */
                struct mt_list pqpkts;
                /* Crypto frames */
index cc560a92e13599a37ba41227e7c9599c6d6b8cd1..bbd3764821a42b2fd3ea7b675629bf2fed16ef2f 100644 (file)
@@ -2494,9 +2494,9 @@ static inline void qc_rm_hp_pkts(struct quic_enc_level *el, struct ssl_sock_ctx
                        pqpkt->aad_len = pqpkt->pn_offset + pqpkt->pnl;
                        /* Store the packet into the tree of packets to decrypt. */
                        pqpkt->pn_node.key = pqpkt->pn;
-                       HA_RWLOCK_WRLOCK(QUIC_LOCK, &el->rx.rwlock);
+                       HA_RWLOCK_WRLOCK(QUIC_LOCK, &el->rx.pkts_rwlock);
                        quic_rx_packet_eb64_insert(&el->rx.pkts, &pqpkt->pn_node);
-                       HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &el->rx.rwlock);
+                       HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &el->rx.pkts_rwlock);
                        TRACE_PROTO("hp removed", QUIC_EV_CONN_ELRMHP, ctx->conn, pqpkt);
                }
                MT_LIST_DELETE_SAFE(pkttmp1);
@@ -2551,7 +2551,7 @@ int qc_treat_rx_pkts(struct quic_enc_level *el, struct ssl_sock_ctx *ctx)
 
        TRACE_ENTER(QUIC_EV_CONN_ELRXPKTS, ctx->conn);
        tls_ctx = &el->tls_ctx;
-       HA_RWLOCK_WRLOCK(QUIC_LOCK, &el->rx.rwlock);
+       HA_RWLOCK_WRLOCK(QUIC_LOCK, &el->rx.pkts_rwlock);
        node = eb64_first(&el->rx.pkts);
        while (node) {
                struct quic_rx_packet *pkt;
@@ -2590,7 +2590,7 @@ int qc_treat_rx_pkts(struct quic_enc_level *el, struct ssl_sock_ctx *ctx)
                node = eb64_next(node);
                quic_rx_packet_eb64_delete(&pkt->pn_node);
        }
-       HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &el->rx.rwlock);
+       HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &el->rx.pkts_rwlock);
 
        if (!qc_treat_rx_crypto_frms(el, ctx))
                goto err;
@@ -2717,7 +2717,7 @@ static int quic_conn_enc_level_init(struct quic_conn *qc,
        qel->tls_ctx.tx.flags = 0;
 
        qel->rx.pkts = EB_ROOT;
-       HA_RWLOCK_INIT(&qel->rx.rwlock);
+       HA_RWLOCK_INIT(&qel->rx.pkts_rwlock);
        MT_LIST_INIT(&qel->rx.pqpkts);
        qel->rx.crypto.offset = 0;
        qel->rx.crypto.frms = EB_ROOT_UNIQUE;
@@ -3045,9 +3045,9 @@ static inline int qc_try_rm_hp(struct quic_rx_packet *pkt,
                qpkt_trace = pkt;
                /* Store the packet */
                pkt->pn_node.key = pkt->pn;
-               HA_RWLOCK_WRLOCK(QUIC_LOCK, &qel->rx.rwlock);
+               HA_RWLOCK_WRLOCK(QUIC_LOCK, &qel->rx.pkts_rwlock);
                quic_rx_packet_eb64_insert(&qel->rx.pkts, &pkt->pn_node);
-               HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &qel->rx.rwlock);
+               HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &qel->rx.pkts_rwlock);
        }
        else if (qel) {
                TRACE_PROTO("hp not removed", QUIC_EV_CONN_TRMHP, ctx ? ctx->conn : NULL, pkt);