Lines Matching +full:rx +full:- +full:threshold

2  * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
32 ++info->lost; in on_lost()
38 ++info->acked; in on_acked()
44 ++info->discarded; in on_discarded()
60 if (h->ackm != NULL) { in helper_destroy()
61 ossl_ackm_free(h->ackm); in helper_destroy()
62 h->ackm = NULL; in helper_destroy()
65 if (h->ccdata != NULL) { in helper_destroy()
66 ossl_cc_dummy_method.free(h->ccdata); in helper_destroy()
67 h->ccdata = NULL; in helper_destroy()
70 if (h->have_statm) { in helper_destroy()
71 ossl_statm_destroy(&h->statm); in helper_destroy()
72 h->have_statm = 0; in helper_destroy()
75 if (h->pkts != NULL) { in helper_destroy()
76 for (i = 0; i < h->num_pkts; ++i) { in helper_destroy()
77 OPENSSL_free(h->pkts[i].pkt); in helper_destroy()
78 h->pkts[i].pkt = NULL; in helper_destroy()
81 OPENSSL_free(h->pkts); in helper_destroy()
82 h->pkts = NULL; in helper_destroy()
95 if (!TEST_int_eq(ossl_statm_init(&h->statm), 1)) in helper_init()
98 h->have_statm = 1; in helper_init()
101 h->ccdata = ossl_cc_dummy_method.new(fake_now, NULL); in helper_init()
102 if (!TEST_ptr(h->ccdata)) in helper_init()
106 h->ackm = ossl_ackm_new(fake_now, NULL, &h->statm, in helper_init()
107 &ossl_cc_dummy_method, h->ccdata, in helper_init()
109 if (!TEST_ptr(h->ackm)) in helper_init()
113 h->num_pkts = num_pkts; in helper_init()
115 h->pkts = OPENSSL_zalloc(sizeof(struct pkt_info) * num_pkts); in helper_init()
116 if (!TEST_ptr(h->pkts)) in helper_init()
119 h->pkts = NULL; in helper_init()
141 * TX ACK (Packet Threshold) Test Cases
187 * Two ranges, partial coverage of space, non-contiguous by 1
188 * Causes inferred loss due to packet threshold being exceeded.
199 * Two ranges, partial coverage of space, non-contiguous by 2
200 * Causes inferred loss due to packet threshold being exceeded.
257 * Causes inferred loss of one packet due to packet threshold being exceeded,
258 * but several other previous packets survive as they are under the threshold.
270 * Causes inferred loss due to packet threshold being exceeded.
282 * Causes inferred loss due to packet threshold being exceeded.
319 if (!TEST_uint_eq(p->anti_deadlock_handshake, anti_deadlock_handshake)) in test_probe_counts()
321 if (!TEST_uint_eq(p->anti_deadlock_initial, anti_deadlock_initial)) in test_probe_counts()
323 if (!TEST_uint_eq(p->pto[QUIC_PN_SPACE_INITIAL], pto_initial)) in test_probe_counts()
325 if (!TEST_uint_eq(p->pto[QUIC_PN_SPACE_HANDSHAKE], pto_handshake)) in test_probe_counts()
327 if (!TEST_uint_eq(p->pto[QUIC_PN_SPACE_APP], pto_app)) in test_probe_counts()
353 if (!TEST_int_eq(helper_init(&h, c->pn_table_len), 1)) in test_tx_ack_case_actual()
362 for (i = 0; i < c->pn_table_len; ++i) { in test_tx_ack_case_actual()
367 tx->pkt_num = c->pn_table[i]; in test_tx_ack_case_actual()
368 tx->pkt_space = space; in test_tx_ack_case_actual()
369 tx->is_inflight = 1; in test_tx_ack_case_actual()
370 tx->is_ack_eliciting = 1; in test_tx_ack_case_actual()
371 tx->num_bytes = 123; in test_tx_ack_case_actual()
372 tx->largest_acked = QUIC_PN_INVALID; in test_tx_ack_case_actual()
373 tx->on_lost = on_lost; in test_tx_ack_case_actual()
374 tx->on_acked = on_acked; in test_tx_ack_case_actual()
375 tx->on_discarded = on_discarded; in test_tx_ack_case_actual()
376 tx->cb_arg = &h.pkts[i]; in test_tx_ack_case_actual()
378 tx->time = fake_time; in test_tx_ack_case_actual()
390 for (i = 0; i < c->pn_table_len; ++i) { in test_tx_ack_case_actual()
400 ack.ack_ranges = (OSSL_QUIC_ACK_RANGE *)c->ack_ranges; in test_tx_ack_case_actual()
401 ack.num_ack_ranges = c->num_ack_ranges; in test_tx_ack_case_actual()
406 for (i = 0; i < c->pn_table_len; ++i) { in test_tx_ack_case_actual()
408 (c->expect_ack[i] & 1) != 0 ? 1 : 0)) in test_tx_ack_case_actual()
411 (c->expect_ack[i] & 2) != 0 ? 1 : 0)) in test_tx_ack_case_actual()
414 (c->expect_ack[i] & 4) != 0 ? 1 : 0)) in test_tx_ack_case_actual()
475 * TX ACK (Time Threshold) Test
528 for (s = script; s->kind != TX_ACK_TIME_OP_END; ++s) in test_tx_ack_time_script()
529 if (s->kind == TX_ACK_TIME_OP_PKT) in test_tx_ack_time_script()
530 num_pkts += s->num_pn; in test_tx_ack_time_script()
543 for (s = script; s->kind != TX_ACK_TIME_OP_END; ++s) in test_tx_ack_time_script()
544 switch (s->kind) { in test_tx_ack_time_script()
546 for (i = 0; i < s->num_pn; ++i) { in test_tx_ack_time_script()
549 tx->pkt_num = s->pn + i; in test_tx_ack_time_script()
550 tx->pkt_space = QUIC_PN_SPACE_INITIAL; in test_tx_ack_time_script()
551 tx->num_bytes = 123; in test_tx_ack_time_script()
552 tx->largest_acked = QUIC_PN_INVALID; in test_tx_ack_time_script()
553 tx->is_inflight = 1; in test_tx_ack_time_script()
554 tx->is_ack_eliciting = 1; in test_tx_ack_time_script()
555 tx->on_lost = on_lost; in test_tx_ack_time_script()
556 tx->on_acked = on_acked; in test_tx_ack_time_script()
557 tx->on_discarded = on_discarded; in test_tx_ack_time_script()
558 tx->cb_arg = &h.pkts[pkt_idx + i]; in test_tx_ack_time_script()
561 ossl_ticks2time(s->time_advance)); in test_tx_ack_time_script()
562 tx->time = fake_time; in test_tx_ack_time_script()
568 pkt_idx += s->num_pn; in test_tx_ack_time_script()
575 ack_range.start = s->pn; in test_tx_ack_time_script()
576 ack_range.end = s->pn + s->num_pn; in test_tx_ack_time_script()
579 ossl_ticks2time(s->time_advance)); in test_tx_ack_time_script()
591 (s->expect[i] & 1) != 0 ? 1 : 0)) in test_tx_ack_time_script()
594 (s->expect[i] & 2) != 0 ? 1 : 0)) in test_tx_ack_time_script()
597 (s->expect[i] & 4) != 0 ? 1 : 0)) in test_tx_ack_time_script()
611 * RX ACK Test
616 RX_OPK_PKT, /* RX packet */
622 RX_OPK_RX_ACK, /* RX ACK frame */
699 /* RX 1. Simple Test with ACK Desired (Packet Threshold, Exactly) */
705 RX_OP_CHECK_STATE (0, 0, 0) /* no threshold yet */
708 RX_OP_PKT (0, 0, 2) /* two packets, threshold */
711 RX_OP_CHECK_STATE (0, 1, 0) /* threshold met, immediate */
726 /* RX 2. Simple Test with ACK Not Yet Desired (Packet Threshold) (1-RTT) */
744 RX_OP_CHECK_STATE (0, 0, 0) /* no threshold yet */
755 /* Second packet should not cause ACK-desired state */
756 RX_OP_PKT (0, 1, 1) /* just one packet, threshold is 2 */
759 RX_OP_CHECK_STATE (0, 0, 1) /* threshold not yet met, so deadline */
760 /* Don't check ACKs here, as it would reset our threshold counter. */
762 /* Now receive a second packet, triggering the threshold */
763 RX_OP_PKT (0, 2, 1) /* second packet meets threshold */
781 /* RX 3. Simple Test with ACK Desired (Packet Threshold, Multiple Watermarks) */
795 RX_OP_CHECK_STATE (0, 0, 0) /* no threshold yet */
806 /* Generate ten packets, exceeding the threshold. */
807 RX_OP_PKT (0, 1, 10) /* ten packets, threshold is 2 */
810 RX_OP_CHECK_STATE (0, 1, 0) /* threshold met, immediate */
846 * RX 4. Simple Test with ACK Not Yet Desired (Packet Threshold)
857 RX_OP_CHECK_STATE (0, 0, 0) /* no threshold yet */
869 * Second packet should cause ACK-desired state because we are
872 RX_OP_PKT (0, 1, 1) /* just one packet, threshold is 2 */
933 for (s = script; s->kind != RX_OPK_END; ++s) in test_rx_ack_actual()
934 if (s->kind == RX_OPK_TX) in test_rx_ack_actual()
935 num_tx += s->num_pn; in test_rx_ack_actual()
947 for (s = script; s->kind != RX_OPK_END; ++s, ++opn) { in test_rx_ack_actual()
949 ossl_ticks2time(s->time_advance)); in test_rx_ack_actual()
950 switch (s->kind) { in test_rx_ack_actual()
952 for (i = 0; i < s->num_pn; ++i) { in test_rx_ack_actual()
955 pkt.pkt_num = s->pn + i; in test_rx_ack_actual()
974 for (i = 0; i < s->num_pn; ++i) in test_rx_ack_actual()
976 s->pn + i, space), in test_rx_ack_actual()
977 (s->kind == RX_OPK_CHECK_PROC))) in test_rx_ack_actual()
984 s->expect_desired)) in test_rx_ack_actual()
989 s->expect_deadline)) in test_rx_ack_actual()
1011 if (!TEST_size_t_eq(ack->num_ack_ranges, s->num_ack_ranges)) in test_rx_ack_actual()
1014 for (i = 0; i < ack->num_ack_ranges; ++i) { in test_rx_ack_actual()
1015 if (!TEST_uint64_t_eq(ack->ack_ranges[i].start, in test_rx_ack_actual()
1016 s->ack_ranges[i].start)) in test_rx_ack_actual()
1018 if (!TEST_uint64_t_eq(ack->ack_ranges[i].end, in test_rx_ack_actual()
1019 s->ack_ranges[i].end)) in test_rx_ack_actual()
1028 tx->pkt_num = s->pn; in test_rx_ack_actual()
1029 tx->pkt_space = space; in test_rx_ack_actual()
1030 tx->num_bytes = 123; in test_rx_ack_actual()
1031 tx->largest_acked = s->largest_acked; in test_rx_ack_actual()
1032 tx->is_inflight = 1; in test_rx_ack_actual()
1033 tx->is_ack_eliciting = 1; in test_rx_ack_actual()
1034 tx->on_lost = on_lost; in test_rx_ack_actual()
1035 tx->on_acked = on_acked; in test_rx_ack_actual()
1036 tx->on_discarded = on_discarded; in test_rx_ack_actual()
1037 tx->cb_arg = &pkts[txi]; in test_rx_ack_actual()
1038 tx->time = fake_time; in test_rx_ack_actual()
1050 rx_ack_range.start = s->pn; in test_rx_ack_actual()
1051 rx_ack_range.end = s->pn + s->num_pn - 1; in test_rx_ack_actual()
1060 if (space == (int)s->pn) { in test_rx_ack_actual()
1075 TEST_error("error in ACKM RX script %d, op %zu", tidx + 1, opn + 1); in test_rx_ack_actual()