Commit Graph

6634 Commits

Author SHA1 Message Date
Xavier Arteaga 369cffec00 More deterministic SCell search test 2020-11-02 16:31:37 +01:00
Francisco Paisana a865858db3 disable srbs UL during handover to avoid UL grants and scheduling requests before the handover is complete 2020-10-30 21:51:58 +00:00
Andre Puschmann f647343f18 rlc_am: fix poll bit during header reconstruction
this makes sure that the reconstructed RLC AM header
has the poll bit set when any of its segments had it set.

this triggered a bug in RLC AM because the Status PDU
isn't transmitted for a RLC PDU that was segmented and
only the first segment had the P flag set.
2020-10-30 20:47:01 +01:00
Francisco Paisana 484c7586b4 fix heap buffer overflow 2020-10-30 20:35:41 +01:00
Francisco Paisana 42cdc5e340 Allocate all the leftover bytes of the TBS to last allocated MAC SDU.
Fix the way the RLC header is accounted for depending on the bearer id.
For instance, the SRB0 does not require any RLC header.
2020-10-30 13:35:15 +00:00
Francisco Paisana 55d62a2baa fix rlc buffer updating inside the scheduler to account for RLC headers 2020-10-30 13:35:15 +00:00
Francisco Paisana 980278fdec add comments regarding radio resource asn1 setting in the eNB 2020-10-29 21:19:40 +00:00
Francisco Paisana 84cfc29ca1 apply the scell configuration sooner during intra-enb handover 2020-10-29 21:19:40 +00:00
Francisco Paisana b40a5a958e use common function to fill rrc reconf message in handover 2020-10-29 21:19:40 +00:00
Francisco Paisana e9b693942f diff-based cell selection activation 2020-10-29 21:19:40 +00:00
Francisco Paisana 836e7d7ede refactor scell addition in the srsenb::rrc to follow the same style of other rrc recfg fields 2020-10-29 21:19:40 +00:00
Francisco Paisana a8e11d7991 removal of the special case for rrc reconf update 2020-10-29 21:19:40 +00:00
Francisco Paisana f26b5ccde7 fix drb reestablishment during handover 2020-10-29 21:19:40 +00:00
Francisco Paisana 7bf196a6e0 removal of srb handling from srsenb::rrc::bearer_cfg_handler 2020-10-29 21:19:40 +00:00
Francisco Paisana 2ef1e286b2 fix set of rrc reconf message radio resource cfg fields 2020-10-29 21:19:40 +00:00
Francisco Paisana 890113fd32 now the rrc enb is using a common function for rr_cfg reconf for the first reconf message 2020-10-29 21:19:40 +00:00
Francisco Paisana ce78fa82ce now the rrc enb is using a common function for rr_cfg setup/reest 2020-10-29 21:19:40 +00:00
Francisco Paisana 97f2e4336e refactor of functions for filling the asn1 radio resource config structs. This functions are used during rrc setup/reest/reconf 2020-10-29 21:19:40 +00:00
Xavier Arteaga 9487d27ef9 Renamed NR constants and comments 2020-10-29 09:23:09 +01:00
Xavier Arteaga e8f168b20c PDSCH NR: Added files 2020-10-29 09:23:09 +01:00
Xavier Arteaga c8477483d9 PDSCH NR: Added files 2020-10-29 09:23:09 +01:00
Xavier Arteaga 30d8e05d50 Fix PDSCH-DMRS symbol index 2020-10-29 09:23:09 +01:00
Xavier Arteaga 275cbafe6e Modified comments 2020-10-29 09:23:09 +01:00
Xavier Arteaga 8d34d344a8 Created PDSCH-NR configuration structures and refactored DMRS 2020-10-29 09:23:09 +01:00
Xavier Arteaga 009f300c5e Initial PHY Data procedures 2020-10-29 09:23:09 +01:00
Xavier Arteaga 775692f461 Rearanged PDCCH NR functions structures 2020-10-29 09:23:09 +01:00
Xavier Arteaga 452eb2dbbf Updated some DOCS 2020-10-29 09:23:09 +01:00
Xavier Arteaga 937c52339d Added PDCCH DMRS estimation and measurement 2020-10-29 09:23:09 +01:00
Xavier Arteaga 5799100e42 FFT based Resampler admits NULL inputs/outputs 2020-10-29 09:23:09 +01:00
Xavier Arteaga 44ae70dcc6 Initial implementation of the 5G NR PDCCH DMRS encoding 2020-10-29 09:23:09 +01:00
Xavier Arteaga 29ad2427d9 Initial implementation of the 5G NR PDCCH DMRS encoding 2020-10-29 09:23:09 +01:00
Xavier Arteaga 579526f1fe Added sequence advance without generating data 2020-10-29 09:23:09 +01:00
Xavier Arteaga fa837925d0 Fix inter-frequency/intra-enb HO 2020-10-29 09:17:34 +01:00
Xavier Arteaga eba20b6367 Radio: fix frame overlap at start-of-burst 2020-10-28 19:01:09 +01:00
Xavier Arteaga a5f9ea5654 SRSUE: force paging for every cell reselection procedure end 2020-10-28 16:50:18 +01:00
Andre Puschmann fd5cde525c proc_bsr: fix race condition in BSR reporting
fix for #1934

