nr_fill_indication(): protect with mutex

nr_fill_indication() fills CRC and RX requests, to be sent from L1 to
L2. Before this commit, nr_fill_indication() is called when
- we finally decoded LDPC (or not)
- low signal on PUSCH
This might happen at the same time, i.e., nr_fill_indication() might try
to fill both CRC and RX, in the same list, from different threads. This
can lead to this assertion:

Assertion (crc->rnti == rx->rnti) failed!
In handle_nr_ulsch() ../../../openair2/NR_PHY_INTERFACE/NR_IF_Module.c:190
mis-match between CRC RNTI e071 and RX RNTI 5e3b

e.g., e071 is low energy, and while 5e3b related message are filled in
one thread, e071 is being put into the message structure as well.

At least that is my understanding. I could not actually reproduce this
assertion; to be seen if it still happens.
This commit is contained in:
Robert Schmidt
2024-03-07 09:56:33 +01:00
parent e80d8a01f3
commit 0128945922
4 changed files with 27 additions and 6 deletions
+5 -3
View File
@@ -64,6 +64,11 @@ typedef struct {
/// crc indication list
nfapi_nr_crc_indication_t crc_ind;
/// RX indication
nfapi_nr_rx_data_indication_t rx_ind;
/// mutex to protect concurrent access to crc_ind and rx_ind, which the L2
/// needs to be pairwise
pthread_mutex_t crc_rx_mutex;
/// RACH indication list
nfapi_nr_rach_indication_t rach_ind;
@@ -71,9 +76,6 @@ typedef struct {
/// SRS indication list
nfapi_nr_srs_indication_t srs_ind;
/// RX indication
nfapi_nr_rx_data_indication_t rx_ind;
/// UCI indication
nfapi_nr_uci_indication_t uci_ind;