fhi_72: allow to provide dpdk_iova_mode to xran
In DPDK, IO Virtual Addresses (IOVA) refers to the memory addressing scheme used for IO operations. The two IOVA modes supported by DPDK are: - IOVA as Physical Address (PA): IO memory addresses correspond directly to physical addresses, no address translation required. - IOVA as Virtual Address (VA): IO memory addresses align with user-space virtual addresses, requiring IOMMU to remap physical memory. Previously, this was hardcoded to 0, to use IOVA as PA mode, with xRAN's DPDK EAL initialization using the "--iova-mode=pa" flag. This commit introduces a gNB configuration option to allow users to select the desired IOVA mode. The default remains PA mode to ensure backward compatibility. Using IOVA VA mode allows DPDK to run without requiring SYS_ADMIN capability in the docker container.
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user