This fixes a race condition between Stack thread and DL
PDU processing that lead to updates of the RLC buffer that
are undetected by the BSR routine.

What happens is that in a UL SCH PDU all outstanding data is transmitted
and and a LBSR with all zero buffers is sent.

14:39:47.327301 [MAC ] [D] [ 3793] BSR:   LCID=3 old_buffer=59
14:39:47.330600 [MAC ] [I] [ 3793] UL LCID=3 len=58 LBSR: b=0 0 0 0

Note that "old_buffer" isn't set to zero here.

At the same time (same TTI), the MAC PDU processing thread handles DL-SCH PDUs
that may generate new UL PDUs:

14:39:47.330749 [RLC ] [I] DRB1 Tx SDU (54 B, tx_sdu_queue_len=1)
14:39:47.330762 [RLC ] [I] DRB1 Tx SDU (54 B, tx_sdu_queue_len=2)
14:39:47.330775 [RLC ] [I] DRB1 Tx SDU (54 B, tx_sdu_queue_len=3)
..

Those PDUs are "new data" since the previous buffer state was zero.

Here is the race now between the threads, at the end of the bsr::step() function
old_buffer of each LCG is updated with the previous new_buffer, so
the buffer state of LCG=2 is now 59.

Now MAC starts the next TTI:

14:39:47.331910 [MAC ] [D] [ 3794] Running MAC tti=3794
14:39:47.331928 [MAC ] [D] [ 3794] Update Bj: lcid=0, Bj=0
14:39:47.331934 [MAC ] [D] [ 3794] Update Bj: lcid=1, Bj=0
14:39:47.331938 [MAC ] [D] [ 3794] Update Bj: lcid=2, Bj=0
14:39:47.331941 [MAC ] [D] [ 3794] Update Bj: lcid=3, Bj=-1752
14:39:47.331951 [MAC ] [D] [ 3794] BSR:   LCID=0 update new buffer=0
14:39:47.331960 [MAC ] [D] [ 3794] BSR:   LCID=1 update new buffer=0
14:39:47.331964 [MAC ] [D] [ 3794] BSR:   LCID=2 update new buffer=0
14:39:47.331971 [MAC ] [D] [ 3794] BSR:   LCID=3 update new buffer=335
14:39:47.331976 [MAC ] [D] [ 3794] BSR:    check_new_data() -> get_buffer_state_lcg(0)=0
14:39:47.331980 [MAC ] [D] [ 3794] BSR:    check_new_data() -> get_buffer_state_lcg(1)=0
14:39:47.331984 [MAC ] [D] [ 3794] BSR:    check_new_data() -> get_buffer_state_lcg(2)=59
14:39:47.331988 [MAC ] [D] [ 3794] BSR:    check_new_data() -> get_buffer_state_lcg(3)=0
14:39:47.331993 [MAC ] [D] [ 3794] BSR:   LCID=0 old_buffer=0
14:39:47.332000 [MAC ] [D] [ 3794] BSR:   LCID=1 old_buffer=0
14:39:47.332003 [MAC ] [D] [ 3794] BSR:   LCID=2 old_buffer=0
14:39:47.332007 [MAC ] [D] [ 3794] BSR:   LCID=3 old_buffer=335

