src/dpdk/lib/librte_eal/linux/eal_vfio.c
static int
vfio_spapr_size_walk(const struct rte_memseg_list *msl, void *arg)
{
	struct spapr_size_walk_param *param = arg;
	uint64_t max = (uint64_t) msl->base_va + (uint64_t) msl->len;

	if (msl->external && !msl->heap) {
		/* ignore user managed external memory */
		param->is_user_managed = true;
		return 0;
	}

	if (max > param->max_va) {
		param->page_sz = msl->page_sz;
		param->max_va = max;
	}

	return 0;
}
/*
 * In order to set the DMA window size required for the SPAPR IOMMU
 * we need to walk the existing virtual memory allocations as well as
 * find the hugepage size used.
 */
In order to set the DMA window size required for the SPAPR IOMMU
we need to walk the existing virtual memory allocations as well as
find the hugepage size used.
In order to set the DMA window size required for the SPAPR IOMMU we need to walk the existing virtual memory allocations as well as find the hugepage size used .
static int
vfio_spapr_size_walk(const struct rte_memseg_list *msl, void *arg)
{
	struct spapr_size_walk_param *param = arg;
	uint64_t max = (uint64_t) msl->base_va + (uint64_t) msl->len;
	if (msl->external && !msl->heap) {
		param->is_user_managed = true;
		return 0;
	}
	if (max > param->max_va) {
		param->page_sz = msl->page_sz;
		param->max_va = max;
	}
	return 0;
}
static int vfio_spapr_size_walk ( const struct rte_memseg_list * msl , void * arg ) { struct spapr_size_walk_param * param = arg ; uint64_t max = ( uint64_t ) msl -> base_va + ( uint64_t ) msl -> len ; if ( msl -> external && ! msl -> heap ) { param -> is_user_managed = true ; return 0 ; } if ( max > param -> max_va ) { param -> page_sz = msl -> page_sz ; param -> max_va = max ; } return 0 ; }
In order to set the DMA window size required for the SPAPR IOMMU
 we need to walk the existing virtual memory allocations as well as
 find the hugepage size used.
In order to set the DMA window size required for the SPAPR IOMMU we need to walk the existing virtual memory allocations as well as find the hugepage size used .
/* ignore user managed external memory */