From 645e9dd3cd50afc620f5ba78617eca8d3fbc2b48 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Mon, 16 Sep 2024 16:57:17 +0200 Subject: [PATCH 1/3] fhi_72: allow to provide dpdk_mem_size to xran xran has a mechanism to request DPDK to allocate a configurable amount of bytes for huge pages. We set it to 0 until now; expose this variable through configuration, and provide a meaningful default 8192 MiB. Provide documentation. --- doc/ORAN_FHI7.2_Tutorial.md | 6 ++++++ radio/fhi_72/oran-config.c | 2 +- radio/fhi_72/oran-params.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/ORAN_FHI7.2_Tutorial.md b/doc/ORAN_FHI7.2_Tutorial.md index 0a4036423b..a7bfe56a0b 100644 --- a/doc/ORAN_FHI7.2_Tutorial.md +++ b/doc/ORAN_FHI7.2_Tutorial.md @@ -783,6 +783,12 @@ Edit the sample OAI gNB configuration file and check following parameters: * `ru_addr`: RU C- and U-plane MAC-addresses (format `UU:VV:WW:XX:YY:ZZ`, hexadecimal numbers) * `mtu`: Maximum Transmission Unit for the RU, specified by RU vendor + * `dpdk_mem_size`: the huge page size that should be pre-allocated by DPDK + _for NUMA node 0_; by default, this is 8192 MiB (corresponding to 8 huge + pages à 1024 MiB each, see above). In the current implementation, you + cannot preallocate memory on NUMA nodes other than 0; in this case, set + this to 0 (no pre-allocation) and so that DPDK will allocate it on-demand + on the right NUMA node. * `fh_config`: parameters that need to match RU parameters * timing parameters (starting with `T`) depend on the RU: `Tadv_cp_dl` is a single number, the rest pairs of numbers `(x, y)` specifying minimum and diff --git a/radio/fhi_72/oran-config.c b/radio/fhi_72/oran-config.c index ddee538dfd..2973fdc2b0 100644 --- a/radio/fhi_72/oran-config.c +++ b/radio/fhi_72/oran-config.c @@ -498,7 +498,7 @@ static bool set_fh_io_cfg(struct xran_io_cfg *io_cfg, const paramdef_t *fhip, in //io_cfg->bbdev_dev = NULL; io_cfg->bbdev_mode = XRAN_BBDEV_NOT_USED; // none io_cfg->dpdkIoVaMode = 0; /* IOVA mode */ - io_cfg->dpdkMemorySize = 0; /* DPDK memory size */ + io_cfg->dpdkMemorySize = *gpd(fhip, nump, ORAN_CONFIG_DPDK_MEM_SIZE)->uptr; io_cfg->core = *gpd(fhip, nump, ORAN_CONFIG_IO_CORE)->iptr; io_cfg->system_core = *gpd(fhip, nump, ORAN_CONFIG_SYSTEM_CORE)->iptr; io_cfg->pkt_proc_core = get_u64_mask(gpd(fhip, nump, ORAN_CONFIG_WORKER_CORES)); diff --git a/radio/fhi_72/oran-params.h b/radio/fhi_72/oran-params.h index c7e17ea42a..ff8058f9ca 100644 --- a/radio/fhi_72/oran-params.h +++ b/radio/fhi_72/oran-params.h @@ -37,6 +37,7 @@ #define ORAN_CONFIG_FILE_PREFIX "file_prefix" #define ORAN_CONFIG_NETHPERPORT "eth_lines" #define ORAN_CONFIG_NETHSPEED "eth_speed" +#define ORAN_CONFIG_DPDK_MEM_SIZE "dpdk_mem_size" // clang-format off // TODO: PCI addr check @@ -52,6 +53,7 @@ {ORAN_CONFIG_FILE_PREFIX, "DPDK file-prefix\n", 0, .strptr=NULL, .defstrval="wls_0", TYPE_STRING, 0}, \ {ORAN_CONFIG_NETHPERPORT, "number of links per port\n", 0, .uptr=NULL, .defuintval=1, TYPE_UINT, 0}, \ {ORAN_CONFIG_NETHSPEED, "ethernet speed link\n", 0, .uptr=NULL, .defuintval=10, TYPE_UINT, 0}, \ + {ORAN_CONFIG_DPDK_MEM_SIZE, "DPDK huge page pre-allocation in MiB\n", 0, .uptr=NULL, .defuintval=8192, TYPE_UINT, 0}, \ } // clang-format on From 513f0beb37539d0887915f4400a4ef280c32c3c6 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 20 Sep 2024 15:14:58 +0200 Subject: [PATCH 2/3] Parse xran version strings for Bronze, E, F --- cmake_targets/tools/MODULES/Findxran.cmake | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cmake_targets/tools/MODULES/Findxran.cmake b/cmake_targets/tools/MODULES/Findxran.cmake index 961efc4e38..39f0ffeb75 100644 --- a/cmake_targets/tools/MODULES/Findxran.cmake +++ b/cmake_targets/tools/MODULES/Findxran.cmake @@ -101,17 +101,16 @@ endif() file(STRINGS ${xran_VERSION_FILE} xran_VERSION_LINE REGEX "^#define[ \t]+VERSIONX[ \t]+\"[a-z_.0-9]+\"$") string(REGEX REPLACE "^#define[ \t]+VERSIONX[ \t]+\"([a-z_.0-9]+)\"$" "\\1" xran_VERSION_STRING "${xran_VERSION_LINE}") -message(STATUS "Found xran release ${xran_VERSION_STRING}") -set(xran_VERSION "NOTFOUND") -if (xran_VERSION_STRING STREQUAL "oran_e_maintenance_release_v1.0") - set(xran_VERSION 5.1.0) -elseif (xran_VERSION_STRING STREQUAL "oran_e_maintenance_release_v1.1") - set(xran_VERSION 5.1.1) -elseif (xran_VERSION_STRING STREQUAL "oran_e_maintenance_release_v1.2") - set(xran_VERSION 5.1.2) -elseif (xran_VERSION_STRING STREQUAL "oran_e_maintenance_release_v1.3") - set(xran_VERSION 5.1.3) +if (xran_VERSION_STRING MATCHES "^oran_e_maintenance_release_v") + string(REGEX REPLACE "oran_e_maintenance_release_v([0-9]+).([0-9]+)" "5.\\1.\\2" xran_VERSION ${xran_VERSION_STRING}) +elseif(xran_VERSION_STRING MATCHES "^oran_f_release_v") + string(REGEX REPLACE "oran_f_release_v([0-9]+).([0-9]+)" "6.\\1.\\2" xran_VERSION ${xran_VERSION_STRING}) +elseif(xran_VERSION_STRING MATCHES "^oran_bronze_release_v") + string(REGEX REPLACE "oran_bronze_release_v([0-9]+).([0-9]+)" "2.\\1.\\2" xran_VERSION ${xran_VERSION_STRING}) +else() + message(FATAL_ERROR "unrecognized xran version string: ${xran_VERSION_STRING}") endif() +message(STATUS "Found xran release ${xran_VERSION_STRING} (v${xran_VERSION})") unset(xran_VERSION_LINE) unset(xran_VERSION_STRING) unset(xran_VERSION_FILE) From 68c28a4828c904b83c51dbf2d97b2fe1bfa94413 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 20 Sep 2024 09:19:43 +0200 Subject: [PATCH 3/3] Modify default xran DPDK socket memory/limit to 0 The default values set by xran for DPDK socket memory/limit is 8192. It is changed when the variable for the memory size, given down to xran, is non-zero (cf also previous patch). Since the last patch, if nothing is given in OAI configuration, OAI will pass down a size of 8192. However, a configuration value of 0 is a valid choice (it is a pre-allocation, DPDK will allocate dynamically), so modify the default in xran to be 0 so that all sizes, including 0, can be given to DPDK. Note that the currently used implementation of xran will always try to allocate this memory on NUMA node 0. If you want to use another one, this field has to be set to 0 (no pre-allocation), and DPDK will allocate it dynamically. Co-authored-by: Sagar Arora --- .../E/oaioran_E.patch | 19 +++++++++++++++---- radio/fhi_72/CMakeLists.txt | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/cmake_targets/tools/oran_fhi_integration_patches/E/oaioran_E.patch b/cmake_targets/tools/oran_fhi_integration_patches/E/oaioran_E.patch index a40aefac2b..e1915cd996 100644 --- a/cmake_targets/tools/oran_fhi_integration_patches/E/oaioran_E.patch +++ b/cmake_targets/tools/oran_fhi_integration_patches/E/oaioran_E.patch @@ -1,5 +1,5 @@ diff --git a/fhi_lib/app/src/common.h b/fhi_lib/app/src/common.h -index 7508117..0dbe0bd 100644 +index 7508117..ce17ebd 100644 --- a/fhi_lib/app/src/common.h +++ b/fhi_lib/app/src/common.h @@ -28,7 +28,7 @@ @@ -7,7 +7,7 @@ index 7508117..0dbe0bd 100644 #include -#define VERSIONX "oran_e_maintenance_release_v1.0" -+#define VERSIONX "oran_e_maintenance_release_v1.3" ++#define VERSIONX "oran_e_maintenance_release_v1.4" #define APP_O_DU 0 #define APP_O_RU 1 @@ -136,9 +136,20 @@ index 7d3afc5..e2f1f21 100644 inline int xran_prepare_iq_symbol_portion( struct rte_mbuf *mbuf, diff --git a/fhi_lib/lib/ethernet/ethdi.c b/fhi_lib/lib/ethernet/ethdi.c -index b6ba257..b53325f 100644 +index b6ba257..1618f65 100644 --- a/fhi_lib/lib/ethernet/ethdi.c +++ b/fhi_lib/lib/ethernet/ethdi.c +@@ -326,8 +326,8 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg, + char bbdev_wdev[32] = ""; + char bbdev_vdev[32] = ""; + char iova_mode[32] = "--iova-mode=pa"; +- char socket_mem[32] = "--socket-mem=8192"; +- char socket_limit[32] = "--socket-limit=8192"; ++ char socket_mem[32] = "--socket-mem=0"; ++ char socket_limit[32] = "--socket-limit=0"; + char ring_name[32] = ""; + int32_t xran_port = -1; + portid_t port_id; @@ -335,6 +335,7 @@ xran_ethdi_init_dpdk_io(char *name, const struct xran_io_cfg *io_cfg, uint16_t count; @@ -183,7 +194,7 @@ index e6d3067..8e0abee 100644 static int16_t saturateAbs(int16_t inVal) { diff --git a/fhi_lib/lib/src/xran_bfp_uplane.cpp b/fhi_lib/lib/src/xran_bfp_uplane.cpp -index a345df4..109b05a 100644 +index a345df4..2a94e01 100644 --- a/fhi_lib/lib/src/xran_bfp_uplane.cpp +++ b/fhi_lib/lib/src/xran_bfp_uplane.cpp @@ -90,7 +90,7 @@ namespace BFP_UPlane diff --git a/radio/fhi_72/CMakeLists.txt b/radio/fhi_72/CMakeLists.txt index 5794848afd..2f1b0a356e 100644 --- a/radio/fhi_72/CMakeLists.txt +++ b/radio/fhi_72/CMakeLists.txt @@ -9,7 +9,7 @@ endif() pkg_check_modules(dpdk REQUIRED libdpdk) pkg_check_modules(numa REQUIRED numa) -find_package(xran 5.1.3 EXACT REQUIRED) # E release -> 5 +find_package(xran 5.1.4 EXACT REQUIRED) # E release -> 5 # Ignore xran-specific warning: we don't care/can't change the following warning, so suppress # alignment 1 of 'struct XYZ' is less than 2