eal: add include for rte_byteorder on ARM

Message ID 20210604114752.412856-1-michael.pfeiffer@tu-ilmenau.de (mailing list archive)
State Superseded, archived
Headers
Series eal: add include for rte_byteorder on ARM |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-testing success Testing PASS

Commit Message

Michael Pfeiffer June 4, 2021, 11:47 a.m. UTC
  Including rte_byteorder.h may fail for ARM builds with 'Platform must
be built with RTE_FORCE_INTRINSICS' if rte_config.h is not included
before. Include rte_config.h from rte_byteorder.h to solve the issue.

Signed-off-by: Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de>
---
 lib/eal/arm/include/rte_byteorder.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
  

Comments

Jerin Jacob June 6, 2021, 5:56 p.m. UTC | #1
On Fri, Jun 4, 2021 at 5:18 PM Michael Pfeiffer
<michael.pfeiffer@tu-ilmenau.de> wrote:
>
> Including rte_byteorder.h may fail for ARM builds with 'Platform must
> be built with RTE_FORCE_INTRINSICS' if rte_config.h is not included
> before. Include rte_config.h from rte_byteorder.h to solve the issue.
>
> Signed-off-by: Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de>

Since -include rte_config.h added by meson, This issue is not coming
with in tree build.
IMO, Fix is correct.

Please send v2 with
- Add Fixes: tag and Cc: stable@dpdk.org so that i can be backported
to stable tree.
- Fix following checkformat.sh warning

Wrong headline format:
        eal: add include for rte_byteorder on ARM
Wrong headline case:
                        "eal: add include for rte_byteorder on ARM": ARM --> Arm

- Subject could be "eal: arm: fix out of tree build" or so.

With above change:

Acked-by: Jerin Jacob <jerinj@marvell.com>



> ---
>  lib/eal/arm/include/rte_byteorder.h | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/lib/eal/arm/include/rte_byteorder.h b/lib/eal/arm/include/rte_byteorder.h
> index df2f1d87ba..1f90db9943 100644
> --- a/lib/eal/arm/include/rte_byteorder.h
> +++ b/lib/eal/arm/include/rte_byteorder.h
> @@ -5,18 +5,19 @@
>  #ifndef _RTE_BYTEORDER_ARM_H_
>  #define _RTE_BYTEORDER_ARM_H_
>
> -#ifndef RTE_FORCE_INTRINSICS
> -#  error Platform must be built with RTE_FORCE_INTRINSICS
> -#endif
> -
>  #ifdef __cplusplus
>  extern "C" {
>  #endif
>
>  #include <stdint.h>
>  #include <rte_common.h>
> +#include <rte_config.h>
>  #include "generic/rte_byteorder.h"
>
> +#ifndef RTE_FORCE_INTRINSICS
> +#  error Platform must be built with RTE_FORCE_INTRINSICS
> +#endif
> +
>  /* fix missing __builtin_bswap16 for gcc older then 4.8 */
>  #if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
>
> --
> 2.31.1
>
  

Patch

diff --git a/lib/eal/arm/include/rte_byteorder.h b/lib/eal/arm/include/rte_byteorder.h
index df2f1d87ba..1f90db9943 100644
--- a/lib/eal/arm/include/rte_byteorder.h
+++ b/lib/eal/arm/include/rte_byteorder.h
@@ -5,18 +5,19 @@ 
 #ifndef _RTE_BYTEORDER_ARM_H_
 #define _RTE_BYTEORDER_ARM_H_
 
-#ifndef RTE_FORCE_INTRINSICS
-#  error Platform must be built with RTE_FORCE_INTRINSICS
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 #include <stdint.h>
 #include <rte_common.h>
+#include <rte_config.h>
 #include "generic/rte_byteorder.h"
 
+#ifndef RTE_FORCE_INTRINSICS
+#  error Platform must be built with RTE_FORCE_INTRINSICS
+#endif
+
 /* fix missing __builtin_bswap16 for gcc older then 4.8 */
 #if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))