mirror of https://github.com/PentHertz/srsLTE.git
Starting to stop tx'ing packets if TX_NEXT overflows.
This commit is contained in:
parent
62230c6ab9
commit
2752e3cff5
|
@ -82,6 +82,15 @@ void pdcp_entity_nr::write_sdu(unique_byte_buffer_t sdu, bool blocking)
|
||||||
(do_integrity) ? "true" : "false",
|
(do_integrity) ? "true" : "false",
|
||||||
(do_encryption) ? "true" : "false");
|
(do_encryption) ? "true" : "false");
|
||||||
|
|
||||||
|
// Check for COUNT overflow
|
||||||
|
if (tx_overflow) {
|
||||||
|
log->warning("TX_NEXT has overflowed. Droping packet\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tx_next + 1 == 0) {
|
||||||
|
tx_overflow = true;
|
||||||
|
}
|
||||||
|
|
||||||
// Start discard timer TODO
|
// Start discard timer TODO
|
||||||
// Perform header compression TODO
|
// Perform header compression TODO
|
||||||
|
|
||||||
|
@ -100,10 +109,6 @@ void pdcp_entity_nr::write_sdu(unique_byte_buffer_t sdu, bool blocking)
|
||||||
|
|
||||||
// Increment TX_NEXT
|
// Increment TX_NEXT
|
||||||
tx_next++;
|
tx_next++;
|
||||||
if (tx_next == 0 or tx_overflow) {
|
|
||||||
tx_overflowasdfdsaf = true;
|
|
||||||
log->warning("TX_NEXT has overflowed. Droping packet\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if PDCP is associated with more than on RLC entity TODO
|
// Check if PDCP is associated with more than on RLC entity TODO
|
||||||
// Write to lower layers
|
// Write to lower layers
|
||||||
|
|
|
@ -92,6 +92,7 @@ int test_tx(uint32_t n_packets,
|
||||||
srslte::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp;
|
srslte::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp;
|
||||||
rlc_dummy* rlc = &pdcp_hlp.rlc;
|
rlc_dummy* rlc = &pdcp_hlp.rlc;
|
||||||
|
|
||||||
|
pdcp_hlp.set_pdcp_initial_state(init_state);
|
||||||
|
|
||||||
// Run test
|
// Run test
|
||||||
for (uint32_t i = 0; i < n_packets; ++i) {
|
for (uint32_t i = 0; i < n_packets; ++i) {
|
||||||
|
@ -104,6 +105,7 @@ int test_tx(uint32_t n_packets,
|
||||||
srslte::unique_byte_buffer_t pdu_act = allocate_unique_buffer(*pool);
|
srslte::unique_byte_buffer_t pdu_act = allocate_unique_buffer(*pool);
|
||||||
rlc->get_last_sdu(pdu_act);
|
rlc->get_last_sdu(pdu_act);
|
||||||
|
|
||||||
|
std::cout << "Actual RX pdus" << rlc->rx_count << "Rcvd pdus " << n_pdus_exp << "\n";
|
||||||
TESTASSERT(rlc->rx_count == n_pdus_exp);
|
TESTASSERT(rlc->rx_count == n_pdus_exp);
|
||||||
TESTASSERT(compare_two_packets(pdu_act, pdu_exp) == 0);
|
TESTASSERT(compare_two_packets(pdu_act, pdu_exp) == 0);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue