build: remove redundant config include

Message ID 20200210095334.1167059-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series build: remove redundant config include |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/Intel-compilation fail apply issues

Commit Message

Thomas Monjalon Feb. 10, 2020, 9:53 a.m. UTC
  The header file rte_config.h is always included by make or meson.
If required in an exported API header file, it must be included
in the public header file for external applications.
In the internal files, explicit include of rte_config.h is useless,
and can be removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test-pmd/config.c                   | 1 -
 buildtools/pmdinfogen/pmdinfogen.h      | 1 -
 drivers/common/mlx5/mlx5_glue.c         | 2 --
 drivers/crypto/ccp/rte_ccp_pmd.c        | 1 -
 drivers/net/af_xdp/rte_eth_af_xdp.c     | 1 -
 drivers/net/failsafe/failsafe_intr.c    | 1 -
 drivers/net/hinic/base/hinic_compat.h   | 1 -
 drivers/net/mlx4/mlx4.c                 | 1 -
 drivers/net/mlx5/mlx5.c                 | 1 -
 drivers/net/vdev_netvsc/vdev_netvsc.c   | 1 -
 lib/librte_eal/common/eal_common_mcfg.c | 1 -
 lib/librte_eal/common/eal_memcfg.h      | 1 -
 12 files changed, 13 deletions(-)
  

Comments

Matan Azrad Feb. 10, 2020, 9:58 a.m. UTC | #1
From: Thomas Monjalon
> Subject: [PATCH] build: remove redundant config include
> 
> The header file rte_config.h is always included by make or meson.
> If required in an exported API header file, it must be included in the public
> header file for external applications.
> In the internal files, explicit include of rte_config.h is useless, and can be
> removed.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@mellanox.com>
  
David Marchand Feb. 10, 2020, 10:25 a.m. UTC | #2
On Mon, Feb 10, 2020 at 10:54 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The header file rte_config.h is always included by make or meson.
> If required in an exported API header file, it must be included
> in the public header file for external applications.
> In the internal files, explicit include of rte_config.h is useless,
> and can be removed.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  app/test-pmd/config.c                   | 1 -
>  buildtools/pmdinfogen/pmdinfogen.h      | 1 -
>  drivers/common/mlx5/mlx5_glue.c         | 2 --
>  drivers/crypto/ccp/rte_ccp_pmd.c        | 1 -
>  drivers/net/af_xdp/rte_eth_af_xdp.c     | 1 -
>  drivers/net/failsafe/failsafe_intr.c    | 1 -
>  drivers/net/hinic/base/hinic_compat.h   | 1 -
>  drivers/net/mlx4/mlx4.c                 | 1 -
>  drivers/net/mlx5/mlx5.c                 | 1 -
>  drivers/net/vdev_netvsc/vdev_netvsc.c   | 1 -
>  lib/librte_eal/common/eal_common_mcfg.c | 1 -
>  lib/librte_eal/common/eal_memcfg.h      | 1 -
>  12 files changed, 13 deletions(-)

Acked-by: David Marchand <david.marchand@redhat.com>
  
