MINOR: mux-quic: use shorter name for flow-control fields

Rename the fields used for flow-control in the qcc structure. The
objective is to have shorter name for better readability while keeping
their purpose clear. It will be useful when the flow-control will be
extended with new fields.
This commit is contained in:
Amaury Denoyelle 2022-03-21 17:13:32 +01:00
parent 75d14ad5cb
commit 78396e5ee8
2 changed files with 14 additions and 14 deletions

View File

@ -42,14 +42,14 @@ struct qcc {
} tx;
} strms[QCS_MAX_TYPES];
/* Flow-control related fields which are enforced on our side. */
/* flow-control fields set by us enforced on our side. */
struct {
uint64_t max_bidi_streams; /* max sub-ID of bidi stream allowed for the peer */
uint64_t initial_max_bidi_streams; /* max initial sub-ID of bidi stream allowed for the peer */
uint64_t closed_bidi_streams; /* total count of closed bidi stream since last MAX_STREAMS emission */
uint64_t ms_bidi_init; /* max initial sub-ID of bidi stream allowed for the peer */
uint64_t ms_bidi; /* max sub-ID of bidi stream allowed for the peer */
uint64_t cl_bidi_r; /* total count of closed remote bidi stream since last MAX_STREAMS emission */
} lfctl;
/* Flow-control related fields from the endpoint which we must respect. */
/* flow-control fields set by the peer which we must respect. */
struct {
} rfctl;

View File

@ -134,7 +134,7 @@ struct eb64_node *qcc_get_qcs(struct qcc *qcc, uint64_t id)
/* TODO also checks max-streams for uni streams */
if (quic_stream_is_bidi(id)) {
if (sub_id + 1 > qcc->lfctl.max_bidi_streams) {
if (sub_id + 1 > qcc->lfctl.ms_bidi) {
/* streams limit reached */
goto out;
}
@ -265,7 +265,7 @@ int qcc_decode_qcs(struct qcc *qcc, struct qcs *qcs)
static int qc_is_max_streams_needed(struct qcc *qcc)
{
return qcc->lfctl.closed_bidi_streams > qcc->lfctl.initial_max_bidi_streams / 2;
return qcc->lfctl.cl_bidi_r > qcc->lfctl.ms_bidi_init / 2;
}
/* detaches the QUIC stream from its QCC and releases it to the QCS pool. */
@ -277,7 +277,7 @@ static void qcs_destroy(struct qcs *qcs)
if (quic_stream_is_remote(qcs->qcc, id)) {
if (quic_stream_is_bidi(id)) {
++qcs->qcc->lfctl.closed_bidi_streams;
++qcs->qcc->lfctl.cl_bidi_r;
if (qc_is_max_streams_needed(qcs->qcc))
tasklet_wakeup(qcs->qcc->wait_event.tasklet);
}
@ -628,8 +628,8 @@ static int qc_send_max_streams(struct qcc *qcc)
BUG_ON(!frm); /* TODO handle this properly */
frm->type = QUIC_FT_MAX_STREAMS_BIDI;
frm->max_streams_bidi.max_streams = qcc->lfctl.max_bidi_streams +
qcc->lfctl.closed_bidi_streams;
frm->max_streams_bidi.max_streams = qcc->lfctl.ms_bidi +
qcc->lfctl.cl_bidi_r;
fprintf(stderr, "SET MAX_STREAMS %lu\n", frm->max_streams_bidi.max_streams);
LIST_APPEND(&frms, &frm->list);
@ -637,8 +637,8 @@ static int qc_send_max_streams(struct qcc *qcc)
return 1;
/* save the new limit if the frame has been send. */
qcc->lfctl.max_bidi_streams += qcc->lfctl.closed_bidi_streams;
qcc->lfctl.closed_bidi_streams = 0;
qcc->lfctl.ms_bidi += qcc->lfctl.cl_bidi_r;
qcc->lfctl.cl_bidi_r = 0;
return 0;
}
@ -749,8 +749,8 @@ static int qc_init(struct connection *conn, struct proxy *prx,
qcc->strms[QCS_SRV_UNI].rx.max_data = lparams->initial_max_stream_data_uni;
qcc->strms[QCS_SRV_UNI].tx.max_data = 0;
qcc->lfctl.max_bidi_streams = qcc->lfctl.initial_max_bidi_streams = lparams->initial_max_streams_bidi;
qcc->lfctl.closed_bidi_streams = 0;
qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = lparams->initial_max_streams_bidi;
qcc->lfctl.cl_bidi_r = 0;
qcc->wait_event.tasklet = tasklet_new();
if (!qcc->wait_event.tasklet)