MINOR: mux-quic: remove nb_streams from qcc

Remove nb_streams field from qcc. It was not used outside of a BUG_ON()
statement to ensure we never have a negative count of streams. However
this is already checked with other fields.

This should be backported up to 2.7.
This commit is contained in:
Amaury Denoyelle 2023-05-25 10:16:19 +02:00
parent 7b41dfd834
commit 087c5f041b
2 changed files with 0 additions and 14 deletions

View File

@ -41,10 +41,6 @@ struct qcc {
uint64_t nb_hreq; /* number of in-progress http requests */ uint64_t nb_hreq; /* number of in-progress http requests */
uint32_t flags; /* QC_CF_* */ uint32_t flags; /* QC_CF_* */
struct {
uint64_t nb_streams; /* Number of open streams */
} strms[QCS_MAX_TYPES];
/* flow-control fields set by us enforced on our side. */ /* flow-control fields set by us enforced on our side. */
struct { struct {
struct list frms; /* prepared frames related to flow-control */ struct list frms; /* prepared frames related to flow-control */

View File

@ -68,9 +68,6 @@ static void qcs_free(struct qcs *qcs)
qc_free_ncbuf(qcs, &qcs->rx.ncbuf); qc_free_ncbuf(qcs, &qcs->rx.ncbuf);
b_free(&qcs->tx.buf); b_free(&qcs->tx.buf);
BUG_ON(!qcc->strms[qcs_id_type(qcs->id)].nb_streams);
--qcc->strms[qcs_id_type(qcs->id)].nb_streams;
/* Remove qcs from qcc tree. */ /* Remove qcs from qcc tree. */
eb64_delete(&qcs->by_id); eb64_delete(&qcs->by_id);
@ -110,8 +107,6 @@ static struct qcs *qcs_new(struct qcc *qcc, uint64_t id, enum qcs_type type)
qcs->id = qcs->by_id.key = id; qcs->id = qcs->by_id.key = id;
eb64_insert(&qcc->streams_by_id, &qcs->by_id); eb64_insert(&qcc->streams_by_id, &qcs->by_id);
qcc->strms[type].nb_streams++;
/* Allocate transport layer stream descriptor. Only needed for TX. */ /* Allocate transport layer stream descriptor. Only needed for TX. */
if (!quic_stream_is_uni(id) || !quic_stream_is_remote(qcc, id)) { if (!quic_stream_is_uni(id) || !quic_stream_is_remote(qcc, id)) {
struct quic_conn *qc = qcc->conn->handle.qc; struct quic_conn *qc = qcc->conn->handle.qc;
@ -2525,11 +2520,6 @@ static int qc_init(struct connection *conn, struct proxy *prx,
qcc->tx.sent_offsets = qcc->tx.offsets = 0; qcc->tx.sent_offsets = qcc->tx.offsets = 0;
qcc->strms[QCS_CLT_BIDI].nb_streams = 0;
qcc->strms[QCS_CLT_UNI].nb_streams = 0;
qcc->strms[QCS_SRV_BIDI].nb_streams = 0;
qcc->strms[QCS_SRV_UNI].nb_streams = 0;
LIST_INIT(&qcc->lfctl.frms); LIST_INIT(&qcc->lfctl.frms);
qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = lparams->initial_max_streams_bidi; qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = lparams->initial_max_streams_bidi;
qcc->lfctl.ms_uni = lparams->initial_max_streams_uni; qcc->lfctl.ms_uni = lparams->initial_max_streams_uni;