]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-quic: use shorter name for flow-control fields
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 21 Mar 2022 16:13:32 +0000 (17:13 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 23 Mar 2022 09:05:29 +0000 (10:05 +0100)
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.

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

index e7ae2331f54a8cd57a27f1accabe5394b25e5496..a5d4d2d23adf1aaf6fc051a67cf0561e9c3a9e6c 100644 (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;
 
index e5dddeeae264bc2dbdcd85a90e8eef6e3817cd67..e239856702dbcba515166f8b2946c7413d1282c2 100644 (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)