Skip to content

Commit 9c06e91

Browse files
a-denoyellehaproxyFred
authored andcommitted
MINOR: mux-quic: encapsulate QCC tasklet wakeup
1 parent 20bbec7 commit 9c06e91

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
@@ -119,6 +119,8 @@ static inline void qcs_wait_http_req(struct qcs *qcs)
119119

120120
void qcc_show_quic(struct qcc *qcc);
121121

122+
void qcc_wakeup(struct qcc *qcc);
123+
122124
#endif /* USE_QUIC */
123125

124126
#endif /* _HAPROXY_MUX_QUIC_H */

src/mux_quic.c

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

391+
void qcc_wakeup(struct qcc *qcc)
392+
{
393+
tasklet_wakeup(qcc->wait_event.tasklet);
394+
}
395+
391396
/* Mark a stream as open if it was idle. This can be used on every
392397
* successful emission/reception operation to update the stream state.
393398
*/
@@ -713,7 +718,7 @@ void qcc_set_error(struct qcc *qcc, int err, int app)
713718
* is too tedious too not forget a wakeup outside of this function for
714719
* the moment.
715720
*/
716-
tasklet_wakeup(qcc->wait_event.tasklet);
721+
qcc_wakeup(qcc);
717722
}
718723

719724
/* Increment glitch counter for <qcc> connection by <inc> steps. If configured
@@ -1067,7 +1072,7 @@ static void qcs_consume(struct qcs *qcs, uint64_t bytes)
10671072
frm->max_stream_data.max_stream_data = qcs->rx.msd;
10681073

10691074
LIST_APPEND(&qcc->lfctl.frms, &frm->list);
1070-
tasklet_wakeup(qcc->wait_event.tasklet);
1075+
qcc_wakeup(qcc);
10711076
}
10721077

10731078
conn_fctl:
@@ -1085,7 +1090,7 @@ static void qcs_consume(struct qcs *qcs, uint64_t bytes)
10851090
frm->max_data.max_data = qcc->lfctl.md;
10861091

10871092
LIST_APPEND(&qcs->qcc->lfctl.frms, &frm->list);
1088-
tasklet_wakeup(qcs->qcc->wait_event.tasklet);
1093+
qcc_wakeup(qcc);
10891094
}
10901095

10911096
TRACE_LEAVE(QMUX_EV_QCS_RECV, qcc->conn, qcs);
@@ -1345,7 +1350,7 @@ void qcc_reset_stream(struct qcs *qcs, int err)
13451350
}
13461351

13471352
qcc_send_stream(qcs, 1, 0);
1348-
tasklet_wakeup(qcc->wait_event.tasklet);
1353+
qcc_wakeup(qcc);
13491354
}
13501355

13511356
/* Register <qcs> stream for emission of STREAM, STOP_SENDING or RESET_STREAM.
@@ -1393,7 +1398,7 @@ void qcc_abort_stream_read(struct qcs *qcs)
13931398
qcs->flags |= (QC_SF_TO_STOP_SENDING|QC_SF_READ_ABORTED);
13941399

13951400
qcc_send_stream(qcs, 1, 0);
1396-
tasklet_wakeup(qcc->wait_event.tasklet);
1401+
qcc_wakeup(qcc);
13971402

13981403
end:
13991404
TRACE_LEAVE(QMUX_EV_QCC_NEW, qcc->conn, qcs);
@@ -1426,7 +1431,7 @@ int qcc_install_app_ops(struct qcc *qcc, const struct qcc_app_ops *app_ops)
14261431
TRACE_ERROR("app ops finalize error", QMUX_EV_QCC_NEW, qcc->conn);
14271432
goto err;
14281433
}
1429-
tasklet_wakeup(qcc->wait_event.tasklet);
1434+
qcc_wakeup(qcc);
14301435
}
14311436

14321437
TRACE_LEAVE(QMUX_EV_QCC_NEW, qcc->conn);
@@ -1605,7 +1610,7 @@ int qcc_recv_max_data(struct qcc *qcc, uint64_t max)
16051610
TRACE_DATA("increase remote max-data", QMUX_EV_QCC_RECV, qcc->conn);
16061611

16071612
if (unblock_real)
1608-
tasklet_wakeup(qcc->wait_event.tasklet);
1613+
qcc_wakeup(qcc);
16091614

16101615
if (unblock_soft)
16111616
qcc_notify_fctl(qcc);
@@ -1651,7 +1656,7 @@ int qcc_recv_max_stream_data(struct qcc *qcc, uint64_t id, uint64_t max)
16511656
TRACE_DATA("increase remote max-stream-data", QMUX_EV_QCC_RECV|QMUX_EV_QCS_RECV, qcc->conn, qcs);
16521657
if (unblock_real) {
16531658
/* TODO optim: only wakeup IO-CB if stream has data to sent. */
1654-
tasklet_wakeup(qcc->wait_event.tasklet);
1659+
qcc_wakeup(qcc);
16551660
}
16561661

