Commit Graph

4514 Commits

Author SHA1 Message Date
Andre Puschmann 5b025cfbf8 rlc_um_nr: reimplement update of RX_Next_Reassembly 2021-10-27 19:50:35 +02:00
Andre Puschmann 2366dc286d rlc_um_nr: improve logging 2021-10-27 19:50:35 +02:00
Andre Puschmann 85e478d8ad rlc_um_nr_test: add TC to reproduce reassembly issue
* add TC to reproduce reassembly issue that causes low TCP throughput
* fix PCAP writing
* fix other testcase to wait for t_reassembly to expire
2021-10-27 19:50:35 +02:00
Alejandro Leal Conejos ca7a377878 Fixes coverity 262740 2021-10-27 19:47:45 +02:00
Alejandro Leal Conejos 4bd8b6f2de Fixes coverity 359677 2021-10-27 19:47:45 +02:00
Bedran Karakoc a14cc451d0 Addition NGAP cleanup 2021-10-27 19:37:49 +02:00
Andre Puschmann 7f6801cb1e ue_sync: fix 32bit compilation
fix printf format string on 32bit arches like ARMv7

FAILED: lib/src/phy/ue/CMakeFiles/srsran_ue.dir/ue_sync.c.o
/usr/bin/gcc -DASSERTS_ENABLED -DENABLE_TIMEPROF -DENABLE_TTCN3 -DHAVE_BACKWARD -DHAVE_MBEDTLS -DHAVE_PCSC -I/usr/include/PCSC -I/usr/include/SoapySDR -Ilib/include -I../lib/include -Wno-unused-but-set-variable -Wall -Wno-comment -Wno-write-strings -Wno-unused-result -Wformat -Wmissing-field-initializers -Wtype-limits -std=c99 -fno-strict-aliasing -D_GNU_SOURCE -O3 -fno-trapping-math -fno-math-errno -DBUILD_TYPE_RELEASE -DIS_ARM -DHAVE_NEON -mfloat-abi=hard -mfpu=neon -fvisibility=hidden -fdiagnostics-color=always -Werror --param large-function-growth=1600 -O3 -DNDEBUG -fPIC -MD -MT lib/src/phy/ue/CMakeFiles/srsran_ue.dir/ue_sync.c.o -MF lib/src/phy/ue/CMakeFiles/srsran_ue.dir/ue_sync.c.o.d -o lib/src/phy/ue/CMakeFiles/srsran_ue.dir/ue_sync.c.o   -c ../lib/src/phy/ue/ue_sync.c
In file included from ../lib/include/srsran/srsran.h:31,
                 from ../lib/src/phy/ue/ue_sync.c:13:
