the code hasn't been maintained for a while an likely needs to be
adapted for a real-world scenarios.
in order to avoid having to maintain two MAC/PHY interfaces we
remove the code from now.
we had it returning int but had a bug in using the return value properly,
i.e. handling when -1 was returned in RLC TM.
Thinking about it more, it doesn't make sense to have a negative return
value here anyway. Either the RLC can return a PDU or not. If it can't the
returned lenght is zero.
general-purpose method for lower layers to signal protocol
failures to higher layers, i.e. RRC.
In the current case, implement a direct release of the UE (enb) or
a reestablishment (UE).
- the consumer does multi-staged waiting:
1. spins first across all queues in a RR fashion
2. each queue access is done with a try_lock.
3. if the try_lock fails, it increases the number of spins needed
2. if no queue had data, the consumer sleeps for 100 usec.
- no differentiation between queues, in terms of notification features
- Replace shared_variable members in log_channel class in favor of atomics.
- Remove the small string optimization in srslog now that we dont allocate anymore.
- Trim some critical sections in srslog.
With the new design, each queue created in the multiqueue object has its own mutex.
Pushing tasks to separate queues will, therefore, not cause contention.
There will be, however, still contention between the popping thread and the pushing threads.
- use const char* instead of std::string in enumerated<>::to_string() to avoid mallocs.
- Remove the use of "typedef", and use "using" keyword instead.
- Fix rrc_nr::setup_release_c<>::to_string() broken linkage.
Main changes:
- addition of pool utilities
- The node size/alignment and batch allocation threshold are now runtime arguments
- object pool and memory pool are not anymore based on the same class.
The object pool cannot use intrusive free list because it would overwrite the object
memory
- use of inheritance to simplify testing
- removal of global network manager
- pass of custon socket manager to s1ap and gtpu ctors
- overhauled the registration of socket fd,callback in socket manager
* Added ability to discard to dyn_block_queue
* Change way of keeping track of SDUs
* Check nullptr in poping callback. Starting to check for nullptr in RLC read_pdu.
* Adding RLC discard tests
* Clearing PDCP info when RLC discard happens
* Read SDUs until they are no longer nullptr
* Changed discard_if to use template argument
since the tests are random we sometimes hit the maxRetx threshold
with 8 retx allowed that made the unit test fail.
increase threshold to lower the likelihood for this to happen.
undeliverd_sdus_queue. Added a queue to store information about
rx_counts received.
Added unit test for when the SNs wrap-around in status report genaration
this patch replaces the std::vector type used in the interface between
PDCP and RLC to signal delivery status between both layers. The new
data type is a configurable but fixed-size vector.
The RLC AM doesn't need to dynamically allocate the vector for every SN but
uses the tx_window for storage.
the PDCP SN was used to fill the SDU with data. But since
the max value isn't devisable by 256 it didn't always increment
correctly. Use a normal byte now that wraps correctly.
among cleaning up the the stress test, it does:
* remove optional pedantic flag and make it the default to catch resegmentation issues
* use random SDU and MAC grant size the default
* use factory functions to create RLC configs (make maxretx configurable)
* remove reestablishment and print error when maxRetx is triggered
* fix NR PCAP usage and removes PCAP ifdef
* Added interfaces for the RLC to notify the PDCP of failure to transmit
SDU
* Limit discard timer to 1500ms, to avoid issues of lingering SDUs in the undeliverd_sdus_queue.
* Fix bug in early exit of notify_delivery and notify_failure
* fix compilation issue in rlc-pdcp notification
Co-authored-by: Francisco <francisco.paisana@softwareradiosystems.com>
Removing unecessary \n for logs and changed log of PDCP info queue
capacity to debug to avoid log spam.
Changed log level for unhandled S1AP messages from error to warning
in EPC to avoid failing tests because of error message.
Changed usage of allocate_unique_buffer to make_unique_buffer()
This includes:
- Adding a queue (implemented with std::map) for undelivered PDUs.
This queue uses the SN used for TX as the key.
- Added discard timer that is started upon reception of the SDU. Upon
expiry of the timeout a discard callback removes undelivered PDUs
from the queue.
- Added the mechanisms to the notify_delivery to remove PDUs from the
undelivered queue when the PDU is ACK'ed.
- Added test case for both timer expiry and acknowledgment.
- Fix up the getter for buffered SDUs to return the undelivered SDUs
- Changed default PDCP discard timer, so AM has a discard timer by
default.
test. The race condition was being cause by write_sdu being called
simultanously to read_pdu, which could cause the read_pdu to try to get
the SDU info before it had been written by the write_sdu.
Changes in this commit include:
- Make sure PDCP sn in included in RLC AM stress test.
- Stop handling control PDU when TX is not enabled in RLC AM.
- Fixed issue with length of the PDCP SN in rlc_stress_test.
- Moved the place were sdu info erase was called to avoid double calls to erase
- Tentative fix for race condition in rlc_am_stress test.
- Added function to print information about undelivered_sdu_info_queue
for debugging.
PDCP PDUs. This includes:
- Modifying the byte_buffer_t to include PDCP SN meta-data. This way,
the RLC can keep track of the ack'ed bytes for a specific PDCP PDU.
- Added in the RLC an `undelivered_sdu_info queue`, to keep track of the
amount of ack'ed bytes and the total size of the PDCP PDU,
so the RLC can know when delivery is finished.
- Added an interface between the PDCP and the RLC so that the RLC can
notify the PDCP when it receives an ack from the status PDUs. The RLC
passes to the PDCP a vector of all the ack'ed pdus in a rx'ed status PDU.
- Added some tests to the notify functionality. This includes some tests
where the PDUs are acked imediatly, and one test where the PDU is
retx'ed.
after adding the thread-safe PCAP writer functionality to the EUTRA
MAC object it became clear that we don't wont to replicate the
same for the NR object.
This patch therefore refactors the class that now supports both EUTRA and
NR rats. The old mac_nr_pcap.[h/cc] has been deleted. All test-cases
and usages now use the new object that needs to pass the RAT type in
the ctor.
this patch addresses the last open point of #2160
* Match hex dump indentation with srslog.
* Port asn1 utils to use srslog. Converted logging functions from taking varargs to variadic template functions.
* Remove trailing new lines in log lines from asn1 utils.
* First round of upgrades to srslog to asn1 tests.
* Second round of porting asn1 tests to srslog.
* - Started porting the enb PHY layer to use srslog loggers.
- Updated srslog to manage the none level.
* Finished porting enb phy layer including the NR part.
* Ported MAC, GTPU, PDCP, RLC and S1AP enb classes to use srslog.
* Use new stack logger.
* Ported the enb RRC clases to use srslog.
* Remove unused log macros.
* Replace loggers in sched, sched_carrier, sched_helpers.
* Replaced loggers in sched grid.
* Replaced loggers in sched harq.
* Replaced loggers in sched ue.
* Replaced loggers in sched ue ctrl.
* Replace loggers in sched ue ctrl TPC.
* Replaced loggers in sched subclasses.
* Replaced loggers in rrc_meascfg_test
* Configure loggers in rrc_mobility_test.
* Fix compilation errors left out after the rebase.
* - Implement a custom log sink that will serve as a test spy to intercept and count the number of error and warning log entries.
- Adapt the erab_test_setup and rrc_mobility tests to use this new class and make them pass again.
* - Remove trailing new lines introduced in the rebase.
- Ported the sched_ue_cell class to srslog.
* Remove unused log member.
* Ported mac tests to srslog.
* - Removed remaining trailing newlines from log entries.
* Fix compiler errors detected in CI.
* Fix another static variable without definition passed to log lines.
* Fixed a bug in srslog::flush that would never end when the backend queue is full.
* Fetch the RRC logger instead of injecting it in the constructor.
* Refactor NR resource allocation classes. Use DCI instead of grant for dummy PDSCH UE/eNB test
* Minor refactors in NR workers and ue_dl
* Fix include issues
* fix compilation issues
* offload PCAP writing to background thread
* use blocking_queue between writer and clients to make it thread-safe
* add basic test case
this fixes point 1-3 of #2161
this patch adds support for measuring the:
* SDU rx latency (Average time in ms from first RLC segment to full SDU)
* amount of buffered bytes (sum of payload of PDUs buffered in rx_window)
the implementation is using std::chrono
when retrieving the RLC metrics, the number of TTIs since the last
call are passed. This allows to calculate the actual rate
based on the LTE timing rather than only the system timing.
- now bounded_vector::resize(N) works for move-only types
- bounded_vector assertions now print error messages
- fixed move ctor/assignment of bounded_vector
- created a unit test for bounded_vectors of move-only types
* rlc_am: add TC for pollRetx timer handling
* rlc_am: fix stopping of pollRetx timer
stopping the pollRetx timer when receiving a status PDU
without checking the acknowledged PDUs is wrong.
if an ACK for another PDU, for which the polling bit has been set,
is still pending, it won't be rescheduled until another
PDU is transmitted that again starts the pollRetx timer.
this fixes the issue with missing RLC AM segment retx in #1992,
and #2003
this patch refactors the MAC PDU class, the main changes are:
* add to_string() method to pretty print PDU and subheaders
This allows to have a single log entry per MAC PDU with all its
contents.
It removes the C-style fprint() method
* Simplity payload vs. w_payload_ce
Before we've used payload when reading the PDU and w_payload_ce
as a buffer when writing. In all getters we needed to differentiate
between both. Now payload points to w_payload_ce initially and is
only updated when parsing a new PDU.
* add various helpers, e.g. to get subheader index, update a BSR, ..
* fix PDU test to use new to_string() method