@@ -2087,7 +2087,12 @@ static int qcc_subscribe_send(struct qcc *qcc)
20872087static int qcc_send_frames (struct qcc * qcc , struct list * frms , int strm_content )
20882088{
20892089 enum quic_tx_err ret ;
2090- int max_burst = strm_content ? global .tune .quic_frontend_max_tx_burst : 0 ;
2090+ //int max_burst = strm_content ? global.tune.quic_frontend_max_tx_burst : 0;
2091+
2092+ struct quic_conn * qc = qcc -> conn -> handle .qc ;
2093+ ullong ns_pkts = qc -> path -> loss .srtt * 1000000 / (qc -> path -> cwnd / 1200 + 1 );
2094+ int max_burst = strm_content ? 4000000 / (ns_pkts + 1 ) + 1 : 0 ;
2095+ //int max_burst = 1;
20912096
20922097 TRACE_ENTER (QMUX_EV_QCC_SEND , qcc -> conn );
20932098
@@ -2096,14 +2101,14 @@ static int qcc_send_frames(struct qcc *qcc, struct list *frms, int strm_content)
20962101 return -1 ;
20972102 }
20982103
2099- ret = qc_send_mux (qcc -> conn -> handle .qc , frms , max_burst );
2104+ ret = qc_send_mux (qcc -> conn -> handle .qc , frms , & max_burst );
21002105 if (ret == QUIC_TX_ERR_FATAL ) {
21012106 TRACE_DEVEL ("error on sending" , QMUX_EV_QCC_SEND , qcc -> conn );
21022107 qcc_subscribe_send (qcc );
21032108 goto err ;
21042109 }
21052110
2106- BUG_ON (ret == QUIC_TX_ERR_AGAIN && !max_burst );
2111+ // BUG_ON(ret == QUIC_TX_ERR_AGAIN && !max_burst);
21072112
21082113 /* If there is frames left at this stage, transport layer is blocked.
21092114 * Subscribe on it to retry later.
@@ -2114,6 +2119,10 @@ static int qcc_send_frames(struct qcc *qcc, struct list *frms, int strm_content)
21142119 goto err ;
21152120 }
21162121
2122+ BUG_ON (ret == QUIC_TX_ERR_AGAIN && !max_burst );
2123+ qcc -> tx .next = now_mono_time () + (qc -> path -> loss .srtt * 1000000 / (qc -> path -> cwnd / 1200 + 1 )) * max_burst ;
2124+ //qcc->tx.next = now_mono_time() + (MAX(qc->path->loss.srtt, 10) * 800000 / (qc->path->cwnd / 1200 + 1)) * max_burst;
2125+
21172126 TRACE_LEAVE (QMUX_EV_QCC_SEND , qcc -> conn );
21182127 return ret == QUIC_TX_ERR_AGAIN ? 1 : 0 ;
21192128
@@ -2266,7 +2275,7 @@ static int qcc_io_send(struct qcc *qcc)
22662275 struct list qcs_failed = LIST_HEAD_INIT (qcs_failed );
22672276 struct qcs * qcs , * qcs_tmp , * first_qcs = NULL ;
22682277 uint64_t window_conn = qfctl_rcap (& qcc -> tx .fc );
2269- int ret , total = 0 , resent ;
2278+ int ret = 0 , total = 0 , resent ;
22702279
22712280 TRACE_ENTER (QMUX_EV_QCC_SEND , qcc -> conn );
22722281
@@ -2376,6 +2385,11 @@ static int qcc_io_send(struct qcc *qcc)
23762385 }
23772386 }
23782387
2388+ if (qcc -> tx .next > now_mono_time ()) {
2389+ qcc_wakeup_pacing (qcc );
2390+ return 1 ;
2391+ }
2392+
23792393 /* Retry sending until no frame to send, data rejected or connection
23802394 * flow-control limit reached.
23812395 */
@@ -2412,6 +2426,9 @@ static int qcc_io_send(struct qcc *qcc)
24122426 sent_done :
24132427 /* Deallocate frames that the transport layer has rejected. */
24142428 if (ret == 1 ) {
2429+ //struct quic_conn *qc = qcc->conn->handle.qc;
2430+ //qcc->tx.next = now_ns + global.tune.pipesize;
2431+ //qcc->tx.next = now_mono_time() + qc->path->loss.srtt * 1000000 / (qc->path->cwnd / 1200 + 1);
24152432 qcc_wakeup_pacing (qcc );
24162433 }
24172434 else if (!LIST_ISEMPTY (& qcc -> tx .frms )) {
@@ -2772,9 +2789,17 @@ static int qcc_purge_sending(struct qcc *qcc)
27722789{
27732790 int ret ;
27742791
2792+ if (qcc -> tx .next > now_mono_time ()) {
2793+ qcc_wakeup_pacing (qcc );
2794+ return 1 ;
2795+ }
2796+
27752797 //fprintf(stderr, "%s\n", __func__);
27762798 ret = qcc_send_frames (qcc , & qcc -> tx .frms , 1 );
27772799 if (ret > 0 ) {
2800+ //struct quic_conn *qc = qcc->conn->handle.qc;
2801+ //qcc->tx.next = now_ns + global.tune.pipesize;
2802+ //qcc->tx.next = now_mono_time() + qc->path->loss.srtt * 1000000 / (qc->path->cwnd / 1200 + 1);
27782803 qcc_wakeup_pacing (qcc );
27792804 return 1 ;
27802805 }
@@ -2829,6 +2854,7 @@ static struct task *qcc_timeout_task(struct task *t, void *ctx, unsigned int sta
28292854 int expired = tick_is_expired (t -> expire , now_ms );
28302855
28312856 TRACE_ENTER (QMUX_EV_QCC_WAKE , qcc ? qcc -> conn : NULL );
2857+ //ABORT_NOW();
28322858
28332859 if (qcc ) {
28342860 if (!expired ) {
@@ -2881,6 +2907,7 @@ static void _qcc_init(struct qcc *qcc)
28812907 qcc -> wait_event .tasklet = NULL ;
28822908 qcc -> app_ops = NULL ;
28832909 qcc -> streams_by_id = EB_ROOT_UNIQUE ;
2910+ qcc -> tx .next = 0 ;
28842911 LIST_INIT (& qcc -> lfctl .frms );
28852912 LIST_INIT (& qcc -> tx .frms );
28862913}
0 commit comments