Commit Graph

8386 Commits

Author SHA1 Message Date
David Rupprecht f90e359208 Moved cp to test common 2021-07-02 17:23:06 +02:00
Andre Puschmann 5999b0d3a5 ue: move blocking wait for detach outside of stack class
the thread sleep waiting for the UE release should not run
on the stack thread. Move it to the UE class therefore.
2021-07-02 17:22:49 +02:00
Andre Puschmann bbcaa49429 network_utils: fix TSAN detected race 2021-07-02 17:22:49 +02:00
Andre Puschmann 3173dedf0a ue_stack_lte: make sure to execute stack commands on Stack thread
some commands were executed from the calling thread which may lead
to concurrent access to members. Detected by TSAN. The patch
moves all remaining calls (the majority was alread moved) to the
Stack task queue.
2021-07-02 17:22:49 +02:00
Andre Puschmann a9ad408f51 task_scheduler: use block_queue for internal tasks
TSAN detected wrong use of the old deque-based internal queue. To avoid
unwanted/undetected mis-use the patch uses the thread-safe block_queue
data structure instead.
2021-07-02 17:22:49 +02:00
Andre Puschmann 626f24c9f9 block_queue: use class mutex to protect size() getter
detected with TSAN
2021-07-02 17:22:49 +02:00
Andre Puschmann fb4dd3ba7b ttcn3: fix various races between SS and Stack thread detected by TSAN
fixed through the right usage of mutexes in both TTCN PHY and syssim.
nested mutex locking is solved by calling SS from the PHY after
releaseing the PHY lock again.
2021-07-02 17:22:49 +02:00
Andre Puschmann 0e6e3d201e sys_metrics: reduce log level when measurement interval is shorter than expected
on highly loaded systems it can happen that the get_metrics() is called
twice within a few houndred milliseconds. Logging a warning in this
case isn't needed, so reduce to info.

