[dpdk-dev] [PATCH 6/6] eal: fix warning seen with armv8a clang

Jerin Jacob jerin.jacob at caviumnetworks.com
Thu May 11 07:52:41 CEST 2017


-----Original Message-----
> Date: Wed, 10 May 2017 03:16:43 -0700
> From: Ashwin Sekhar T K <ashwin.sekhar at caviumnetworks.com>
> To: thomas at monjalon.net, jerin.jacob at caviumnetworks.com,
>  maciej.czekaj at caviumnetworks.com, viktorin at rehivetech.com,
>  jianbo.liu at linaro.org, bruce.richardson at intel.com,
>  pablo.de.lara.guarch at intel.com, konstantin.ananyev at intel.com
> Cc: dev at dpdk.org, Ashwin Sekhar T K <ashwin.sekhar at caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH 6/6] eal: fix warning seen with armv8a clang
> X-Mailer: git-send-email 2.13.0.rc1
> 
> Fixed warning -Wempty-body seen with armv8a clang compilation.
> 
> Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar at caviumnetworks.com>
> ---
>  lib/librte_eal/linuxapp/eal/Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile
> index 640afd088..dea1c1d59 100644
> --- a/lib/librte_eal/linuxapp/eal/Makefile
> +++ b/lib/librte_eal/linuxapp/eal/Makefile
> @@ -126,6 +126,10 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
>  CFLAGS_eal_thread.o += -Wno-return-type
>  endif
>  
> +ifeq ($(CONFIG_RTE_ARCH_ARM64)$(CONFIG_RTE_TOOLCHAIN_CLANG),yy)
> +CFLAGS_eal_common_launch.o += -Wno-empty-body
> +endif

clang pointed us an improvement here. You can add rte_pause() to reduce
the power usage while waiting in rte_eal_wait_lcore().

That will remove the need for -Wno-empty-body for clang too.

➜ [master][dpdk-master] $ git diff
diff --git a/lib/librte_eal/common/eal_common_launch.c
b/lib/librte_eal/common/eal_common_launch.c
index 229c3a0..1848466 100644
--- a/lib/librte_eal/common/eal_common_launch.c
+++ b/lib/librte_eal/common/eal_common_launch.c
@@ -54,7 +54,8 @@ rte_eal_wait_lcore(unsigned slave_id)
                return 0;
 
        while (lcore_config[slave_id].state != WAIT &&
-              lcore_config[slave_id].state != FINISHED);
+              lcore_config[slave_id].state != FINISHED)
+               rte_pause();
 


> +
>  INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h
>  
>  SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include/exec-env := \
> -- 
> 2.13.0.rc1
> 


More information about the dev mailing list