F1AP IDs: Add update method to fix concurrency bug

Introduce function cu_update_f1_ue_data() which does remove+add under
one lock. This fixes a concurrency bug. For instance, during
reestablishment, the CU needs to update the DU UE ID under which the UE
is identified in the DU. Previously, the CU would remove, then add the
DU UE ID info.  At the same time, the PDCP thread might look up the
information. This can lead to asserts. Use the above addmod
functionality to do the remove-add under a mutex.

Modify test to verify this works as expected.
This commit is contained in:
Robert Schmidt
2025-01-24 16:09:10 +01:00
parent ffb3354d49
commit febeaa7181
6 changed files with 29 additions and 15 deletions
+11
View File
@@ -49,10 +49,21 @@ void cu_data_test()
DevAssert(ret);
ret = cu_add_f1_ue_data(ue_id, &data);
DevAssert(!ret);
data.secondary_ue = 2;
ret = cu_update_f1_ue_data(ue_id, &data);
bool exists = cu_exists_f1_ue_data(ue_id);
DevAssert(exists);
f1_ue_data_t rdata = cu_get_f1_ue_data(ue_id);
DevAssert(rdata.secondary_ue == data.secondary_ue);
rdata.secondary_ue = 3;
// overwrite once more
ret = cu_update_f1_ue_data(ue_id, &rdata);
DevAssert(ret);
exists = cu_exists_f1_ue_data(ue_id);
DevAssert(exists);
f1_ue_data_t r2data = cu_get_f1_ue_data(ue_id);
DevAssert(r2data.secondary_ue == rdata.secondary_ue);
}
int main()