Skip to content

Commit fa4ee21

Browse files
committed
MINOR: mux-quic: encapsulate QCC tasklet wakeup
QUIC MUX will be responsible to drive emission with pacing. This will be implemented via setting TASK_F_USR1 before I/O tasklet wakeup. To prepare this, encapsulate each I/O tasklet wakeup into a new function qcc_wakeup(). This commit is purely refactoring prior to pacing implementation into QUIC MUX.
1 parent 1608cb3 commit fa4ee21

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

include/haproxy/mux_quic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ static inline void qcs_wait_http_req(struct qcs *qcs)
124124

125125
void qcc_show_quic(struct qcc *qcc);
126126

127+
void qcc_wakeup(struct qcc *qcc);
128+
127129
#endif /* USE_QUIC */
128130

129131
#endif /* _HAPROXY_MUX_QUIC_H */

src/mux_quic.c

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,11 @@ static void qcc_refresh_timeout(struct qcc *qcc)
395395
TRACE_LEAVE(QMUX_EV_QCS_NEW, qcc->conn);
396396
}
397397

398+
void qcc_wakeup(struct qcc *qcc)
399+
{
400+
tasklet_wakeup(qcc->wait_event.tasklet);
401+
}
402+
398403
/* Mark a stream as open if it was idle. This can be used on every
399404
* successful emission/reception operation to update the stream state.
400405
*/
@@ -720,7 +725,7 @@ void qcc_set_error(struct qcc *qcc, int err, int app)
720725
* is too tedious too not forget a wakeup outside of this function for
721726
* the moment.
722727
*/
723-
tasklet_wakeup(qcc->wait_event.tasklet);
728+
qcc_wakeup(qcc);
724729
}
725730

726731
/* Increment glitch counter for <qcc> connection by <inc> steps. If configured
@@ -1074,7 +1079,7 @@ static void qcs_consume(struct qcs *qcs, uint64_t bytes)
10741079
frm->max_stream_data.max_stream_data = qcs->rx.msd;
10751080

10761081
LIST_APPEND(&qcc->lfctl.frms, &frm->list);
1077-
tasklet_wakeup(qcc->wait_event.tasklet);
1082+
qcc_wakeup(qcc);
10781083
}
10791084

10801085
conn_fctl:
@@ -1092,7 +1097,7 @@ static void qcs_consume(struct qcs *qcs, uint64_t bytes)
10921097
frm->max_data.max_data = qcc->lfctl.md;
10931098

10941099
LIST_APPEND(&qcs->qcc->lfctl.frms, &frm->list);
1095-
tasklet_wakeup(qcs->qcc->wait_event.tasklet);
1100+
qcc_wakeup(qcc);
10961101
}
10971102

10981103
TRACE_LEAVE(QMUX_EV_QCS_RECV, qcc->conn, qcs);
@@ -1352,7 +1357,7 @@ void qcc_reset_stream(struct qcs *qcs, int err)
13521357
}
13531358

13541359
qcc_send_stream(qcs, 1, 0);
1355-
tasklet_wakeup(qcc->wait_event.tasklet);
1360+
qcc_wakeup(qcc);
13561361
}
13571362

13581363
/* Register <qcs> stream for emission of STREAM, STOP_SENDING or RESET_STREAM.
@@ -1400,7 +1405,7 @@ void qcc_abort_stream_read(struct qcs *qcs)
14001405
qcs->flags |= (QC_SF_TO_STOP_SENDING|QC_SF_READ_ABORTED);
14011406

14021407
qcc_send_stream(qcs, 1, 0);
1403-
tasklet_wakeup(qcc->wait_event.tasklet);
1408+
qcc_wakeup(qcc);
14041409

14051410
end:
14061411
TRACE_LEAVE(QMUX_EV_QCC_NEW, qcc->conn, qcs);
@@ -1433,7 +1438,7 @@ int qcc_install_app_ops(struct qcc *qcc, const struct qcc_app_ops *app_ops)
14331438
TRACE_ERROR("app ops finalize error", QMUX_EV_QCC_NEW, qcc->conn);
14341439
goto err;
14351440
}
1436-
tasklet_wakeup(qcc->wait_event.tasklet);
1441+
qcc_wakeup(qcc);
14371442
}
14381443

14391444
TRACE_LEAVE(QMUX_EV_QCC_NEW, qcc->conn);
@@ -1612,7 +1617,7 @@ int qcc_recv_max_data(struct qcc *qcc, uint64_t max)
16121617
TRACE_DATA("increase remote max-data", QMUX_EV_QCC_RECV, qcc->conn);
16131618

16141619
if (unblock_real)
1615-
tasklet_wakeup(qcc->wait_event.tasklet);
1620+
qcc_wakeup(qcc);
16161621

16171622
if (unblock_soft)
16181623
qcc_notify_fctl(qcc);
@@ -1658,7 +1663,7 @@ int qcc_recv_max_stream_data(struct qcc *qcc, uint64_t id, uint64_t max)
16581663
TRACE_DATA("increase remote max-stream-data", QMUX_EV_QCC_RECV|QMUX_EV_QCS_RECV, qcc->conn, qcs);
16591664
if (unblock_real) {
16601665
/* TODO optim: only wakeup IO-CB if stream has data to sent. */
1661-
tasklet_wakeup(qcc->wait_event.tasklet);
1666+
qcc_wakeup(qcc);
16621667
}
16631668

16641669
if (unblock_soft) {
@@ -1908,7 +1913,7 @@ static int qcc_release_remote_stream(struct qcc *qcc, uint64_t id)
19081913
frm->max_streams_bidi.max_streams = qcc->lfctl.ms_bidi +
19091914
qcc->lfctl.cl_bidi_r;
19101915
LIST_APPEND(&qcc->lfctl.frms, &frm->list);
1911-
tasklet_wakeup(qcc->wait_event.tasklet);
1916+
qcc_wakeup(qcc);
19121917

19131918
qcc->lfctl.ms_bidi += qcc->lfctl.cl_bidi_r;
19141919
qcc->lfctl.cl_bidi_r = 0;
@@ -2415,7 +2420,7 @@ static int qcc_io_send(struct qcc *qcc)
24152420
}
24162421

24172422
if (!qfctl_rblocked(&qcc->tx.fc))
2418-
tasklet_wakeup(qcc->wait_event.tasklet);
2423+
qcc_wakeup(qcc);
24192424
}
24202425

24212426
out:
@@ -2958,7 +2963,7 @@ static int qmux_init(struct connection *conn, struct proxy *prx,
29582963
LIST_APPEND(&mux_stopping_data[tid].list, &conn->stopping_list);
29592964

29602965
/* init read cycle */
2961-
tasklet_wakeup(qcc->wait_event.tasklet);
2966+
qcc_wakeup(qcc);
29622967

29632968
TRACE_LEAVE(QMUX_EV_QCC_NEW, conn);
29642969
return 0;
@@ -3104,7 +3109,7 @@ static size_t qmux_strm_rcv_buf(struct stconn *sc, struct buffer *buf,
31043109

31053110
qcs->flags &= ~QC_SF_DEM_FULL;
31063111
if (!(qcc->flags & QC_CF_ERRL))
3107-
tasklet_wakeup(qcc->wait_event.tasklet);
3112+
qcc_wakeup(qcc);
31083113
}
31093114

31103115
TRACE_LEAVE(QMUX_EV_STRM_RECV, qcc->conn, qcs);
@@ -3168,7 +3173,7 @@ static size_t qmux_strm_snd_buf(struct stconn *sc, struct buffer *buf,
31683173
if (data || fin)
31693174
qcc_send_stream(qcs, 0, data);
31703175
if (!(qcs->qcc->wait_event.events & SUB_RETRY_SEND))
3171-
tasklet_wakeup(qcs->qcc->wait_event.tasklet);
3176+
qcc_wakeup(qcs->qcc);
31723177
}
31733178

31743179
end:
@@ -3289,7 +3294,7 @@ static size_t qmux_strm_done_ff(struct stconn *sc)
32893294
if (data || qcs->flags & QC_SF_FIN_STREAM)
32903295
qcc_send_stream(qcs, 0, data);
32913296
if (!(qcs->qcc->wait_event.events & SUB_RETRY_SEND))
3292-
tasklet_wakeup(qcc->wait_event.tasklet);
3297+
qcc_wakeup(qcc);
32933298

32943299
end:
32953300
TRACE_LEAVE(QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs);
@@ -3387,7 +3392,7 @@ static void qmux_strm_shut(struct stconn *sc, unsigned int mode, struct se_abort
33873392
qcc_reset_stream(qcs, 0);
33883393
}
33893394

3390-
tasklet_wakeup(qcc->wait_event.tasklet);
3395+
qcc_wakeup(qcc);
33913396
}
33923397

33933398
out:

src/quic_conn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,7 @@ void qc_notify_err(struct quic_conn *qc)
18071807
* is made between MUX and quic-conn layer, wake up could be
18081808
* conducted only with qc.subs.
18091809
*/
1810-
tasklet_wakeup(qc->qcc->wait_event.tasklet);
1810+
qcc_wakeup(qc->qcc);
18111811
}
18121812

18131813
TRACE_LEAVE(QUIC_EV_CONN_CLOSE, qc);

0 commit comments

Comments
 (0)