And since the buffer state of LCG=2 isn't zero, the new data for LCID=3 of that LCG is considered.
So effectivly, the BSR missed the "empty" buffer state for a fraction of time and doesn't
consider the outgoing data generated in the same TTI as new. It therefore
doesn't transmit a BSR.

in which a BSR wasn't
2020-10-28 12:05:53 +01:00
Andre Puschmann 465c3d9186 proc_sr: remove info log when starting SR proc
this was a very noisy log that was printed in pretty much
every TTI because the BSR procedure starts a SR whenever
it needs to send a regular BSR. The SR is canceled when a UL
grant arrives but the log line stays there.

Since we are printing a log when we actually signal a SR
to the PHY, this line is not needed.
2020-10-28 12:05:53 +01:00
Andre Puschmann 1e3ad5b0dc proc_bsr: fix high priority channel trigger logic
this fixes the trigger logic for periodic BSRs. Previously we
would always trigger the "new data for highest priority LCID"
whenever new data becomes available for a LCID for which
a BSR has already been sent.

However, a BSR should only be sent if the priority is in fact higher
(lower int number).
2020-10-28 12:05:53 +01:00
Andre Puschmann debbab93e8 mac_test: cosmetic change 2020-10-28 12:05:53 +01:00
Andre Puschmann e89254ad1f mac_test: fix mac_ra_test according to BSR changes
the BSR routine had a bug in which it would generate a BSR even
before the reTx timer expires if new data becomes availble
for a LCID that already had data and a BSR was already sent.

The RA test here relies on a BSR in the generated MAC PDU to pass.

However, since after fixing the BSR bug the PDU the MUX unit
no longer generates a BSR, we need generate data for a LCID
which has higher priority than the one for which a BSR has
already been sent.
2020-10-28 12:05:53 +01:00
Andre Puschmann d6ef66b0dc mac_test: add periodic BSR test 2020-10-28 12:05:53 +01:00
Andre Puschmann d5286e70aa proc_bsr: refactor and add extra print_state() method
allows to call the print_state() routine from other places in the BSR
2020-10-28 12:05:53 +01:00
Andre Puschmann d1ef5bd915 demux: log DL PDUs
instead of just printing the LCIDs that contain SDUs,
we use the to_string() function to log the entire MAC DL-SCH PDU
2020-10-28 12:05:53 +01:00
Andre Puschmann ff21d9c077 enb: fix error log when parsing cell config 2020-10-28 12:05:53 +01:00
Andre Puschmann 41e3bc5eaf update changelog and readme for 20.10 release 2020-10-27 21:52:17 +01:00
Xavier Arteaga be400503b9 Add pass criteria to PRACH USRP test 2020-10-27 21:12:21 +01:00
Xavier Arteaga 28bb4709ff Solved possible high impact PHY out-of-bounds issues 2020-10-27 20:33:48 +01:00
Pedro Alvarez e4f143059e Simple log fix to make it easier to compare PDCP RX and TX. 2020-10-27 20:30:56 +01:00
Xavier Arteaga 58be68f856 Changed cell gain command from cell index to cell id 2020-10-26 10:13:02 +01:00
Andre Puschmann 0740154bff rrc,sync: fix two uninit vars
detected by Valgrind when running UE with TDD cell
2020-10-25 14:42:30 +01:00