[dpdk-dev] eal: fix remaining checks for other 64bits architectures

Message ID 1416842331-7716-1-git-send-email-david.marchand@6wind.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

David Marchand Nov. 24, 2014, 3:18 p.m. UTC
  RTE_ARCH_X86_64 can not be used as a way to determine if we are building for
64bits cpus. Instead, RTE_ARCH_64 should be used.

Signed-off-by: David Marchand <david.marchand@6wind.com>
---
 lib/librte_eal/linuxapp/eal/eal.c               |    2 +-
 lib/librte_eal/linuxapp/eal/eal_hugepage_info.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Chao Zhu Nov. 24, 2014, 3:58 p.m. UTC | #1
Quoting David Marchand <david.marchand@6wind.com>:

> RTE_ARCH_X86_64 can not be used as a way to determine if we are building for
> 64bits cpus. Instead, RTE_ARCH_64 should be used.
>
> Signed-off-by: David Marchand <david.marchand@6wind.com>
> ---
>  lib/librte_eal/linuxapp/eal/eal.c               |    2 +-
>  lib/librte_eal/linuxapp/eal/eal_hugepage_info.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/librte_eal/linuxapp/eal/eal.c  
> b/lib/librte_eal/linuxapp/eal/eal.c
> index f9517c7..e321524 100644
> --- a/lib/librte_eal/linuxapp/eal/eal.c
> +++ b/lib/librte_eal/linuxapp/eal/eal.c
> @@ -450,7 +450,7 @@ eal_parse_base_virtaddr(const char *arg)
>  		return -1;
>
>  	/* make sure we don't exceed 32-bit boundary on 32-bit target */
> -#ifndef RTE_ARCH_X86_64
> +#ifndef RTE_ARCH_64
>  	if (addr >= UINTPTR_MAX)
>  		return -1;
>  #endif
> diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c  
> b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
> index 73d1cdb..590cb56 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
> @@ -324,7 +324,7 @@ eal_hugepage_info_init(void)
>  				 * later they will be sorted */
>  				hpi->num_pages[0] = get_num_hugepages(dirent->d_name);
>
> -#ifndef RTE_ARCH_X86_64
> +#ifndef RTE_ARCH_64
>  				/* for 32-bit systems, limit number of hugepages to 1GB per page size */
>  				hpi->num_pages[0] = RTE_MIN(hpi->num_pages[0],
>  						RTE_PGSIZE_1G / hpi->hugepage_sz);
> --
> 1.7.10.4
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
  
Thomas Monjalon Nov. 27, 2014, 7:47 a.m. UTC | #2
> > RTE_ARCH_X86_64 can not be used as a way to determine if we are building for
> > 64bits cpus. Instead, RTE_ARCH_64 should be used.
> >
> > Signed-off-by: David Marchand <david.marchand@6wind.com>
> 
> Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>

Applied

Thanks
  

Patch

diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index f9517c7..e321524 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -450,7 +450,7 @@  eal_parse_base_virtaddr(const char *arg)
 		return -1;
 
 	/* make sure we don't exceed 32-bit boundary on 32-bit target */
-#ifndef RTE_ARCH_X86_64
+#ifndef RTE_ARCH_64
 	if (addr >= UINTPTR_MAX)
 		return -1;
 #endif
diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
index 73d1cdb..590cb56 100644
--- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
+++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
@@ -324,7 +324,7 @@  eal_hugepage_info_init(void)
 				 * later they will be sorted */
 				hpi->num_pages[0] = get_num_hugepages(dirent->d_name);
 
-#ifndef RTE_ARCH_X86_64
+#ifndef RTE_ARCH_64
 				/* for 32-bit systems, limit number of hugepages to 1GB per page size */
 				hpi->num_pages[0] = RTE_MIN(hpi->num_pages[0],
 						RTE_PGSIZE_1G / hpi->hugepage_sz);