[dpdk-dev] [PATCH 1/2] eal: honor IOVA mode for no-huge case

Burakov, Anatoly anatoly.burakov at intel.com
Wed Oct 11 13:27:42 CEST 2017


On 11-Oct-17 11:33 AM, Jianfeng Tan wrote:
> With the introduction of IOVA mode, the only blocker to run
> with 4KB pages for NICs binding to vfio-pci, is that
> RTE_BAD_PHYS_ADDR is not a valid IOVA address.
> 
> We can refine this by using VA as IOVA if it's IOVA mode.
> 
> Signed-off-by: Jianfeng Tan <jianfeng.tan at intel.com>
> ---
>   lib/librte_eal/linuxapp/eal/eal_memory.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
> index 28bca49..187d338 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_memory.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
> @@ -1030,7 +1030,10 @@ rte_eal_hugepage_init(void)
>   					strerror(errno));
>   			return -1;
>   		}
> -		mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR;
> +		if (rte_eal_iova_mode() == RTE_IOVA_VA)
> +			mcfg->memseg[0].phys_addr = (uintptr_t)addr;
> +		else
> +			mcfg->memseg[0].phys_addr = RTE_BAD_PHYS_ADDR;
>   		mcfg->memseg[0].addr = addr;
>   		mcfg->memseg[0].hugepage_sz = RTE_PGSIZE_4K;
>   		mcfg->memseg[0].len = internal_config.memory;
> 
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>

-- 
Thanks,
Anatoly


More information about the dev mailing list