Neil Horman Feb. 10, 2020, 1:39 p.m. UTC | #3
On Mon, Feb 10, 2020 at 10:53:34AM +0100, Thomas Monjalon wrote:
> The header file rte_config.h is always included by make or meson.
> If required in an exported API header file, it must be included
> in the public header file for external applications.
> In the internal files, explicit include of rte_config.h is useless,
> and can be removed.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  app/test-pmd/config.c                   | 1 -
>  buildtools/pmdinfogen/pmdinfogen.h      | 1 -
>  drivers/common/mlx5/mlx5_glue.c         | 2 --
>  drivers/crypto/ccp/rte_ccp_pmd.c        | 1 -
>  drivers/net/af_xdp/rte_eth_af_xdp.c     | 1 -
>  drivers/net/failsafe/failsafe_intr.c    | 1 -
>  drivers/net/hinic/base/hinic_compat.h   | 1 -
>  drivers/net/mlx4/mlx4.c                 | 1 -
>  drivers/net/mlx5/mlx5.c                 | 1 -
>  drivers/net/vdev_netvsc/vdev_netvsc.c   | 1 -
>  lib/librte_eal/common/eal_common_mcfg.c | 1 -
>  lib/librte_eal/common/eal_memcfg.h      | 1 -
>  12 files changed, 13 deletions(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 9669cbd4cb..67840d86b7 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -49,7 +49,6 @@
>  #include <rte_pmd_bnxt.h>
>  #endif
>  #include <rte_gro.h>
> -#include <rte_config.h>
>  
>  #include "testpmd.h"
>  
> diff --git a/buildtools/pmdinfogen/pmdinfogen.h b/buildtools/pmdinfogen/pmdinfogen.h
> index c8a9e2136a..160867b9f3 100644
> --- a/buildtools/pmdinfogen/pmdinfogen.h
> +++ b/buildtools/pmdinfogen/pmdinfogen.h
> @@ -24,7 +24,6 @@
>  #include <fcntl.h>
>  #include <unistd.h>
>  #include <elf.h>
> -#include <rte_config.h>
>  #include <rte_pci.h>
>  
>  /* On BSD-alike OSes elf.h defines these according to host's word size */
> diff --git a/drivers/common/mlx5/mlx5_glue.c b/drivers/common/mlx5/mlx5_glue.c
> index 27cf33cdb9..0af0b86677 100644
> --- a/drivers/common/mlx5/mlx5_glue.c
> +++ b/drivers/common/mlx5/mlx5_glue.c
> @@ -14,8 +14,6 @@
>   */
>  #include <sys/types.h>
>  
> -#include <rte_config.h>
> -
>  #include "mlx5_glue.h"
>  
>  static int
> diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
> index b5bb6790bc..f6ea008444 100644
> --- a/drivers/crypto/ccp/rte_ccp_pmd.c
> +++ b/drivers/crypto/ccp/rte_ccp_pmd.c
> @@ -6,7 +6,6 @@
>  #include <rte_bus_pci.h>
>  #include <rte_bus_vdev.h>
>  #include <rte_common.h>
> -#include <rte_config.h>
>  #include <rte_cryptodev.h>
>  #include <rte_cryptodev_pmd.h>
>  #include <rte_pci.h>
> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
> index 683e2a5594..ed784dff19 100644
> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c
> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
> @@ -26,7 +26,6 @@
>  #include <rte_string_fns.h>
>  #include <rte_branch_prediction.h>
>  #include <rte_common.h>
> -#include <rte_config.h>
>  #include <rte_dev.h>
>  #include <rte_eal.h>
>  #include <rte_ether.h>
> diff --git a/drivers/net/failsafe/failsafe_intr.c b/drivers/net/failsafe/failsafe_intr.c
> index 0f34c5bbac..d8728fe7e3 100644
> --- a/drivers/net/failsafe/failsafe_intr.c
> +++ b/drivers/net/failsafe/failsafe_intr.c
> @@ -13,7 +13,6 @@
>  #include <unistd.h>
>  
>  #include <rte_alarm.h>
> -#include <rte_config.h>
>  #include <rte_errno.h>
>  #include <rte_ethdev.h>
>  #include <rte_interrupts.h>
> diff --git a/drivers/net/hinic/base/hinic_compat.h b/drivers/net/hinic/base/hinic_compat.h
> index e4a7f12d15..b72e8cfe26 100644
> --- a/drivers/net/hinic/base/hinic_compat.h
> +++ b/drivers/net/hinic/base/hinic_compat.h
> @@ -18,7 +18,6 @@
>  #include <rte_spinlock.h>
>  #include <rte_cycles.h>
>  #include <rte_log.h>
> -#include <rte_config.h>
>  
>  typedef uint8_t   u8;
>  typedef int8_t    s8;
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
> index 5522eb595c..a1dd658176 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -29,7 +29,6 @@
>  #endif
>  
>  #include <rte_common.h>
> -#include <rte_config.h>
>  #include <rte_dev.h>
>  #include <rte_errno.h>
>  #include <rte_ethdev_driver.h>
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
> index b4ec6cba1a..23a50f3f92 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -29,7 +29,6 @@
>  #include <rte_pci.h>
>  #include <rte_bus_pci.h>
>  #include <rte_common.h>
> -#include <rte_config.h>
>  #include <rte_kvargs.h>
>  #include <rte_rwlock.h>
>  #include <rte_spinlock.h>
> diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
> index be8f19c0c6..9ed74a1d6a 100644
> --- a/drivers/net/vdev_netvsc/vdev_netvsc.c
> +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
> @@ -27,7 +27,6 @@
>  #include <rte_bus.h>
>  #include <rte_bus_vdev.h>
>  #include <rte_common.h>
> -#include <rte_config.h>
>  #include <rte_dev.h>
>  #include <rte_errno.h>
>  #include <rte_ethdev.h>
> diff --git a/lib/librte_eal/common/eal_common_mcfg.c b/lib/librte_eal/common/eal_common_mcfg.c
> index 36a8ca8fcf..49d3ed0ce5 100644
> --- a/lib/librte_eal/common/eal_common_mcfg.c
> +++ b/lib/librte_eal/common/eal_common_mcfg.c
> @@ -2,7 +2,6 @@
>   * Copyright(c) 2019 Intel Corporation
>   */
>  
> -#include <rte_config.h>
>  #include <rte_eal_memconfig.h>
>  #include <rte_version.h>
>  
> diff --git a/lib/librte_eal/common/eal_memcfg.h b/lib/librte_eal/common/eal_memcfg.h
> index 4d650025c2..583fcb5953 100644
> --- a/lib/librte_eal/common/eal_memcfg.h
> +++ b/lib/librte_eal/common/eal_memcfg.h
> @@ -5,7 +5,6 @@
>  #ifndef EAL_MEMCFG_H
>  #define EAL_MEMCFG_H
>  
> -#include <rte_config.h>
>  #include <rte_memory.h>
>  #include <rte_memzone.h>
>  #include <rte_pause.h>
> -- 
> 2.25.0
> 
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>
  
David Marchand Feb. 11, 2020, 4:03 p.m. UTC | #4
On Mon, Feb 10, 2020 at 10:54 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The header file rte_config.h is always included by make or meson.
> If required in an exported API header file, it must be included
> in the public header file for external applications.
> In the internal files, explicit include of rte_config.h is useless,
> and can be removed.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>

Applied, thanks.
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 9669cbd4cb..67840d86b7 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -49,7 +49,6 @@ 
 #include <rte_pmd_bnxt.h>
 #endif
 #include <rte_gro.h>
-#include <rte_config.h>
 
 #include "testpmd.h"
 
diff --git a/buildtools/pmdinfogen/pmdinfogen.h b/buildtools/pmdinfogen/pmdinfogen.h
index c8a9e2136a..160867b9f3 100644
--- a/buildtools/pmdinfogen/pmdinfogen.h
+++ b/buildtools/pmdinfogen/pmdinfogen.h
@@ -24,7 +24,6 @@ 
 #include <fcntl.h>
 #include <unistd.h>
 #include <elf.h>
-#include <rte_config.h>
 #include <rte_pci.h>
 
 /* On BSD-alike OSes elf.h defines these according to host's word size */
diff --git a/drivers/common/mlx5/mlx5_glue.c b/drivers/common/mlx5/mlx5_glue.c
index 27cf33cdb9..0af0b86677 100644
--- a/drivers/common/mlx5/mlx5_glue.c
+++ b/drivers/common/mlx5/mlx5_glue.c
@@ -14,8 +14,6 @@ 
  */
 #include <sys/types.h>
 
-#include <rte_config.h>
-
 #include "mlx5_glue.h"
 
 static int
diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c
index b5bb6790bc..f6ea008444 100644
--- a/drivers/crypto/ccp/rte_ccp_pmd.c
+++ b/drivers/crypto/ccp/rte_ccp_pmd.c
@@ -6,7 +6,6 @@ 
 #include <rte_bus_pci.h>
 #include <rte_bus_vdev.h>
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_cryptodev.h>
 #include <rte_cryptodev_pmd.h>
 #include <rte_pci.h>
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 683e2a5594..ed784dff19 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -26,7 +26,6 @@ 
 #include <rte_string_fns.h>
 #include <rte_branch_prediction.h>
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_dev.h>
 #include <rte_eal.h>
 #include <rte_ether.h>
diff --git a/drivers/net/failsafe/failsafe_intr.c b/drivers/net/failsafe/failsafe_intr.c
index 0f34c5bbac..d8728fe7e3 100644
--- a/drivers/net/failsafe/failsafe_intr.c
+++ b/drivers/net/failsafe/failsafe_intr.c
@@ -13,7 +13,6 @@ 
 #include <unistd.h>
 
 #include <rte_alarm.h>
-#include <rte_config.h>
 #include <rte_errno.h>
 #include <rte_ethdev.h>
 #include <rte_interrupts.h>
diff --git a/drivers/net/hinic/base/hinic_compat.h b/drivers/net/hinic/base/hinic_compat.h
index e4a7f12d15..b72e8cfe26 100644
--- a/drivers/net/hinic/base/hinic_compat.h
+++ b/drivers/net/hinic/base/hinic_compat.h
@@ -18,7 +18,6 @@ 
 #include <rte_spinlock.h>
 #include <rte_cycles.h>
 #include <rte_log.h>
-#include <rte_config.h>
 
 typedef uint8_t   u8;
 typedef int8_t    s8;
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 5522eb595c..a1dd658176 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -29,7 +29,6 @@ 
 #endif
 
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_ethdev_driver.h>
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index b4ec6cba1a..23a50f3f92 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -29,7 +29,6 @@ 
 #include <rte_pci.h>
 #include <rte_bus_pci.h>
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_kvargs.h>
 #include <rte_rwlock.h>
 #include <rte_spinlock.h>
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index be8f19c0c6..9ed74a1d6a 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -27,7 +27,6 @@ 
 #include <rte_bus.h>
 #include <rte_bus_vdev.h>
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_ethdev.h>
diff --git a/lib/librte_eal/common/eal_common_mcfg.c b/lib/librte_eal/common/eal_common_mcfg.c
index 36a8ca8fcf..49d3ed0ce5 100644
--- a/lib/librte_eal/common/eal_common_mcfg.c
+++ b/lib/librte_eal/common/eal_common_mcfg.c
@@ -2,7 +2,6 @@ 
  * Copyright(c) 2019 Intel Corporation
  */
 
-#include <rte_config.h>
 #include <rte_eal_memconfig.h>
 #include <rte_version.h>
 
diff --git a/lib/librte_eal/common/eal_memcfg.h b/lib/librte_eal/common/eal_memcfg.h
index 4d650025c2..583fcb5953 100644
--- a/lib/librte_eal/common/eal_memcfg.h
+++ b/lib/librte_eal/common/eal_memcfg.h
@@ -5,7 +5,6 @@ 
 #ifndef EAL_MEMCFG_H
 #define EAL_MEMCFG_H
 
-#include <rte_config.h>
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_pause.h>