on the other hand, 100ms might be to convervative. Patch also
lowers the smallest interval to 10ms
2021-07-02 12:01:39 +02:00
Ismael Gomez 4e39982a19
Fix TSAN warnings in UE (#3021)
* Protect PHY SR signal management in a class

* Protect intra_freq_meas vector

* Protect cell and srate shared variables in thread-safe classes

* srsue,srsenb: include TSAN options header

* Protect ue_rnti_t and rnti scheduling windows behind thread-safe classes

* Protect access to state variable in sync_state

* Protect access to metrics configuration

* Protect access to is_pending_sr

* Protect access to UE prach worker

* Protect UE mux

* Avoid unlocking mutex twice

* Fix data races in RF/ZMQ

* Fix data races in intra_measure and PHY

* Fix minor data races in MAC

* Make TSAN default behaviour to not halt on error

* Fix blocking in intra cell measurement

* Address comments

Co-authored-by: Andre Puschmann <andre@softwareradiosystems.com>
2021-07-01 17:39:54 +02:00
Ismael Gomez c0fd64c4e6 Fix data races in srsENB MAC 2021-07-01 17:39:06 +02:00
David Rupprecht 4ed33fed7d Fixed unpack bytes limit 2021-07-01 17:02:29 +02:00
Pedro Alvarez 05fbca43d1 Fix GCC 11 warning in dyn_array 2021-07-01 10:55:11 +01:00
Pedro Alvarez 1b676aa406 Moved lib GTPU to its own folder 2021-06-30 18:19:20 +01:00
Pedro Alvarez 865298f8d5 Moved lib PDCP to its own folder 2021-06-30 18:19:20 +01:00
Pedro Alvarez 171d5727be Moved lib RLC into it's own folder 2021-06-30 18:19:20 +01:00
Francisco Paisana 30802777cf fix,enb: fix enb.conf param description 2021-06-29 20:39:32 +02:00
Francisco Paisana 4d014e7ceb s1ap,feature: make the ts1 reloc timers configurable via the enb.conf 2021-06-29 20:39:32 +02:00
Andre Puschmann b6a3b8c5b1 rlc: fix dtor
TSAN was complaining about destroying a locked mutex
2021-06-29 14:27:07 +02:00
Francisco 4c316aa9ea sched,nr: integrate mac-phy interface types into the scheduler 2021-06-29 14:19:35 +02:00
Francisco 5b3c5ded63 sched,nr: implement NR PDCCH allocation algorithm 2021-06-29 14:19:35 +02:00
faluco a70ad58440 Fix a data race in the UHD class wrapper where the last error member was being set concurrently causing random crashes.
Introduce a new macro to catch UHD exceptions and log them directly instead of storing an error string, similar to what errno does.

Remove usrp logging helpers that depend on the now removed member since all calls potentially log the error directly.
2021-06-28 21:16:56 +02:00
Andre Puschmann 8087bb01e4 nas: log message when airplane mode timer expires 2021-06-28 17:35:02 +02:00
Andre Puschmann 0a16f48869 gw: fix race condition
GW thread was checking the default_eps_bearer variable without
protection. RRC could update it when deleting DRB or receiving RRC
connection release.
2021-06-28 17:35:02 +02:00
Andre Puschmann 4d11e5552a rrc,ue: for RRC conn release, delay transition to RRC idle by 60ms as per TS 36.331
when receiving RRC connection release all actions shall be delayed by 60ms as
per the standard
2021-06-28 17:35:02 +02:00
Andre Puschmann 368c7b9e4f ue,stack: clear all EPS bearers when going RRC idle
the EPS bearer manager was only informed when a single DRB
was removed but not when entering idle which requires to
remove all bearers.

This cause the service request to fail.
2021-06-28 17:35:02 +02:00
faluco e20934583e Remove an unsafe assert in the log backend that could be triggered under very certain circumstances.
RFCI has detected this assert failing in the log_backend_test. I have not been able to reproduce this locally but my theory is the following one:
one of the unit tests does the following:

backend.start();
backend.stop();

the internal running_flag member could be set to true and then to false by the main thread before the worker thread calls do_work(). If this happens
the assert will be triggered, which is wrong and too conservative, so remove the assert.
2021-06-28 10:02:22 +02:00
Xavier Arteaga 6f5614a0cc Suggested modifications on gNb MAC/PHY interface 2021-06-28 00:27:36 +02:00
Xavier Arteaga 8378c85ec4 Refactored gNb PHY 2021-06-28 00:27:36 +02:00
Xavier Arteaga c4e13f70a2 SRSENB: fix NR worker pointer check 2021-06-28 00:27:36 +02:00
Xavier Arteaga aef3e5a40a More NR PHY test and GNB PHY development 2021-06-28 00:27:36 +02:00
Xavier Arteaga 9126ad3b8b Added NR type1 RIV function helper 2021-06-28 00:27:36 +02:00
Xavier Arteaga d49734b1bc SRSENB: Refactor to accomodate 5G NR 2021-06-28 00:27:36 +02:00
Xavier Arteaga e98a6f9eea Make ACK M constant i UEDLNR 2021-06-28 00:27:36 +02:00
Xavier Arteaga 567c7c9c77 Create TTI semaphpore default constructor 2021-06-28 00:27:36 +02:00
Francisco de05e1e549 sched,nr: fix invalid memory write 2021-06-24 16:22:42 +01:00
Francisco 75153c7c83 sched,nr: implementation of sched sim test class 2021-06-24 16:22:42 +01:00
Francisco f1b3cfc764 sched,nr: implementation of sched NR harq retxs. Refactor of rb grid classes. 2021-06-24 16:22:42 +01:00
Francisco d950433cbd sched,nr: fix time-domain parallelization sched nr test. creation of util class to handle acquisition of boolean resources 2021-06-24 16:22:42 +01:00
Francisco 35a236b1b9 sched,nr: fix sched_nr_test. Resolve data race issues. Created new config structs used across the scheduler. 2021-06-24 16:22:42 +01:00
Francisco 407da794e1 sched,nr: implementation of slot grid class 2021-06-24 16:22:42 +01:00
Francisco 4fa27f3841 sched,nr: implementation of main classes for NR scheduler, and basic test for concurrency 2021-06-24 16:22:42 +01:00
Andre Puschmann e248e086ed ttcn3_dut: reset TFT matcher object when DUT is switched off 2021-06-24 16:52:58 +02:00
Andre Puschmann 7a85191323 nas: call GW for all removed EPS bearers
this makes sure that GW can also remove all associated TFTs
2021-06-24 16:52:58 +02:00
Andre Puschmann ab0fba5449 gw: try to remove TFTs for all non-default EPS bearer
GW needs to reset its default EPS bearer when it is removed
and also try to remove all TFTs for a non-default bearere when
it is removed.
2021-06-24 16:52:58 +02:00
Andre Puschmann 5313fb99d6 tft: add helper to delete all TFTs for EPS bearer
when a EPS bearer is removed, all associated TFTs need
to be removed as well.
2021-06-24 16:52:58 +02:00
Andre Puschmann eef9eb80c4 ttcn3_ue: fix removal of dedicated EPS bearer 2021-06-24 16:52:58 +02:00
Andre Puschmann 60f8a8db1c nas,tft: add support for TFT modification 2021-06-24 16:52:58 +02:00
Andre Puschmann 483a216bd5 ue,stack: refactor handling of radio bearears in UE stack
this is a rather large commit that is hard to split because
it touches quite a few components.

It's a preparation patch for adding NR split bearers in the next
step.

We realized that managing RLC and PDCP bearers for both NR and LTE
in the same entity doesn't work. This is because we use the LCID
as a key for all accesses. With NR dual connectivity however we
can have the same LCID active at the same time for both LTE and NR
carriers.

The patch solves that by creating a dedicated NR instance for RLC/PDCP
in the stack. But then the question arises for UL traffic on, e.g. LCID 4
what PDCP instance the GW should use for pushing SDUs. It doesnt' know
that. And in fact it doesn't need to. It just needs to know EPS
bearer IDs. So the next change was to remove the knowledge of what
LCIDs are from the GW. Make is agnostic and only work on EPS bearer IDs.

The handling and mapping between EPS bearer IDs and LCIDs for LTE
or NR (mainly PDCP for pushing data) is done in the Stack because
it has access to both.

The NAS also has a EPS bearer map but only knows about default and
dedicated bearers. It doesn't know on which logical channels they
are transmitted.
2021-06-24 16:52:58 +02:00
Andre Puschmann a4b2a065ff pdcp: reword warning when dropping PDU 2021-06-24 16:52:58 +02:00
Andre Puschmann 3f9c069ff7 ue_stack_lte: add RLC and PDCP entities for NR 2021-06-24 16:52:58 +02:00