From fd773068068821e0f3bcaef2cfdb8b82815d8ce8 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 13 Jan 2025 12:13:48 +0100 Subject: [PATCH] FHI72: make polling configurable in xran_fh_rx_read_slot(), default off xran_fh_rx_read_slot() uses polling (a loop over cnt++) to wait for the next frame/slot. The reasons I have been told is "it does not work differently", or "there are real-time problems". None of those seem to be true; by default disable polling, and use the queue instead. It is possible to enable polling with the cmake option OAI_FHI72_USE_POLLING=ON. Documentation has been updated to inform about this change. --- doc/ORAN_FHI7.2_Tutorial.md | 15 +++++++++++++++ radio/fhi_72/CMakeLists.txt | 2 ++ radio/fhi_72/oaioran.c | 5 ++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/ORAN_FHI7.2_Tutorial.md b/doc/ORAN_FHI7.2_Tutorial.md index 84ae6b2064..8e2058f5c1 100644 --- a/doc/ORAN_FHI7.2_Tutorial.md +++ b/doc/ORAN_FHI7.2_Tutorial.md @@ -475,6 +475,19 @@ cmake .. -GNinja -DOAI_FHI72=ON -Dxran_LOCATION=$HOME/phy/fhi_lib/lib ninja nr-softmodem oran_fhlib_5g params_libconfig ``` +Note that in tags 2025.w06 and prior, the FHI72 driver used polling to wait for +the next slot. This is inefficient as it burns CPU time, and has been replaced +with a more efficient mechanism. Nevertheless, if you experience problems that +did not occur previously, it is possible to re-enable polling, either with +`build_oai` like this + + ./build_oai --gNB --ninja -t oran_fhlib_5g --cmake-opt -Dxran_LOCATION=$HOME/phy/fhi_lib/lib --cmake-opt -DOAI_FHI72_USE_POLLING=ON + +or with `cmake` like so + + cmake .. -GNinja -DOAI_FHI72=ON -Dxran_LOCATION=$HOME/phy/fhi_lib/lib -DOAI_FHI72_USE_POLLING=ON + ninja oran_fhlib_5g + # Configuration RU and DU configurations have a circular dependency: you have to configure DU MAC address in the RU configuration and the RU MAC address, VLAN and Timing advance parameters in the DU configuration. @@ -1040,6 +1053,8 @@ In this case, you should reverify that `ptp4l` and `phc2sys` are working, e.g., do not do any jumps (during the last hour). While an occasional jump is not necessarily problematic for the gNB, many such messages mean that the system is not working, and UEs might not be able to attach or reach good performance. +Also, you can try to compile with polling (see [the build +section](.#build-oai-gnb)) to see if it resolves the problem. # Operation with multiple RUs diff --git a/radio/fhi_72/CMakeLists.txt b/radio/fhi_72/CMakeLists.txt index 4068b285d8..3fab4f5d47 100644 --- a/radio/fhi_72/CMakeLists.txt +++ b/radio/fhi_72/CMakeLists.txt @@ -39,6 +39,8 @@ target_link_libraries(oran_fhlib_5g PRIVATE ${T_LIB}) # TODO: can be removed? target_include_directories(oran_fhlib_5g PRIVATE ${xran_INCLUDE_DIRS}/../src/) +add_boolean_option(OAI_FHI72_USE_POLLING OFF "Enable polling in FHI72 driver" ON) + set_target_properties(oran_fhlib_5g PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) add_custom_command(TARGET oran_fhlib_5g POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink liboran_fhlib_5g.so liboai_transpro.so diff --git a/radio/fhi_72/oaioran.c b/radio/fhi_72/oaioran.c index 034035b4bc..f4368a481e 100644 --- a/radio/fhi_72/oaioran.c +++ b/radio/fhi_72/oaioran.c @@ -39,7 +39,10 @@ #include "common/utils/threadPool/notified_fifo.h" -#define USE_POLLING 1 +#if OAI_FHI72_USE_POLLING +#define USE_POLLING +#endif + // Declare variable useful for the send buffer function volatile uint8_t first_call_set = 0; volatile uint8_t first_rx_set = 0;