../lib/src/phy/ue/ue_sync.c: In function ‘srsran_ue_sync_set_tti_from_timestamp’:
../lib/include/srsran/phy/utils/debug.h:59:23: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Werror=format=]
       fprintf(stdout, "[DEBUG]: " _fmt "\n", ##__VA_ARGS__);                                                           \
                       ^~~~~~~~~~~
../lib/src/phy/ue/ue_sync.c:1044:3: note: in expansion of macro ‘DEBUG’
   DEBUG("rx time with 3gpp base in ms %lu\n", time_3gpp_msecs);
   ^~~~~
../lib/src/phy/ue/ue_sync.c:1044:41: note: format string is defined here
   DEBUG("rx time with 3gpp base in ms %lu\n", time_3gpp_msecs);
                                       ~~^
                                       %llu
cc1: all warnings being treated as errors
2021-10-27 18:03:03 +02:00
joaquim-SRS 00b82bc772 Fix more issues in PHY lib
Fix variable shadowing issues in chest_test
Fix mutex unlock position in dft_fftw.c
CID 371598 Out of bounds access, in ssb_decode_test.c
2021-10-27 18:02:00 +02:00
joaquim-SRS 9b74e3429c Fix more Coverity issues in the PHY lib
CID 369560 Missing unlock, in dft_fftw.c
CID 363710 Logically dead code, in resampler.c
CID 55097 Result is not floating point, in chest_test_dl.c
CID 351020 Result is not floating point, in chest_nbiot_test_dl.c
2021-10-27 18:02:00 +02:00
Nils Fürste b036da07de Extend ASN1 utils function from_number() 2021-10-27 17:53:28 +02:00
Fabian Eckermann 0007473c7a Initialize variable. 2021-10-27 17:39:51 +02:00
Fabian Eckermann f539851128 Fix possible out-of-bounds-read. 2021-10-27 17:39:51 +02:00
Fabian Eckermann 1b2d77a49d Fix possible out-of-bounds-read. 2021-10-27 17:39:51 +02:00
Fabian Eckermann 8753ea1be5 Fix coverty defects. 2021-10-27 17:39:51 +02:00
Carlo Galiotto 9c74dda039 rrc,nr: add msg5 and inactivity timers to RRC-NR
Signed-off-by: Carlo Galiotto <carlo@srs.io>
2021-10-26 23:18:17 +02:00
faluco edf0926a2f Batch of LGTM fixes. 2021-10-26 21:49:17 +02:00
Francisco 529e2bdf55 nr,rlc: call bsr update callback in RLC UM NR 2021-10-26 21:44:59 +02:00
Francisco 7ad1ad800e lte,enb,rlc: atomically compute DL buffer state and update the scheduler in the eNB 2021-10-26 21:44:59 +02:00
Ismael Gomez d972fb368c
Some LGTM fixes (#3564)
* Fix LGTM issues

* ue: add logging to switch on function

* Fix new LGTM issues
2021-10-26 21:15:36 +02:00
Joaquim 93649429dd
WIP: Fix Coverity issues in PHY lib (#3507)
Fix several Coverity issues

This commit adrresses the following code issues found by Coverity:

CID 339785 Division by zero, in fading_channel_test.c
CID 355272 Division by zero, in awgn_channel_test.c
CID 355277 NULL ptr dereference, in awgn_channel_test.c
CID 359663 NULL ptr dereference, in delay_channel_test.c
CID 369544 NULL ptr dereference, in chest_dl_nbiot.c
CID 373326 Resource Leak, in dft_fftw.c
CID 373329 Resource Leak, in dft_fftw.c
CID 372878 Division by zero, in sliv_test.c
CID 372871 Division by zero, in dmrs_pdcch.c
CID 370622 Negative loop bound, in csr_rs.c
CID 370624 Negative loop bound, in csr_rs.c
CID 370626 Negative loop bound, in csr_rs.c
CID's 369568, 369594 NULL ptr dereference, in ch_awgn.c
CID 369540 Logically dead code, in refsignal_dl.c
CID 369608 Logically dead code, in refsignal_ul.c
CIDs 366291, 366296, 366297 Out-of-bounds access, in zc_sequence.c
CID 372209 Division by zero, in cqi.c
CID 370992 Uninitialized pointer read, in pdcch_test.c
CID 373334 Integer overflow, in ue_sync.h
CID 370993, 370995 Undefined division, in pdcch_test.c
CID 370994 Undefined division, in ssb_decode_test.c
CIDs 353368 353364 353365 359673 353366 353367
Explicit null dereferenced, in psss_file_test.c
CID 371865 Unchecked return value, in rf_uhd_imp.cc
CID 363810 Undefined division, in ldpc_rm_chain_test.c
CID 372209, 372211, 372213, 372216 Undefined modulo, in cqi.c
CID 339834 Array compared against 0, in chest_dl.c
CID 369589 Out of bounds access, in dmrs_pucch.c
CID 371681 Out of bounds access, in ue_sync_nr_test.c
CIDs 370761, 370825 Copy-paste error, in ssb.c
CID 369599 out of bounds read, in dmrs_pdcch_test.c
CID 363795 out of bounds read, in ldpc_dec_c_avx2_flood.c
CID 363805 out of bounds read, in ldpc_dec_c_avx2long_flood.c
CID 363821 out of bounds read, in ldpc_dec_c_flood.c
2021-10-26 19:59:45 +02:00
faluco dc31fb05a3 Fix ODR issue detected by ASAN in arch for the srsran_verbose global variable. 2021-10-26 16:56:11 +02:00
faluco fa8e8ddf1f Fix an ODR issue detected by ASAN in arch, where the global variable handler_registered was defined multiple times. 2021-10-26 16:56:11 +02:00
yagoda 5d6b48311e fixing a few regression bugs in embms 2021-10-26 15:35:18 +02:00
Andre Puschmann 497e183487 rf_zmq_imp: disable Tx baseband scaling
until the correct gain settings are documented and potential
mis-configuration are handled. It seems that the default
Tx/rx gains values are not working with this function.
2021-10-26 14:56:44 +02:00
Andre Puschmann e2d26b5a8c rlc_um_nr: log PDU without SN if full SDU is transmitted
PDUs that contain full SDUs don't have SNs, so the log should be
without it
2021-10-26 13:32:48 +02:00
Andre Puschmann 3eb1862ab9 gnb_interface: reduce MAX_GRANTS to 4
see #3530 for detailed discussion. This change saves some CPU cycles it seems
2021-10-25 21:52:03 +02:00
Fabian Eckermann 32a1646536
nr,gnb,rrc: Derive RRC parameters from config.
* Derive RRC parameters from config.
* nr,gnb,rrc: hard code prach config index to 8 to avoid expiring RA proc window.
2021-10-25 20:54:32 +02:00
faluco 5ff6b2eaa9 Fix data race in ZMQ where nsamples and running variables could be read concurrently. 2021-10-25 20:30:57 +02:00
Xavier Arteaga 322f57a952
Initial real-time Tx gain setting (#2976)
* Make filename const in filesink

* Sine generation returns the next phase

* Avoid malloc/free in radio class

* Implement Tx gain in ZMQ

* Initial ratio RT gain test

* UHD: use timed Tx gain commands to align changes to subframes

* Minor improvement in test_radio_rt_gain

* Fix compilation

* Check RF gain thread id before joining

* Remove redundant zero initialization.

Co-authored-by: Fabian Eckermann <fabian@srs.io>
2021-10-25 10:54:17 +02:00
Xavier Arteaga ebab12403f
Asynchronous NR PHY configuration (#3527)
* Fix a race condition when accessing the NR PHY cfg by the RRC and phy workers.
Rework how the phy cfg is handled, now workers have their own copy that gets updated after a reconfig moving it out of the state class.

* Default initialize sf_len member in sf_worker for consistency.

* Asynchronous NR PHY configuration

* Fix compilation

* Corrected method override and fix unitialised value

* Added carrier equal comparison to avoid aligment byte padding comparison

Co-authored-by: faluco <borja.ferrer@softwareradiosystems.com>
2021-10-25 10:51:02 +02:00
faluco 0ada9a01ec Whitelist TSAN issue in srsenb::mac::sr_detected. 2021-10-23 21:26:00 +02:00
faluco a1b2f3915d Whitelist lock order inversion tsan issue in srsenb::rlc::rb_is_um. 2021-10-23 21:26:00 +02:00
Andre Puschmann 8294724aad gnb_interface: reduce MAX_GRANTS to 4
this significantly reduces data copies when providing the PHY
with scheduler results.
2021-10-23 21:09:26 +02:00
Xavier Arteaga 95bf85b3d3 Reduced maximum number of CSI reports 2021-10-23 17:23:08 +02:00
Pedro Alvarez fbcffb84bd Check if RLC is suspended before transmiting PDCP SDU.
This was done to avoid integrity issues, when the UE's RRC erroneously sent
measurement reports while the re-establishment was already in progress.

As errously sending PDCP PDUs on DRBs can cause issues as well, this was
disabled too.
2021-10-22 17:27:32 +01:00
Alejandro Leal Conejos 9daa32e591 Configure the term timeout using the cmake definition
EXTRA_TERM_TIMEOUT_S
2021-10-22 13:52:07 +02:00
Xavier Arteaga d9bdc3f83e Add CSI resource information and fix segmentation fault 2021-10-22 12:46:44 +02:00
Carlo Galiotto 284207dad6 WIP: fixing collision in the the users_map
Signed-off-by: Carlo Galiotto <carlo@srs.io>
2021-10-21 23:26:46 +02:00
Xavier Arteaga eace81d613 Fix UCI multiplexing for NR PUSCH 2021-10-21 22:14:00 +02:00
Xavier Arteaga 39bfcf4a5c Add UCI valid in NR PUSCH info 2021-10-21 22:14:00 +02:00
Ismael Gomez 7920e084b8 Revert "Do not abort tsan"
This reverts commit e8e1d101c553912f733070e71d020a33ec895280.
2021-10-21 21:31:21 +02:00
Ismael Gomez 80c48a8b01 rlc: protect access to tx_enabled 2021-10-21 21:31:21 +02:00
Ismael Gomez bf566fbd29 radio: protect concurrent access from tx_end and tx 2021-10-21 21:31:21 +02:00
Ismael Gomez 4239222909 Do not abort tsan 2021-10-21 21:31:21 +02:00
faluco 95b4a92f5f Clarify the error messages printed when trying to open a RF device. 2021-10-21 17:51:51 +02:00
Francisco c6226b0d94 lte,enb,rrc: parse cellIndividualOffset in rr.conf and propagate it to measConfig sent to UE 2021-10-21 16:16:01 +01:00
Pedro Alvarez 65a2b35f09 Fix not checking initialization of S11 in MME. Fixed typo. 2021-10-21 14:50:44 +01:00
Pedro Alvarez 0b948d4098 Make sure that bind returns error if it cannot bind. Added test for SCTP bind error/success. 2021-10-21 14:50:44 +01:00
Pedro Alvarez e721504f8e Removed the sctp_init_server for consistency. Added listen method to unique_socket class. 2021-10-21 14:50:44 +01:00
Pedro Alvarez e9a7e6dbae Getting rid of sctp_init_client function. The only thing it does is call the sctp_init_socket function. 2021-10-21 14:50:44 +01:00
Francisco d60950d0f3 lte,enb,rlc: change new_tx and prio_tx variable names to snake_case and ensure they are zero initialized 2021-10-21 09:31:03 +01:00
Francisco 7aa5f731ce lte,enb,rlc: push to scheduler pending prioritized bytes both in case of RLC timer expiry or in case of new buffer state detection 2021-10-21 09:31:03 +01:00
Francisco 4a58c10f30 lte,enb,rlc: compute and forward to scheduler the number of bytes pending for retx and status pdu in RLC AM bearer 2021-10-21 09:31:03 +01:00
Xavier Arteaga 4edb61212f Added number of CDM groups to phy_dl_nr_test 2021-10-20 10:27:45 +02:00
Xavier Arteaga 8e5fe9018b Corrected LBRM functionality 2021-10-20 10:27:45 +02:00
Xavier Arteaga 9ecea014bd Added PUSCH DMRS minimum SNR 2021-10-19 23:05:16 +02:00
Francisco 0b51848dda nr,gnb,rrc: use multiqueue to forward x2 tasks to NR stack 2021-10-19 22:50:57 +02:00
Fabian Eckermann 59df04547e Increase buffer size for NR. 2021-10-19 10:18:44 +02:00
Andre Puschmann 3bf09021f9 enb: remove unused parameter 2021-10-18 14:17:53 +02:00
Francisco 5b2afb1739 rrc,nr,gnb: ensure same PDCCH config is sent to PHY, scheduler cell config, and sched ue cfg 2021-10-16 22:43:23 +01:00
Francisco 7a16be9692 rrc,nr: ensure coresets and search spaces are passed to scheduler cell_cfg and ue_cfg 2021-10-16 22:43:23 +01:00
Andre Puschmann e5556fcc32 mac_pdu_nr_test: add LBSR unpacking tests 2021-10-16 21:50:07 +02:00
Andre Puschmann af69551c8d mac_sch_pdu_nr: add LBSR unpacking
* add LBSR unpacking
* add pretty printer
* also simplify and unify general unpacking code
2021-10-16 21:50:07 +02:00
Francisco 81174bda64 nr,ue,rrc: release NR logical channels during RRC release 2021-10-15 18:28:09 +01:00
Xavier Arteaga 537f165482 Added comments 2021-10-15 18:19:04 +02:00
Xavier Arteaga 3c40cd2840 Improved NR PHY logging info 2021-10-15 18:19:04 +02:00
Xavier Arteaga addd687d7e Fix NR PUCCH format 1 normalised correlation 2021-10-15 18:19:04 +02:00
Xavier Arteaga e6bd6462b1 Estimate CFO for NR PUCCH formats 0 and 1 2021-10-15 18:19:04 +02:00
Xavier Arteaga 51ff429bc7 Added SS type to PDSCH context info 2021-10-15 18:19:04 +02:00
Xavier Arteaga a5f6aa9f31 Added CSI string in PDSCH and PUSCH decode 2021-10-15 18:19:04 +02:00
Xavier Arteaga 003c6e524c Added short NR CSI information 2021-10-15 18:19:04 +02:00
faluco dacf40f63e Delete move constructor and move assignment operator explictly for mac_pcap_base and s1ap_pcap classes.
Move emergency handlers header file into the support folder.

Refactored signal handling:
- Remove the dependency with the running static variable in the header file.
- Move implementations down to cc files.
- Allow specifying a new signal handler that will be used to stop the applications.
- Move signal handling files to support.
2021-10-15 15:05:37 +02:00
faluco 9075251627 Move the cleanup code from the signal handlers down to the new emergency handlers for the ue, epc and enb. 2021-10-15 15:05:37 +02:00
faluco 2c1e9c0c55 Implement an emergency cleanup handler registration mechanism to allow modules to clean themselves before application gets killed.
Flush PCAP contents just before killing the application.
2021-10-15 15:05:37 +02:00
Fabian Eckermann 44de4996e8 Fix log message. 2021-10-15 11:49:27 +02:00
Francisco f427a25a30 nr,gnb,mac: account for header space larger than 2 when packing PDSCH 2021-10-15 11:03:02 +02:00
Francisco ed2e88524f asn1,rrc_nr: implement to_json in setup_release_c 2021-10-14 21:38:48 +01:00
Francisco 9df6c6b936 sched,nr: ensure the ue_cfg_t passed to the scheduler in NR FDD mode has the correct harq delay 2021-10-14 21:38:12 +01:00
Andre Puschmann 255ddb1329 enb,gnb: add basic support for sgnb release procedure
the procedure is currently started when the EUTRA UE object
is deleted (after RRC release) in order to clean-up the
ENDC resources on the gNB.
2021-10-14 21:30:14 +02:00
Francisco ea324e8cbe nr,sched,test: update sched nr test to better reflect MAC-PHY FAPI 2021-10-14 19:27:52 +01:00
Andre Puschmann 7cbd3d50b7 mac_sch_pdu_nr,bsr: fix length check for BSR
fix nasty bug where the length calucation for the LCID
was taking the bsr_format_nr_t that was having the same name.
2021-10-14 11:16:37 +02:00
faluco 28bbaa7816 Blacklist TSAN issues from libusb and libuhd. 2021-10-14 08:55:06 +02:00
faluco 75af37bd4b Batch of race fixes when running the UE and ENB with UHD.
Main fixes are in the UHD driver, fixing races and potential deadlocks.
2021-10-14 08:55:06 +02:00
Alejandro Leal Conejos 1a64c6adad Enum fixes so clang 12 can build the repo 2021-10-14 08:48:04 +02:00
Carlo Galiotto f53e01cfa3 mac: apply changes by PR reviewers
- reinstate write_lock on ue metrics
- change "rwlock" variable name in mac_nr.h

Signed-off-by: Carlo Galiotto <carlo@srs.io>
2021-10-13 11:12:03 +02:00
Carlo Galiotto dc3e3a89f8 mac: update CQI in MAC with CSI reports from PHY
Signed-off-by: Carlo Galiotto <carlo@srs.io>
2021-10-13 11:12:03 +02:00
Xavier Arteaga a9904c2b64 Fix info format string 2021-10-13 11:02:30 +02:00
Xavier Arteaga a31a40184d Fix NR PRACH encoding 2021-10-13 11:00:03 +02:00
Xavier Arteaga 8bab12fb00 Added NR case to prach_test 2021-10-13 11:00:03 +02:00
Xavier Arteaga 3c4efba418 Added missing parameters to NR PHY configuration factory 2021-10-13 11:00:03 +02:00
Xavier Arteaga 5e1291b0c7 Fix PRACH detection sequence generation for NR 2021-10-13 11:00:03 +02:00
Francisco 11ee4ab9dd nr,gnb,rrc: fix scheduler FDD configuration 2021-10-12 17:49:12 +01:00
Francisco 4e49508d8f nr,gnb,mac: fix RAR encoding by resetting the RAR buffer 2021-10-11 18:30:33 +01:00
Francisco 1b595b6eff nr,gnb: if no nr cell is initiated, do not enable endc in the LTE RRC 2021-10-11 18:21:51 +01:00
Francisco 3721523810 pdcp,lte: fix debug logging in PDCP, to avoid segmentation fault and crash 2021-10-11 11:12:07 +01:00
Francisco 43b12b9ffb rrc,nr: transfer SSB config to both UE and NR scheduler 2021-10-09 16:53:14 +01:00
Carlo Galiotto 43a7d822fa stack,rrc: fix double removal of EPS bearer
The EPS bearer was removed twice, causing an error in the logs.

Fix issue #3380

Signed-off-by: Carlo Galiotto <carlo@srs.io>
2021-10-08 11:19:12 +02:00
Xavier Arteaga 7262287926 Zero power UCI bits is not an error but KO 2021-10-08 10:17:21 +02:00
Xavier Arteaga 4a327ad17d Consider CRC length when calculating real LDPC rate 2021-10-08 10:17:21 +02:00
Xavier Arteaga 5f17c46098 Modify periodic CSI time offset to UL slot 2021-10-08 10:17:21 +02:00
Xavier Arteaga bd186fab2e Fix CMake SSB frequency addition overflow 2021-10-08 09:49:07 +02:00
Xavier Arteaga be870d66ad More relaxed SSB measure assertions and reorder SSB test 2021-10-08 09:49:07 +02:00
Xavier Arteaga 4b77127ed6 Added missing SSB pattern to unit test 2021-10-08 09:49:07 +02:00
Xavier Arteaga 8bb23cc74a Correct CMake sign 2021-10-08 09:49:07 +02:00
Xavier Arteaga 52e00d6376 Fix PBCH encoding and added unit test 2021-10-08 09:49:07 +02:00
Xavier Arteaga 25bd0d6219 Added SSB pattern to/from string functions 2021-10-08 09:49:07 +02:00
Francisco 053877f489 rrc,nr: fix conversion from asn1 to phy cfg 2021-10-08 01:16:07 +01:00
Francisco 47e5e85449 refactor: clean unnecessary includes of the asn1/rrc_nr.h 2021-10-07 23:08:07 +01:00
Xavier Arteaga 1bdb1bb62d Store PUSCH CSI from PUSCH DMRS 2021-10-07 16:31:26 +02:00
Fabian Eckermann 420d6a6a98 enhanced and fixed some tests. 2021-10-07 10:42:16 +02:00
Bedran Karakoc 850606f20b Added deregistration (UE terminating) 2021-10-06 20:01:00 +02:00
Robert Falkenberg b0430ebfe2 rf_imp.c: fix segfault when closing RF device with no AGC thread 2021-10-06 18:25:11 +02:00
Francisco 3b79393974 sched,nr: fix default ue configuration when prach arrives 2021-10-06 16:33:51 +02:00
Xavier Arteaga d5b34696b4 Sepparate CSI report configuration from quantification and integrate in nr_phy_test with assertions 2021-10-06 16:33:51 +02:00
faluco 388b1e5d92 Fix data race in radio::is_start_of_burst. 2021-10-06 12:49:34 +02:00
faluco 7b0b76d58e Whitelist two lock order inversion TSAN issues that acquire a readlock. 2021-10-06 12:49:34 +02:00
Francisco Paisana b7f40b2baf rrc,nr: reenable CSI reporting in gNB 2021-10-06 10:58:29 +01:00
Xavier Arteaga 00a6e71f50 Fix UL/DL frequency compensation 2021-10-06 10:46:21 +02:00
Fabian Eckermann cb721aa292 fix calculation of ssb frequency. 2021-10-05 18:21:58 +02:00
Francisco Paisana b58915d7ed rrc,nr: make gnb cell CSI NZP configuration consistent with UE NSA configuration. 2021-10-05 10:28:36 +02:00
Francisco Paisana 23bf542ae7 stack,nr: isolate calls between LTE and NR stacks via the task multiqueue 2021-10-05 10:12:28 +02:00
Andre Puschmann 8bb06ff2c0 Added SSB in gNb PHY 2021-10-04 19:26:07 +02:00
Xavier Arteaga 3763d04578 implement helper function to calculate FFT size for a given sampling rate 2021-10-04 19:26:07 +02:00
Andre Puschmann 7496b7c14f Add SSB to configuration factory 2021-10-04 19:26:07 +02:00
Andre Puschmann 5b0767772b Added SSB center frequency to band helper 2021-10-04 19:26:07 +02:00
Andre Puschmann 91e17337db Added SSB scaling configuration option 2021-10-04 19:26:07 +02:00
Andre Puschmann 3e5b40fd36 enb,rrc: fix compilation after freq point a has been removed from nr_carrier_t
since absolute freq point a members have been removed from the srslte_nr_carrier_t
struct (they are now actual frequencies) the abs_point_a values are now in
the RRC cell structs
2021-10-04 17:52:14 +02:00
Fabian Eckermann 5f40d4fd99 Add test for ssb from band calculation. 2021-10-04 15:59:05 +02:00
Fabian Eckermann 95abfbfec8 Calculate ssb frequency from freqency point a. 2021-10-04 15:59:05 +02:00
Francisco Paisana f22483ce72 sched,nr: use formatting %d to represent slot index 2021-10-04 13:43:56 +02:00
Xavier Arteaga c9d7db7314 Minor changes 2021-10-04 10:28:34 +02:00
Xavier Arteaga e3bd92d87c Fix SSB pattern in UE 2021-10-04 10:28:34 +02:00
Xavier Arteaga 8f90ee847a Refactor carrier frequency from PHY and fix OFDM phase compensation 2021-10-04 10:28:34 +02:00
Xavier Arteaga fda35bf6a1 Initial OFDM carrier phase compensation 2021-10-04 10:28:34 +02:00
Xavier Arteaga 2ab3971ef1 Fix NR PBCH encoding/decoding 2021-10-04 10:28:34 +02:00
Xavier Arteaga 530b381c6c Change NR PDSCH/PUSCH freq/time resource format in log 2021-10-04 10:28:34 +02:00
Ismael Gomez 6b506ec357
phy_common: clear tx_hold flag before releasing the semaphore (#3342) 2021-10-03 20:05:38 +02:00
yagoda 82bda02b36 adding nr metrics 2021-10-03 13:06:59 +02:00
Andre Puschmann 1937e4d7fc ssb: add extra checks when configuring SSB
this is to avoid invalid configs that later on cause segfaults, etc.

e.g.:

    0 0x7f397adf64a3  (/lib/x86_64-linux-gnu/libc.so.6+0xbb4a3)
    1 0x7f397cc8c6ce  (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x796ce)
    2 0x55b921d61707 in srsran_vec_cf_copy /mnt/data/jenkins/workspace/srslte_ogt_trial_builder_x86-ubuntu1804-asan/srsLTE/lib/src/phy/utils/vector.c:226
    3 0x55b921d3b1d4 in ssb_demodulate /mnt/data/jenkins/workspace/srslte_ogt_trial_builder_x86-ubuntu1804-asan/srsLTE/lib/src/phy/sync/ssb.c:632
    4 0x55b921d3d8ce in srsran_ssb_csi_measure /mnt/data/jenkins/workspace/srslte_ogt_trial_builder_x86-ubuntu1804-asan/srsLTE/lib/src/phy/sync/ssb.c:905
    5 0x55b9215dc20f in srsue::nr::cc_worker::measure_csi() /mnt/data/jenkins/workspace/srslte_ogt_trial_builder_x86-ubuntu1804-asan/srsLTE/srsue/src/phy/nr/cc_worker.cc:373
    6 0x55b9215dd216 in srsue::nr::cc_worker::work_dl() /mnt/data/jenkins/workspace/srslte_ogt_trial_builder_x86-ubuntu1804-asan/srsLTE/srsue/src/phy/nr/cc_worker.cc:483
    7 0x55b9215f9c69 in srsue::nr::sf_worker::work_imp() /mnt/data/jenkins/workspace/srslte_ogt_trial_builder_x86-ubuntu1804-asan/srsLTE/srsue/src/phy/nr/sf_worker.cc:78
    8 0x55b921c47cc6 in srsran::thread_pool::worker::run_thread() /mnt/data/jenkins/workspace/srslte_ogt_trial_builder_x86-ubuntu1804-asan/srsLTE/lib/src/common/thread_pool.cc:48
    9 0x55b92152ea0b in srsran:🧵:thread_function_entry(void*) /mnt/data/jenkins/workspace/srslte_ogt_trial_builder_x86-ubuntu1804-asan/srsLTE/lib/include/srsran/common/threads.h:103
    10 0x7f397c9fb6da in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76da)
    11 0x7f397ae5c71e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x12171e)
2021-10-02 17:58:16 +02:00
Xavier Arteaga 1aa65bd10c HOTFIX: force DFT wisdom save at exit 2021-10-01 18:06:37 +02:00
Fabian Eckermann 077f9cd03e Add test for get_abs_freq_point_a_arfcn. 2021-09-29 22:31:23 +02:00
Fabian Eckermann 7f7cfe687d fix calculation. 2021-09-29 22:31:23 +02:00
Ismael Gomez c09f09b7be Move rrc_common from srsue to lib 2021-09-29 21:39:56 +02:00
Fabian Eckermann 8830c2796f Add support for NSA FDD on band n3, n5 and n7. 2021-09-29 16:03:44 +02:00
Fabian Eckermann 2d0be77660 Add helper functions for abs freq point a. 2021-09-29 16:03:44 +02:00
faluco a8f58f503c - Fix arm compiler warning. GCC treats chars as unsigned in this arch.
- Fix race condition in json metrics.
2021-09-29 13:26:14 +02:00
Andre Puschmann 315057d11c enb: signal user activity to EUTRA RRC when doing NR DL traffic
to avoid releasing the UE when only NR DL traffic is done.
similar to the EUTRA solution.
2021-09-28 16:55:54 +02:00
Xavier Arteaga 8b2514ded3 Added NZP-CSI-RS signals in gNb 2021-09-28 16:54:37 +02:00
Francisco Paisana cbb709d4e3 sched,nr: function to log UEs buffer status before scheduling decision, fix const_iterator of circular_map 2021-09-27 15:43:16 +02:00
faluco 1eaca0d343 Escape asn1 message strings that get printed in the enb event json report. 2021-09-27 13:57:40 +02:00
Ismael Gomez 1c77998df5 Stop PDCP for data bearers before initiating HO 2021-09-27 13:54:51 +02:00
faluco fa351cd285 Rename functions that contain the unsafe word to nolock.
The term "unsafe" does not clearly state that the function is not locking the shared date and it sounds "dangerous", so use a more explicit term.
2021-09-27 13:26:21 +02:00
Andre Puschmann 59e1bca3f5 rlc_am_lte: fix potential crash when attempting to resize tx queue
under some circumstances it could happen that the RLC is configured
when SDUs are already being written to the queue. The resize
operation of the underlying container would fail in this case.

Make sure to empty the queue before doing the resize.
2021-09-27 11:35:42 +02:00
Francisco Paisana bdf18856d1 sched,nr: fix handling of DL BSR in NR scheduler and computation of UCI 2021-09-24 17:35:15 +02:00
faluco 7b079fe289 Fix a data race in rlc TM metrics. 2021-09-24 14:27:37 +02:00
faluco edb7342aef Fix data race in rlc UM metrics. 2021-09-24 14:27:37 +02:00
faluco 6c91a824e2 Whitelist the TSAN lock order inversion issue in srsenb::mac::rlc_buffer_state. 2021-09-24 14:27:37 +02:00
faluco 8a38a89652 Fix compiler warning: control reaches end of non-void function 2021-09-24 13:15:05 +02:00
Andre Puschmann 426e876047 enb,nr: fix GTPU handler to forward UL PDUs 2021-09-23 19:07:31 +02:00
yagoda bc4388a78c -adding temp crnti removal for NR carrier attach 2021-09-23 18:27:13 +02:00
Andre Puschmann 430694c72f gnb,dl: fix amplitude scaling
use PDSCH struct to get number of PRBs to compute scaling factor.
then PDCCH struct is only filled if it's encoded.
2021-09-22 16:41:18 +02:00
Andre Puschmann 802b22ac91 enb,nsa: refactor NR RRC/cell config parsing
this allows to access all cell-related params from within RRC
2021-09-22 16:41:18 +02:00
David Rupprecht 611255aa5f Added GTPU bind address as output parameter 2021-09-22 15:15:47 +02:00
David Rupprecht bd0e641633 Added GTPU PDU Session header parsing 2021-09-22 15:15:47 +02:00
Bedran Karakoc 43915550cc NGAP GTP Bearer Establishment 2021-09-22 15:15:47 +02:00
David Rupprecht 3712983308 Added PDU Session est request 2021-09-22 15:15:47 +02:00
David Rupprecht c670383ae9 Added NAS 5G functions incoming msg and reg proc 2021-09-22 15:15:47 +02:00
David Rupprecht bbe54fb248 Fix uninitialized issue in NAS 5G pack/unpacking 2021-09-22 15:15:47 +02:00
Xavier Arteaga d0ce17f736 Added SSB different SCS combination unit test 2021-09-22 14:15:41 +02:00
Xavier Arteaga e2facef540 Abort radio application if decimation/interpolation ratios are not integer 2021-09-22 13:19:51 +02:00
Xavier Arteaga cdfbe28b69 Initial NR-MIB packing/unpacking 2021-09-22 11:17:27 +02:00
Fabian Eckermann f44eb0534f Add RRC NR test for FDD 2021-09-21 18:12:34 +02:00
Xavier Arteaga 0324806d6c Packed NR TDD config in duplex configuration and created test case for FDD 2021-09-21 18:11:16 +02:00
Fabian Eckermann dd8db1a929 Replaced inet_addr() with inet_pton. 2021-09-21 11:59:40 +02:00
Xavier Arteaga 574683e3ef Fix error message 2021-09-21 11:30:56 +02:00
Fabian Eckermann d59ebfce9d add lock for fftw wisdom 2021-09-20 20:48:55 +02:00
Xavier Arteaga ffba972fb7 Fix gnb amplitude 2021-09-20 20:48:08 +02:00
Xavier Arteaga 51d6ab3b3f Disable CSI-RS resource mapping number of port check 2021-09-20 20:48:08 +02:00
Xavier Arteaga de00b80228 Review NR NSA CFO estimation and compensation 2021-09-20 20:48:08 +02:00
Xavier Arteaga 63bb86bce1 Added SS type conversion to string 2021-09-20 20:48:08 +02:00
Xavier Arteaga 7ba5099bee Implement CSI-RS resource mapping validation 2021-09-20 20:48:08 +02:00
Fabian Eckermann e57ffca722
gnss_sync: fix timestamp to TTI conversion
* Improve reliability of timestamp to tti conversion

Difftime is not reliable as it might use 32 bit calculation, depending on the system. This leads to wrong frame numbers and subframe indices.
I encountered this Issue when testing the pssch_ue exampel on my system and the conversion from timestamp to frame number and sf idx was wrong.

* Improve GNSS Sync 

Added loop to check for GNSS alignment while syncing.
If the received GNSS signal is weak, synchronization errors might occur while syncing.
2021-09-20 14:29:25 +02:00
Andre Puschmann 3fd47d2af4 enb: refactor L2/L3 and (re)move all NR components to gNB stack
* decouple EUTRA and NR stack classes
* implement dummy X2 interface with control and data plane methods
* implement eNB time source interface that PHY calls
2021-09-17 14:57:33 +02:00
faluco d2f09a8d3c Fix a nasty data race in the ue_bearer_manager class. The underlying std::map member was being accessed concurrently potentially corrupting memory. 2021-09-17 11:34:28 +02:00
faluco d009160ba6 Fix data race in the metrics of the rlc. 2021-09-17 11:34:28 +02:00
Andre Puschmann e563e5918e rf_imp: fail opening RF altogether if specified device fails to open
we've had a few runs in the CI where opening the specified RF device
failed but the eNB/UE still continued to run, just picking the next available
run. This led to false-positive tests.

The policy should be that whenever the user specified a RF device to
be openend, and this device fails, the whole process should fail and
the application should exit.

The auto-detection mode is still available but only if no device name
is specified at all.
2021-09-16 15:28:13 +02:00
Andre Puschmann b127327684 enb,s1ap: print filename when writing S1AP PCAP 2021-09-16 15:25:46 +02:00
David Rupprecht e8a464228d Cleaned string helpers 2021-09-16 15:24:32 +02:00
Andre Puschmann cc2d71183e ue,phy,nr: fix race condition when setting UL grant for Msg3
the Msg3 UL grant requires the TTI in which the RAR has been received
to calcualte the correct timing. There was a race between PHY and Stack
thread.

This patch circumvents the issue by removing a PHY state member that only holds
the RAR Rx timing. In the new interface the RA proc passes the Rx TTI
to the PHY again when setting the UL grant so the PHY can calculate the
correct timing without any state.
2021-09-16 15:22:59 +02:00
Andre Puschmann ed92f2bd34 enb,mac_nr: remove EUTRA cell param for MAC-NR cell config calls
* the old srsran_cell_cfg_t is only carried for SIB params
* the SIB scheduling, etc needs to be ported and integrated into NR data structures
* disbable SIB test for the moment
2021-09-15 14:49:28 +02:00
faluco cf20b143c0 Fix the default constructor of the optional class to avoid a spurious uninitialized value warning in older GCC versions (seen for ARM32 and GCC 8.3).
Use a union of a byte and the real storage, and init the char by default.
2021-09-14 11:22:40 +02:00
faluco 485ec2edab Implement a new option to flush the file sink contents on every write. 2021-09-14 10:22:37 +02:00
Nils Fürste d75fe22a0a Soapy: Fix include path of Types.h 2021-09-14 09:38:31 +02:00
Andre Puschmann 06f000c2c4 band_helper: fix format 2021-09-13 17:10:32 +02:00
faluco c7ddedcf72 Log the invalid format string to help grepping it in the logs. 2021-09-13 11:11:41 +02:00
faluco 9571109a69 Abort program execution if STOP_ON_WARNING is defined when formatting an invalid log entry. 2021-09-13 11:11:41 +02:00
faluco 8cde3f20e7 Catch exceptions thrown on invalid format strings in the log backend and print an error message to signal the issue. 2021-09-13 11:11:41 +02:00
Andre Puschmann 07019a5bd6 nr: refactor DL/UL frequency deriviation
* add separate DL/UL freq point a in NR carrier struct
* use freqInfoDL/freqInfoUL to get freq point a
* simplify carrier tuning logic
2021-09-13 10:27:16 +02:00
Andre Puschmann 11af5662a7 band_helper_test: extend TC for band 5 FDD freq calcs 2021-09-13 10:27:16 +02:00
Andre Puschmann d26a7e0350 band_helper: add helper to derive DL/UL freq from abs_freq_point
calculate DL and UL freq in carrier struct based on given values
2021-09-13 10:27:16 +02:00
Andre Puschmann 377eb52b86 band_helper_test: add TC for band n5 2021-09-13 10:27:16 +02:00
Andre Puschmann 69619d725a band_helper: add helper to derive UL ARFCN from DL ARFCN 2021-09-13 10:27:16 +02:00
Andre Puschmann 93e1d7712d enb,phy: add checks for invalid EARFCN and exit eNB if config is wrong 2021-09-10 22:08:26 +02:00
faluco 5703752faa Fix a enb crash when no more users could be added into the bearer manager map.
This was caused by not removing old user from the map, so add the code to cleanup the map on user removal.
2021-09-10 15:34:29 +02:00
Andre Puschmann f382a7c7db Revert "ue,proc_ra_nr: add temporary flag to skip RAR reception"
This reverts commit 28668aac34.
2021-09-09 14:29:04 +02:00
Andre Puschmann c1892eb2ec enb,nsa: refactor of SgNB addition interface
* update of FSM
* better integration of parameter for X2 calls
2021-09-09 14:29:04 +02:00
Andre Puschmann aba0ba9ad8 mac_sch_pdu_nr: fix newline in logs 2021-09-09 14:29:04 +02:00
Andre Puschmann 54ab64327a ue,mac_nr: move BSR levels lookup table into lib header
prepare for shared use with gNB
2021-09-09 14:29:04 +02:00
Andre Puschmann 6745eced49 ssb: avoid NaN when SSB can't be detected
when PSS+SSS can't be detected the RSRP was 0 and
the resulting conversion to dB resulted in NaN.
2021-09-09 12:04:27 +02:00
faluco ec272061a0 Fix a dangling SDU pointer in mac_sch_subpdu_nr when adding subpdus into a mac_sch_pdu_nr. 2021-09-08 14:45:23 +02:00
faluco 934802d23c Report the SIB9 home enb name in the enb sector start/sector stop events. 2021-09-07 16:36:56 +02:00
faluco 2fd3ed789a Rename sector_id to carrier_id JSON key in enb metrics and events. 2021-09-07 16:36:56 +02:00
faluco d122d0c69b Add new field for the PCI in the enb JSON report file. 2021-09-07 16:36:56 +02:00
faluco d168536bc4 Add a new program option to control how ASN1 messages get printed into the enb JSON report file. 2021-09-07 16:36:56 +02:00
faluco df6ae7b0e0 - Implement new enb events:
* ho_command
* connection_resume
* rlf_detected
- Rename rlf_report event to "rlf_report".
2021-09-07 16:36:56 +02:00
faluco 8a3586dfbf Include a ASN1 json representation for RRC enb events. 2021-09-07 16:36:56 +02:00
David Rupprecht a9a23214b0 Added more 5G security kdfs
Added new 5G SIM functions

Added const parameters for security functions
2021-09-07 11:06:56 +02:00
David Rupprecht a645d74eaf USIM functions for res star
Added gen_res_star in security.h

Added USIM interfaces for res star

Added RES star test case
2021-09-07 11:06:56 +02:00
David Rupprecht bce6b5cc0f Added kdf common
Use kdf functions in 5G KDF

Moved EPS KDF function to new KDF structure
2021-09-07 11:06:56 +02:00
David Rupprecht 15eaef21e2 Update test f12345 function
Moved XOR functions to lib

Added testcase for KDF

Minor liblte_security updates
2021-09-07 11:06:56 +02:00
David Rupprecht 0ef8976d53 Remove length from class and pass by reference 2021-09-07 11:05:59 +02:00
Andre Puschmann 88bb92dc0d mac_nr,sched: handle C-RNTI CE 2021-09-06 10:35:59 +02:00
Andre Puschmann f3e8847ad3 mac_pdu_nr_test: fix test 2021-09-03 12:09:41 +02:00
Andre Puschmann 82e9652a92 mac_sch_pdu_nr: fix ASAN/fmt issue when print space 2021-09-03 12:09:41 +02:00
Andre Puschmann ea48a350a4 mac_rar_pdu_nr: fix clearing of padding bytes 2021-09-03 12:09:41 +02:00
Andre Puschmann 02bd15878e mac_sch_pdu_nr: fix logging 2021-09-03 12:09:41 +02:00
Andre Puschmann ede81be5e4 mac_rar_pdu_nr: add packing routines
* add packing for RAR PDUs
* rewrite to_string() to use fmt lib
* add test case for packer
2021-09-03 12:09:41 +02:00
Andre Puschmann 20c0e0bc41 mac_sch_pdu_nr: add to_string() helper to format MAC PDUs in logs 2021-09-03 12:09:41 +02:00
Francisco Paisana 227ae97bcb workaround gcc4.8 issue with inability to derive move ctor noexcept specifier 2021-09-03 12:06:17 +02:00
Francisco Paisana ebd12b0778 stack lte,refactor: pass bearer manager instead of stack pointer to srsenb::rrc 2021-09-03 12:06:17 +02:00
Francisco Paisana f4df55c245 stack lte: separate bearer manager into two classes, one for the ue and one for the enb 2021-09-03 12:06:17 +02:00
Francisco Paisana 2ade4628ca stack lte: create an gtpu-pdcp adapter class that correctly converts lcids to eps bearers and vice-versa 2021-09-02 17:12:04 +02:00
Francisco Paisana 4b2f079581 gtpu: renamed lcid to eps_bearer_id as parte of the refactor of gtpu to use eps_bearer_ids 2021-09-02 17:12:04 +02:00
Andre Puschmann 3949a727a7 enb_interface: add stack interface for RRC
RRC uses the interface to register/deregister EPS bearer
2021-09-02 17:12:04 +02:00
Andre Puschmann db8b710442 bearer_manager: move to lib folder and extend for multiple users
prepare bearer manager to be used by eNB which requires
to support multiple RNTIs
2021-09-02 17:12:04 +02:00
Francisco Paisana 020bec025e sched: created class common to LTE and NR for ue buffer status management 2021-09-01 20:08:11 +02:00
Xavier Arteaga 9e1669c403 Better comments in minimum size symbol selection 2021-08-31 18:56:41 +02:00
Xavier Arteaga 4858202bf6 Fix NR symbol size for 270RB 2021-08-31 18:56:41 +02:00
Xavier Arteaga 14a85d31ec Fix symbol size simensioning for LTE standard rate 2021-08-31 18:56:41 +02:00
Xavier Arteaga 01390a7340 Better NR softbuffer size adjustment 2021-08-31 18:56:41 +02:00
Andre Puschmann 9bf74843f6 mac_pdu_nr: add error handling to init_tx() method
check provided byte_buffer and return error if it's not valid
2021-08-31 17:20:13 +02:00
Francisco Paisana 04e5c81edf sched,nr: nr_phy_test now uses the whole mac class rather than just the scheduler 2021-08-27 15:50:23 +02:00
Francisco Paisana b486d2a1b5 sched,nr: implement prb grant fmt formatting 2021-08-26 12:09:11 +02:00
Francisco Paisana da4b7e4f80 sched,nr: fix sched RAR NR test; update test assert macros 2021-08-26 12:09:11 +02:00
Xavier Arteaga 83b9b2d1ff Implemented UE open loop CFO compensation for NR 2021-08-26 09:34:43 +02:00
Xavier Arteaga 5aa2279990 Fix NZP-CSI-RS CFO sign 2021-08-26 09:34:43 +02:00
Xavier Arteaga 7da2d20447 Added UE UL NR frequency offset option 2021-08-26 09:34:43 +02:00
Xavier Arteaga cfe2b305a1 Fix CORESET0 related PDSCH resource allocation procedure 2021-08-26 09:34:43 +02:00
Xavier Arteaga 36207db615 Added CORESET start_rb helper function 2021-08-26 09:34:43 +02:00
Xavier Arteaga 89ef3b64b4 Optimization NR PDCCH mapping minor optimization 2021-08-26 09:34:43 +02:00