From: Frédéric Lécaille Date: Wed, 2 Feb 2022 09:51:50 +0000 (+0100) Subject: MINOR: quic: Remove an RX buffer useless lock X-Git-Tag: v2.6-dev2~169 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83cd51e87a2e233bb4f256a4a2e5715342497ca9;p=thirdparty%2Fhaproxy.git MINOR: quic: Remove an RX buffer useless lock This lock is no more useful: the RX buffer for a connection is always handled by the same thread. --- diff --git a/include/haproxy/xprt_quic-t.h b/include/haproxy/xprt_quic-t.h index 0f1004fd84..66912ef482 100644 --- a/include/haproxy/xprt_quic-t.h +++ b/include/haproxy/xprt_quic-t.h @@ -734,8 +734,6 @@ struct quic_conn { struct quic_transport_params params; /* RX buffer */ struct buffer buf; - /* RX buffer read/write lock */ - __decl_thread(HA_RWLOCK_T buf_rwlock); struct list pkt_list; } rx; struct { diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 361a6431fb..ddbe031476 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -3650,7 +3650,6 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4, qc->rx.bytes = 0; qc->rx.nb_ack_eliciting = 0; qc->rx.buf = b_make(buf_area, QUIC_CONN_RX_BUFSZ, 0, 0); - HA_RWLOCK_INIT(&qc->rx.buf_rwlock); LIST_INIT(&qc->rx.pkt_list); if (!quic_tls_ku_init(qc)) { TRACE_PROTO("Key update initialization failed", QUIC_EV_CONN_INIT, qc); @@ -4467,7 +4466,6 @@ static ssize_t qc_lstnr_pkt_rcv(unsigned char *buf, const unsigned char *end, } pkt->raw_len = pkt->len; - HA_RWLOCK_WRLOCK(QUIC_LOCK, &qc->rx.buf_rwlock); quic_rx_pkts_del(qc); b_cspace = b_contig_space(&qc->rx.buf); if (b_cspace < pkt->len) { @@ -4478,7 +4476,6 @@ static ssize_t qc_lstnr_pkt_rcv(unsigned char *buf, const unsigned char *end, } b_add(&qc->rx.buf, b_cspace); if (b_contig_space(&qc->rx.buf) < pkt->len) { - HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &qc->rx.buf_rwlock); TRACE_PROTO("Too big packet", QUIC_EV_CONN_LPKT, qc, pkt, &pkt->len); qc_list_all_rx_pkts(qc); goto err; @@ -4486,12 +4483,10 @@ static ssize_t qc_lstnr_pkt_rcv(unsigned char *buf, const unsigned char *end, } if (!qc_try_rm_hp(qc, pkt, payload, beg, end, &qel)) { - HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &qc->rx.buf_rwlock); TRACE_PROTO("Packet dropped", QUIC_EV_CONN_LPKT, qc); goto err; } - HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &qc->rx.buf_rwlock); TRACE_PROTO("New packet", QUIC_EV_CONN_LPKT, qc, pkt); if (pkt->aad_len) qc_pkt_insert(pkt, qel);