16571662
if (unblock_soft) {
@@ -1901,7 +1906,7 @@ static int qcc_release_remote_stream(struct qcc *qcc, uint64_t id)
19011906
frm->max_streams_bidi.max_streams = qcc->lfctl.ms_bidi +
19021907
qcc->lfctl.cl_bidi_r;
19031908
LIST_APPEND(&qcc->lfctl.frms, &frm->list);
1904-
tasklet_wakeup(qcc->wait_event.tasklet);
1909+
qcc_wakeup(qcc);
19051910

19061911
qcc->lfctl.ms_bidi += qcc->lfctl.cl_bidi_r;
19071912
qcc->lfctl.cl_bidi_r = 0;
@@ -2408,7 +2413,7 @@ static int qcc_io_send(struct qcc *qcc)
24082413
}
24092414

24102415
if (!qfctl_rblocked(&qcc->tx.fc))
2411-
tasklet_wakeup(qcc->wait_event.tasklet);
2416+
qcc_wakeup(qcc);
24122417
}
24132418

24142419
out:
@@ -2951,7 +2956,7 @@ static int qmux_init(struct connection *conn, struct proxy *prx,
29512956
LIST_APPEND(&mux_stopping_data[tid].list, &conn->stopping_list);
29522957

29532958
/* init read cycle */
2954-
tasklet_wakeup(qcc->wait_event.tasklet);
2959+
qcc_wakeup(qcc);
29552960

29562961
TRACE_LEAVE(QMUX_EV_QCC_NEW, conn);
29572962
return 0;
@@ -3097,7 +3102,7 @@ static size_t qmux_strm_rcv_buf(struct stconn *sc, struct buffer *buf,
30973102

30983103
qcs->flags &= ~QC_SF_DEM_FULL;
30993104
if (!(qcc->flags & QC_CF_ERRL))
3100-
tasklet_wakeup(qcc->wait_event.tasklet);
3105+
qcc_wakeup(qcc);
31013106
}
31023107

31033108
TRACE_LEAVE(QMUX_EV_STRM_RECV, qcc->conn, qcs);
@@ -3161,7 +3166,7 @@ static size_t qmux_strm_snd_buf(struct stconn *sc, struct buffer *buf,
31613166
if (data || fin)
31623167
qcc_send_stream(qcs, 0, data);
31633168
if (!(qcs->qcc->wait_event.events & SUB_RETRY_SEND))
3164-
tasklet_wakeup(qcs->qcc->wait_event.tasklet);
3169+
qcc_wakeup(qcs->qcc);
31653170
}
31663171

31673172
end:
@@ -3282,7 +3287,7 @@ static size_t qmux_strm_done_ff(struct stconn *sc)
32823287
if (data || qcs->flags & QC_SF_FIN_STREAM)
32833288
qcc_send_stream(qcs, 0, data);
32843289
if (!(qcs->qcc->wait_event.events & SUB_RETRY_SEND))
3285-
tasklet_wakeup(qcc->wait_event.tasklet);
3290+
qcc_wakeup(qcc);
32863291

32873292
end:
32883293
TRACE_LEAVE(QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs);
@@ -3380,7 +3385,7 @@ static void qmux_strm_shut(struct stconn *sc, unsigned int mode, struct se_abort
33803385
qcc_reset_stream(qcs, 0);
33813386
}
33823387

3383-
tasklet_wakeup(qcc->wait_event.tasklet);
3388+
qcc_wakeup(qcc);
33843389
}
33853390

33863391
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)