mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
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.
This commit is contained in:
parent
88c5695c67
commit
83cd51e87a
@ -734,8 +734,6 @@ struct quic_conn {
|
|||||||
struct quic_transport_params params;
|
struct quic_transport_params params;
|
||||||
/* RX buffer */
|
/* RX buffer */
|
||||||
struct buffer buf;
|
struct buffer buf;
|
||||||
/* RX buffer read/write lock */
|
|
||||||
__decl_thread(HA_RWLOCK_T buf_rwlock);
|
|
||||||
struct list pkt_list;
|
struct list pkt_list;
|
||||||
} rx;
|
} rx;
|
||||||
struct {
|
struct {
|
||||||
|
@ -3650,7 +3650,6 @@ static struct quic_conn *qc_new_conn(unsigned int version, int ipv4,
|
|||||||
qc->rx.bytes = 0;
|
qc->rx.bytes = 0;
|
||||||
qc->rx.nb_ack_eliciting = 0;
|
qc->rx.nb_ack_eliciting = 0;
|
||||||
qc->rx.buf = b_make(buf_area, QUIC_CONN_RX_BUFSZ, 0, 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);
|
LIST_INIT(&qc->rx.pkt_list);
|
||||||
if (!quic_tls_ku_init(qc)) {
|
if (!quic_tls_ku_init(qc)) {
|
||||||
TRACE_PROTO("Key update initialization failed", QUIC_EV_CONN_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;
|
pkt->raw_len = pkt->len;
|
||||||
HA_RWLOCK_WRLOCK(QUIC_LOCK, &qc->rx.buf_rwlock);
|
|
||||||
quic_rx_pkts_del(qc);
|
quic_rx_pkts_del(qc);
|
||||||
b_cspace = b_contig_space(&qc->rx.buf);
|
b_cspace = b_contig_space(&qc->rx.buf);
|
||||||
if (b_cspace < pkt->len) {
|
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);
|
b_add(&qc->rx.buf, b_cspace);
|
||||||
if (b_contig_space(&qc->rx.buf) < pkt->len) {
|
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);
|
TRACE_PROTO("Too big packet", QUIC_EV_CONN_LPKT, qc, pkt, &pkt->len);
|
||||||
qc_list_all_rx_pkts(qc);
|
qc_list_all_rx_pkts(qc);
|
||||||
goto err;
|
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)) {
|
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);
|
TRACE_PROTO("Packet dropped", QUIC_EV_CONN_LPKT, qc);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &qc->rx.buf_rwlock);
|
|
||||||
TRACE_PROTO("New packet", QUIC_EV_CONN_LPKT, qc, pkt);
|
TRACE_PROTO("New packet", QUIC_EV_CONN_LPKT, qc, pkt);
|
||||||
if (pkt->aad_len)
|
if (pkt->aad_len)
|
||||||
qc_pkt_insert(pkt, qel);
|
qc_pkt_insert(pkt, qel);
|
||||||
|
Loading…
Reference in New Issue
Block a user