Commit 4dfbd0dd authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/oran-iova-config' into integration_2025_w02 (!3189)

fhi_72: allow to provide dpdk_iova_mode to xran

- Introduce a gNB configuration option that enables users to select the
  desired IOVA mode for DPDK ("PA" or "VA") with dpdk_iova_mode
  parameters in fhi_72 configuration section. If not set, the default
  remains PA mode to ensure backward compatibility with existing
  configurations. Detailed information about IOVA modes, including their
  advantages and disadvantages, can be found in the DPDK documentation:
  Memory in DPDK Part 2: Deep Dive into IOVA
- Using IOVA VA mode allows DPDK to run without requiring SYS_ADMIN
  capability for the docker container.
- Switch to IOVA VA mode in the FHI7.2 pipeline and reduce the required
  capabilities for the docker container.
parents 39d9d32e acd8f073
......@@ -235,6 +235,7 @@ log_config :
fhi_72 = {
dpdk_devices = ("0000:c3:11.0", "0000:c3:11.1");
dpdk_iova_mode = "VA";
system_core = 0;
io_core = 1;
worker_cores = (2);
......
......@@ -2,7 +2,6 @@ services:
oai-gnb:
image: ${REGISTRY:-oaisoftwarealliance}/oai-gnb-fhi72:${TAG:-develop}
cap_add:
- SYS_ADMIN
- IPC_LOCK
- SYS_NICE
cap_drop:
......
......@@ -917,6 +917,17 @@ Edit the sample OAI gNB configuration file and check following parameters:
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.
* `dpdk_iova_mode`: Specifies DPDK IO Virtual Address (IOVA) mode:
* `PA`: IOVA as Physical Address (PA) mode, where DPDK IOVA memory layout
corresponds directly to the physical memory layout.
* `VA`: IOVA as Virtual Address (VA) mode, where DPDK IOVA addresses do not
follow the physical memory layout. Uses IOMMU to remap physical memory.
Requires kernel support and IOMMU for address translation.
* If not specified, default value of "PA" is used (for backwards compabilibity;
it was hardcoded to PA in the past). However, we recommend using "VA" mode
as it offers several benefits. For a detailed explanation of DPDK IOVA,
including the advantages and disadvantages of each mode, refer to
[Memory in DPDK](https://www.dpdk.org/memory-in-dpdk-part-2-deep-dive-into-iova/)
* `owdm_enable`: used for eCPRI One-Way Delay Measurements; it depends if the RU supports it; if not set to 1 (enabled), default value is 0 (disabled)
* `fh_config`: parameters that need to match RU parameters
* timing parameters (starting with `T`) depend on the RU: `Tadv_cp_dl` is a
......
......@@ -146,6 +146,9 @@ on DPDK:
- `IPC_LOCK` (becomes mandatory with DPDK)
- `SYS_RESOURCE`
- `NET_RAW`
- `SYS_ADMIN`: This is required by DPDK when using IOVA PA (Physical Address)
mode to read `/proc/self/pagemaps`. However, if DPDK EAL is configured to use
IOVA VA (Virtual Address) mode, this capability is no longer required.
## Capabilities with UHD
......
......@@ -472,7 +472,9 @@ static bool set_fh_io_cfg(struct xran_io_cfg *io_cfg, const paramdef_t *fhip, in
}
io_cfg->bbdev_dev[0] = NULL; // BBDev dev name; max devices = 1
io_cfg->bbdev_mode = XRAN_BBDEV_NOT_USED; // DPDK for BBDev
io_cfg->dpdkIoVaMode = 0; // IOVA mode
int dpdk_iova_mode_idx = config_paramidx_fromname((paramdef_t *)fhip, nump, ORAN_CONFIG_DPDK_IOVA_MODE);
AssertFatal(dpdk_iova_mode_idx >= 0,"Index for dpdk_iova_mode config option not found!");
io_cfg->dpdkIoVaMode = config_get_processedint(config_get_if(), (paramdef_t *)&fhip[dpdk_iova_mode_idx]); // IOVA mode
io_cfg->dpdkMemorySize = *gpd(fhip, nump, ORAN_CONFIG_DPDK_MEM_SIZE)->uptr; // DPDK max memory allocation
/* the following core assignment is needed for rte_eal_init() function within xran library;
......@@ -586,7 +588,11 @@ static bool set_fh_init(struct xran_fh_init *fh_init, enum xran_category xran_ca
}
paramdef_t fhip[] = ORAN_GLOBALPARAMS_DESC;
checkedparam_t fhip_CheckParams[] = ORAN_GLOBALPARAMS_CHECK_DESC;
static_assert(sizeofArray(fhip) == sizeofArray(fhip_CheckParams),
"fhip and fhip_CheckParams should have the same size");
int nump = sizeofArray(fhip);
config_set_checkfunctions(fhip, fhip_CheckParams, nump);
int ret = config_get(config_get_if(), fhip, nump, CONFIG_STRING_ORAN);
if (ret <= 0) {
printf("problem reading section \"%s\"\n", CONFIG_STRING_ORAN);
......
......@@ -37,6 +37,7 @@
#define ORAN_CONFIG_NETHPERPORT "eth_lines"
#define ORAN_CONFIG_NETHSPEED "eth_speed"
#define ORAN_CONFIG_DPDK_MEM_SIZE "dpdk_mem_size"
#define ORAN_CONFIG_DPDK_IOVA_MODE "dpdk_iova_mode"
#define ORAN_CONFIG_ECPRI_OWDM "owdm_enable"
// clang-format off
......@@ -53,8 +54,28 @@
{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}, \
{ORAN_CONFIG_DPDK_IOVA_MODE, "DPDK IOVA mode\n", 0, .strptr=NULL, .defstrval="PA", TYPE_STRING, 0}, \
{ORAN_CONFIG_ECPRI_OWDM, "eCPRI One-Way Delay Measurements\n", PARAMFLAG_BOOL, .uptr=NULL, .defuintval=0, TYPE_UINT, 0}, \
}
// clang-format off
#define ORAN_GLOBALPARAMS_CHECK_DESC { \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s3a = { config_checkstr_assign_integer, \
{"PA", "VA"}, {0, 1}, 2} }, \
{ .s5 = { NULL } }, \
}
// clang-format on
#define CONFIG_STRING_ORAN_FH "fh_config"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment