DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1 0/5] introduce IWYU
@ 2021-10-04 10:10 Sean Morrissey
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 1/5] devtools: script to remove unused headers includes Sean Morrissey
                   ` (6 more replies)
  0 siblings, 7 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-04 10:10 UTC (permalink / raw)
  Cc: dev, Sean Morrissey

This patchset introduces the include-what-you-use script which removes
unused header includes. IWYU GitHub:

https://github.com/include-what-you-use/include-what-you-use

Along with the script there are some patches which make a start on
removing unneeded headers.

Sean Morrissey (5):
  devtools: script to remove unused headers includes
  lib/telemetry: remove unneeded header includes
  lib/ring: remove unneeded header includes
  lib/kvargs: remove unneeded header includes
  lib/eal: remove unneeded header includes

 devtools/process_iwyu.py               | 109 +++++++++++++++++++++++++
 lib/eal/common/eal_common_dev.c        |   5 --
 lib/eal/common/eal_common_devargs.c    |   1 -
 lib/eal/common/eal_common_errno.c      |   4 -
 lib/eal/common/eal_common_fbarray.c    |   3 -
 lib/eal/common/eal_common_hexdump.c    |   3 -
 lib/eal/common/eal_common_launch.c     |   6 --
 lib/eal/common/eal_common_lcore.c      |   6 --
 lib/eal/common/eal_common_log.c        |   2 -
 lib/eal/common/eal_common_memalloc.c   |   3 -
 lib/eal/common/eal_common_memory.c     |   5 --
 lib/eal/common/eal_common_memzone.c    |   4 -
 lib/eal/common/eal_common_options.c    |   2 -
 lib/eal/common/eal_common_proc.c       |   2 -
 lib/eal/common/eal_common_string_fns.c |   2 -
 lib/eal/common/eal_common_tailqs.c     |  11 ---
 lib/eal/common/eal_common_thread.c     |   3 -
 lib/eal/common/eal_common_timer.c      |   6 --
 lib/eal/common/eal_common_trace.c      |   1 -
 lib/eal/common/hotplug_mp.h            |   1 -
 lib/eal/common/malloc_elem.c           |   6 --
 lib/eal/common/malloc_heap.c           |   5 --
 lib/eal/common/malloc_mp.c             |   1 -
 lib/eal/common/malloc_mp.h             |   2 -
 lib/eal/common/rte_malloc.c            |   6 --
 lib/eal/common/rte_random.c            |   3 -
 lib/eal/common/rte_service.c           |   6 --
 lib/eal/include/rte_version.h          |   2 -
 lib/eal/linux/eal.c                    |  10 ---
 lib/eal/linux/eal_alarm.c              |   7 --
 lib/eal/linux/eal_cpuflags.c           |   2 -
 lib/eal/linux/eal_debug.c              |   5 --
 lib/eal/linux/eal_dev.c                |   4 -
 lib/eal/linux/eal_hugepage_info.c      |   8 --
 lib/eal/linux/eal_interrupts.c         |   8 --
 lib/eal/linux/eal_lcore.c              |   7 --
 lib/eal/linux/eal_log.c                |  11 +--
 lib/eal/linux/eal_memalloc.c           |   8 --
 lib/eal/linux/eal_memory.c             |   9 --
 lib/eal/linux/eal_thread.c             |   5 --
 lib/eal/linux/eal_timer.c              |  15 ----
 lib/eal/linux/eal_vfio_mp_sync.c       |   1 -
 lib/eal/unix/eal_file.c                |   1 -
 lib/eal/unix/rte_thread.c              |   1 -
 lib/eal/x86/rte_cycles.c               |   1 -
 lib/kvargs/rte_kvargs.c                |   1 -
 lib/ring/rte_ring.c                    |   7 --
 lib/telemetry/telemetry.c              |   1 -
 lib/telemetry/telemetry_data.h         |   1 -
 49 files changed, 110 insertions(+), 213 deletions(-)
 create mode 100755 devtools/process_iwyu.py

-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v1 1/5] devtools: script to remove unused headers includes
  2021-10-04 10:10 [dpdk-dev] [PATCH v1 0/5] introduce IWYU Sean Morrissey
@ 2021-10-04 10:10 ` Sean Morrissey
  2021-10-04 15:07   ` Bruce Richardson
  2021-10-06 13:37   ` Thomas Monjalon
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 2/5] lib/telemetry: remove unneeded header includes Sean Morrissey
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-04 10:10 UTC (permalink / raw)
  Cc: dev, Sean Morrissey, Conor Fogarty

This script can be used for removing headers flagged for removal by the
include-what-you-use (IWYU) tool. The script has the ability to remove
headers from specified sub-directories or dpdk as a whole.

example usages:

Remove headers flagged by iwyu_tool output file
$ ./devtools/process_iwyu.py iwyu.out -b build

Remove headers flagged by iwyu_tool output file from sub-directory
$ ./devtools/process_iwyu.py iwyu.out -b build -d lib/kvargs

Remove headers directly piped from the iwyu_tool
$ iwyu_tool -p build | ./devtools/process_iwyu.py - -b build

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
---
 devtools/process_iwyu.py | 109 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 109 insertions(+)
 create mode 100755 devtools/process_iwyu.py

diff --git a/devtools/process_iwyu.py b/devtools/process_iwyu.py
new file mode 100755
index 0000000000..ddc4ceafa4
--- /dev/null
+++ b/devtools/process_iwyu.py
@@ -0,0 +1,109 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+#
+
+import argparse
+import fileinput
+import sys
+from os.path import abspath, relpath, join
+from pathlib import Path
+from mesonbuild import mesonmain
+
+def args_parse():
+    parser = argparse.ArgumentParser(description='This script can be used to remove includes which are not in use\n')
+    parser.add_argument('-b', '--build_dir', type=str, help='Name of the build directory in which the IWYU tool was used in.', default="build")
+    parser.add_argument('-d', '--sub_dir', type=str, help='The sub-directory to remove headers from.', default="")
+    parser.add_argument('file', type=Path, help='The path to the IWYU log file or output from stdin.')
+
+    args = parser.parse_args()
+
+    return args
+
+
+def run_meson(args):
+    "Runs a meson command logging output to process.log"
+    with open('process.log', 'a') as sys.stdout:
+        ret = mesonmain.run(args, abspath('meson'))
+    sys.stdout = sys.__stdout__
+    return ret
+
+
+def remove_includes(filename, include, dpdk_dir, build_dir):
+    # Load in file - readlines()
+    # loop through list once in mem -> make cpy of list with line removed
+    # write cpy  -> stored in memory so write cpy to file then check
+    # run test build -> call ninja on the build folder, ninja -C build, subprocess
+    # if fails -> write original back to file otherwise continue on
+    # newlist = [ln for ln in lines if not ln.startswith(...)] filters out one element
+    filepath = filename
+
+    with open(filepath, 'r+') as f:
+        lines = f.readlines()  # Read lines when file is opened
+
+    with open(filepath, 'w') as f:
+        for ln in lines:  # Removes the include passed in
+            if ln.strip("\n") != include:
+                f.write(ln)
+
+    ret = run_meson(['compile', '-C', join(dpdk_dir, build_dir)])
+    if (ret == 0):  # Include is not needed -> build is successful
+        print('SUCCESS')
+    else:
+        # failed, catch the error
+        # return file to original state
+        with open(filepath, 'w') as f:
+            f.writelines(lines)
+            print('FAILED')
+
+
+def get_build_config(builddir, condition):
+    "returns contents of rte_build_config.h"
+    with open(join(builddir, 'rte_build_config.h')) as f:
+        return [ln for ln in f.readlines() if condition(ln)]
+
+
+def uses_libbsd(builddir):
+    "return whether the build uses libbsd or not"
+    return bool(get_build_config(builddir, lambda ln: 'RTE_USE_LIBBSD' in ln))
+
+
+def process(args):
+    filename = None
+    build_dir = args.build_dir
+    dpdk_dir = abspath(__file__).split('/devtools')[0]
+    directory = args.sub_dir
+    # Use stdin if no iwyu_tool out file given
+    logfile = abspath(args.file) if str(args.file) != '-' else args.file
+
+    keep_str_fns = uses_libbsd(join(dpdk_dir, build_dir)) # check for libbsd
+    if keep_str_fns:
+        print('Warning: libbsd is present, build will fail to detect incorrect removal of rte_string_fns.h',
+              file=sys.stderr)
+    run_meson(['configure', dpdk_dir + "/" + build_dir, '-Dwerror=true'])  # turn on werror
+
+    for line in fileinput.input(logfile):
+        if 'should remove' in line:
+            # If the file path in the iwyu_tool output is an absolute path
+            # it means the file is outside of the dpdk directory, therefore ignore it
+            # Also check to see if the file is within the specified sub directory
+            if line.split()[0] != abspath(line.split()[0]) and directory in line.split()[0]:
+                filename = relpath(join(build_dir, line.split()[0]))
+        elif line.startswith('-') and filename:
+            include = '#include ' + line.split()[2]
+            print(f"Remove {include} from {filename} ... ", end='', flush=True)
+            if keep_str_fns and '<rte_string_fns.h>' in include:
+                print('skipped')
+                continue
+            remove_includes(filename, include, dpdk_dir, build_dir)
+        else:
+            filename = None
+
+
+def main():
+    args = args_parse()
+    process(args)
+
+
+if __name__ == '__main__':
+    main()
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v1 2/5] lib/telemetry: remove unneeded header includes
  2021-10-04 10:10 [dpdk-dev] [PATCH v1 0/5] introduce IWYU Sean Morrissey
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 1/5] devtools: script to remove unused headers includes Sean Morrissey
@ 2021-10-04 10:10 ` Sean Morrissey
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 3/5] lib/ring: " Sean Morrissey
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-04 10:10 UTC (permalink / raw)
  To: Ciara Power; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/telemetry/telemetry.c      | 1 -
 lib/telemetry/telemetry_data.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 8665db8d03..fb3b93ca7e 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -8,7 +8,6 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/stat.h>
-#include <dlfcn.h>
 #endif /* !RTE_EXEC_ENV_WINDOWS */
 
 /* we won't link against libbsd, so just always use DPDKs-specific strlcpy */
diff --git a/lib/telemetry/telemetry_data.h b/lib/telemetry/telemetry_data.h
index adb84a09f1..26aa28e72c 100644
--- a/lib/telemetry/telemetry_data.h
+++ b/lib/telemetry/telemetry_data.h
@@ -5,7 +5,6 @@
 #ifndef _TELEMETRY_DATA_H_
 #define _TELEMETRY_DATA_H_
 
-#include <inttypes.h>
 #include "rte_telemetry.h"
 
 enum tel_container_types {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v1 3/5] lib/ring: remove unneeded header includes
  2021-10-04 10:10 [dpdk-dev] [PATCH v1 0/5] introduce IWYU Sean Morrissey
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 1/5] devtools: script to remove unused headers includes Sean Morrissey
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 2/5] lib/telemetry: remove unneeded header includes Sean Morrissey
@ 2021-10-04 10:10 ` Sean Morrissey
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 4/5] lib/kvargs: " Sean Morrissey
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-04 10:10 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/ring/rte_ring.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
index f17bd966be..bb95962b0c 100644
--- a/lib/ring/rte_ring.c
+++ b/lib/ring/rte_ring.c
@@ -17,16 +17,9 @@
 
 #include <rte_common.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_malloc.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_atomic.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_spinlock.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v1 4/5] lib/kvargs: remove unneeded header includes
  2021-10-04 10:10 [dpdk-dev] [PATCH v1 0/5] introduce IWYU Sean Morrissey
                   ` (2 preceding siblings ...)
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 3/5] lib/ring: " Sean Morrissey
@ 2021-10-04 10:10 ` Sean Morrissey
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 5/5] lib/eal: " Sean Morrissey
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-04 10:10 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/kvargs/rte_kvargs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
index 38e9d5c1ca..4cce8e953b 100644
--- a/lib/kvargs/rte_kvargs.c
+++ b/lib/kvargs/rte_kvargs.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <stdbool.h>
 
-#include <rte_os_shim.h>
 #include <rte_string_fns.h>
 
 #include "rte_kvargs.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v1 5/5] lib/eal: remove unneeded header includes
  2021-10-04 10:10 [dpdk-dev] [PATCH v1 0/5] introduce IWYU Sean Morrissey
                   ` (3 preceding siblings ...)
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 4/5] lib/kvargs: " Sean Morrissey
@ 2021-10-04 10:10 ` Sean Morrissey
  2021-10-04 10:23   ` Van Haaren, Harry
  2021-10-04 18:15   ` David Christensen
  2021-10-04 15:55 ` [dpdk-dev] [PATCH v1 0/5] introduce IWYU Stephen Hemminger
  2021-10-06 11:13 ` [dpdk-dev] [PATCH v2 " Sean Morrissey
  6 siblings, 2 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-04 10:10 UTC (permalink / raw)
  To: Anatoly Burakov, Jerin Jacob, Sunil Kumar Kori,
	Mattias Rönnblom, Harry van Haaren, Harman Kalra,
	Bruce Richardson, Konstantin Ananyev
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/eal/common/eal_common_dev.c        |  5 -----
 lib/eal/common/eal_common_devargs.c    |  1 -
 lib/eal/common/eal_common_errno.c      |  4 ----
 lib/eal/common/eal_common_fbarray.c    |  3 ---
 lib/eal/common/eal_common_hexdump.c    |  3 ---
 lib/eal/common/eal_common_launch.c     |  6 ------
 lib/eal/common/eal_common_lcore.c      |  6 ------
 lib/eal/common/eal_common_log.c        |  2 --
 lib/eal/common/eal_common_memalloc.c   |  3 ---
 lib/eal/common/eal_common_memory.c     |  5 -----
 lib/eal/common/eal_common_memzone.c    |  4 ----
 lib/eal/common/eal_common_options.c    |  2 --
 lib/eal/common/eal_common_proc.c       |  2 --
 lib/eal/common/eal_common_string_fns.c |  2 --
 lib/eal/common/eal_common_tailqs.c     | 11 -----------
 lib/eal/common/eal_common_thread.c     |  3 ---
 lib/eal/common/eal_common_timer.c      |  6 ------
 lib/eal/common/eal_common_trace.c      |  1 -
 lib/eal/common/hotplug_mp.h            |  1 -
 lib/eal/common/malloc_elem.c           |  6 ------
 lib/eal/common/malloc_heap.c           |  5 -----
 lib/eal/common/malloc_mp.c             |  1 -
 lib/eal/common/malloc_mp.h             |  2 --
 lib/eal/common/rte_malloc.c            |  6 ------
 lib/eal/common/rte_random.c            |  3 ---
 lib/eal/common/rte_service.c           |  6 ------
 lib/eal/include/rte_version.h          |  2 --
 lib/eal/linux/eal.c                    | 10 ----------
 lib/eal/linux/eal_alarm.c              |  7 -------
 lib/eal/linux/eal_cpuflags.c           |  2 --
 lib/eal/linux/eal_debug.c              |  5 -----
 lib/eal/linux/eal_dev.c                |  4 ----
 lib/eal/linux/eal_hugepage_info.c      |  8 --------
 lib/eal/linux/eal_interrupts.c         |  8 --------
 lib/eal/linux/eal_lcore.c              |  7 -------
 lib/eal/linux/eal_log.c                | 11 +----------
 lib/eal/linux/eal_memalloc.c           |  8 --------
 lib/eal/linux/eal_memory.c             |  9 ---------
 lib/eal/linux/eal_thread.c             |  5 -----
 lib/eal/linux/eal_timer.c              | 15 ---------------
 lib/eal/linux/eal_vfio_mp_sync.c       |  1 -
 lib/eal/unix/eal_file.c                |  1 -
 lib/eal/unix/rte_thread.c              |  1 -
 lib/eal/x86/rte_cycles.c               |  1 -
 44 files changed, 1 insertion(+), 203 deletions(-)

diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index 148a23830a..12bf3d3c22 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -5,20 +5,15 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 
-#include <rte_compat.h>
 #include <rte_bus.h>
 #include <rte_class.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
-#include <rte_debug.h>
 #include <rte_errno.h>
-#include <rte_kvargs.h>
 #include <rte_log.h>
 #include <rte_spinlock.h>
-#include <rte_malloc.h>
 #include <rte_string_fns.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c
index 7ab9e71b2a..f4beb35591 100644
--- a/lib/eal/common/eal_common_devargs.c
+++ b/lib/eal/common/eal_common_devargs.c
@@ -12,7 +12,6 @@
 
 #include <rte_bus.h>
 #include <rte_class.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_errno.h>
diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c
index f86802705a..1091065568 100644
--- a/lib/eal/common/eal_common_errno.c
+++ b/lib/eal/common/eal_common_errno.c
@@ -5,15 +5,11 @@
 /* Use XSI-compliant portable version of strerror_r() */
 #undef _GNU_SOURCE
 
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdarg.h>
-#include <errno.h>
 
 #include <rte_per_lcore.h>
 #include <rte_errno.h>
-#include <rte_string_fns.h>
 
 #ifdef RTE_EXEC_ENV_WINDOWS
 #define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum)
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 3a28a53247..f11f87979f 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -2,7 +2,6 @@
  * Copyright(c) 2017-2018 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <inttypes.h>
 #include <limits.h>
 #include <stdint.h>
@@ -14,9 +13,7 @@
 #include <rte_eal_paging.h>
 #include <rte_errno.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 #include "eal_filesystem.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_hexdump.c b/lib/eal/common/eal_common_hexdump.c
index 2d2179d411..63bbbdcf0a 100644
--- a/lib/eal/common/eal_common_hexdump.c
+++ b/lib/eal/common/eal_common_hexdump.c
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2010-2014 Intel Corporation
  */
-#include <stdlib.h>
 #include <stdio.h>
-#include <errno.h>
-#include <stdint.h>
 #include <rte_hexdump.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/eal_common_launch.c b/lib/eal/common/eal_common_launch.c
index 34f854ad80..2a20b32a77 100644
--- a/lib/eal/common/eal_common_launch.c
+++ b/lib/eal/common/eal_common_launch.c
@@ -3,16 +3,10 @@
  */
 
 #include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <sys/queue.h>
 
 #include <rte_launch.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
 #include <rte_atomic.h>
 #include <rte_pause.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c
index 66d6bad1a7..4307a13190 100644
--- a/lib/eal/common/eal_common_lcore.c
+++ b/lib/eal/common/eal_common_lcore.c
@@ -2,19 +2,13 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <unistd.h>
-#include <limits.h>
 #include <string.h>
 
 #include <rte_common.h>
-#include <rte_debug.h>
-#include <rte_eal.h>
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_rwlock.h>
 
-#include "eal_memcfg.h"
 #include "eal_private.h"
 #include "eal_thread.h"
 
diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c
index ec8fe23a7f..24afb57c89 100644
--- a/lib/eal/common/eal_common_log.c
+++ b/lib/eal/common/eal_common_log.c
@@ -11,9 +11,7 @@
 #include <regex.h>
 #include <fnmatch.h>
 
-#include <rte_eal.h>
 #include <rte_log.h>
-#include <rte_os_shim.h>
 #include <rte_per_lcore.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/common/eal_common_memalloc.c b/lib/eal/common/eal_common_memalloc.c
index e872c6533b..f8770ff835 100644
--- a/lib/eal/common/eal_common_memalloc.c
+++ b/lib/eal/common/eal_common_memalloc.c
@@ -5,12 +5,9 @@
 #include <string.h>
 
 #include <rte_errno.h>
-#include <rte_lcore.h>
 #include <rte_fbarray.h>
-#include <rte_memzone.h>
 #include <rte_memory.h>
 #include <rte_string_fns.h>
-#include <rte_rwlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
index f83b75092e..bb0da9e50a 100644
--- a/lib/eal/common/eal_common_memory.c
+++ b/lib/eal/common/eal_common_memory.c
@@ -2,16 +2,11 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdlib.h>
-#include <stdarg.h>
 #include <string.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/queue.h>
 
 #include <rte_fbarray.h>
 #include <rte_memory.h>
diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c
index 7c21aa921e..67dcaaafbf 100644
--- a/lib/eal/common/eal_common_memzone.c
+++ b/lib/eal/common/eal_common_memzone.c
@@ -2,20 +2,16 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdarg.h>
 #include <inttypes.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/queue.h>
 
 #include <rte_log.h>
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_common.h>
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index eaef57312f..1eb51be09c 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -4,7 +4,6 @@
  */
 
 #include <stdlib.h>
-#include <unistd.h>
 #include <string.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <syslog.h>
@@ -17,7 +16,6 @@
 #include <dlfcn.h>
 #include <libgen.h>
 #endif
-#include <sys/types.h>
 #include <sys/stat.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <dirent.h>
diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index ebd0f6673b..575b4ca24d 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -15,7 +15,6 @@
 #include <string.h>
 #include <sys/file.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
@@ -27,7 +26,6 @@
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_tailq.h>
 
 #include "eal_memcfg.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_string_fns.c b/lib/eal/common/eal_common_string_fns.c
index ddd1891656..0236ae4023 100644
--- a/lib/eal/common/eal_common_string_fns.c
+++ b/lib/eal/common/eal_common_string_fns.c
@@ -2,9 +2,7 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 
 #include <rte_string_fns.h>
diff --git a/lib/eal/common/eal_common_tailqs.c b/lib/eal/common/eal_common_tailqs.c
index ead06897b8..580fbf24bc 100644
--- a/lib/eal/common/eal_common_tailqs.c
+++ b/lib/eal/common/eal_common_tailqs.c
@@ -3,24 +3,13 @@
  */
 
 #include <sys/queue.h>
-#include <stdint.h>
-#include <errno.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
-#include <inttypes.h>
 
-#include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_log.h>
 #include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_memcfg.h"
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index 1a52f42a2b..cfa6a69ad4 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -4,10 +4,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
 #include <pthread.h>
-#include <signal.h>
 #include <sched.h>
 #include <assert.h>
 #include <string.h>
diff --git a/lib/eal/common/eal_common_timer.c b/lib/eal/common/eal_common_timer.c
index 86f8429847..5686a5102b 100644
--- a/lib/eal/common/eal_common_timer.c
+++ b/lib/eal/common/eal_common_timer.c
@@ -2,16 +2,10 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/types.h>
-#include <time.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
 #include <rte_pause.h>
diff --git a/lib/eal/common/eal_common_trace.c b/lib/eal/common/eal_common_trace.c
index 7bff1cd2ce..036f6ac348 100644
--- a/lib/eal/common/eal_common_trace.c
+++ b/lib/eal/common/eal_common_trace.c
@@ -3,7 +3,6 @@
  */
 
 #include <fnmatch.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 #include <regex.h>
 
diff --git a/lib/eal/common/hotplug_mp.h b/lib/eal/common/hotplug_mp.h
index 8fcf9b52e2..066494ff27 100644
--- a/lib/eal/common/hotplug_mp.h
+++ b/lib/eal/common/hotplug_mp.h
@@ -6,7 +6,6 @@
 #define _HOTPLUG_MP_H_
 
 #include "rte_dev.h"
-#include "rte_bus.h"
 
 #define EAL_DEV_MP_ACTION_REQUEST      "eal_dev_mp_request"
 #define EAL_DEV_MP_ACTION_RESPONSE     "eal_dev_mp_response"
diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c
index c2c9461f1d..4c6e6f4910 100644
--- a/lib/eal/common/malloc_elem.c
+++ b/lib/eal/common/malloc_elem.c
@@ -6,17 +6,11 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/queue.h>
 
 #include <rte_memory.h>
 #include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_debug.h>
 #include <rte_common.h>
-#include <rte_spinlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c
index ee400f38ec..61f0a5d84f 100644
--- a/lib/eal/common/malloc_heap.c
+++ b/lib/eal/common/malloc_heap.c
@@ -5,7 +5,6 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <sys/queue.h>
 
@@ -13,15 +12,11 @@
 #include <rte_errno.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_string_fns.h>
 #include <rte_spinlock.h>
-#include <rte_memcpy.h>
 #include <rte_memzone.h>
-#include <rte_atomic.h>
 #include <rte_fbarray.h>
 
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c
index 2e597a17a2..801b2e7fbd 100644
--- a/lib/eal/common/malloc_mp.c
+++ b/lib/eal/common/malloc_mp.c
@@ -5,7 +5,6 @@
 #include <string.h>
 #include <sys/time.h>
 
-#include <rte_alarm.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/malloc_mp.h b/lib/eal/common/malloc_mp.h
index 0095062b72..fb10817e13 100644
--- a/lib/eal/common/malloc_mp.h
+++ b/lib/eal/common/malloc_mp.h
@@ -10,8 +10,6 @@
 
 #include <rte_common.h>
 #include <rte_random.h>
-#include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 /* forward declarations */
 struct malloc_heap;
diff --git a/lib/eal/common/rte_malloc.c b/lib/eal/common/rte_malloc.c
index 9d39e58c08..6c69a2cf3b 100644
--- a/lib/eal/common/rte_malloc.c
+++ b/lib/eal/common/rte_malloc.c
@@ -6,18 +6,12 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
 
 #include <rte_errno.h>
 #include <rte_memcpy.h>
 #include <rte_memory.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_branch_prediction.h>
-#include <rte_debug.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/common/rte_random.c b/lib/eal/common/rte_random.c
index ce21c2242a..4535cc980c 100644
--- a/lib/eal/common/rte_random.c
+++ b/lib/eal/common/rte_random.c
@@ -5,14 +5,11 @@
 #ifdef __RDSEED__
 #include <x86intrin.h>
 #endif
-#include <stdlib.h>
 #include <unistd.h>
 
 #include <rte_branch_prediction.h>
 #include <rte_cycles.h>
-#include <rte_eal.h>
 #include <rte_lcore.h>
-#include <rte_memory.h>
 #include <rte_random.h>
 
 struct rte_rand_state {
diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c
index bd8fb72e78..ef31b1f63c 100644
--- a/lib/eal/common/rte_service.c
+++ b/lib/eal/common/rte_service.c
@@ -3,22 +3,16 @@
  */
 
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <limits.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_service.h>
 #include <rte_service_component.h>
 
-#include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_debug.h>
 #include <rte_cycles.h>
 #include <rte_atomic.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/include/rte_version.h b/lib/eal/include/rte_version.h
index b06a62e7a2..414b6167f2 100644
--- a/lib/eal/include/rte_version.h
+++ b/lib/eal/include/rte_version.h
@@ -14,10 +14,8 @@
 extern "C" {
 #endif
 
-#include <stdint.h>
 #include <string.h>
 #include <stdio.h>
-#include <rte_common.h>
 #include <rte_compat.h>
 
 /**
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 3577eaeaa4..f55d1860d8 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -7,10 +7,8 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <syslog.h>
 #include <getopt.h>
 #include <sys/file.h>
 #include <dirent.h>
@@ -20,32 +18,24 @@
 #include <errno.h>
 #include <limits.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
 #include <sys/stat.h>
 #if defined(RTE_ARCH_X86)
 #include <sys/io.h>
 #endif
 #include <linux/version.h>
 
-#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_errno.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_service_component.h>
 #include <rte_log.h>
-#include <rte_random.h>
-#include <rte_cycles.h>
 #include <rte_string_fns.h>
 #include <rte_cpuflags.h>
-#include <rte_interrupts.h>
 #include <rte_bus.h>
-#include <rte_dev.h>
-#include <rte_devargs.h>
 #include <rte_version.h>
 #include <malloc_heap.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/linux/eal_alarm.c b/lib/eal/linux/eal_alarm.c
index 3252c6fa59..43f6bb14f2 100644
--- a/lib/eal/linux/eal_alarm.c
+++ b/lib/eal/linux/eal_alarm.c
@@ -3,21 +3,14 @@
  */
 #include <stdio.h>
 #include <stdint.h>
-#include <signal.h>
 #include <errno.h>
-#include <string.h>
 #include <sys/queue.h>
 #include <sys/time.h>
 #include <sys/timerfd.h>
 
-#include <rte_memory.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_common.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_lcore.h>
 #include <rte_errno.h>
 #include <rte_spinlock.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_cpuflags.c b/lib/eal/linux/eal_cpuflags.c
index d38296e1e5..c684940e1d 100644
--- a/lib/eal/linux/eal_cpuflags.c
+++ b/lib/eal/linux/eal_cpuflags.c
@@ -5,8 +5,6 @@
 #include <elf.h>
 #include <fcntl.h>
 #include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
diff --git a/lib/eal/linux/eal_debug.c b/lib/eal/linux/eal_debug.c
index 64dab4e0da..b0ecf5a9dc 100644
--- a/lib/eal/linux/eal_debug.c
+++ b/lib/eal/linux/eal_debug.c
@@ -5,16 +5,11 @@
 #ifdef RTE_BACKTRACE
 #include <execinfo.h>
 #endif
-#include <stdarg.h>
-#include <signal.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdint.h>
 
 #include <rte_log.h>
 #include <rte_debug.h>
-#include <rte_common.h>
-#include <rte_eal.h>
 
 #define BACKTRACE_SIZE 256
 
diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c
index 3b905e18f5..0a654e5b50 100644
--- a/lib/eal/linux/eal_dev.c
+++ b/lib/eal/linux/eal_dev.c
@@ -4,20 +4,16 @@
 
 #include <string.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
 
 #include <rte_string_fns.h>
 #include <rte_log.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
-#include <rte_malloc.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_bus.h>
-#include <rte_eal.h>
 #include <rte_spinlock.h>
 #include <rte_errno.h>
 
diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index d97792cade..b3e4c40ee7 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -3,7 +3,6 @@
  */
 
 #include <string.h>
-#include <sys/types.h>
 #include <sys/file.h>
 #include <dirent.h>
 #include <fcntl.h>
@@ -12,19 +11,12 @@
 #include <stdio.h>
 #include <fnmatch.h>
 #include <inttypes.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
-#include <sys/stat.h>
 
 #include <linux/mman.h> /* for hugetlb-related flags */
 
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_debug.h>
 #include <rte_log.h>
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index 22b3b7bcd9..1d5c9b272c 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -7,13 +7,10 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <sys/queue.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <inttypes.h>
 #include <sys/epoll.h>
-#include <sys/signalfd.h>
 #include <sys/ioctl.h>
 #include <sys/eventfd.h>
 #include <assert.h>
@@ -21,9 +18,6 @@
 
 #include <rte_common.h>
 #include <rte_interrupts.h>
-#include <rte_memory.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_branch_prediction.h>
@@ -36,8 +30,6 @@
 #include <rte_eal_trace.h>
 
 #include "eal_private.h"
-#include "eal_vfio.h"
-#include "eal_thread.h"
 
 #define EAL_INTR_EPOLL_WAIT_FOREVER (-1)
 #define NB_OTHER_INTR               1
diff --git a/lib/eal/linux/eal_lcore.c b/lib/eal/linux/eal_lcore.c
index bc8965844c..2e6a350603 100644
--- a/lib/eal/linux/eal_lcore.c
+++ b/lib/eal/linux/eal_lcore.c
@@ -4,15 +4,8 @@
 
 #include <unistd.h>
 #include <limits.h>
-#include <string.h>
-#include <dirent.h>
 
 #include <rte_log.h>
-#include <rte_eal.h>
-#include <rte_lcore.h>
-#include <rte_common.h>
-#include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_filesystem.h"
diff --git a/lib/eal/linux/eal_log.c b/lib/eal/linux/eal_log.c
index c0aa1007c4..9e72412e2b 100644
--- a/lib/eal/linux/eal_log.c
+++ b/lib/eal/linux/eal_log.c
@@ -2,19 +2,10 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdint.h>
 #include <sys/types.h>
 #include <syslog.h>
-#include <sys/queue.h>
-
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_spinlock.h>
+
 #include <rte_log.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index 0ec8542283..e3aba10107 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -3,23 +3,17 @@
  */
 
 #include <errno.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <unistd.h>
 #include <limits.h>
 #include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
@@ -36,9 +30,7 @@
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_eal.h>
-#include <rte_errno.h>
 #include <rte_memory.h>
-#include <rte_spinlock.h>
 
 #include "eal_filesystem.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c
index 03a4f2dd2d..40ec9663d0 100644
--- a/lib/eal/linux/eal_memory.c
+++ b/lib/eal/linux/eal_memory.c
@@ -5,7 +5,6 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -13,19 +12,14 @@
 #include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <sys/resource.h>
 #include <unistd.h>
 #include <limits.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
-#include <linux/memfd.h>
 #define MEMFD_SUPPORTED
 #endif
 #ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
@@ -36,12 +30,9 @@
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_string_fns.h>
 
 #include "eal_private.h"
 #include "eal_memalloc.h"
diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index 83c2034b93..60fa64ea55 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -4,20 +4,15 @@
 
 #include <errno.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdint.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <sched.h>
-#include <sys/queue.h>
 #include <sys/syscall.h>
 
 #include <rte_debug.h>
 #include <rte_atomic.h>
 #include <rte_launch.h>
 #include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_per_lcore.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_timer.c b/lib/eal/linux/eal_timer.c
index 7cf15cabac..620baf038d 100644
--- a/lib/eal/linux/eal_timer.c
+++ b/lib/eal/linux/eal_timer.c
@@ -3,28 +3,13 @@
  * Copyright(c) 2012-2013 6WIND S.A.
  */
 
-#include <string.h>
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <sys/mman.h>
-#include <sys/queue.h>
-#include <pthread.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_log.h>
 #include <rte_cycles.h>
-#include <rte_lcore.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
-#include "eal_internal_cfg.h"
 
 enum timer_source eal_timer_source = EAL_TIMER_HPET;
 
diff --git a/lib/eal/linux/eal_vfio_mp_sync.c b/lib/eal/linux/eal_vfio_mp_sync.c
index a2accfab3a..e1776166af 100644
--- a/lib/eal/linux/eal_vfio_mp_sync.c
+++ b/lib/eal/linux/eal_vfio_mp_sync.c
@@ -5,7 +5,6 @@
 #include <unistd.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/unix/eal_file.c b/lib/eal/unix/eal_file.c
index ec554e0096..f04f5fbcbc 100644
--- a/lib/eal/unix/eal_file.c
+++ b/lib/eal/unix/eal_file.c
@@ -3,7 +3,6 @@
  */
 
 #include <sys/file.h>
-#include <sys/mman.h>
 #include <fcntl.h>
 #include <unistd.h>
 
diff --git a/lib/eal/unix/rte_thread.c b/lib/eal/unix/rte_thread.c
index c72d619ec1..c34ede9186 100644
--- a/lib/eal/unix/rte_thread.c
+++ b/lib/eal/unix/rte_thread.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_thread.h>
diff --git a/lib/eal/x86/rte_cycles.c b/lib/eal/x86/rte_cycles.c
index edd9621abb..0e695caf28 100644
--- a/lib/eal/x86/rte_cycles.c
+++ b/lib/eal/x86/rte_cycles.c
@@ -6,7 +6,6 @@
 #include <unistd.h>
 #include <cpuid.h>
 
-#include <rte_common.h>
 
 #include "eal_private.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v1 5/5] lib/eal: remove unneeded header includes
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 5/5] lib/eal: " Sean Morrissey
@ 2021-10-04 10:23   ` Van Haaren, Harry
  2021-10-04 10:46     ` Mattias Rönnblom
  2021-10-04 18:15   ` David Christensen
  1 sibling, 1 reply; 147+ messages in thread
From: Van Haaren, Harry @ 2021-10-04 10:23 UTC (permalink / raw)
  To: Morrissey, Sean, Burakov, Anatoly, Jerin Jacob, Sunil Kumar Kori,
	mattias.ronnblom, Harman Kalra, Richardson, Bruce, Ananyev,
	Konstantin
  Cc: dev

> -----Original Message-----
> From: Morrissey, Sean <sean.morrissey@intel.com>
> Sent: Monday, October 4, 2021 11:11 AM
> To: Burakov, Anatoly <anatoly.burakov@intel.com>; Jerin Jacob
> <jerinj@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; mattias.ronnblom
> <mattias.ronnblom@ericsson.com>; Van Haaren, Harry
> <harry.van.haaren@intel.com>; Harman Kalra <hkalra@marvell.com>;
> Richardson, Bruce <bruce.richardson@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>
> Cc: dev@dpdk.org; Morrissey, Sean <sean.morrissey@intel.com>
> Subject: [PATCH v1 5/5] lib/eal: remove unneeded header includes
> 
> These header includes have been flagged by the iwyu_tool
> and removed.
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

<snip patch>

For lib/eal/common/rte_service.c;
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>



^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v1 5/5] lib/eal: remove unneeded header includes
  2021-10-04 10:23   ` Van Haaren, Harry
@ 2021-10-04 10:46     ` Mattias Rönnblom
  0 siblings, 0 replies; 147+ messages in thread
From: Mattias Rönnblom @ 2021-10-04 10:46 UTC (permalink / raw)
  To: Van Haaren, Harry, Morrissey, Sean, Burakov, Anatoly,
	Jerin Jacob, Sunil Kumar Kori, Harman Kalra, Richardson, Bruce,
	Ananyev, Konstantin
  Cc: dev

On 2021-10-04 12:23, Van Haaren, Harry wrote:
>> -----Original Message-----
>> From: Morrissey, Sean <sean.morrissey@intel.com>
>> Sent: Monday, October 4, 2021 11:11 AM
>> To: Burakov, Anatoly <anatoly.burakov@intel.com>; Jerin Jacob
>> <jerinj@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; mattias.ronnblom
>> <mattias.ronnblom@ericsson.com>; Van Haaren, Harry
>> <harry.van.haaren@intel.com>; Harman Kalra <hkalra@marvell.com>;
>> Richardson, Bruce <bruce.richardson@intel.com>; Ananyev, Konstantin
>> <konstantin.ananyev@intel.com>
>> Cc: dev@dpdk.org; Morrissey, Sean <sean.morrissey@intel.com>
>> Subject: [PATCH v1 5/5] lib/eal: remove unneeded header includes
>>
>> These header includes have been flagged by the iwyu_tool
>> and removed.
>>
>> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> <snip patch>
>
> For lib/eal/common/rte_service.c;
> Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

For lib/eal/common/rte_random.c:
Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>


^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/5] devtools: script to remove unused headers includes
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 1/5] devtools: script to remove unused headers includes Sean Morrissey
@ 2021-10-04 15:07   ` Bruce Richardson
  2021-10-06 13:37   ` Thomas Monjalon
  1 sibling, 0 replies; 147+ messages in thread
From: Bruce Richardson @ 2021-10-04 15:07 UTC (permalink / raw)
  To: Sean Morrissey; +Cc: dev, Conor Fogarty

On Mon, Oct 04, 2021 at 10:10:54AM +0000, Sean Morrissey wrote:
> This script can be used for removing headers flagged for removal by the
> include-what-you-use (IWYU) tool. The script has the ability to remove
> headers from specified sub-directories or dpdk as a whole.
> 
Since it also is importing meson and calling "meson compile" it appears to
be testing the build after each removal too. I think this should be called
out, to make it clear it's not a "blind" removal of headers.

Further review comments inline below.

/Bruce

> example usages:
> 
> Remove headers flagged by iwyu_tool output file
> $ ./devtools/process_iwyu.py iwyu.out -b build
> 
> Remove headers flagged by iwyu_tool output file from sub-directory
> $ ./devtools/process_iwyu.py iwyu.out -b build -d lib/kvargs
> 
> Remove headers directly piped from the iwyu_tool
> $ iwyu_tool -p build | ./devtools/process_iwyu.py - -b build
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
> ---
>  devtools/process_iwyu.py | 109 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 109 insertions(+)
>  create mode 100755 devtools/process_iwyu.py
> 
> diff --git a/devtools/process_iwyu.py b/devtools/process_iwyu.py
> new file mode 100755
> index 0000000000..ddc4ceafa4
> --- /dev/null
> +++ b/devtools/process_iwyu.py
> @@ -0,0 +1,109 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2021 Intel Corporation
> +#
> +
> +import argparse
> +import fileinput
> +import sys
> +from os.path import abspath, relpath, join
> +from pathlib import Path
> +from mesonbuild import mesonmain
> +
> +def args_parse():
> +    parser = argparse.ArgumentParser(description='This script can be used to remove includes which are not in use\n')
> +    parser.add_argument('-b', '--build_dir', type=str, help='Name of the build directory in which the IWYU tool was used in.', default="build")
> +    parser.add_argument('-d', '--sub_dir', type=str, help='The sub-directory to remove headers from.', default="")
> +    parser.add_argument('file', type=Path, help='The path to the IWYU log file or output from stdin.')
> +

These lines are all very long. While the text strings shouldn't be split
across lines, you can break the line across multiple ones between
parameters. I suggest checking this whole script using "flake8" to check
for style errors.

> +    args = parser.parse_args()
> +
> +    return args
> +

"args" is unneeded here. "return parse.parse_args()" is shorter. :-)

> +
> +def run_meson(args):
> +    "Runs a meson command logging output to process.log"
> +    with open('process.log', 'a') as sys.stdout:
> +        ret = mesonmain.run(args, abspath('meson'))
> +    sys.stdout = sys.__stdout__
> +    return ret
> +

I think process.log should be renamed to "process_iwyu.log" to match the
script name.
Also, it's nice to see a few functions like this with a docstring at the
start. It would be good to have a one-line summary at the start of every
fn in this file.

> +
> +def remove_includes(filename, include, dpdk_dir, build_dir):
> +    # Load in file - readlines()
> +    # loop through list once in mem -> make cpy of list with line removed
> +    # write cpy  -> stored in memory so write cpy to file then check
> +    # run test build -> call ninja on the build folder, ninja -C build, subprocess
You actually call "meson compile" rather than ninja -C build. Please make
sure the comments match the code as the code is reworked.

If you take the approach of adding a one-line string at the start of each
function, I'd suggest splitting up this comment into smaller comments
spread throughout the code, explaining each short block as it appears.
[Though I see it's reasonably well commented below as-is]

> +    # if fails -> write original back to file otherwise continue on
> +    # newlist = [ln for ln in lines if not ln.startswith(...)] filters out one element
> +    filepath = filename
> +
> +    with open(filepath, 'r+') as f:
> +        lines = f.readlines()  # Read lines when file is opened
> +
> +    with open(filepath, 'w') as f:
> +        for ln in lines:  # Removes the include passed in
> +            if ln.strip("\n") != include:
Strip without any parameters removes all whitespace, which is probably ok
here, so drop the explicit "\n".

> +                f.write(ln)
> +
> +    ret = run_meson(['compile', '-C', join(dpdk_dir, build_dir)])
> +    if (ret == 0):  # Include is not needed -> build is successful
> +        print('SUCCESS')
> +    else:
> +        # failed, catch the error
> +        # return file to original state
> +        with open(filepath, 'w') as f:
> +            f.writelines(lines)
> +            print('FAILED')
> +
> +
> +def get_build_config(builddir, condition):
> +    "returns contents of rte_build_config.h"
> +    with open(join(builddir, 'rte_build_config.h')) as f:
> +        return [ln for ln in f.readlines() if condition(ln)]
> +
> +
> +def uses_libbsd(builddir):
> +    "return whether the build uses libbsd or not"
> +    return bool(get_build_config(builddir, lambda ln: 'RTE_USE_LIBBSD' in ln))
> +
> +
> +def process(args):
> +    filename = None
> +    build_dir = args.build_dir
> +    dpdk_dir = abspath(__file__).split('/devtools')[0]
This assumes that we are using the script from the devtools dir of the copy
of DPDK we want to edit. That's probably a fair enough assumption and good
enough, though I'd like more input on it.
The other alternative is to work of the build dir, which will have the
paths to the DPDK source code directory in it.  Running "meson configure"
in the build dir will print out the source directory location at the start:

$ meson configure | head
Core properties:
  Source dir /home/bruce/dpdk.org
  Build dir  /home/bruce/dpdk.org/build


> +    directory = args.sub_dir
> +    # Use stdin if no iwyu_tool out file given
> +    logfile = abspath(args.file) if str(args.file) != '-' else args.file

Not sure this line is necessary. Assuming that we don't chdir anywhere,
using args.file directly below in call to "fileinput.input" should work
perfectly.

> +
> +    keep_str_fns = uses_libbsd(join(dpdk_dir, build_dir)) # check for libbsd
> +    if keep_str_fns:
> +        print('Warning: libbsd is present, build will fail to detect incorrect removal of rte_string_fns.h',
> +              file=sys.stderr)
> +    run_meson(['configure', dpdk_dir + "/" + build_dir, '-Dwerror=true'])  # turn on werror
> +
> +    for line in fileinput.input(logfile):
> +        if 'should remove' in line:
> +            # If the file path in the iwyu_tool output is an absolute path
> +            # it means the file is outside of the dpdk directory, therefore ignore it
> +            # Also check to see if the file is within the specified sub directory
> +            if line.split()[0] != abspath(line.split()[0]) and directory in line.split()[0]:
> +                filename = relpath(join(build_dir, line.split()[0]))
> +        elif line.startswith('-') and filename:
> +            include = '#include ' + line.split()[2]
> +            print(f"Remove {include} from {filename} ... ", end='', flush=True)
> +            if keep_str_fns and '<rte_string_fns.h>' in include:
> +                print('skipped')
> +                continue
> +            remove_includes(filename, include, dpdk_dir, build_dir)
> +        else:
> +            filename = None
> +
> +
> +def main():
> +    args = args_parse()
> +    process(args)
> +
Nit: again, args variable is unnecessary, and you can shorten to single
line if you like "process(args_parse())"

> +
> +if __name__ == '__main__':
> +    main()
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v1 0/5] introduce IWYU
  2021-10-04 10:10 [dpdk-dev] [PATCH v1 0/5] introduce IWYU Sean Morrissey
                   ` (4 preceding siblings ...)
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 5/5] lib/eal: " Sean Morrissey
@ 2021-10-04 15:55 ` Stephen Hemminger
  2021-10-04 16:34   ` Bruce Richardson
  2021-10-06 11:13 ` [dpdk-dev] [PATCH v2 " Sean Morrissey
  6 siblings, 1 reply; 147+ messages in thread
From: Stephen Hemminger @ 2021-10-04 15:55 UTC (permalink / raw)
  To: Sean Morrissey; +Cc: dev

On Mon,  4 Oct 2021 10:10:53 +0000
Sean Morrissey <sean.morrissey@intel.com> wrote:

> This patchset introduces the include-what-you-use script which removes
> unused header includes. IWYU GitHub:
> 
> https://github.com/include-what-you-use/include-what-you-use
> 
> Along with the script there are some patches which make a start on
> removing unneeded headers.
> 
> Sean Morrissey (5):
>   devtools: script to remove unused headers includes
>   lib/telemetry: remove unneeded header includes
>   lib/ring: remove unneeded header includes
>   lib/kvargs: remove unneeded header includes
>   lib/eal: remove unneeded header includes
> 
>  devtools/process_iwyu.py               | 109 +++++++++++++++++++++++++
>  lib/eal/common/eal_common_dev.c        |   5 --
>  lib/eal/common/eal_common_devargs.c    |   1 -
>  lib/eal/common/eal_common_errno.c      |   4 -
>  lib/eal/common/eal_common_fbarray.c    |   3 -
>  lib/eal/common/eal_common_hexdump.c    |   3 -
>  lib/eal/common/eal_common_launch.c     |   6 --
>  lib/eal/common/eal_common_lcore.c      |   6 --
>  lib/eal/common/eal_common_log.c        |   2 -
>  lib/eal/common/eal_common_memalloc.c   |   3 -
>  lib/eal/common/eal_common_memory.c     |   5 --
>  lib/eal/common/eal_common_memzone.c    |   4 -
>  lib/eal/common/eal_common_options.c    |   2 -
>  lib/eal/common/eal_common_proc.c       |   2 -
>  lib/eal/common/eal_common_string_fns.c |   2 -
>  lib/eal/common/eal_common_tailqs.c     |  11 ---
>  lib/eal/common/eal_common_thread.c     |   3 -
>  lib/eal/common/eal_common_timer.c      |   6 --
>  lib/eal/common/eal_common_trace.c      |   1 -
>  lib/eal/common/hotplug_mp.h            |   1 -
>  lib/eal/common/malloc_elem.c           |   6 --
>  lib/eal/common/malloc_heap.c           |   5 --
>  lib/eal/common/malloc_mp.c             |   1 -
>  lib/eal/common/malloc_mp.h             |   2 -
>  lib/eal/common/rte_malloc.c            |   6 --
>  lib/eal/common/rte_random.c            |   3 -
>  lib/eal/common/rte_service.c           |   6 --
>  lib/eal/include/rte_version.h          |   2 -
>  lib/eal/linux/eal.c                    |  10 ---
>  lib/eal/linux/eal_alarm.c              |   7 --
>  lib/eal/linux/eal_cpuflags.c           |   2 -
>  lib/eal/linux/eal_debug.c              |   5 --
>  lib/eal/linux/eal_dev.c                |   4 -
>  lib/eal/linux/eal_hugepage_info.c      |   8 --
>  lib/eal/linux/eal_interrupts.c         |   8 --
>  lib/eal/linux/eal_lcore.c              |   7 --
>  lib/eal/linux/eal_log.c                |  11 +--
>  lib/eal/linux/eal_memalloc.c           |   8 --
>  lib/eal/linux/eal_memory.c             |   9 --
>  lib/eal/linux/eal_thread.c             |   5 --
>  lib/eal/linux/eal_timer.c              |  15 ----
>  lib/eal/linux/eal_vfio_mp_sync.c       |   1 -
>  lib/eal/unix/eal_file.c                |   1 -
>  lib/eal/unix/rte_thread.c              |   1 -
>  lib/eal/x86/rte_cycles.c               |   1 -
>  lib/kvargs/rte_kvargs.c                |   1 -
>  lib/ring/rte_ring.c                    |   7 --
>  lib/telemetry/telemetry.c              |   1 -
>  lib/telemetry/telemetry_data.h         |   1 -
>  49 files changed, 110 insertions(+), 213 deletions(-)
>  create mode 100755 devtools/process_iwyu.py
> 

There is a risk of breaking builds on other platforms.
How can you be sure the include files (especially auto generated list)
are the same in Linux, FreeBSD and Windows as well as the special
versions of libc (musl etc).




^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v1 0/5] introduce IWYU
  2021-10-04 15:55 ` [dpdk-dev] [PATCH v1 0/5] introduce IWYU Stephen Hemminger
@ 2021-10-04 16:34   ` Bruce Richardson
  0 siblings, 0 replies; 147+ messages in thread
From: Bruce Richardson @ 2021-10-04 16:34 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Sean Morrissey, dev

On Mon, Oct 04, 2021 at 08:55:35AM -0700, Stephen Hemminger wrote:
> On Mon,  4 Oct 2021 10:10:53 +0000
> Sean Morrissey <sean.morrissey@intel.com> wrote:
> 
> > This patchset introduces the include-what-you-use script which removes
> > unused header includes. IWYU GitHub:
> > 
> > https://github.com/include-what-you-use/include-what-you-use
> > 
> > Along with the script there are some patches which make a start on
> > removing unneeded headers.
> > 
> > Sean Morrissey (5):
> >   devtools: script to remove unused headers includes
> >   lib/telemetry: remove unneeded header includes
> >   lib/ring: remove unneeded header includes
> >   lib/kvargs: remove unneeded header includes
> >   lib/eal: remove unneeded header includes
> > 
> >  devtools/process_iwyu.py               | 109 +++++++++++++++++++++++++
<snip>
> >  49 files changed, 110 insertions(+), 213 deletions(-)
> >  create mode 100755 devtools/process_iwyu.py
> > 
> 
> There is a risk of breaking builds on other platforms.
> How can you be sure the include files (especially auto generated list)
> are the same in Linux, FreeBSD and Windows as well as the special
> versions of libc (musl etc).

Yep, there is a risk of that but:

a) that's why we have automated build checks of various types in
test-meson-builds and why we have automated testing of patches in a number
of different labs reported out in patchwork.
b) if we say we can't risk it, we then can't gain much/any real benefit
from tools like iwyu - a tool that you have encouraged use of a number of
times :-).

Overall, I think this is a good thing for DPDK, and I encouraged Sean to
look into it, because it just helps with code quality in DPDK. However,
it's also true that there is risk in this, so I think the approach of only
doing a few libraries initially - so we can see how it works out - is
probably best, rather than trying to do the whole codebase in one go. I
think it's also true to say that the risk is greatest with EAL, so if it
can be cleaned up, cleaning the other libs and maybe then drivers should be
easier. Having the whole processing automated will also help with this, as -
if we want to minimize risk - the work on each driver can be done by the
driver maintainers themselves, who are best placed to know the
platform-specific issues for that code.

Regards,
/Bruce

^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v1 5/5] lib/eal: remove unneeded header includes
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 5/5] lib/eal: " Sean Morrissey
  2021-10-04 10:23   ` Van Haaren, Harry
@ 2021-10-04 18:15   ` David Christensen
  1 sibling, 0 replies; 147+ messages in thread
From: David Christensen @ 2021-10-04 18:15 UTC (permalink / raw)
  To: Sean Morrissey, Anatoly Burakov, Jerin Jacob, Sunil Kumar Kori,
	Mattias Rönnblom, Harry van Haaren, Harman Kalra,
	Bruce Richardson, Konstantin Ananyev
  Cc: dev



On 10/4/21 3:10 AM, Sean Morrissey wrote:
> These header includes have been flagged by the iwyu_tool
> and removed.
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> ---
>   lib/eal/common/eal_common_dev.c        |  5 -----
>   lib/eal/common/eal_common_devargs.c    |  1 -
>   lib/eal/common/eal_common_errno.c      |  4 ----
>   lib/eal/common/eal_common_fbarray.c    |  3 ---
>   lib/eal/common/eal_common_hexdump.c    |  3 ---
>   lib/eal/common/eal_common_launch.c     |  6 ------
>   lib/eal/common/eal_common_lcore.c      |  6 ------
>   lib/eal/common/eal_common_log.c        |  2 --
>   lib/eal/common/eal_common_memalloc.c   |  3 ---
>   lib/eal/common/eal_common_memory.c     |  5 -----
>   lib/eal/common/eal_common_memzone.c    |  4 ----
>   lib/eal/common/eal_common_options.c    |  2 --
>   lib/eal/common/eal_common_proc.c       |  2 --
>   lib/eal/common/eal_common_string_fns.c |  2 --
>   lib/eal/common/eal_common_tailqs.c     | 11 -----------
>   lib/eal/common/eal_common_thread.c     |  3 ---
>   lib/eal/common/eal_common_timer.c      |  6 ------
>   lib/eal/common/eal_common_trace.c      |  1 -
>   lib/eal/common/hotplug_mp.h            |  1 -
>   lib/eal/common/malloc_elem.c           |  6 ------
>   lib/eal/common/malloc_heap.c           |  5 -----
>   lib/eal/common/malloc_mp.c             |  1 -
>   lib/eal/common/malloc_mp.h             |  2 --
>   lib/eal/common/rte_malloc.c            |  6 ------
>   lib/eal/common/rte_random.c            |  3 ---
>   lib/eal/common/rte_service.c           |  6 ------
>   lib/eal/include/rte_version.h          |  2 --
>   lib/eal/linux/eal.c                    | 10 ----------
>   lib/eal/linux/eal_alarm.c              |  7 -------
>   lib/eal/linux/eal_cpuflags.c           |  2 --
>   lib/eal/linux/eal_debug.c              |  5 -----
>   lib/eal/linux/eal_dev.c                |  4 ----
>   lib/eal/linux/eal_hugepage_info.c      |  8 --------
>   lib/eal/linux/eal_interrupts.c         |  8 --------
>   lib/eal/linux/eal_lcore.c              |  7 -------
>   lib/eal/linux/eal_log.c                | 11 +----------
>   lib/eal/linux/eal_memalloc.c           |  8 --------
>   lib/eal/linux/eal_memory.c             |  9 ---------
>   lib/eal/linux/eal_thread.c             |  5 -----
>   lib/eal/linux/eal_timer.c              | 15 ---------------
>   lib/eal/linux/eal_vfio_mp_sync.c       |  1 -
>   lib/eal/unix/eal_file.c                |  1 -
>   lib/eal/unix/rte_thread.c              |  1 -
>   lib/eal/x86/rte_cycles.c               |  1 -
>   44 files changed, 1 insertion(+), 203 deletions(-)


Build errors generated on POWER build with gcc 8.3.1-5 (RHEL 8.4):

[64/2593] Compiling C object 
'lib/76b5a35@@rte_eal@sta/eal_common_eal_common_lcore.c.o'.
../lib/eal/common/eal_common_lcore.c: In function ‘rte_lcore_index’:
../lib/eal/common/eal_common_lcore.c:27:6: warning: implicit declaration 
of function ‘unlikely’ [-Wimplicit-function-declaration]
   if (unlikely(lcore_id >= RTE_MAX_LCORE))
       ^~~~~~~~
../lib/eal/common/eal_common_lcore.c:27:6: warning: nested extern 
declaration of ‘unlikely’ [-Wnested-externs]
[436/2593] Linking target lib/librte_eal.so.22.0.
FAILED: lib/librte_eal.so.22.0

Failure can be fixed in one of two ways:

1) Leave #include <rte_debug.h> in lib/eal/common/eal_common_lcore.c
2) Replace #include <rte_debug.h> with <rte_branch_prediction.h> in 
lib/eal/common/eal_common_lcore.c

Dave


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v2 0/5] introduce IWYU
  2021-10-04 10:10 [dpdk-dev] [PATCH v1 0/5] introduce IWYU Sean Morrissey
                   ` (5 preceding siblings ...)
  2021-10-04 15:55 ` [dpdk-dev] [PATCH v1 0/5] introduce IWYU Stephen Hemminger
@ 2021-10-06 11:13 ` Sean Morrissey
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 1/5] devtools: script to remove unused headers includes Sean Morrissey
                     ` (5 more replies)
  6 siblings, 6 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-06 11:13 UTC (permalink / raw)
  Cc: dev, Sean Morrissey

This patchset introduces the include-what-you-use script which removes
unused header includes. IWYU GitHub:

https://github.com/include-what-you-use/include-what-you-use

Along with the script there are some patches which make a start on
removing unneeded headers.

Sean Morrissey (5):
  devtools: script to remove unused headers includes
  lib/telemetry: remove unneeded header includes
  lib/ring: remove unneeded header includes
  lib/kvargs: remove unneeded header includes
  lib/eal: remove unneeded header includes

 devtools/process_iwyu.py               | 114 +++++++++++++++++++++++++
 lib/eal/common/eal_common_dev.c        |   5 --
 lib/eal/common/eal_common_devargs.c    |   1 -
 lib/eal/common/eal_common_errno.c      |   4 -
 lib/eal/common/eal_common_fbarray.c    |   3 -
 lib/eal/common/eal_common_hexdump.c    |   3 -
 lib/eal/common/eal_common_launch.c     |   6 --
 lib/eal/common/eal_common_lcore.c      |   7 +-
 lib/eal/common/eal_common_log.c        |   2 -
 lib/eal/common/eal_common_memalloc.c   |   3 -
 lib/eal/common/eal_common_memory.c     |   5 --
 lib/eal/common/eal_common_memzone.c    |   4 -
 lib/eal/common/eal_common_options.c    |   2 -
 lib/eal/common/eal_common_proc.c       |   2 -
 lib/eal/common/eal_common_string_fns.c |   2 -
 lib/eal/common/eal_common_tailqs.c     |  11 ---
 lib/eal/common/eal_common_thread.c     |   3 -
 lib/eal/common/eal_common_timer.c      |   6 --
 lib/eal/common/eal_common_trace.c      |   1 -
 lib/eal/common/hotplug_mp.h            |   1 -
 lib/eal/common/malloc_elem.c           |   6 --
 lib/eal/common/malloc_heap.c           |   5 --
 lib/eal/common/malloc_mp.c             |   1 -
 lib/eal/common/malloc_mp.h             |   2 -
 lib/eal/common/rte_malloc.c            |   6 --
 lib/eal/common/rte_random.c            |   3 -
 lib/eal/common/rte_service.c           |   6 --
 lib/eal/include/rte_version.h          |   2 -
 lib/eal/linux/eal.c                    |  10 ---
 lib/eal/linux/eal_alarm.c              |   7 --
 lib/eal/linux/eal_cpuflags.c           |   2 -
 lib/eal/linux/eal_debug.c              |   5 --
 lib/eal/linux/eal_dev.c                |   4 -
 lib/eal/linux/eal_hugepage_info.c      |   8 --
 lib/eal/linux/eal_interrupts.c         |   8 --
 lib/eal/linux/eal_lcore.c              |   7 --
 lib/eal/linux/eal_log.c                |  11 +--
 lib/eal/linux/eal_memalloc.c           |   8 --
 lib/eal/linux/eal_memory.c             |   9 --
 lib/eal/linux/eal_thread.c             |   5 --
 lib/eal/linux/eal_timer.c              |  15 ----
 lib/eal/linux/eal_vfio_mp_sync.c       |   1 -
 lib/eal/unix/eal_file.c                |   1 -
 lib/eal/unix/rte_thread.c              |   1 -
 lib/eal/x86/rte_cycles.c               |   1 -
 lib/kvargs/rte_kvargs.c                |   1 -
 lib/ring/rte_ring.c                    |   7 --
 lib/telemetry/telemetry.c              |   1 -
 lib/telemetry/telemetry_data.h         |   1 -
 49 files changed, 116 insertions(+), 213 deletions(-)
 create mode 100755 devtools/process_iwyu.py

-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v2 1/5] devtools: script to remove unused headers includes
  2021-10-06 11:13 ` [dpdk-dev] [PATCH v2 " Sean Morrissey
@ 2021-10-06 11:13   ` Sean Morrissey
  2021-10-06 13:30     ` Bruce Richardson
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 2/5] lib/telemetry: remove unneeded header includes Sean Morrissey
                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 147+ messages in thread
From: Sean Morrissey @ 2021-10-06 11:13 UTC (permalink / raw)
  Cc: dev, Sean Morrissey, Conor Fogarty

This script can be used for removing headers flagged for removal by the
include-what-you-use (IWYU) tool. The script has the ability to remove
headers from specified sub-directories or dpdk as a whole and tests the
build after each removal by calling meson compile.

example usages:

Remove headers flagged by iwyu_tool output file
$ ./devtools/process_iwyu.py iwyu.out -b build

Remove headers flagged by iwyu_tool output file from sub-directory
$ ./devtools/process_iwyu.py iwyu.out -b build -d lib/kvargs

Remove headers directly piped from the iwyu_tool
$ iwyu_tool -p build | ./devtools/process_iwyu.py - -b build

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
---
 devtools/process_iwyu.py | 114 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 114 insertions(+)
 create mode 100755 devtools/process_iwyu.py

diff --git a/devtools/process_iwyu.py b/devtools/process_iwyu.py
new file mode 100755
index 0000000000..c5b93c5ef3
--- /dev/null
+++ b/devtools/process_iwyu.py
@@ -0,0 +1,114 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+#
+
+import argparse
+import fileinput
+import sys
+from os.path import abspath, relpath, join
+from pathlib import Path
+from mesonbuild import mesonmain
+
+
+def args_parse():
+    "parse arguments and return the argument object back to main"
+    parser = argparse.ArgumentParser(
+        description="""This script can be used to remove
+        includes which are not in use\n""")
+    parser.add_argument('-b', '--build_dir', type=str,
+                        help="""The path to the build directory in which
+                        the IWYU tool was used in.""", default="build")
+    parser.add_argument('-d', '--sub_dir', type=str,
+                        help='The sub-directory to remove headers from.',
+                        default="")
+    parser.add_argument('file', type=Path,
+                        help="""The path to the IWYU log file or output
+                        from stdin.""")
+
+    return parser.parse_args()
+
+
+def run_meson(args):
+    "Runs a meson command logging output to process.log"
+    with open('process_iwyu.log', 'a') as sys.stdout:
+        ret = mesonmain.run(args, abspath('meson'))
+    sys.stdout = sys.__stdout__
+    return ret
+
+
+def remove_includes(filename, include, build_dir):
+    "Attempts to remove include, if it fails then revert to original state"
+    filepath = filename
+
+    with open(filepath, 'r+') as f:
+        lines = f.readlines()  # Read lines when file is opened
+
+    with open(filepath, 'w') as f:
+        for ln in lines:  # Removes the include passed in
+            if ln.strip() != include:
+                f.write(ln)
+
+    # run test build -> call meson on the build folder, meson compile -C build
+    ret = run_meson(['compile', '-C', build_dir])
+    if (ret == 0):  # Include is not needed -> build is successful
+        print('SUCCESS')
+    else:
+        # failed, catch the error
+        # return file to original state
+        with open(filepath, 'w') as f:
+            f.writelines(lines)
+            print('FAILED')
+
+
+def get_build_config(builddir, condition):
+    "returns contents of rte_build_config.h"
+    with open(join(builddir, 'rte_build_config.h')) as f:
+        return [ln for ln in f.readlines() if condition(ln)]
+
+
+def uses_libbsd(builddir):
+    "return whether the build uses libbsd or not"
+    return bool(get_build_config(builddir, lambda ln: 'RTE_USE_LIBBSD' in ln))
+
+
+def process(args):
+    "process the iwyu output on a set of files"
+    filename = None
+    build_dir = abspath(args.build_dir)
+    directory = args.sub_dir
+
+    keep_str_fns = uses_libbsd(build_dir)  # check for libbsd
+    if keep_str_fns:
+        print("""Warning: libbsd is present, build will fail to detect
+                incorrect removal of rte_string_fns.h""", file=sys.stderr)
+    # turn on werror
+    run_meson(['configure', build_dir, '-Dwerror=true'])
+    # Use stdin if no iwyu_tool out file given
+    for line in fileinput.input(args.file):
+        if 'should remove' in line:
+            # If the file path in the iwyu_tool output is
+            # an absolute path it means the file is outside
+            # of the dpdk directory, therefore ignore it.
+            # Also check to see if the file is within the
+            # specified sub directory.
+            if (line.split()[0] != abspath(line.split()[0]) and
+                    directory in line.split()[0]):
+                filename = relpath(join(build_dir, line.split()[0]))
+        elif line.startswith('-') and filename:
+            include = '#include ' + line.split()[2]
+            print(f"Remove {include} from {filename} ... ", end='', flush=True)
+            if keep_str_fns and '<rte_string_fns.h>' in include:
+                print('skipped')
+                continue
+            remove_includes(filename, include, build_dir)
+        else:
+            filename = None
+
+
+def main():
+    process(args_parse())
+
+
+if __name__ == '__main__':
+    main()
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v2 2/5] lib/telemetry: remove unneeded header includes
  2021-10-06 11:13 ` [dpdk-dev] [PATCH v2 " Sean Morrissey
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 1/5] devtools: script to remove unused headers includes Sean Morrissey
@ 2021-10-06 11:13   ` Sean Morrissey
  2021-10-06 12:34     ` Power, Ciara
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 3/5] lib/ring: " Sean Morrissey
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 147+ messages in thread
From: Sean Morrissey @ 2021-10-06 11:13 UTC (permalink / raw)
  To: Ciara Power; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/telemetry/telemetry.c      | 1 -
 lib/telemetry/telemetry_data.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 8665db8d03..fb3b93ca7e 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -8,7 +8,6 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/stat.h>
-#include <dlfcn.h>
 #endif /* !RTE_EXEC_ENV_WINDOWS */
 
 /* we won't link against libbsd, so just always use DPDKs-specific strlcpy */
diff --git a/lib/telemetry/telemetry_data.h b/lib/telemetry/telemetry_data.h
index adb84a09f1..26aa28e72c 100644
--- a/lib/telemetry/telemetry_data.h
+++ b/lib/telemetry/telemetry_data.h
@@ -5,7 +5,6 @@
 #ifndef _TELEMETRY_DATA_H_
 #define _TELEMETRY_DATA_H_
 
-#include <inttypes.h>
 #include "rte_telemetry.h"
 
 enum tel_container_types {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v2 3/5] lib/ring: remove unneeded header includes
  2021-10-06 11:13 ` [dpdk-dev] [PATCH v2 " Sean Morrissey
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 1/5] devtools: script to remove unused headers includes Sean Morrissey
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 2/5] lib/telemetry: remove unneeded header includes Sean Morrissey
@ 2021-10-06 11:13   ` Sean Morrissey
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 4/5] lib/kvargs: " Sean Morrissey
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-06 11:13 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/ring/rte_ring.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
index f17bd966be..bb95962b0c 100644
--- a/lib/ring/rte_ring.c
+++ b/lib/ring/rte_ring.c
@@ -17,16 +17,9 @@
 
 #include <rte_common.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_malloc.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_atomic.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_spinlock.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v2 4/5] lib/kvargs: remove unneeded header includes
  2021-10-06 11:13 ` [dpdk-dev] [PATCH v2 " Sean Morrissey
                     ` (2 preceding siblings ...)
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 3/5] lib/ring: " Sean Morrissey
@ 2021-10-06 11:13   ` Sean Morrissey
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 5/5] lib/eal: " Sean Morrissey
  2021-10-07 10:25   ` [dpdk-dev] [PATCH v3 0/5] introduce IWYU Sean Morrissey
  5 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-06 11:13 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/kvargs/rte_kvargs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
index 38e9d5c1ca..4cce8e953b 100644
--- a/lib/kvargs/rte_kvargs.c
+++ b/lib/kvargs/rte_kvargs.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <stdbool.h>
 
-#include <rte_os_shim.h>
 #include <rte_string_fns.h>
 
 #include "rte_kvargs.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v2 5/5] lib/eal: remove unneeded header includes
  2021-10-06 11:13 ` [dpdk-dev] [PATCH v2 " Sean Morrissey
                     ` (3 preceding siblings ...)
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 4/5] lib/kvargs: " Sean Morrissey
@ 2021-10-06 11:13   ` Sean Morrissey
  2021-10-06 16:36     ` David Christensen
  2021-10-07 10:25   ` [dpdk-dev] [PATCH v3 0/5] introduce IWYU Sean Morrissey
  5 siblings, 1 reply; 147+ messages in thread
From: Sean Morrissey @ 2021-10-06 11:13 UTC (permalink / raw)
  To: Anatoly Burakov, Jerin Jacob, Sunil Kumar Kori,
	Mattias Rönnblom, Harry van Haaren, Harman Kalra,
	Bruce Richardson, Konstantin Ananyev
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
---
 lib/eal/common/eal_common_dev.c        |  5 -----
 lib/eal/common/eal_common_devargs.c    |  1 -
 lib/eal/common/eal_common_errno.c      |  4 ----
 lib/eal/common/eal_common_fbarray.c    |  3 ---
 lib/eal/common/eal_common_hexdump.c    |  3 ---
 lib/eal/common/eal_common_launch.c     |  6 ------
 lib/eal/common/eal_common_lcore.c      |  7 +------
 lib/eal/common/eal_common_log.c        |  2 --
 lib/eal/common/eal_common_memalloc.c   |  3 ---
 lib/eal/common/eal_common_memory.c     |  5 -----
 lib/eal/common/eal_common_memzone.c    |  4 ----
 lib/eal/common/eal_common_options.c    |  2 --
 lib/eal/common/eal_common_proc.c       |  2 --
 lib/eal/common/eal_common_string_fns.c |  2 --
 lib/eal/common/eal_common_tailqs.c     | 11 -----------
 lib/eal/common/eal_common_thread.c     |  3 ---
 lib/eal/common/eal_common_timer.c      |  6 ------
 lib/eal/common/eal_common_trace.c      |  1 -
 lib/eal/common/hotplug_mp.h            |  1 -
 lib/eal/common/malloc_elem.c           |  6 ------
 lib/eal/common/malloc_heap.c           |  5 -----
 lib/eal/common/malloc_mp.c             |  1 -
 lib/eal/common/malloc_mp.h             |  2 --
 lib/eal/common/rte_malloc.c            |  6 ------
 lib/eal/common/rte_random.c            |  3 ---
 lib/eal/common/rte_service.c           |  6 ------
 lib/eal/include/rte_version.h          |  2 --
 lib/eal/linux/eal.c                    | 10 ----------
 lib/eal/linux/eal_alarm.c              |  7 -------
 lib/eal/linux/eal_cpuflags.c           |  2 --
 lib/eal/linux/eal_debug.c              |  5 -----
 lib/eal/linux/eal_dev.c                |  4 ----
 lib/eal/linux/eal_hugepage_info.c      |  8 --------
 lib/eal/linux/eal_interrupts.c         |  8 --------
 lib/eal/linux/eal_lcore.c              |  7 -------
 lib/eal/linux/eal_log.c                | 11 +----------
 lib/eal/linux/eal_memalloc.c           |  8 --------
 lib/eal/linux/eal_memory.c             |  9 ---------
 lib/eal/linux/eal_thread.c             |  5 -----
 lib/eal/linux/eal_timer.c              | 15 ---------------
 lib/eal/linux/eal_vfio_mp_sync.c       |  1 -
 lib/eal/unix/eal_file.c                |  1 -
 lib/eal/unix/rte_thread.c              |  1 -
 lib/eal/x86/rte_cycles.c               |  1 -
 44 files changed, 2 insertions(+), 203 deletions(-)

diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index 148a23830a..12bf3d3c22 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -5,20 +5,15 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 
-#include <rte_compat.h>
 #include <rte_bus.h>
 #include <rte_class.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
-#include <rte_debug.h>
 #include <rte_errno.h>
-#include <rte_kvargs.h>
 #include <rte_log.h>
 #include <rte_spinlock.h>
-#include <rte_malloc.h>
 #include <rte_string_fns.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c
index 7ab9e71b2a..f4beb35591 100644
--- a/lib/eal/common/eal_common_devargs.c
+++ b/lib/eal/common/eal_common_devargs.c
@@ -12,7 +12,6 @@
 
 #include <rte_bus.h>
 #include <rte_class.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_errno.h>
diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c
index f86802705a..1091065568 100644
--- a/lib/eal/common/eal_common_errno.c
+++ b/lib/eal/common/eal_common_errno.c
@@ -5,15 +5,11 @@
 /* Use XSI-compliant portable version of strerror_r() */
 #undef _GNU_SOURCE
 
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdarg.h>
-#include <errno.h>
 
 #include <rte_per_lcore.h>
 #include <rte_errno.h>
-#include <rte_string_fns.h>
 
 #ifdef RTE_EXEC_ENV_WINDOWS
 #define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum)
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 3a28a53247..f11f87979f 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -2,7 +2,6 @@
  * Copyright(c) 2017-2018 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <inttypes.h>
 #include <limits.h>
 #include <stdint.h>
@@ -14,9 +13,7 @@
 #include <rte_eal_paging.h>
 #include <rte_errno.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 #include "eal_filesystem.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_hexdump.c b/lib/eal/common/eal_common_hexdump.c
index 2d2179d411..63bbbdcf0a 100644
--- a/lib/eal/common/eal_common_hexdump.c
+++ b/lib/eal/common/eal_common_hexdump.c
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2010-2014 Intel Corporation
  */
-#include <stdlib.h>
 #include <stdio.h>
-#include <errno.h>
-#include <stdint.h>
 #include <rte_hexdump.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/eal_common_launch.c b/lib/eal/common/eal_common_launch.c
index 34f854ad80..2a20b32a77 100644
--- a/lib/eal/common/eal_common_launch.c
+++ b/lib/eal/common/eal_common_launch.c
@@ -3,16 +3,10 @@
  */
 
 #include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <sys/queue.h>
 
 #include <rte_launch.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
 #include <rte_atomic.h>
 #include <rte_pause.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c
index 66d6bad1a7..c747353b17 100644
--- a/lib/eal/common/eal_common_lcore.c
+++ b/lib/eal/common/eal_common_lcore.c
@@ -2,19 +2,14 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <unistd.h>
-#include <limits.h>
 #include <string.h>
 
 #include <rte_common.h>
-#include <rte_debug.h>
-#include <rte_eal.h>
+#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_rwlock.h>
 
-#include "eal_memcfg.h"
 #include "eal_private.h"
 #include "eal_thread.h"
 
diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c
index ec8fe23a7f..24afb57c89 100644
--- a/lib/eal/common/eal_common_log.c
+++ b/lib/eal/common/eal_common_log.c
@@ -11,9 +11,7 @@
 #include <regex.h>
 #include <fnmatch.h>
 
-#include <rte_eal.h>
 #include <rte_log.h>
-#include <rte_os_shim.h>
 #include <rte_per_lcore.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/common/eal_common_memalloc.c b/lib/eal/common/eal_common_memalloc.c
index e872c6533b..f8770ff835 100644
--- a/lib/eal/common/eal_common_memalloc.c
+++ b/lib/eal/common/eal_common_memalloc.c
@@ -5,12 +5,9 @@
 #include <string.h>
 
 #include <rte_errno.h>
-#include <rte_lcore.h>
 #include <rte_fbarray.h>
-#include <rte_memzone.h>
 #include <rte_memory.h>
 #include <rte_string_fns.h>
-#include <rte_rwlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
index f83b75092e..bb0da9e50a 100644
--- a/lib/eal/common/eal_common_memory.c
+++ b/lib/eal/common/eal_common_memory.c
@@ -2,16 +2,11 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdlib.h>
-#include <stdarg.h>
 #include <string.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/queue.h>
 
 #include <rte_fbarray.h>
 #include <rte_memory.h>
diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c
index 7c21aa921e..67dcaaafbf 100644
--- a/lib/eal/common/eal_common_memzone.c
+++ b/lib/eal/common/eal_common_memzone.c
@@ -2,20 +2,16 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdarg.h>
 #include <inttypes.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/queue.h>
 
 #include <rte_log.h>
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_common.h>
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index eaef57312f..1eb51be09c 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -4,7 +4,6 @@
  */
 
 #include <stdlib.h>
-#include <unistd.h>
 #include <string.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <syslog.h>
@@ -17,7 +16,6 @@
 #include <dlfcn.h>
 #include <libgen.h>
 #endif
-#include <sys/types.h>
 #include <sys/stat.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <dirent.h>
diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index ebd0f6673b..575b4ca24d 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -15,7 +15,6 @@
 #include <string.h>
 #include <sys/file.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
@@ -27,7 +26,6 @@
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_tailq.h>
 
 #include "eal_memcfg.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_string_fns.c b/lib/eal/common/eal_common_string_fns.c
index ddd1891656..0236ae4023 100644
--- a/lib/eal/common/eal_common_string_fns.c
+++ b/lib/eal/common/eal_common_string_fns.c
@@ -2,9 +2,7 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 
 #include <rte_string_fns.h>
diff --git a/lib/eal/common/eal_common_tailqs.c b/lib/eal/common/eal_common_tailqs.c
index ead06897b8..580fbf24bc 100644
--- a/lib/eal/common/eal_common_tailqs.c
+++ b/lib/eal/common/eal_common_tailqs.c
@@ -3,24 +3,13 @@
  */
 
 #include <sys/queue.h>
-#include <stdint.h>
-#include <errno.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
-#include <inttypes.h>
 
-#include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_log.h>
 #include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_memcfg.h"
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index 1a52f42a2b..cfa6a69ad4 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -4,10 +4,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
 #include <pthread.h>
-#include <signal.h>
 #include <sched.h>
 #include <assert.h>
 #include <string.h>
diff --git a/lib/eal/common/eal_common_timer.c b/lib/eal/common/eal_common_timer.c
index 86f8429847..5686a5102b 100644
--- a/lib/eal/common/eal_common_timer.c
+++ b/lib/eal/common/eal_common_timer.c
@@ -2,16 +2,10 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/types.h>
-#include <time.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
 #include <rte_pause.h>
diff --git a/lib/eal/common/eal_common_trace.c b/lib/eal/common/eal_common_trace.c
index 7bff1cd2ce..036f6ac348 100644
--- a/lib/eal/common/eal_common_trace.c
+++ b/lib/eal/common/eal_common_trace.c
@@ -3,7 +3,6 @@
  */
 
 #include <fnmatch.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 #include <regex.h>
 
diff --git a/lib/eal/common/hotplug_mp.h b/lib/eal/common/hotplug_mp.h
index 8fcf9b52e2..066494ff27 100644
--- a/lib/eal/common/hotplug_mp.h
+++ b/lib/eal/common/hotplug_mp.h
@@ -6,7 +6,6 @@
 #define _HOTPLUG_MP_H_
 
 #include "rte_dev.h"
-#include "rte_bus.h"
 
 #define EAL_DEV_MP_ACTION_REQUEST      "eal_dev_mp_request"
 #define EAL_DEV_MP_ACTION_RESPONSE     "eal_dev_mp_response"
diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c
index c2c9461f1d..4c6e6f4910 100644
--- a/lib/eal/common/malloc_elem.c
+++ b/lib/eal/common/malloc_elem.c
@@ -6,17 +6,11 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/queue.h>
 
 #include <rte_memory.h>
 #include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_debug.h>
 #include <rte_common.h>
-#include <rte_spinlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c
index ee400f38ec..61f0a5d84f 100644
--- a/lib/eal/common/malloc_heap.c
+++ b/lib/eal/common/malloc_heap.c
@@ -5,7 +5,6 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <sys/queue.h>
 
@@ -13,15 +12,11 @@
 #include <rte_errno.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_string_fns.h>
 #include <rte_spinlock.h>
-#include <rte_memcpy.h>
 #include <rte_memzone.h>
-#include <rte_atomic.h>
 #include <rte_fbarray.h>
 
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c
index 2e597a17a2..801b2e7fbd 100644
--- a/lib/eal/common/malloc_mp.c
+++ b/lib/eal/common/malloc_mp.c
@@ -5,7 +5,6 @@
 #include <string.h>
 #include <sys/time.h>
 
-#include <rte_alarm.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/malloc_mp.h b/lib/eal/common/malloc_mp.h
index 0095062b72..fb10817e13 100644
--- a/lib/eal/common/malloc_mp.h
+++ b/lib/eal/common/malloc_mp.h
@@ -10,8 +10,6 @@
 
 #include <rte_common.h>
 #include <rte_random.h>
-#include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 /* forward declarations */
 struct malloc_heap;
diff --git a/lib/eal/common/rte_malloc.c b/lib/eal/common/rte_malloc.c
index 9d39e58c08..6c69a2cf3b 100644
--- a/lib/eal/common/rte_malloc.c
+++ b/lib/eal/common/rte_malloc.c
@@ -6,18 +6,12 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
 
 #include <rte_errno.h>
 #include <rte_memcpy.h>
 #include <rte_memory.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_branch_prediction.h>
-#include <rte_debug.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/common/rte_random.c b/lib/eal/common/rte_random.c
index ce21c2242a..4535cc980c 100644
--- a/lib/eal/common/rte_random.c
+++ b/lib/eal/common/rte_random.c
@@ -5,14 +5,11 @@
 #ifdef __RDSEED__
 #include <x86intrin.h>
 #endif
-#include <stdlib.h>
 #include <unistd.h>
 
 #include <rte_branch_prediction.h>
 #include <rte_cycles.h>
-#include <rte_eal.h>
 #include <rte_lcore.h>
-#include <rte_memory.h>
 #include <rte_random.h>
 
 struct rte_rand_state {
diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c
index bd8fb72e78..ef31b1f63c 100644
--- a/lib/eal/common/rte_service.c
+++ b/lib/eal/common/rte_service.c
@@ -3,22 +3,16 @@
  */
 
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <limits.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_service.h>
 #include <rte_service_component.h>
 
-#include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_debug.h>
 #include <rte_cycles.h>
 #include <rte_atomic.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/include/rte_version.h b/lib/eal/include/rte_version.h
index b06a62e7a2..414b6167f2 100644
--- a/lib/eal/include/rte_version.h
+++ b/lib/eal/include/rte_version.h
@@ -14,10 +14,8 @@
 extern "C" {
 #endif
 
-#include <stdint.h>
 #include <string.h>
 #include <stdio.h>
-#include <rte_common.h>
 #include <rte_compat.h>
 
 /**
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 3577eaeaa4..f55d1860d8 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -7,10 +7,8 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <syslog.h>
 #include <getopt.h>
 #include <sys/file.h>
 #include <dirent.h>
@@ -20,32 +18,24 @@
 #include <errno.h>
 #include <limits.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
 #include <sys/stat.h>
 #if defined(RTE_ARCH_X86)
 #include <sys/io.h>
 #endif
 #include <linux/version.h>
 
-#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_errno.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_service_component.h>
 #include <rte_log.h>
-#include <rte_random.h>
-#include <rte_cycles.h>
 #include <rte_string_fns.h>
 #include <rte_cpuflags.h>
-#include <rte_interrupts.h>
 #include <rte_bus.h>
-#include <rte_dev.h>
-#include <rte_devargs.h>
 #include <rte_version.h>
 #include <malloc_heap.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/linux/eal_alarm.c b/lib/eal/linux/eal_alarm.c
index 3252c6fa59..43f6bb14f2 100644
--- a/lib/eal/linux/eal_alarm.c
+++ b/lib/eal/linux/eal_alarm.c
@@ -3,21 +3,14 @@
  */
 #include <stdio.h>
 #include <stdint.h>
-#include <signal.h>
 #include <errno.h>
-#include <string.h>
 #include <sys/queue.h>
 #include <sys/time.h>
 #include <sys/timerfd.h>
 
-#include <rte_memory.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_common.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_lcore.h>
 #include <rte_errno.h>
 #include <rte_spinlock.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_cpuflags.c b/lib/eal/linux/eal_cpuflags.c
index d38296e1e5..c684940e1d 100644
--- a/lib/eal/linux/eal_cpuflags.c
+++ b/lib/eal/linux/eal_cpuflags.c
@@ -5,8 +5,6 @@
 #include <elf.h>
 #include <fcntl.h>
 #include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
diff --git a/lib/eal/linux/eal_debug.c b/lib/eal/linux/eal_debug.c
index 64dab4e0da..b0ecf5a9dc 100644
--- a/lib/eal/linux/eal_debug.c
+++ b/lib/eal/linux/eal_debug.c
@@ -5,16 +5,11 @@
 #ifdef RTE_BACKTRACE
 #include <execinfo.h>
 #endif
-#include <stdarg.h>
-#include <signal.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdint.h>
 
 #include <rte_log.h>
 #include <rte_debug.h>
-#include <rte_common.h>
-#include <rte_eal.h>
 
 #define BACKTRACE_SIZE 256
 
diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c
index 3b905e18f5..0a654e5b50 100644
--- a/lib/eal/linux/eal_dev.c
+++ b/lib/eal/linux/eal_dev.c
@@ -4,20 +4,16 @@
 
 #include <string.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
 
 #include <rte_string_fns.h>
 #include <rte_log.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
-#include <rte_malloc.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_bus.h>
-#include <rte_eal.h>
 #include <rte_spinlock.h>
 #include <rte_errno.h>
 
diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index d97792cade..b3e4c40ee7 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -3,7 +3,6 @@
  */
 
 #include <string.h>
-#include <sys/types.h>
 #include <sys/file.h>
 #include <dirent.h>
 #include <fcntl.h>
@@ -12,19 +11,12 @@
 #include <stdio.h>
 #include <fnmatch.h>
 #include <inttypes.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
-#include <sys/stat.h>
 
 #include <linux/mman.h> /* for hugetlb-related flags */
 
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_debug.h>
 #include <rte_log.h>
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index 22b3b7bcd9..1d5c9b272c 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -7,13 +7,10 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <sys/queue.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <inttypes.h>
 #include <sys/epoll.h>
-#include <sys/signalfd.h>
 #include <sys/ioctl.h>
 #include <sys/eventfd.h>
 #include <assert.h>
@@ -21,9 +18,6 @@
 
 #include <rte_common.h>
 #include <rte_interrupts.h>
-#include <rte_memory.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_branch_prediction.h>
@@ -36,8 +30,6 @@
 #include <rte_eal_trace.h>
 
 #include "eal_private.h"
-#include "eal_vfio.h"
-#include "eal_thread.h"
 
 #define EAL_INTR_EPOLL_WAIT_FOREVER (-1)
 #define NB_OTHER_INTR               1
diff --git a/lib/eal/linux/eal_lcore.c b/lib/eal/linux/eal_lcore.c
index bc8965844c..2e6a350603 100644
--- a/lib/eal/linux/eal_lcore.c
+++ b/lib/eal/linux/eal_lcore.c
@@ -4,15 +4,8 @@
 
 #include <unistd.h>
 #include <limits.h>
-#include <string.h>
-#include <dirent.h>
 
 #include <rte_log.h>
-#include <rte_eal.h>
-#include <rte_lcore.h>
-#include <rte_common.h>
-#include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_filesystem.h"
diff --git a/lib/eal/linux/eal_log.c b/lib/eal/linux/eal_log.c
index c0aa1007c4..9e72412e2b 100644
--- a/lib/eal/linux/eal_log.c
+++ b/lib/eal/linux/eal_log.c
@@ -2,19 +2,10 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdint.h>
 #include <sys/types.h>
 #include <syslog.h>
-#include <sys/queue.h>
-
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_spinlock.h>
+
 #include <rte_log.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index 0ec8542283..e3aba10107 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -3,23 +3,17 @@
  */
 
 #include <errno.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <unistd.h>
 #include <limits.h>
 #include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
@@ -36,9 +30,7 @@
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_eal.h>
-#include <rte_errno.h>
 #include <rte_memory.h>
-#include <rte_spinlock.h>
 
 #include "eal_filesystem.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c
index 03a4f2dd2d..40ec9663d0 100644
--- a/lib/eal/linux/eal_memory.c
+++ b/lib/eal/linux/eal_memory.c
@@ -5,7 +5,6 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -13,19 +12,14 @@
 #include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <sys/resource.h>
 #include <unistd.h>
 #include <limits.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
-#include <linux/memfd.h>
 #define MEMFD_SUPPORTED
 #endif
 #ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
@@ -36,12 +30,9 @@
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_string_fns.h>
 
 #include "eal_private.h"
 #include "eal_memalloc.h"
diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index 83c2034b93..60fa64ea55 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -4,20 +4,15 @@
 
 #include <errno.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdint.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <sched.h>
-#include <sys/queue.h>
 #include <sys/syscall.h>
 
 #include <rte_debug.h>
 #include <rte_atomic.h>
 #include <rte_launch.h>
 #include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_per_lcore.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_timer.c b/lib/eal/linux/eal_timer.c
index 7cf15cabac..620baf038d 100644
--- a/lib/eal/linux/eal_timer.c
+++ b/lib/eal/linux/eal_timer.c
@@ -3,28 +3,13 @@
  * Copyright(c) 2012-2013 6WIND S.A.
  */
 
-#include <string.h>
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <sys/mman.h>
-#include <sys/queue.h>
-#include <pthread.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_log.h>
 #include <rte_cycles.h>
-#include <rte_lcore.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
-#include "eal_internal_cfg.h"
 
 enum timer_source eal_timer_source = EAL_TIMER_HPET;
 
diff --git a/lib/eal/linux/eal_vfio_mp_sync.c b/lib/eal/linux/eal_vfio_mp_sync.c
index a2accfab3a..e1776166af 100644
--- a/lib/eal/linux/eal_vfio_mp_sync.c
+++ b/lib/eal/linux/eal_vfio_mp_sync.c
@@ -5,7 +5,6 @@
 #include <unistd.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/unix/eal_file.c b/lib/eal/unix/eal_file.c
index ec554e0096..f04f5fbcbc 100644
--- a/lib/eal/unix/eal_file.c
+++ b/lib/eal/unix/eal_file.c
@@ -3,7 +3,6 @@
  */
 
 #include <sys/file.h>
-#include <sys/mman.h>
 #include <fcntl.h>
 #include <unistd.h>
 
diff --git a/lib/eal/unix/rte_thread.c b/lib/eal/unix/rte_thread.c
index c72d619ec1..c34ede9186 100644
--- a/lib/eal/unix/rte_thread.c
+++ b/lib/eal/unix/rte_thread.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_thread.h>
diff --git a/lib/eal/x86/rte_cycles.c b/lib/eal/x86/rte_cycles.c
index edd9621abb..0e695caf28 100644
--- a/lib/eal/x86/rte_cycles.c
+++ b/lib/eal/x86/rte_cycles.c
@@ -6,7 +6,6 @@
 #include <unistd.h>
 #include <cpuid.h>
 
-#include <rte_common.h>
 
 #include "eal_private.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v2 2/5] lib/telemetry: remove unneeded header includes
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 2/5] lib/telemetry: remove unneeded header includes Sean Morrissey
@ 2021-10-06 12:34     ` Power, Ciara
  0 siblings, 0 replies; 147+ messages in thread
From: Power, Ciara @ 2021-10-06 12:34 UTC (permalink / raw)
  To: Morrissey, Sean; +Cc: dev

Hi Sean,

>-----Original Message-----
>From: Morrissey, Sean <sean.morrissey@intel.com>
>Sent: Wednesday 6 October 2021 12:13
>To: Power, Ciara <ciara.power@intel.com>
>Cc: dev@dpdk.org; Morrissey, Sean <sean.morrissey@intel.com>
>Subject: [PATCH v2 2/5] lib/telemetry: remove unneeded header includes
>
>These header includes have been flagged by the iwyu_tool and removed.
>
>Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
>---
> lib/telemetry/telemetry.c      | 1 -
> lib/telemetry/telemetry_data.h | 1 -
> 2 files changed, 2 deletions(-)
<snip>

Thanks for cleaning these up,

Acked-by: Ciara Power <ciara.power@intel.com>


^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/5] devtools: script to remove unused headers includes
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 1/5] devtools: script to remove unused headers includes Sean Morrissey
@ 2021-10-06 13:30     ` Bruce Richardson
  0 siblings, 0 replies; 147+ messages in thread
From: Bruce Richardson @ 2021-10-06 13:30 UTC (permalink / raw)
  To: Sean Morrissey; +Cc: dev, Conor Fogarty

On Wed, Oct 06, 2021 at 11:13:25AM +0000, Sean Morrissey wrote:
> This script can be used for removing headers flagged for removal by the
> include-what-you-use (IWYU) tool. The script has the ability to remove
> headers from specified sub-directories or dpdk as a whole and tests the
> build after each removal by calling meson compile.
> 
> example usages:
> 
> Remove headers flagged by iwyu_tool output file
> $ ./devtools/process_iwyu.py iwyu.out -b build
> 
> Remove headers flagged by iwyu_tool output file from sub-directory
> $ ./devtools/process_iwyu.py iwyu.out -b build -d lib/kvargs
> 
> Remove headers directly piped from the iwyu_tool
> $ iwyu_tool -p build | ./devtools/process_iwyu.py - -b build
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
> ---

Some more comments inline.
When those are addresses you can add my reviewed-by.

Thanks,
/Bruce

>  devtools/process_iwyu.py | 114 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 114 insertions(+)
>  create mode 100755 devtools/process_iwyu.py
> 
> diff --git a/devtools/process_iwyu.py b/devtools/process_iwyu.py
> new file mode 100755
> index 0000000000..c5b93c5ef3
> --- /dev/null
> +++ b/devtools/process_iwyu.py
> @@ -0,0 +1,114 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2021 Intel Corporation
> +#
> +
> +import argparse
> +import fileinput
> +import sys
> +from os.path import abspath, relpath, join
> +from pathlib import Path
> +from mesonbuild import mesonmain
> +
> +
> +def args_parse():
> +    "parse arguments and return the argument object back to main"
> +    parser = argparse.ArgumentParser(
> +        description="""This script can be used to remove
> +        includes which are not in use\n""")

While in general lines should be kept under 80 characters to satisfy the
flake8 script checks, literal strings are always the exception and should
not be split across lines without good reason, or an explicit break in
them. Most checkpatch and flake8 tools are aware of this and should not
omit a warning if a literal string crosses the line-length boundary.

Also, the "\n" should be unnecessary at the end of the description string.

> +    parser.add_argument('-b', '--build_dir', type=str,
> +                        help="""The path to the build directory in which
> +                        the IWYU tool was used in.""", default="build")

For these items, again don't split the string, but I suggest putting all
parameters bar the help text on one line, and the help text on its own on
the second line i.e. move the "default" option up a line, and put "help"
value all alone on second line.

> +    parser.add_argument('-d', '--sub_dir', type=str,
> +                        help='The sub-directory to remove headers from.',
> +                        default="")
> +    parser.add_argument('file', type=Path,
> +                        help="""The path to the IWYU log file or output
> +                        from stdin.""")
> +
> +    return parser.parse_args()
> +
> +
> +def run_meson(args):
> +    "Runs a meson command logging output to process.log"
> +    with open('process_iwyu.log', 'a') as sys.stdout:
> +        ret = mesonmain.run(args, abspath('meson'))
> +    sys.stdout = sys.__stdout__
> +    return ret
> +
> +
> +def remove_includes(filename, include, build_dir):
> +    "Attempts to remove include, if it fails then revert to original state"
> +    filepath = filename
> +
> +    with open(filepath, 'r+') as f:

Not sure you need a mode here at all, since you are just reading the file.
"open(filepath) as f:" should work fine.

> +        lines = f.readlines()  # Read lines when file is opened
> +
> +    with open(filepath, 'w') as f:
> +        for ln in lines:  # Removes the include passed in
> +            if ln.strip() != include:

I'd just point out that this will fail to remove any includes which have a
comment after them. Probably "startswith" is best used here instead of a
straight comparison: "if not ln.startswith(include)"

> +                f.write(ln)
> +
> +    # run test build -> call meson on the build folder, meson compile -C build
> +    ret = run_meson(['compile', '-C', build_dir])
> +    if (ret == 0):  # Include is not needed -> build is successful
> +        print('SUCCESS')
> +    else:
> +        # failed, catch the error
> +        # return file to original state
> +        with open(filepath, 'w') as f:
> +            f.writelines(lines)
> +            print('FAILED')

Minor nit, I'd suggest dedenting (or de-indenting) the print one level, so
that it's not part of the "with" clause, but part of the "else".

[If you want to remove the else entirely, you can put a "return" after the
print success.]

> +
> +
> +def get_build_config(builddir, condition):
> +    "returns contents of rte_build_config.h"
> +    with open(join(builddir, 'rte_build_config.h')) as f:
> +        return [ln for ln in f.readlines() if condition(ln)]
> +
> +
> +def uses_libbsd(builddir):
> +    "return whether the build uses libbsd or not"
> +    return bool(get_build_config(builddir, lambda ln: 'RTE_USE_LIBBSD' in ln))
> +
> +
> +def process(args):
> +    "process the iwyu output on a set of files"
> +    filename = None
> +    build_dir = abspath(args.build_dir)
> +    directory = args.sub_dir
> +
> +    keep_str_fns = uses_libbsd(build_dir)  # check for libbsd
> +    if keep_str_fns:
> +        print("""Warning: libbsd is present, build will fail to detect
> +                incorrect removal of rte_string_fns.h""", file=sys.stderr)
> +    # turn on werror
> +    run_meson(['configure', build_dir, '-Dwerror=true'])
> +    # Use stdin if no iwyu_tool out file given
> +    for line in fileinput.input(args.file):
> +        if 'should remove' in line:
> +            # If the file path in the iwyu_tool output is
> +            # an absolute path it means the file is outside
> +            # of the dpdk directory, therefore ignore it.
> +            # Also check to see if the file is within the
> +            # specified sub directory.

You don't need to word-wrap the comment above quite so aggressively. Having
lines a little longer would make it visually shorter and no harder to read.

> +            if (line.split()[0] != abspath(line.split()[0]) and
> +                    directory in line.split()[0]):
> +                filename = relpath(join(build_dir, line.split()[0]))

The python interpreter is going to split that line a lot of times! Use of a
temporary variable would be justified I think.

> +        elif line.startswith('-') and filename:
> +            include = '#include ' + line.split()[2]
> +            print(f"Remove {include} from {filename} ... ", end='', flush=True)
> +            if keep_str_fns and '<rte_string_fns.h>' in include:
> +                print('skipped')
> +                continue
> +            remove_includes(filename, include, build_dir)
> +        else:
> +            filename = None
> +
> +
> +def main():
> +    process(args_parse())
> +
> +
> +if __name__ == '__main__':
> +    main()
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/5] devtools: script to remove unused headers includes
  2021-10-04 10:10 ` [dpdk-dev] [PATCH v1 1/5] devtools: script to remove unused headers includes Sean Morrissey
  2021-10-04 15:07   ` Bruce Richardson
@ 2021-10-06 13:37   ` Thomas Monjalon
  2021-10-06 15:19     ` Morrissey, Sean
  1 sibling, 1 reply; 147+ messages in thread
From: Thomas Monjalon @ 2021-10-06 13:37 UTC (permalink / raw)
  To: Sean Morrissey; +Cc: dev, Conor Fogarty, bruce.richardson, david.marchand

04/10/2021 12:10, Sean Morrissey:
> This script can be used for removing headers flagged for removal by the
> include-what-you-use (IWYU) tool. The script has the ability to remove
> headers from specified sub-directories or dpdk as a whole.

My fear is that it could flag an include as useless,
while it is required for a different system (BSD, Windows).




^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/5] devtools: script to remove unused headers includes
  2021-10-06 13:37   ` Thomas Monjalon
@ 2021-10-06 15:19     ` Morrissey, Sean
  2021-10-06 16:28       ` Bruce Richardson
  0 siblings, 1 reply; 147+ messages in thread
From: Morrissey, Sean @ 2021-10-06 15:19 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Conor Fogarty, bruce.richardson, david.marchand


On 06/10/2021 14:37, Thomas Monjalon wrote:
> 04/10/2021 12:10, Sean Morrissey:
>> This script can be used for removing headers flagged for removal by the
>> include-what-you-use (IWYU) tool. The script has the ability to remove
>> headers from specified sub-directories or dpdk as a whole.
> My fear is that it could flag an include as useless,
> while it is required for a different system (BSD, Windows).
>
>
Hi Thomas,

Stephen raised a similar concern. Please see Bruce's reply here: 
https://patches.dpdk.org/project/dpdk/cover/20211004101058.2396458-1-sean.morrissey@intel.com/

Thanks,

Sean.


^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/5] devtools: script to remove unused headers includes
  2021-10-06 15:19     ` Morrissey, Sean
@ 2021-10-06 16:28       ` Bruce Richardson
  2021-10-06 16:44         ` Thomas Monjalon
  0 siblings, 1 reply; 147+ messages in thread
From: Bruce Richardson @ 2021-10-06 16:28 UTC (permalink / raw)
  To: Morrissey, Sean; +Cc: Thomas Monjalon, dev, Conor Fogarty, david.marchand

On Wed, Oct 06, 2021 at 04:19:46PM +0100, Morrissey, Sean wrote:
> 
> On 06/10/2021 14:37, Thomas Monjalon wrote:
> > 04/10/2021 12:10, Sean Morrissey:
> > > This script can be used for removing headers flagged for removal by the
> > > include-what-you-use (IWYU) tool. The script has the ability to remove
> > > headers from specified sub-directories or dpdk as a whole.
> > My fear is that it could flag an include as useless,
> > while it is required for a different system (BSD, Windows).
> > 
> > 
> Hi Thomas,
> 
> Stephen raised a similar concern. Please see Bruce's reply here: https://patches.dpdk.org/project/dpdk/cover/20211004101058.2396458-1-sean.morrissey@intel.com/
> 
One additional data point. Checking the output of a run I did of IWYU a
month or two ago, shows 2254 header includes that IWYU thinks should be
removed. With that sort of scale of an issue, I think automation will be
needed.

/Bruce

^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v2 5/5] lib/eal: remove unneeded header includes
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 5/5] lib/eal: " Sean Morrissey
@ 2021-10-06 16:36     ` David Christensen
  0 siblings, 0 replies; 147+ messages in thread
From: David Christensen @ 2021-10-06 16:36 UTC (permalink / raw)
  To: Sean Morrissey, Anatoly Burakov, Jerin Jacob, Sunil Kumar Kori,
	Mattias Rönnblom, Harry van Haaren, Harman Kalra,
	Bruce Richardson, Konstantin Ananyev
  Cc: dev



On 10/6/21 4:13 AM, Sean Morrissey wrote:
> These header includes have been flagged by the iwyu_tool
> and removed.
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> 
> Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
> 
> Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
> ---
>   lib/eal/common/eal_common_dev.c        |  5 -----
>   lib/eal/common/eal_common_devargs.c    |  1 -
>   lib/eal/common/eal_common_errno.c      |  4 ----
>   lib/eal/common/eal_common_fbarray.c    |  3 ---
>   lib/eal/common/eal_common_hexdump.c    |  3 ---
>   lib/eal/common/eal_common_launch.c     |  6 ------
>   lib/eal/common/eal_common_lcore.c      |  7 +------
>   lib/eal/common/eal_common_log.c        |  2 --
>   lib/eal/common/eal_common_memalloc.c   |  3 ---
>   lib/eal/common/eal_common_memory.c     |  5 -----
>   lib/eal/common/eal_common_memzone.c    |  4 ----
>   lib/eal/common/eal_common_options.c    |  2 --
>   lib/eal/common/eal_common_proc.c       |  2 --
>   lib/eal/common/eal_common_string_fns.c |  2 --
>   lib/eal/common/eal_common_tailqs.c     | 11 -----------
>   lib/eal/common/eal_common_thread.c     |  3 ---
>   lib/eal/common/eal_common_timer.c      |  6 ------
>   lib/eal/common/eal_common_trace.c      |  1 -
>   lib/eal/common/hotplug_mp.h            |  1 -
>   lib/eal/common/malloc_elem.c           |  6 ------
>   lib/eal/common/malloc_heap.c           |  5 -----
>   lib/eal/common/malloc_mp.c             |  1 -
>   lib/eal/common/malloc_mp.h             |  2 --
>   lib/eal/common/rte_malloc.c            |  6 ------
>   lib/eal/common/rte_random.c            |  3 ---
>   lib/eal/common/rte_service.c           |  6 ------
>   lib/eal/include/rte_version.h          |  2 --
>   lib/eal/linux/eal.c                    | 10 ----------
>   lib/eal/linux/eal_alarm.c              |  7 -------
>   lib/eal/linux/eal_cpuflags.c           |  2 --
>   lib/eal/linux/eal_debug.c              |  5 -----
>   lib/eal/linux/eal_dev.c                |  4 ----
>   lib/eal/linux/eal_hugepage_info.c      |  8 --------
>   lib/eal/linux/eal_interrupts.c         |  8 --------
>   lib/eal/linux/eal_lcore.c              |  7 -------
>   lib/eal/linux/eal_log.c                | 11 +----------
>   lib/eal/linux/eal_memalloc.c           |  8 --------
>   lib/eal/linux/eal_memory.c             |  9 ---------
>   lib/eal/linux/eal_thread.c             |  5 -----
>   lib/eal/linux/eal_timer.c              | 15 ---------------
>   lib/eal/linux/eal_vfio_mp_sync.c       |  1 -
>   lib/eal/unix/eal_file.c                |  1 -
>   lib/eal/unix/rte_thread.c              |  1 -
>   lib/eal/x86/rte_cycles.c               |  1 -
>   44 files changed, 2 insertions(+), 203 deletions(-)
> 

Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>

^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/5] devtools: script to remove unused headers includes
  2021-10-06 16:28       ` Bruce Richardson
@ 2021-10-06 16:44         ` Thomas Monjalon
  0 siblings, 0 replies; 147+ messages in thread
From: Thomas Monjalon @ 2021-10-06 16:44 UTC (permalink / raw)
  To: Morrissey, Sean, Bruce Richardson; +Cc: dev, Conor Fogarty, david.marchand

06/10/2021 18:28, Bruce Richardson:
> On Wed, Oct 06, 2021 at 04:19:46PM +0100, Morrissey, Sean wrote:
> > 
> > On 06/10/2021 14:37, Thomas Monjalon wrote:
> > > 04/10/2021 12:10, Sean Morrissey:
> > > > This script can be used for removing headers flagged for removal by the
> > > > include-what-you-use (IWYU) tool. The script has the ability to remove
> > > > headers from specified sub-directories or dpdk as a whole.
> > > My fear is that it could flag an include as useless,
> > > while it is required for a different system (BSD, Windows).
> > > 
> > > 
> > Hi Thomas,
> > 
> > Stephen raised a similar concern. Please see Bruce's reply here: https://patches.dpdk.org/project/dpdk/cover/20211004101058.2396458-1-sean.morrissey@intel.com/
> > 
> One additional data point. Checking the output of a run I did of IWYU a
> month or two ago, shows 2254 header includes that IWYU thinks should be
> removed. With that sort of scale of an issue, I think automation will be
> needed.

I agree to integrate this tool, but we must make clear there are false positives.
Please add a warning when running it.



^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v3 0/5] introduce IWYU
  2021-10-06 11:13 ` [dpdk-dev] [PATCH v2 " Sean Morrissey
                     ` (4 preceding siblings ...)
  2021-10-06 11:13   ` [dpdk-dev] [PATCH v2 5/5] lib/eal: " Sean Morrissey
@ 2021-10-07 10:25   ` Sean Morrissey
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 1/5] devtools: script to remove unused headers includes Sean Morrissey
                       ` (5 more replies)
  5 siblings, 6 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-07 10:25 UTC (permalink / raw)
  Cc: dev, Sean Morrissey

This patchset introduces the include-what-you-use script which removes
unused header includes. IWYU GitHub:

https://github.com/include-what-you-use/include-what-you-use

Along with the script there are some patches which make a start on
removing unneeded headers.

Sean Morrissey (5):
  devtools: script to remove unused headers includes
  lib/telemetry: remove unneeded header includes
  lib/ring: remove unneeded header includes
  lib/kvargs: remove unneeded header includes
  lib/eal: remove unneeded header includes

 devtools/process_iwyu.py               | 109 +++++++++++++++++++++++++
 lib/eal/common/eal_common_dev.c        |   5 --
 lib/eal/common/eal_common_devargs.c    |   1 -
 lib/eal/common/eal_common_errno.c      |   4 -
 lib/eal/common/eal_common_fbarray.c    |   3 -
 lib/eal/common/eal_common_hexdump.c    |   3 -
 lib/eal/common/eal_common_launch.c     |   6 --
 lib/eal/common/eal_common_lcore.c      |   7 +-
 lib/eal/common/eal_common_log.c        |   2 -
 lib/eal/common/eal_common_memalloc.c   |   3 -
 lib/eal/common/eal_common_memory.c     |   5 --
 lib/eal/common/eal_common_memzone.c    |   4 -
 lib/eal/common/eal_common_options.c    |   2 -
 lib/eal/common/eal_common_proc.c       |   2 -
 lib/eal/common/eal_common_string_fns.c |   2 -
 lib/eal/common/eal_common_tailqs.c     |  11 ---
 lib/eal/common/eal_common_thread.c     |   3 -
 lib/eal/common/eal_common_timer.c      |   6 --
 lib/eal/common/eal_common_trace.c      |   1 -
 lib/eal/common/hotplug_mp.h            |   1 -
 lib/eal/common/malloc_elem.c           |   6 --
 lib/eal/common/malloc_heap.c           |   5 --
 lib/eal/common/malloc_mp.c             |   1 -
 lib/eal/common/malloc_mp.h             |   2 -
 lib/eal/common/rte_malloc.c            |   6 --
 lib/eal/common/rte_random.c            |   3 -
 lib/eal/common/rte_service.c           |   6 --
 lib/eal/include/rte_version.h          |   2 -
 lib/eal/linux/eal.c                    |  10 ---
 lib/eal/linux/eal_alarm.c              |   7 --
 lib/eal/linux/eal_cpuflags.c           |   2 -
 lib/eal/linux/eal_debug.c              |   5 --
 lib/eal/linux/eal_dev.c                |   4 -
 lib/eal/linux/eal_hugepage_info.c      |   8 --
 lib/eal/linux/eal_interrupts.c         |   8 --
 lib/eal/linux/eal_lcore.c              |   7 --
 lib/eal/linux/eal_log.c                |  11 +--
 lib/eal/linux/eal_memalloc.c           |   8 --
 lib/eal/linux/eal_memory.c             |   9 --
 lib/eal/linux/eal_thread.c             |   5 --
 lib/eal/linux/eal_timer.c              |  15 ----
 lib/eal/linux/eal_vfio_mp_sync.c       |   1 -
 lib/eal/unix/eal_file.c                |   1 -
 lib/eal/unix/rte_thread.c              |   1 -
 lib/eal/x86/rte_cycles.c               |   1 -
 lib/kvargs/rte_kvargs.c                |   1 -
 lib/ring/rte_ring.c                    |   7 --
 lib/telemetry/telemetry.c              |   1 -
 lib/telemetry/telemetry_data.h         |   1 -
 49 files changed, 111 insertions(+), 213 deletions(-)
 create mode 100755 devtools/process_iwyu.py

-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v3 1/5] devtools: script to remove unused headers includes
  2021-10-07 10:25   ` [dpdk-dev] [PATCH v3 0/5] introduce IWYU Sean Morrissey
@ 2021-10-07 10:25     ` Sean Morrissey
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 2/5] lib/telemetry: remove unneeded header includes Sean Morrissey
                       ` (4 subsequent siblings)
  5 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-07 10:25 UTC (permalink / raw)
  Cc: dev, Sean Morrissey, Conor Fogarty, Bruce Richardson

This script can be used for removing headers flagged for removal by the
include-what-you-use (IWYU) tool. The script has the ability to remove
headers from specified sub-directories or dpdk as a whole and tests the
build after each removal by calling meson compile.

example usages:

Remove headers flagged by iwyu_tool output file
$ ./devtools/process_iwyu.py iwyu.out -b build

Remove headers flagged by iwyu_tool output file from sub-directory
$ ./devtools/process_iwyu.py iwyu.out -b build -d lib/kvargs

Remove headers directly piped from the iwyu_tool
$ iwyu_tool -p build | ./devtools/process_iwyu.py - -b build

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>

Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/process_iwyu.py | 109 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 109 insertions(+)
 create mode 100755 devtools/process_iwyu.py

diff --git a/devtools/process_iwyu.py b/devtools/process_iwyu.py
new file mode 100755
index 0000000000..50f3d4c5c7
--- /dev/null
+++ b/devtools/process_iwyu.py
@@ -0,0 +1,109 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+#
+
+import argparse
+import fileinput
+import sys
+from os.path import abspath, relpath, join
+from pathlib import Path
+from mesonbuild import mesonmain
+
+
+def args_parse():
+    "parse arguments and return the argument object back to main"
+    parser = argparse.ArgumentParser(description="This script can be used to remove includes which are not in use\n")
+    parser.add_argument('-b', '--build_dir', type=str, default='build',
+                        help="The path to the build directory in which the IWYU tool was used in.")
+    parser.add_argument('-d', '--sub_dir', type=str, default='',
+                        help="The sub-directory to remove headers from.")
+    parser.add_argument('file', type=Path,
+                        help="The path to the IWYU log file or output from stdin.")
+
+    return parser.parse_args()
+
+
+def run_meson(args):
+    "Runs a meson command logging output to process.log"
+    with open('process_iwyu.log', 'a') as sys.stdout:
+        ret = mesonmain.run(args, abspath('meson'))
+    sys.stdout = sys.__stdout__
+    return ret
+
+
+def remove_includes(filepath, include, build_dir):
+    "Attempts to remove include, if it fails then revert to original state"
+    with open(filepath) as f:
+        lines = f.readlines()  # Read lines when file is opened
+
+    with open(filepath, 'w') as f:
+        for ln in lines:  # Removes the include passed in
+            if not ln.startswith(include):
+                f.write(ln)
+
+    # run test build -> call meson on the build folder, meson compile -C build
+    ret = run_meson(['compile', '-C', build_dir])
+    if (ret == 0):  # Include is not needed -> build is successful
+        print('SUCCESS')
+    else:
+        # failed, catch the error
+        # return file to original state
+        with open(filepath, 'w') as f:
+            f.writelines(lines)
+        print('FAILED')
+
+
+def get_build_config(builddir, condition):
+    "returns contents of rte_build_config.h"
+    with open(join(builddir, 'rte_build_config.h')) as f:
+        return [ln for ln in f.readlines() if condition(ln)]
+
+
+def uses_libbsd(builddir):
+    "return whether the build uses libbsd or not"
+    return bool(get_build_config(builddir, lambda ln: 'RTE_USE_LIBBSD' in ln))
+
+
+def process(args):
+    "process the iwyu output on a set of files"
+    filepath = None
+    build_dir = abspath(args.build_dir)
+    directory = args.sub_dir
+
+    print("Warning: The results of this script may include false positives which are required for different systems",
+          file=sys.stderr)
+
+    keep_str_fns = uses_libbsd(build_dir)  # check for libbsd
+    if keep_str_fns:
+        print("Warning: libbsd is present, build will fail to detect incorrect removal of rte_string_fns.h",
+              file=sys.stderr)
+    # turn on werror
+    run_meson(['configure', build_dir, '-Dwerror=true'])
+    # Use stdin if no iwyu_tool out file given
+    for line in fileinput.input(args.file):
+        if 'should remove' in line:
+            # If the file path in the iwyu_tool output is an absolute path it
+            # means the file is outside of the dpdk directory, therefore ignore it.
+            # Also check to see if the file is within the specified sub directory.
+            filename = line.split()[0]
+            if (filename != abspath(filename) and
+                    directory in filename):
+                filepath = relpath(join(build_dir, filename))
+        elif line.startswith('-') and filepath:
+            include = '#include ' + line.split()[2]
+            print(f"Remove {include} from {filepath} ... ", end='', flush=True)
+            if keep_str_fns and '<rte_string_fns.h>' in include:
+                print('skipped')
+                continue
+            remove_includes(filepath, include, build_dir)
+        else:
+            filepath = None
+
+
+def main():
+    process(args_parse())
+
+
+if __name__ == '__main__':
+    main()
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v3 2/5] lib/telemetry: remove unneeded header includes
  2021-10-07 10:25   ` [dpdk-dev] [PATCH v3 0/5] introduce IWYU Sean Morrissey
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 1/5] devtools: script to remove unused headers includes Sean Morrissey
@ 2021-10-07 10:25     ` Sean Morrissey
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 3/5] lib/ring: " Sean Morrissey
                       ` (3 subsequent siblings)
  5 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-07 10:25 UTC (permalink / raw)
  To: Ciara Power; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

Acked-by: Ciara Power <ciara.power@intel.com>
---
 lib/telemetry/telemetry.c      | 1 -
 lib/telemetry/telemetry_data.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index 8665db8d03..fb3b93ca7e 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -8,7 +8,6 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/stat.h>
-#include <dlfcn.h>
 #endif /* !RTE_EXEC_ENV_WINDOWS */
 
 /* we won't link against libbsd, so just always use DPDKs-specific strlcpy */
diff --git a/lib/telemetry/telemetry_data.h b/lib/telemetry/telemetry_data.h
index adb84a09f1..26aa28e72c 100644
--- a/lib/telemetry/telemetry_data.h
+++ b/lib/telemetry/telemetry_data.h
@@ -5,7 +5,6 @@
 #ifndef _TELEMETRY_DATA_H_
 #define _TELEMETRY_DATA_H_
 
-#include <inttypes.h>
 #include "rte_telemetry.h"
 
 enum tel_container_types {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v3 3/5] lib/ring: remove unneeded header includes
  2021-10-07 10:25   ` [dpdk-dev] [PATCH v3 0/5] introduce IWYU Sean Morrissey
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 1/5] devtools: script to remove unused headers includes Sean Morrissey
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 2/5] lib/telemetry: remove unneeded header includes Sean Morrissey
@ 2021-10-07 10:25     ` Sean Morrissey
  2021-10-07 12:17       ` Ananyev, Konstantin
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 4/5] lib/kvargs: " Sean Morrissey
                       ` (2 subsequent siblings)
  5 siblings, 1 reply; 147+ messages in thread
From: Sean Morrissey @ 2021-10-07 10:25 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/ring/rte_ring.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
index f17bd966be..bb95962b0c 100644
--- a/lib/ring/rte_ring.c
+++ b/lib/ring/rte_ring.c
@@ -17,16 +17,9 @@
 
 #include <rte_common.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_malloc.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_atomic.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_spinlock.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v3 4/5] lib/kvargs: remove unneeded header includes
  2021-10-07 10:25   ` [dpdk-dev] [PATCH v3 0/5] introduce IWYU Sean Morrissey
                       ` (2 preceding siblings ...)
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 3/5] lib/ring: " Sean Morrissey
@ 2021-10-07 10:25     ` Sean Morrissey
  2021-10-15  9:00       ` Olivier Matz
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 5/5] lib/eal: " Sean Morrissey
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
  5 siblings, 1 reply; 147+ messages in thread
From: Sean Morrissey @ 2021-10-07 10:25 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/kvargs/rte_kvargs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
index 38e9d5c1ca..4cce8e953b 100644
--- a/lib/kvargs/rte_kvargs.c
+++ b/lib/kvargs/rte_kvargs.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <stdbool.h>
 
-#include <rte_os_shim.h>
 #include <rte_string_fns.h>
 
 #include "rte_kvargs.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [dpdk-dev] [PATCH v3 5/5] lib/eal: remove unneeded header includes
  2021-10-07 10:25   ` [dpdk-dev] [PATCH v3 0/5] introduce IWYU Sean Morrissey
                       ` (3 preceding siblings ...)
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 4/5] lib/kvargs: " Sean Morrissey
@ 2021-10-07 10:25     ` Sean Morrissey
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
  5 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2021-10-07 10:25 UTC (permalink / raw)
  To: Anatoly Burakov, Jerin Jacob, Sunil Kumar Kori,
	Mattias Rönnblom, Harry van Haaren, Harman Kalra,
	Bruce Richardson, Konstantin Ananyev
  Cc: dev, Sean Morrissey, David Christensen

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>

Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
---
 lib/eal/common/eal_common_dev.c        |  5 -----
 lib/eal/common/eal_common_devargs.c    |  1 -
 lib/eal/common/eal_common_errno.c      |  4 ----
 lib/eal/common/eal_common_fbarray.c    |  3 ---
 lib/eal/common/eal_common_hexdump.c    |  3 ---
 lib/eal/common/eal_common_launch.c     |  6 ------
 lib/eal/common/eal_common_lcore.c      |  7 +------
 lib/eal/common/eal_common_log.c        |  2 --
 lib/eal/common/eal_common_memalloc.c   |  3 ---
 lib/eal/common/eal_common_memory.c     |  5 -----
 lib/eal/common/eal_common_memzone.c    |  4 ----
 lib/eal/common/eal_common_options.c    |  2 --
 lib/eal/common/eal_common_proc.c       |  2 --
 lib/eal/common/eal_common_string_fns.c |  2 --
 lib/eal/common/eal_common_tailqs.c     | 11 -----------
 lib/eal/common/eal_common_thread.c     |  3 ---
 lib/eal/common/eal_common_timer.c      |  6 ------
 lib/eal/common/eal_common_trace.c      |  1 -
 lib/eal/common/hotplug_mp.h            |  1 -
 lib/eal/common/malloc_elem.c           |  6 ------
 lib/eal/common/malloc_heap.c           |  5 -----
 lib/eal/common/malloc_mp.c             |  1 -
 lib/eal/common/malloc_mp.h             |  2 --
 lib/eal/common/rte_malloc.c            |  6 ------
 lib/eal/common/rte_random.c            |  3 ---
 lib/eal/common/rte_service.c           |  6 ------
 lib/eal/include/rte_version.h          |  2 --
 lib/eal/linux/eal.c                    | 10 ----------
 lib/eal/linux/eal_alarm.c              |  7 -------
 lib/eal/linux/eal_cpuflags.c           |  2 --
 lib/eal/linux/eal_debug.c              |  5 -----
 lib/eal/linux/eal_dev.c                |  4 ----
 lib/eal/linux/eal_hugepage_info.c      |  8 --------
 lib/eal/linux/eal_interrupts.c         |  8 --------
 lib/eal/linux/eal_lcore.c              |  7 -------
 lib/eal/linux/eal_log.c                | 11 +----------
 lib/eal/linux/eal_memalloc.c           |  8 --------
 lib/eal/linux/eal_memory.c             |  9 ---------
 lib/eal/linux/eal_thread.c             |  5 -----
 lib/eal/linux/eal_timer.c              | 15 ---------------
 lib/eal/linux/eal_vfio_mp_sync.c       |  1 -
 lib/eal/unix/eal_file.c                |  1 -
 lib/eal/unix/rte_thread.c              |  1 -
 lib/eal/x86/rte_cycles.c               |  1 -
 44 files changed, 2 insertions(+), 203 deletions(-)

diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index 148a23830a..12bf3d3c22 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -5,20 +5,15 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 
-#include <rte_compat.h>
 #include <rte_bus.h>
 #include <rte_class.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
-#include <rte_debug.h>
 #include <rte_errno.h>
-#include <rte_kvargs.h>
 #include <rte_log.h>
 #include <rte_spinlock.h>
-#include <rte_malloc.h>
 #include <rte_string_fns.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c
index 7ab9e71b2a..f4beb35591 100644
--- a/lib/eal/common/eal_common_devargs.c
+++ b/lib/eal/common/eal_common_devargs.c
@@ -12,7 +12,6 @@
 
 #include <rte_bus.h>
 #include <rte_class.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_errno.h>
diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c
index f86802705a..1091065568 100644
--- a/lib/eal/common/eal_common_errno.c
+++ b/lib/eal/common/eal_common_errno.c
@@ -5,15 +5,11 @@
 /* Use XSI-compliant portable version of strerror_r() */
 #undef _GNU_SOURCE
 
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdarg.h>
-#include <errno.h>
 
 #include <rte_per_lcore.h>
 #include <rte_errno.h>
-#include <rte_string_fns.h>
 
 #ifdef RTE_EXEC_ENV_WINDOWS
 #define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum)
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 3a28a53247..f11f87979f 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -2,7 +2,6 @@
  * Copyright(c) 2017-2018 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <inttypes.h>
 #include <limits.h>
 #include <stdint.h>
@@ -14,9 +13,7 @@
 #include <rte_eal_paging.h>
 #include <rte_errno.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 #include "eal_filesystem.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_hexdump.c b/lib/eal/common/eal_common_hexdump.c
index 2d2179d411..63bbbdcf0a 100644
--- a/lib/eal/common/eal_common_hexdump.c
+++ b/lib/eal/common/eal_common_hexdump.c
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2010-2014 Intel Corporation
  */
-#include <stdlib.h>
 #include <stdio.h>
-#include <errno.h>
-#include <stdint.h>
 #include <rte_hexdump.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/eal_common_launch.c b/lib/eal/common/eal_common_launch.c
index 34f854ad80..2a20b32a77 100644
--- a/lib/eal/common/eal_common_launch.c
+++ b/lib/eal/common/eal_common_launch.c
@@ -3,16 +3,10 @@
  */
 
 #include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <sys/queue.h>
 
 #include <rte_launch.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
 #include <rte_atomic.h>
 #include <rte_pause.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c
index 66d6bad1a7..c747353b17 100644
--- a/lib/eal/common/eal_common_lcore.c
+++ b/lib/eal/common/eal_common_lcore.c
@@ -2,19 +2,14 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <unistd.h>
-#include <limits.h>
 #include <string.h>
 
 #include <rte_common.h>
-#include <rte_debug.h>
-#include <rte_eal.h>
+#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_rwlock.h>
 
-#include "eal_memcfg.h"
 #include "eal_private.h"
 #include "eal_thread.h"
 
diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c
index ec8fe23a7f..24afb57c89 100644
--- a/lib/eal/common/eal_common_log.c
+++ b/lib/eal/common/eal_common_log.c
@@ -11,9 +11,7 @@
 #include <regex.h>
 #include <fnmatch.h>
 
-#include <rte_eal.h>
 #include <rte_log.h>
-#include <rte_os_shim.h>
 #include <rte_per_lcore.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/common/eal_common_memalloc.c b/lib/eal/common/eal_common_memalloc.c
index e872c6533b..f8770ff835 100644
--- a/lib/eal/common/eal_common_memalloc.c
+++ b/lib/eal/common/eal_common_memalloc.c
@@ -5,12 +5,9 @@
 #include <string.h>
 
 #include <rte_errno.h>
-#include <rte_lcore.h>
 #include <rte_fbarray.h>
-#include <rte_memzone.h>
 #include <rte_memory.h>
 #include <rte_string_fns.h>
-#include <rte_rwlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
index f83b75092e..bb0da9e50a 100644
--- a/lib/eal/common/eal_common_memory.c
+++ b/lib/eal/common/eal_common_memory.c
@@ -2,16 +2,11 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdlib.h>
-#include <stdarg.h>
 #include <string.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/queue.h>
 
 #include <rte_fbarray.h>
 #include <rte_memory.h>
diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c
index 7c21aa921e..67dcaaafbf 100644
--- a/lib/eal/common/eal_common_memzone.c
+++ b/lib/eal/common/eal_common_memzone.c
@@ -2,20 +2,16 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdarg.h>
 #include <inttypes.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/queue.h>
 
 #include <rte_log.h>
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_common.h>
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index eaef57312f..1eb51be09c 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -4,7 +4,6 @@
  */
 
 #include <stdlib.h>
-#include <unistd.h>
 #include <string.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <syslog.h>
@@ -17,7 +16,6 @@
 #include <dlfcn.h>
 #include <libgen.h>
 #endif
-#include <sys/types.h>
 #include <sys/stat.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <dirent.h>
diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index ebd0f6673b..575b4ca24d 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -15,7 +15,6 @@
 #include <string.h>
 #include <sys/file.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
@@ -27,7 +26,6 @@
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_tailq.h>
 
 #include "eal_memcfg.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_string_fns.c b/lib/eal/common/eal_common_string_fns.c
index ddd1891656..0236ae4023 100644
--- a/lib/eal/common/eal_common_string_fns.c
+++ b/lib/eal/common/eal_common_string_fns.c
@@ -2,9 +2,7 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 
 #include <rte_string_fns.h>
diff --git a/lib/eal/common/eal_common_tailqs.c b/lib/eal/common/eal_common_tailqs.c
index ead06897b8..580fbf24bc 100644
--- a/lib/eal/common/eal_common_tailqs.c
+++ b/lib/eal/common/eal_common_tailqs.c
@@ -3,24 +3,13 @@
  */
 
 #include <sys/queue.h>
-#include <stdint.h>
-#include <errno.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
-#include <inttypes.h>
 
-#include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_log.h>
 #include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_memcfg.h"
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index 1a52f42a2b..cfa6a69ad4 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -4,10 +4,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
 #include <pthread.h>
-#include <signal.h>
 #include <sched.h>
 #include <assert.h>
 #include <string.h>
diff --git a/lib/eal/common/eal_common_timer.c b/lib/eal/common/eal_common_timer.c
index 86f8429847..5686a5102b 100644
--- a/lib/eal/common/eal_common_timer.c
+++ b/lib/eal/common/eal_common_timer.c
@@ -2,16 +2,10 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/types.h>
-#include <time.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
 #include <rte_pause.h>
diff --git a/lib/eal/common/eal_common_trace.c b/lib/eal/common/eal_common_trace.c
index 7bff1cd2ce..036f6ac348 100644
--- a/lib/eal/common/eal_common_trace.c
+++ b/lib/eal/common/eal_common_trace.c
@@ -3,7 +3,6 @@
  */
 
 #include <fnmatch.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 #include <regex.h>
 
diff --git a/lib/eal/common/hotplug_mp.h b/lib/eal/common/hotplug_mp.h
index 8fcf9b52e2..066494ff27 100644
--- a/lib/eal/common/hotplug_mp.h
+++ b/lib/eal/common/hotplug_mp.h
@@ -6,7 +6,6 @@
 #define _HOTPLUG_MP_H_
 
 #include "rte_dev.h"
-#include "rte_bus.h"
 
 #define EAL_DEV_MP_ACTION_REQUEST      "eal_dev_mp_request"
 #define EAL_DEV_MP_ACTION_RESPONSE     "eal_dev_mp_response"
diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c
index c2c9461f1d..4c6e6f4910 100644
--- a/lib/eal/common/malloc_elem.c
+++ b/lib/eal/common/malloc_elem.c
@@ -6,17 +6,11 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/queue.h>
 
 #include <rte_memory.h>
 #include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_debug.h>
 #include <rte_common.h>
-#include <rte_spinlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c
index ee400f38ec..61f0a5d84f 100644
--- a/lib/eal/common/malloc_heap.c
+++ b/lib/eal/common/malloc_heap.c
@@ -5,7 +5,6 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <sys/queue.h>
 
@@ -13,15 +12,11 @@
 #include <rte_errno.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_string_fns.h>
 #include <rte_spinlock.h>
-#include <rte_memcpy.h>
 #include <rte_memzone.h>
-#include <rte_atomic.h>
 #include <rte_fbarray.h>
 
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c
index 2e597a17a2..801b2e7fbd 100644
--- a/lib/eal/common/malloc_mp.c
+++ b/lib/eal/common/malloc_mp.c
@@ -5,7 +5,6 @@
 #include <string.h>
 #include <sys/time.h>
 
-#include <rte_alarm.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/malloc_mp.h b/lib/eal/common/malloc_mp.h
index 0095062b72..fb10817e13 100644
--- a/lib/eal/common/malloc_mp.h
+++ b/lib/eal/common/malloc_mp.h
@@ -10,8 +10,6 @@
 
 #include <rte_common.h>
 #include <rte_random.h>
-#include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 /* forward declarations */
 struct malloc_heap;
diff --git a/lib/eal/common/rte_malloc.c b/lib/eal/common/rte_malloc.c
index 9d39e58c08..6c69a2cf3b 100644
--- a/lib/eal/common/rte_malloc.c
+++ b/lib/eal/common/rte_malloc.c
@@ -6,18 +6,12 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
 
 #include <rte_errno.h>
 #include <rte_memcpy.h>
 #include <rte_memory.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_branch_prediction.h>
-#include <rte_debug.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/common/rte_random.c b/lib/eal/common/rte_random.c
index ce21c2242a..4535cc980c 100644
--- a/lib/eal/common/rte_random.c
+++ b/lib/eal/common/rte_random.c
@@ -5,14 +5,11 @@
 #ifdef __RDSEED__
 #include <x86intrin.h>
 #endif
-#include <stdlib.h>
 #include <unistd.h>
 
 #include <rte_branch_prediction.h>
 #include <rte_cycles.h>
-#include <rte_eal.h>
 #include <rte_lcore.h>
-#include <rte_memory.h>
 #include <rte_random.h>
 
 struct rte_rand_state {
diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c
index bd8fb72e78..ef31b1f63c 100644
--- a/lib/eal/common/rte_service.c
+++ b/lib/eal/common/rte_service.c
@@ -3,22 +3,16 @@
  */
 
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <limits.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_service.h>
 #include <rte_service_component.h>
 
-#include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_debug.h>
 #include <rte_cycles.h>
 #include <rte_atomic.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/include/rte_version.h b/lib/eal/include/rte_version.h
index b06a62e7a2..414b6167f2 100644
--- a/lib/eal/include/rte_version.h
+++ b/lib/eal/include/rte_version.h
@@ -14,10 +14,8 @@
 extern "C" {
 #endif
 
-#include <stdint.h>
 #include <string.h>
 #include <stdio.h>
-#include <rte_common.h>
 #include <rte_compat.h>
 
 /**
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 3577eaeaa4..f55d1860d8 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -7,10 +7,8 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <syslog.h>
 #include <getopt.h>
 #include <sys/file.h>
 #include <dirent.h>
@@ -20,32 +18,24 @@
 #include <errno.h>
 #include <limits.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
 #include <sys/stat.h>
 #if defined(RTE_ARCH_X86)
 #include <sys/io.h>
 #endif
 #include <linux/version.h>
 
-#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_errno.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_service_component.h>
 #include <rte_log.h>
-#include <rte_random.h>
-#include <rte_cycles.h>
 #include <rte_string_fns.h>
 #include <rte_cpuflags.h>
-#include <rte_interrupts.h>
 #include <rte_bus.h>
-#include <rte_dev.h>
-#include <rte_devargs.h>
 #include <rte_version.h>
 #include <malloc_heap.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/linux/eal_alarm.c b/lib/eal/linux/eal_alarm.c
index 3252c6fa59..43f6bb14f2 100644
--- a/lib/eal/linux/eal_alarm.c
+++ b/lib/eal/linux/eal_alarm.c
@@ -3,21 +3,14 @@
  */
 #include <stdio.h>
 #include <stdint.h>
-#include <signal.h>
 #include <errno.h>
-#include <string.h>
 #include <sys/queue.h>
 #include <sys/time.h>
 #include <sys/timerfd.h>
 
-#include <rte_memory.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_common.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_lcore.h>
 #include <rte_errno.h>
 #include <rte_spinlock.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_cpuflags.c b/lib/eal/linux/eal_cpuflags.c
index d38296e1e5..c684940e1d 100644
--- a/lib/eal/linux/eal_cpuflags.c
+++ b/lib/eal/linux/eal_cpuflags.c
@@ -5,8 +5,6 @@
 #include <elf.h>
 #include <fcntl.h>
 #include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
diff --git a/lib/eal/linux/eal_debug.c b/lib/eal/linux/eal_debug.c
index 64dab4e0da..b0ecf5a9dc 100644
--- a/lib/eal/linux/eal_debug.c
+++ b/lib/eal/linux/eal_debug.c
@@ -5,16 +5,11 @@
 #ifdef RTE_BACKTRACE
 #include <execinfo.h>
 #endif
-#include <stdarg.h>
-#include <signal.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdint.h>
 
 #include <rte_log.h>
 #include <rte_debug.h>
-#include <rte_common.h>
-#include <rte_eal.h>
 
 #define BACKTRACE_SIZE 256
 
diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c
index 3b905e18f5..0a654e5b50 100644
--- a/lib/eal/linux/eal_dev.c
+++ b/lib/eal/linux/eal_dev.c
@@ -4,20 +4,16 @@
 
 #include <string.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
 
 #include <rte_string_fns.h>
 #include <rte_log.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
-#include <rte_malloc.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_bus.h>
-#include <rte_eal.h>
 #include <rte_spinlock.h>
 #include <rte_errno.h>
 
diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index d97792cade..b3e4c40ee7 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -3,7 +3,6 @@
  */
 
 #include <string.h>
-#include <sys/types.h>
 #include <sys/file.h>
 #include <dirent.h>
 #include <fcntl.h>
@@ -12,19 +11,12 @@
 #include <stdio.h>
 #include <fnmatch.h>
 #include <inttypes.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
-#include <sys/stat.h>
 
 #include <linux/mman.h> /* for hugetlb-related flags */
 
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_debug.h>
 #include <rte_log.h>
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index 22b3b7bcd9..1d5c9b272c 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -7,13 +7,10 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <sys/queue.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <inttypes.h>
 #include <sys/epoll.h>
-#include <sys/signalfd.h>
 #include <sys/ioctl.h>
 #include <sys/eventfd.h>
 #include <assert.h>
@@ -21,9 +18,6 @@
 
 #include <rte_common.h>
 #include <rte_interrupts.h>
-#include <rte_memory.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_branch_prediction.h>
@@ -36,8 +30,6 @@
 #include <rte_eal_trace.h>
 
 #include "eal_private.h"
-#include "eal_vfio.h"
-#include "eal_thread.h"
 
 #define EAL_INTR_EPOLL_WAIT_FOREVER (-1)
 #define NB_OTHER_INTR               1
diff --git a/lib/eal/linux/eal_lcore.c b/lib/eal/linux/eal_lcore.c
index bc8965844c..2e6a350603 100644
--- a/lib/eal/linux/eal_lcore.c
+++ b/lib/eal/linux/eal_lcore.c
@@ -4,15 +4,8 @@
 
 #include <unistd.h>
 #include <limits.h>
-#include <string.h>
-#include <dirent.h>
 
 #include <rte_log.h>
-#include <rte_eal.h>
-#include <rte_lcore.h>
-#include <rte_common.h>
-#include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_filesystem.h"
diff --git a/lib/eal/linux/eal_log.c b/lib/eal/linux/eal_log.c
index c0aa1007c4..9e72412e2b 100644
--- a/lib/eal/linux/eal_log.c
+++ b/lib/eal/linux/eal_log.c
@@ -2,19 +2,10 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdint.h>
 #include <sys/types.h>
 #include <syslog.h>
-#include <sys/queue.h>
-
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_spinlock.h>
+
 #include <rte_log.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index 0ec8542283..e3aba10107 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -3,23 +3,17 @@
  */
 
 #include <errno.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <unistd.h>
 #include <limits.h>
 #include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
@@ -36,9 +30,7 @@
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_eal.h>
-#include <rte_errno.h>
 #include <rte_memory.h>
-#include <rte_spinlock.h>
 
 #include "eal_filesystem.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c
index 03a4f2dd2d..40ec9663d0 100644
--- a/lib/eal/linux/eal_memory.c
+++ b/lib/eal/linux/eal_memory.c
@@ -5,7 +5,6 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -13,19 +12,14 @@
 #include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <sys/resource.h>
 #include <unistd.h>
 #include <limits.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
-#include <linux/memfd.h>
 #define MEMFD_SUPPORTED
 #endif
 #ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
@@ -36,12 +30,9 @@
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_string_fns.h>
 
 #include "eal_private.h"
 #include "eal_memalloc.h"
diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index 83c2034b93..60fa64ea55 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -4,20 +4,15 @@
 
 #include <errno.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdint.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <sched.h>
-#include <sys/queue.h>
 #include <sys/syscall.h>
 
 #include <rte_debug.h>
 #include <rte_atomic.h>
 #include <rte_launch.h>
 #include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_per_lcore.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_timer.c b/lib/eal/linux/eal_timer.c
index 7cf15cabac..620baf038d 100644
--- a/lib/eal/linux/eal_timer.c
+++ b/lib/eal/linux/eal_timer.c
@@ -3,28 +3,13 @@
  * Copyright(c) 2012-2013 6WIND S.A.
  */
 
-#include <string.h>
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <sys/mman.h>
-#include <sys/queue.h>
-#include <pthread.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_log.h>
 #include <rte_cycles.h>
-#include <rte_lcore.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
-#include "eal_internal_cfg.h"
 
 enum timer_source eal_timer_source = EAL_TIMER_HPET;
 
diff --git a/lib/eal/linux/eal_vfio_mp_sync.c b/lib/eal/linux/eal_vfio_mp_sync.c
index a2accfab3a..e1776166af 100644
--- a/lib/eal/linux/eal_vfio_mp_sync.c
+++ b/lib/eal/linux/eal_vfio_mp_sync.c
@@ -5,7 +5,6 @@
 #include <unistd.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/unix/eal_file.c b/lib/eal/unix/eal_file.c
index ec554e0096..f04f5fbcbc 100644
--- a/lib/eal/unix/eal_file.c
+++ b/lib/eal/unix/eal_file.c
@@ -3,7 +3,6 @@
  */
 
 #include <sys/file.h>
-#include <sys/mman.h>
 #include <fcntl.h>
 #include <unistd.h>
 
diff --git a/lib/eal/unix/rte_thread.c b/lib/eal/unix/rte_thread.c
index c72d619ec1..c34ede9186 100644
--- a/lib/eal/unix/rte_thread.c
+++ b/lib/eal/unix/rte_thread.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_thread.h>
diff --git a/lib/eal/x86/rte_cycles.c b/lib/eal/x86/rte_cycles.c
index edd9621abb..0e695caf28 100644
--- a/lib/eal/x86/rte_cycles.c
+++ b/lib/eal/x86/rte_cycles.c
@@ -6,7 +6,6 @@
 #include <unistd.h>
 #include <cpuid.h>
 
-#include <rte_common.h>
 
 #include "eal_private.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v3 3/5] lib/ring: remove unneeded header includes
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 3/5] lib/ring: " Sean Morrissey
@ 2021-10-07 12:17       ` Ananyev, Konstantin
  0 siblings, 0 replies; 147+ messages in thread
From: Ananyev, Konstantin @ 2021-10-07 12:17 UTC (permalink / raw)
  To: Morrissey, Sean, Honnappa Nagarahalli; +Cc: dev

> 
> These header includes have been flagged by the iwyu_tool
> and removed.
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> ---
>  lib/ring/rte_ring.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
> index f17bd966be..bb95962b0c 100644
> --- a/lib/ring/rte_ring.c
> +++ b/lib/ring/rte_ring.c
> @@ -17,16 +17,9 @@
> 
>  #include <rte_common.h>
>  #include <rte_log.h>
> -#include <rte_memory.h>
>  #include <rte_memzone.h>
>  #include <rte_malloc.h>
> -#include <rte_launch.h>
> -#include <rte_eal.h>
>  #include <rte_eal_memconfig.h>
> -#include <rte_atomic.h>
> -#include <rte_per_lcore.h>
> -#include <rte_lcore.h>
> -#include <rte_branch_prediction.h>
>  #include <rte_errno.h>
>  #include <rte_string_fns.h>
>  #include <rte_spinlock.h>
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v3 4/5] lib/kvargs: remove unneeded header includes
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 4/5] lib/kvargs: " Sean Morrissey
@ 2021-10-15  9:00       ` Olivier Matz
  2021-10-15  9:20         ` Morrissey, Sean
  0 siblings, 1 reply; 147+ messages in thread
From: Olivier Matz @ 2021-10-15  9:00 UTC (permalink / raw)
  To: Sean Morrissey; +Cc: dev, dmitry.kozliuk

Hi Sean,

On Thu, Oct 07, 2021 at 10:25:56AM +0000, Sean Morrissey wrote:
> These header includes have been flagged by the iwyu_tool
> and removed.
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> ---
>  lib/kvargs/rte_kvargs.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
> index 38e9d5c1ca..4cce8e953b 100644
> --- a/lib/kvargs/rte_kvargs.c
> +++ b/lib/kvargs/rte_kvargs.c
> @@ -7,7 +7,6 @@
>  #include <stdlib.h>
>  #include <stdbool.h>
>  
> -#include <rte_os_shim.h>
>  #include <rte_string_fns.h>
>  
>  #include "rte_kvargs.h"
> -- 
> 2.25.1
> 

Did you check that it still compiles for the Windows platform
after this change?

+CC Dmitry

^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v3 4/5] lib/kvargs: remove unneeded header includes
  2021-10-15  9:00       ` Olivier Matz
@ 2021-10-15  9:20         ` Morrissey, Sean
  2021-10-15 12:24           ` Olivier Matz
  0 siblings, 1 reply; 147+ messages in thread
From: Morrissey, Sean @ 2021-10-15  9:20 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, dmitry.kozliuk


On 15/10/2021 10:00, Olivier Matz wrote:
> Hi Sean,
>
> On Thu, Oct 07, 2021 at 10:25:56AM +0000, Sean Morrissey wrote:
>> These header includes have been flagged by the iwyu_tool
>> and removed.
>>
>> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
>> ---
>>   lib/kvargs/rte_kvargs.c | 1 -
>>   1 file changed, 1 deletion(-)
>>
>> diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
>> index 38e9d5c1ca..4cce8e953b 100644
>> --- a/lib/kvargs/rte_kvargs.c
>> +++ b/lib/kvargs/rte_kvargs.c
>> @@ -7,7 +7,6 @@
>>   #include <stdlib.h>
>>   #include <stdbool.h>
>>   
>> -#include <rte_os_shim.h>
>>   #include <rte_string_fns.h>
>>   
>>   #include "rte_kvargs.h"
>> -- 
>> 2.25.1
>>
> Did you check that it still compiles for the Windows platform
> after this change?
>
> +CC Dmitry

Hi Olivier,

I cross-compiled with MinGW-64 after this change and it still compiled.

Thanks,

Sean.


^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [dpdk-dev] [PATCH v3 4/5] lib/kvargs: remove unneeded header includes
  2021-10-15  9:20         ` Morrissey, Sean
@ 2021-10-15 12:24           ` Olivier Matz
  0 siblings, 0 replies; 147+ messages in thread
From: Olivier Matz @ 2021-10-15 12:24 UTC (permalink / raw)
  To: Morrissey, Sean; +Cc: dev, dmitry.kozliuk

On Fri, Oct 15, 2021 at 10:20:06AM +0100, Morrissey, Sean wrote:
> 
> On 15/10/2021 10:00, Olivier Matz wrote:
> > Hi Sean,
> > 
> > On Thu, Oct 07, 2021 at 10:25:56AM +0000, Sean Morrissey wrote:
> > > These header includes have been flagged by the iwyu_tool
> > > and removed.
> > > 
> > > Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> > > ---
> > >   lib/kvargs/rte_kvargs.c | 1 -
> > >   1 file changed, 1 deletion(-)
> > > 
> > > diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
> > > index 38e9d5c1ca..4cce8e953b 100644
> > > --- a/lib/kvargs/rte_kvargs.c
> > > +++ b/lib/kvargs/rte_kvargs.c
> > > @@ -7,7 +7,6 @@
> > >   #include <stdlib.h>
> > >   #include <stdbool.h>
> > > -#include <rte_os_shim.h>
> > >   #include <rte_string_fns.h>
> > >   #include "rte_kvargs.h"
> > > -- 
> > > 2.25.1
> > > 
> > Did you check that it still compiles for the Windows platform
> > after this change?
> > 
> > +CC Dmitry
> 
> Hi Olivier,
> 
> I cross-compiled with MinGW-64 after this change and it still compiled.

Thanks.

However I see that strdup() is used in rte_kvargs.c, and it is defined in
lib/eal/windows/include/rte_os_shim.h. So at first glance, it seems a better
option to keep the include as it is.

I don't know if strdup() is defined somewhere else on windows, or if
rte_os_shim.h is included by another header. Better have an opinion from a
windows maintainer if we want to remove this include.

^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 00/53] introduce IWYU
  2021-10-07 10:25   ` [dpdk-dev] [PATCH v3 0/5] introduce IWYU Sean Morrissey
                       ` (4 preceding siblings ...)
  2021-10-07 10:25     ` [dpdk-dev] [PATCH v3 5/5] lib/eal: " Sean Morrissey
@ 2022-01-14 16:23     ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 01/53] devtools: script to remove unused headers includes Sean Morrissey
                         ` (53 more replies)
  5 siblings, 54 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  Cc: dev, Sean Morrissey

This patchset introduces the include-what-you-use script which removes
unused header includes. IWYU GitHub:

https://github.com/include-what-you-use/include-what-you-use

Along with the script there are some patches which make a start on
removing unneeded headers.

V4:
* Re-added removed headers that are now needed in order to fix build
  issues.
* Removed other unused headers from other libraries

Sean Morrissey (53):
  devtools: script to remove unused headers includes
  telemetry: remove unneeded header includes
  ring: remove unneeded header includes
  kvargs: remove unneeded header includes
  eal: remove unneeded header includes
  vhost: remove unneeded header includes
  timer: remove unneeded header includes
  table: remove unneeded header includes
  stack: remove unneeded header includes
  security: remove unneeded header includes
  sched: remove unneeded header includes
  ring: remove unneeded header includes
  rib: remove unneeded header includes
  reorder: remove unneeded header includes
  regexdev: remove unneeded header includes
  rcu: remove unneeded header includes
  rawdev: remove unneeded header includes
  power: remove unneeded header includes
  port: remove unneeded header includes
  pipeline: remove unneeded header includes
  pdump: remove unneeded header includes
  pci: remove unneeded header includes
  pcapng: remove unneeded header includes
  node: remove unneeded header includes
  net: remove unneeded header includes
  metrics: remove unneeded header includes
  mempool: remove unneeded header includes
  member: remove unneeded header includes
  mbuf: remove unneeded header includes
  lpm: remove unneeded header includes
  latencystats: remove unneeded header includes
  kvargs: remove unneeded header includes
  kni: remove unneeded header includes
  jobstats: remove unneeded header includes
  ipsec: remove unneeded header includes
  ip_frag: remove unneeded header includes
  hash: remove unneeded header includes
  gro: remove unneeded header includes
  graph: remove unneeded header includes
  gpudev: remove unneeded header includes
  flow_classify: remove unneeded header includes
  fib: remove unneeded header includes
  eventdev: remove unneeded header includes
  efd: remove unneeded header includes
  eal: remove unneeded header includes
  dmadev: remove unneeded header includes
  distributor: remove unneeded header includes
  compressdev: remove unneeded header includes
  cmdline: remove unneeded header includes
  bpf: remove unneeded header includes
  bbdev: remove unneeded header includes
  cryptodev: remove unneeded header includes
  acl: remove unneeded header includes

 devtools/process_iwyu.py                    | 109 ++++++++++++++++++++
 examples/vm_power_manager/guest_cli/main.c  |   1 +
 lib/acl/rte_acl.c                           |   1 -
 lib/bbdev/rte_bbdev.c                       |   4 -
 lib/bbdev/rte_bbdev.h                       |   4 -
 lib/bpf/bpf.c                               |   4 -
 lib/bpf/bpf_exec.c                          |   6 --
 lib/bpf/bpf_jit_x86.c                       |   5 -
 lib/bpf/bpf_load.c                          |   8 --
 lib/bpf/bpf_pkt.c                           |  12 ---
 lib/bpf/bpf_validate.c                      |   3 -
 lib/cmdline/cmdline.c                       |   2 -
 lib/cmdline/cmdline_cirbuf.c                |   1 -
 lib/cmdline/cmdline_cirbuf.h                |   1 -
 lib/cmdline/cmdline_parse.c                 |   3 -
 lib/cmdline/cmdline_parse_num.c             |   4 -
 lib/cmdline/cmdline_parse_portlist.c        |   3 -
 lib/cmdline/cmdline_parse_string.c          |   4 -
 lib/cmdline/cmdline_rdline.c                |   2 -
 lib/cmdline/cmdline_socket.c                |   5 -
 lib/cmdline/cmdline_socket.h                |   1 -
 lib/cmdline/cmdline_vt100.c                 |   3 -
 lib/compressdev/rte_comp.c                  |   1 -
 lib/compressdev/rte_comp.h                  |   1 -
 lib/compressdev/rte_compressdev.c           |   1 -
 lib/compressdev/rte_compressdev.h           |   1 -
 lib/compressdev/rte_compressdev_pmd.h       |   2 -
 lib/cryptodev/cryptodev_pmd.h               |   4 -
 lib/cryptodev/rte_cryptodev.c               |  11 --
 lib/cryptodev/rte_cryptodev.h               |   2 -
 lib/distributor/rte_distributor.c           |   2 -
 lib/distributor/rte_distributor_match_sse.c |   2 -
 lib/distributor/rte_distributor_single.c    |   2 -
 lib/dmadev/rte_dmadev.h                     |   1 -
 lib/eal/common/eal_common_dev.c             |   5 -
 lib/eal/common/eal_common_devargs.c         |   1 -
 lib/eal/common/eal_common_errno.c           |   4 -
 lib/eal/common/eal_common_fbarray.c         |   3 -
 lib/eal/common/eal_common_hexdump.c         |   3 -
 lib/eal/common/eal_common_launch.c          |   6 --
 lib/eal/common/eal_common_lcore.c           |   7 +-
 lib/eal/common/eal_common_log.c             |   2 -
 lib/eal/common/eal_common_memalloc.c        |   3 -
 lib/eal/common/eal_common_memory.c          |   5 -
 lib/eal/common/eal_common_memzone.c         |   4 -
 lib/eal/common/eal_common_options.c         |   2 -
 lib/eal/common/eal_common_proc.c            |   2 -
 lib/eal/common/eal_common_string_fns.c      |   2 -
 lib/eal/common/eal_common_tailqs.c          |  11 --
 lib/eal/common/eal_common_thread.c          |   3 -
 lib/eal/common/eal_common_timer.c           |   6 --
 lib/eal/common/eal_common_trace.c           |   1 -
 lib/eal/common/hotplug_mp.h                 |   1 -
 lib/eal/common/malloc_elem.c                |   6 --
 lib/eal/common/malloc_heap.c                |   5 -
 lib/eal/common/malloc_mp.c                  |   1 -
 lib/eal/common/malloc_mp.h                  |   2 -
 lib/eal/common/rte_malloc.c                 |   5 -
 lib/eal/common/rte_random.c                 |   3 -
 lib/eal/common/rte_service.c                |   6 --
 lib/eal/include/rte_version.h               |   2 -
 lib/eal/linux/eal.c                         |  10 --
 lib/eal/linux/eal_alarm.c                   |   7 --
 lib/eal/linux/eal_cpuflags.c                |   2 -
 lib/eal/linux/eal_debug.c                   |   5 -
 lib/eal/linux/eal_dev.c                     |   4 -
 lib/eal/linux/eal_hugepage_info.c           |   7 --
 lib/eal/linux/eal_interrupts.c              |   8 --
 lib/eal/linux/eal_lcore.c                   |   7 --
 lib/eal/linux/eal_log.c                     |  11 +-
 lib/eal/linux/eal_memalloc.c                |   8 --
 lib/eal/linux/eal_memory.c                  |   9 --
 lib/eal/linux/eal_thread.c                  |   6 --
 lib/eal/linux/eal_timer.c                   |  15 ---
 lib/eal/linux/eal_vfio_mp_sync.c            |   1 -
 lib/eal/unix/eal_file.c                     |   1 -
 lib/eal/unix/rte_thread.c                   |   1 -
 lib/eal/x86/rte_cycles.c                    |   1 -
 lib/efd/rte_efd.c                           |   3 -
 lib/eventdev/rte_event_ring.c               |   6 --
 lib/eventdev/rte_event_ring.h               |   2 -
 lib/eventdev/rte_event_timer_adapter.c      |   5 -
 lib/eventdev/rte_event_timer_adapter.h      |   2 -
 lib/eventdev/rte_eventdev.c                 |  11 --
 lib/eventdev/rte_eventdev.h                 |   2 -
 lib/fib/dir24_8.c                           |   4 -
 lib/fib/rte_fib.c                           |   2 -
 lib/fib/rte_fib.h                           |   1 -
 lib/fib/rte_fib6.c                          |   2 -
 lib/fib/rte_fib6.h                          |   1 -
 lib/fib/trie.c                              |   5 -
 lib/fib/trie.h                              |   2 -
 lib/flow_classify/rte_flow_classify.c       |   3 -
 lib/flow_classify/rte_flow_classify.h       |   4 -
 lib/flow_classify/rte_flow_classify_parse.c |   1 -
 lib/flow_classify/rte_flow_classify_parse.h |   1 -
 lib/gpudev/gpudev.c                         |   1 -
 lib/graph/graph_debug.c                     |   2 -
 lib/graph/graph_ops.c                       |   1 -
 lib/graph/graph_populate.c                  |   2 -
 lib/graph/node.c                            |   1 -
 lib/gro/gro_tcp4.c                          |   1 -
 lib/gro/gro_tcp4.h                          |   2 -
 lib/gro/gro_udp4.c                          |   1 -
 lib/gro/gro_udp4.h                          |   2 -
 lib/gro/gro_vxlan_tcp4.c                    |   1 -
 lib/gro/gro_vxlan_udp4.c                    |   1 -
 lib/gro/rte_gro.c                           |   1 -
 lib/hash/rte_cuckoo_hash.c                  |   4 -
 lib/hash/rte_fbk_hash.c                     |   6 --
 lib/hash/rte_fbk_hash.h                     |   1 -
 lib/hash/rte_thash.c                        |   1 -
 lib/hash/rte_thash.h                        |   1 -
 lib/ip_frag/rte_ip_frag_common.c            |   1 -
 lib/ip_frag/rte_ipv4_fragmentation.c        |   2 -
 lib/ipsec/esp_inb.c                         |   1 -
 lib/ipsec/esp_outb.c                        |   1 -
 lib/ipsec/ipsec_sad.c                       |   1 -
 lib/ipsec/sa.c                              |   3 -
 lib/ipsec/sa.h                              |   1 -
 lib/jobstats/rte_jobstats.c                 |   3 -
 lib/kni/rte_kni.c                           |   2 -
 lib/kni/rte_kni.h                           |   2 -
 lib/kvargs/rte_kvargs.c                     |   2 -
 lib/latencystats/rte_latencystats.c         |   4 -
 lib/lpm/rte_lpm.c                           |   7 --
 lib/lpm/rte_lpm.h                           |   4 -
 lib/lpm/rte_lpm6.c                          |   7 --
 lib/lpm/rte_lpm6.h                          |   1 -
 lib/mbuf/rte_mbuf.c                         |  11 --
 lib/mbuf/rte_mbuf.h                         |   2 -
 lib/mbuf/rte_mbuf_dyn.h                     |   2 -
 lib/mbuf/rte_mbuf_pool_ops.c                |   1 -
 lib/mbuf/rte_mbuf_pool_ops.h                |   1 -
 lib/member/rte_member.c                     |   2 -
 lib/member/rte_member.h                     |   1 -
 lib/member/rte_member_vbf.c                 |   1 -
 lib/mempool/rte_mempool.c                   |   7 --
 lib/mempool/rte_mempool.h                   |   4 -
 lib/metrics/rte_metrics.c                   |   3 -
 lib/net/net_crc_avx512.c                    |   3 -
 lib/net/net_crc_sse.c                       |   1 -
 lib/net/rte_arp.c                           |   1 -
 lib/net/rte_ether.h                         |   1 -
 lib/net/rte_net.h                           |   1 -
 lib/net/rte_net_crc.c                       |   2 -
 lib/node/ethdev_ctrl.c                      |   2 -
 lib/node/ethdev_rx.c                        |   1 -
 lib/node/ethdev_tx.c                        |   1 -
 lib/node/ip4_lookup.c                       |   5 -
 lib/node/ip4_rewrite.c                      |   4 -
 lib/node/pkt_cls.c                          |   4 -
 lib/node/pkt_drop.c                         |   1 -
 lib/pcapng/rte_pcapng.c                     |   1 -
 lib/pcapng/rte_pcapng.h                     |   2 -
 lib/pci/rte_pci.c                           |  15 +--
 lib/pci/rte_pci.h                           |   2 -
 lib/pdump/rte_pdump.c                       |   1 -
 lib/pdump/rte_pdump.h                       |   2 -
 lib/pipeline/rte_pipeline.c                 |   4 -
 lib/pipeline/rte_port_in_action.c           |   2 -
 lib/pipeline/rte_swx_ctl.h                  |   2 -
 lib/pipeline/rte_swx_pipeline.c             |   1 -
 lib/pipeline/rte_swx_pipeline.h             |   1 -
 lib/pipeline/rte_swx_pipeline_spec.c        |   1 -
 lib/pipeline/rte_table_action.c             |   2 -
 lib/port/rte_port_fd.h                      |   1 -
 lib/port/rte_port_frag.c                    |   2 -
 lib/port/rte_port_frag.h                    |   1 -
 lib/port/rte_port_kni.c                     |   1 -
 lib/port/rte_port_kni.h                     |   1 -
 lib/port/rte_port_ras.c                     |   1 -
 lib/port/rte_port_ras.h                     |   1 -
 lib/port/rte_port_ring.h                    |   1 -
 lib/port/rte_port_sched.c                   |   1 -
 lib/port/rte_port_source_sink.c             |   1 -
 lib/port/rte_swx_port_fd.c                  |   1 -
 lib/port/rte_swx_port_fd.h                  |   1 -
 lib/port/rte_swx_port_ring.h                |   1 -
 lib/power/guest_channel.c                   |   2 -
 lib/power/power_acpi_cpufreq.c              |   7 --
 lib/power/power_acpi_cpufreq.h              |   4 -
 lib/power/power_common.h                    |   1 -
 lib/power/power_cppc_cpufreq.c              |   1 -
 lib/power/power_cppc_cpufreq.h              |   4 -
 lib/power/power_kvm_vm.c                    |   1 -
 lib/power/power_kvm_vm.h                    |   4 -
 lib/power/power_pstate_cpufreq.c            |   7 --
 lib/power/power_pstate_cpufreq.h            |   4 -
 lib/power/rte_power.c                       |   1 -
 lib/power/rte_power.h                       |   2 -
 lib/power/rte_power_empty_poll.c            |   2 -
 lib/rawdev/rte_rawdev.c                     |  14 ---
 lib/rcu/rte_rcu_qsbr.c                      |   4 -
 lib/rcu/rte_rcu_qsbr.h                      |   4 -
 lib/regexdev/rte_regexdev.c                 |   2 -
 lib/regexdev/rte_regexdev.h                 |   3 -
 lib/reorder/rte_reorder.c                   |   1 -
 lib/rib/rte_rib.c                           |   2 -
 lib/rib/rte_rib.h                           |   1 -
 lib/rib/rte_rib6.c                          |   2 -
 lib/rib/rte_rib6.h                          |   1 -
 lib/ring/rte_ring.c                         |   9 --
 lib/sched/rte_pie.c                         |   2 -
 lib/sched/rte_red.h                         |   1 -
 lib/sched/rte_sched.c                       |   1 -
 lib/sched/rte_sched.h                       |   1 -
 lib/security/rte_security.c                 |   2 -
 lib/security/rte_security.h                 |   3 -
 lib/stack/rte_stack.c                       |   2 -
 lib/stack/rte_stack.h                       |   1 -
 lib/table/rte_swx_table_em.c                |   1 -
 lib/table/rte_swx_table_em.h                |   1 -
 lib/table/rte_swx_table_learner.c           |   1 -
 lib/table/rte_swx_table_learner.h           |   1 -
 lib/table/rte_swx_table_selector.c          |   1 -
 lib/table/rte_swx_table_wm.c                |   2 -
 lib/table/rte_swx_table_wm.h                |   1 -
 lib/table/rte_table_acl.c                   |   3 -
 lib/table/rte_table_array.c                 |   2 -
 lib/table/rte_table_hash_cuckoo.c           |   2 -
 lib/table/rte_table_hash_ext.c              |   2 -
 lib/table/rte_table_hash_key16.c            |   2 -
 lib/table/rte_table_hash_key32.c            |   2 -
 lib/table/rte_table_hash_key8.c             |   2 -
 lib/table/rte_table_hash_lru.c              |   2 -
 lib/table/rte_table_lpm.c                   |   2 -
 lib/table/rte_table_lpm_ipv6.c              |   3 -
 lib/table/rte_table_stub.c                  |   1 -
 lib/table/rte_table_stub.h                  |   1 -
 lib/telemetry/telemetry.c                   |   1 -
 lib/telemetry/telemetry_data.h              |   1 -
 lib/timer/rte_timer.c                       |   7 --
 lib/vhost/fd_man.c                          |   6 --
 lib/vhost/fd_man.h                          |   1 -
 lib/vhost/socket.c                          |   1 -
 lib/vhost/vdpa.c                            |   1 -
 lib/vhost/vhost.c                           |   4 -
 lib/vhost/vhost.h                           |   6 --
 lib/vhost/vhost_user.c                      |   2 -
 lib/vhost/vhost_user.h                      |   1 -
 241 files changed, 113 insertions(+), 706 deletions(-)
 create mode 100755 devtools/process_iwyu.py

-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 01/53] devtools: script to remove unused headers includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 17:02         ` Stephen Hemminger
  2022-01-14 16:23       ` [PATCH v4 02/53] telemetry: remove unneeded header includes Sean Morrissey
                         ` (52 subsequent siblings)
  53 siblings, 1 reply; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  Cc: dev, Sean Morrissey, Conor Fogarty, Bruce Richardson

This script can be used for removing headers flagged for removal by the
include-what-you-use (IWYU) tool. The script has the ability to remove
headers from specified sub-directories or dpdk as a whole and tests the
build after each removal by calling meson compile.

example usages:

Remove headers flagged by iwyu_tool output file
$ ./devtools/process_iwyu.py iwyu.out -b build

Remove headers flagged by iwyu_tool output file from sub-directory
$ ./devtools/process_iwyu.py iwyu.out -b build -d lib/kvargs

Remove headers directly piped from the iwyu_tool
$ iwyu_tool -p build | ./devtools/process_iwyu.py - -b build

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>

Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/process_iwyu.py | 109 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 109 insertions(+)
 create mode 100755 devtools/process_iwyu.py

diff --git a/devtools/process_iwyu.py b/devtools/process_iwyu.py
new file mode 100755
index 0000000000..50f3d4c5c7
--- /dev/null
+++ b/devtools/process_iwyu.py
@@ -0,0 +1,109 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+#
+
+import argparse
+import fileinput
+import sys
+from os.path import abspath, relpath, join
+from pathlib import Path
+from mesonbuild import mesonmain
+
+
+def args_parse():
+    "parse arguments and return the argument object back to main"
+    parser = argparse.ArgumentParser(description="This script can be used to remove includes which are not in use\n")
+    parser.add_argument('-b', '--build_dir', type=str, default='build',
+                        help="The path to the build directory in which the IWYU tool was used in.")
+    parser.add_argument('-d', '--sub_dir', type=str, default='',
+                        help="The sub-directory to remove headers from.")
+    parser.add_argument('file', type=Path,
+                        help="The path to the IWYU log file or output from stdin.")
+
+    return parser.parse_args()
+
+
+def run_meson(args):
+    "Runs a meson command logging output to process.log"
+    with open('process_iwyu.log', 'a') as sys.stdout:
+        ret = mesonmain.run(args, abspath('meson'))
+    sys.stdout = sys.__stdout__
+    return ret
+
+
+def remove_includes(filepath, include, build_dir):
+    "Attempts to remove include, if it fails then revert to original state"
+    with open(filepath) as f:
+        lines = f.readlines()  # Read lines when file is opened
+
+    with open(filepath, 'w') as f:
+        for ln in lines:  # Removes the include passed in
+            if not ln.startswith(include):
+                f.write(ln)
+
+    # run test build -> call meson on the build folder, meson compile -C build
+    ret = run_meson(['compile', '-C', build_dir])
+    if (ret == 0):  # Include is not needed -> build is successful
+        print('SUCCESS')
+    else:
+        # failed, catch the error
+        # return file to original state
+        with open(filepath, 'w') as f:
+            f.writelines(lines)
+        print('FAILED')
+
+
+def get_build_config(builddir, condition):
+    "returns contents of rte_build_config.h"
+    with open(join(builddir, 'rte_build_config.h')) as f:
+        return [ln for ln in f.readlines() if condition(ln)]
+
+
+def uses_libbsd(builddir):
+    "return whether the build uses libbsd or not"
+    return bool(get_build_config(builddir, lambda ln: 'RTE_USE_LIBBSD' in ln))
+
+
+def process(args):
+    "process the iwyu output on a set of files"
+    filepath = None
+    build_dir = abspath(args.build_dir)
+    directory = args.sub_dir
+
+    print("Warning: The results of this script may include false positives which are required for different systems",
+          file=sys.stderr)
+
+    keep_str_fns = uses_libbsd(build_dir)  # check for libbsd
+    if keep_str_fns:
+        print("Warning: libbsd is present, build will fail to detect incorrect removal of rte_string_fns.h",
+              file=sys.stderr)
+    # turn on werror
+    run_meson(['configure', build_dir, '-Dwerror=true'])
+    # Use stdin if no iwyu_tool out file given
+    for line in fileinput.input(args.file):
+        if 'should remove' in line:
+            # If the file path in the iwyu_tool output is an absolute path it
+            # means the file is outside of the dpdk directory, therefore ignore it.
+            # Also check to see if the file is within the specified sub directory.
+            filename = line.split()[0]
+            if (filename != abspath(filename) and
+                    directory in filename):
+                filepath = relpath(join(build_dir, filename))
+        elif line.startswith('-') and filepath:
+            include = '#include ' + line.split()[2]
+            print(f"Remove {include} from {filepath} ... ", end='', flush=True)
+            if keep_str_fns and '<rte_string_fns.h>' in include:
+                print('skipped')
+                continue
+            remove_includes(filepath, include, build_dir)
+        else:
+            filepath = None
+
+
+def main():
+    process(args_parse())
+
+
+if __name__ == '__main__':
+    main()
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 02/53] telemetry: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 01/53] devtools: script to remove unused headers includes Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 03/53] ring: " Sean Morrissey
                         ` (51 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Ciara Power; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

Acked-by: Ciara Power <ciara.power@intel.com>
---
 lib/telemetry/telemetry.c      | 1 -
 lib/telemetry/telemetry_data.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index e5ccfe47f7..c6fd03a5ab 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -8,7 +8,6 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/stat.h>
-#include <dlfcn.h>
 #endif /* !RTE_EXEC_ENV_WINDOWS */
 
 /* we won't link against libbsd, so just always use DPDKs-specific strlcpy */
diff --git a/lib/telemetry/telemetry_data.h b/lib/telemetry/telemetry_data.h
index adb84a09f1..26aa28e72c 100644
--- a/lib/telemetry/telemetry_data.h
+++ b/lib/telemetry/telemetry_data.h
@@ -5,7 +5,6 @@
 #ifndef _TELEMETRY_DATA_H_
 #define _TELEMETRY_DATA_H_
 
-#include <inttypes.h>
 #include "rte_telemetry.h"
 
 enum tel_container_types {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 03/53] ring: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 01/53] devtools: script to remove unused headers includes Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 02/53] telemetry: remove unneeded header includes Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 04/53] kvargs: " Sean Morrissey
                         ` (50 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/ring/rte_ring.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
index f17bd966be..bb95962b0c 100644
--- a/lib/ring/rte_ring.c
+++ b/lib/ring/rte_ring.c
@@ -17,16 +17,9 @@
 
 #include <rte_common.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_malloc.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_atomic.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_spinlock.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 04/53] kvargs: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (2 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 03/53] ring: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 05/53] eal: " Sean Morrissey
                         ` (49 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/kvargs/rte_kvargs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
index 11f624ef14..7010d3ac51 100644
--- a/lib/kvargs/rte_kvargs.c
+++ b/lib/kvargs/rte_kvargs.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <stdbool.h>
 
-#include <rte_os_shim.h>
 #include <rte_string_fns.h>
 
 #include "rte_kvargs.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 05/53] eal: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (3 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 04/53] kvargs: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 06/53] vhost: " Sean Morrissey
                         ` (48 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Anatoly Burakov, Jerin Jacob, Sunil Kumar Kori,
	Mattias Rönnblom, Harry van Haaren, Harman Kalra,
	Bruce Richardson, Konstantin Ananyev
  Cc: dev, Sean Morrissey, David Christensen

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>

Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
---
 lib/eal/common/eal_common_dev.c        |  5 -----
 lib/eal/common/eal_common_devargs.c    |  1 -
 lib/eal/common/eal_common_errno.c      |  4 ----
 lib/eal/common/eal_common_fbarray.c    |  3 ---
 lib/eal/common/eal_common_hexdump.c    |  3 ---
 lib/eal/common/eal_common_launch.c     |  6 ------
 lib/eal/common/eal_common_lcore.c      |  7 +------
 lib/eal/common/eal_common_log.c        |  2 --
 lib/eal/common/eal_common_memalloc.c   |  3 ---
 lib/eal/common/eal_common_memory.c     |  5 -----
 lib/eal/common/eal_common_memzone.c    |  4 ----
 lib/eal/common/eal_common_options.c    |  2 --
 lib/eal/common/eal_common_proc.c       |  2 --
 lib/eal/common/eal_common_string_fns.c |  2 --
 lib/eal/common/eal_common_tailqs.c     | 11 -----------
 lib/eal/common/eal_common_thread.c     |  3 ---
 lib/eal/common/eal_common_timer.c      |  6 ------
 lib/eal/common/eal_common_trace.c      |  1 -
 lib/eal/common/hotplug_mp.h            |  1 -
 lib/eal/common/malloc_elem.c           |  6 ------
 lib/eal/common/malloc_heap.c           |  5 -----
 lib/eal/common/malloc_mp.c             |  1 -
 lib/eal/common/malloc_mp.h             |  2 --
 lib/eal/common/rte_malloc.c            |  5 -----
 lib/eal/common/rte_random.c            |  3 ---
 lib/eal/common/rte_service.c           |  6 ------
 lib/eal/include/rte_version.h          |  2 --
 lib/eal/linux/eal.c                    | 10 ----------
 lib/eal/linux/eal_alarm.c              |  7 -------
 lib/eal/linux/eal_cpuflags.c           |  2 --
 lib/eal/linux/eal_debug.c              |  5 -----
 lib/eal/linux/eal_dev.c                |  4 ----
 lib/eal/linux/eal_hugepage_info.c      |  7 -------
 lib/eal/linux/eal_interrupts.c         |  8 --------
 lib/eal/linux/eal_lcore.c              |  7 -------
 lib/eal/linux/eal_log.c                | 11 +----------
 lib/eal/linux/eal_memalloc.c           |  8 --------
 lib/eal/linux/eal_memory.c             |  9 ---------
 lib/eal/linux/eal_thread.c             |  5 -----
 lib/eal/linux/eal_timer.c              | 15 ---------------
 lib/eal/linux/eal_vfio_mp_sync.c       |  1 -
 lib/eal/unix/eal_file.c                |  1 -
 lib/eal/unix/rte_thread.c              |  1 -
 lib/eal/x86/rte_cycles.c               |  1 -
 44 files changed, 2 insertions(+), 201 deletions(-)

diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index e1e9976d8d..c0ee4e442f 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -5,20 +5,15 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 
-#include <rte_compat.h>
 #include <rte_bus.h>
 #include <rte_class.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
-#include <rte_debug.h>
 #include <rte_errno.h>
-#include <rte_kvargs.h>
 #include <rte_log.h>
 #include <rte_spinlock.h>
-#include <rte_malloc.h>
 #include <rte_string_fns.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c
index 8c7650cf6c..c3c3a9e6e4 100644
--- a/lib/eal/common/eal_common_devargs.c
+++ b/lib/eal/common/eal_common_devargs.c
@@ -12,7 +12,6 @@
 
 #include <rte_bus.h>
 #include <rte_class.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_errno.h>
diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c
index f86802705a..1091065568 100644
--- a/lib/eal/common/eal_common_errno.c
+++ b/lib/eal/common/eal_common_errno.c
@@ -5,15 +5,11 @@
 /* Use XSI-compliant portable version of strerror_r() */
 #undef _GNU_SOURCE
 
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdarg.h>
-#include <errno.h>
 
 #include <rte_per_lcore.h>
 #include <rte_errno.h>
-#include <rte_string_fns.h>
 
 #ifdef RTE_EXEC_ENV_WINDOWS
 #define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum)
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 3a28a53247..f11f87979f 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -2,7 +2,6 @@
  * Copyright(c) 2017-2018 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <inttypes.h>
 #include <limits.h>
 #include <stdint.h>
@@ -14,9 +13,7 @@
 #include <rte_eal_paging.h>
 #include <rte_errno.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 #include "eal_filesystem.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_hexdump.c b/lib/eal/common/eal_common_hexdump.c
index 2d2179d411..63bbbdcf0a 100644
--- a/lib/eal/common/eal_common_hexdump.c
+++ b/lib/eal/common/eal_common_hexdump.c
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2010-2014 Intel Corporation
  */
-#include <stdlib.h>
 #include <stdio.h>
-#include <errno.h>
-#include <stdint.h>
 #include <rte_hexdump.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/eal_common_launch.c b/lib/eal/common/eal_common_launch.c
index e95dadffb3..9f393b9bda 100644
--- a/lib/eal/common/eal_common_launch.c
+++ b/lib/eal/common/eal_common_launch.c
@@ -3,16 +3,10 @@
  */
 
 #include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <sys/queue.h>
 
 #include <rte_launch.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
 #include <rte_atomic.h>
 #include <rte_pause.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c
index 5de7570aac..11092791a4 100644
--- a/lib/eal/common/eal_common_lcore.c
+++ b/lib/eal/common/eal_common_lcore.c
@@ -2,19 +2,14 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <unistd.h>
-#include <limits.h>
 #include <string.h>
 
 #include <rte_common.h>
-#include <rte_debug.h>
-#include <rte_eal.h>
+#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_rwlock.h>
 
-#include "eal_memcfg.h"
 #include "eal_private.h"
 #include "eal_thread.h"
 
diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c
index 1be35f5397..6030927bbf 100644
--- a/lib/eal/common/eal_common_log.c
+++ b/lib/eal/common/eal_common_log.c
@@ -12,9 +12,7 @@
 #include <fnmatch.h>
 #include <sys/queue.h>
 
-#include <rte_eal.h>
 #include <rte_log.h>
-#include <rte_os_shim.h>
 #include <rte_per_lcore.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/common/eal_common_memalloc.c b/lib/eal/common/eal_common_memalloc.c
index e872c6533b..f8770ff835 100644
--- a/lib/eal/common/eal_common_memalloc.c
+++ b/lib/eal/common/eal_common_memalloc.c
@@ -5,12 +5,9 @@
 #include <string.h>
 
 #include <rte_errno.h>
-#include <rte_lcore.h>
 #include <rte_fbarray.h>
-#include <rte_memzone.h>
 #include <rte_memory.h>
 #include <rte_string_fns.h>
-#include <rte_rwlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
index 616db5ce31..e93d558a7d 100644
--- a/lib/eal/common/eal_common_memory.c
+++ b/lib/eal/common/eal_common_memory.c
@@ -2,16 +2,11 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdlib.h>
-#include <stdarg.h>
 #include <string.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/queue.h>
 
 #include <rte_fbarray.h>
 #include <rte_memory.h>
diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c
index ecde9441ee..0059de6981 100644
--- a/lib/eal/common/eal_common_memzone.c
+++ b/lib/eal/common/eal_common_memzone.c
@@ -2,20 +2,16 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdarg.h>
 #include <inttypes.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/queue.h>
 
 #include <rte_log.h>
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_common.h>
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index 1cfdd75f3b..071f1acf50 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -4,7 +4,6 @@
  */
 
 #include <stdlib.h>
-#include <unistd.h>
 #include <string.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <syslog.h>
@@ -17,7 +16,6 @@
 #include <dlfcn.h>
 #include <libgen.h>
 #endif
-#include <sys/types.h>
 #include <sys/stat.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <dirent.h>
diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index ebd0f6673b..575b4ca24d 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -15,7 +15,6 @@
 #include <string.h>
 #include <sys/file.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
@@ -27,7 +26,6 @@
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_tailq.h>
 
 #include "eal_memcfg.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_string_fns.c b/lib/eal/common/eal_common_string_fns.c
index ddd1891656..0236ae4023 100644
--- a/lib/eal/common/eal_common_string_fns.c
+++ b/lib/eal/common/eal_common_string_fns.c
@@ -2,9 +2,7 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 
 #include <rte_string_fns.h>
diff --git a/lib/eal/common/eal_common_tailqs.c b/lib/eal/common/eal_common_tailqs.c
index ead06897b8..580fbf24bc 100644
--- a/lib/eal/common/eal_common_tailqs.c
+++ b/lib/eal/common/eal_common_tailqs.c
@@ -3,24 +3,13 @@
  */
 
 #include <sys/queue.h>
-#include <stdint.h>
-#include <errno.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
-#include <inttypes.h>
 
-#include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_log.h>
 #include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_memcfg.h"
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index bb6fc8084c..684bea166c 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -4,10 +4,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
 #include <pthread.h>
-#include <signal.h>
 #include <sched.h>
 #include <assert.h>
 #include <string.h>
diff --git a/lib/eal/common/eal_common_timer.c b/lib/eal/common/eal_common_timer.c
index 86f8429847..5686a5102b 100644
--- a/lib/eal/common/eal_common_timer.c
+++ b/lib/eal/common/eal_common_timer.c
@@ -2,16 +2,10 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/types.h>
-#include <time.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
 #include <rte_pause.h>
diff --git a/lib/eal/common/eal_common_trace.c b/lib/eal/common/eal_common_trace.c
index 7bff1cd2ce..036f6ac348 100644
--- a/lib/eal/common/eal_common_trace.c
+++ b/lib/eal/common/eal_common_trace.c
@@ -3,7 +3,6 @@
  */
 
 #include <fnmatch.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 #include <regex.h>
 
diff --git a/lib/eal/common/hotplug_mp.h b/lib/eal/common/hotplug_mp.h
index 8fcf9b52e2..066494ff27 100644
--- a/lib/eal/common/hotplug_mp.h
+++ b/lib/eal/common/hotplug_mp.h
@@ -6,7 +6,6 @@
 #define _HOTPLUG_MP_H_
 
 #include "rte_dev.h"
-#include "rte_bus.h"
 
 #define EAL_DEV_MP_ACTION_REQUEST      "eal_dev_mp_request"
 #define EAL_DEV_MP_ACTION_RESPONSE     "eal_dev_mp_response"
diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c
index bdd20a162e..c08f129c04 100644
--- a/lib/eal/common/malloc_elem.c
+++ b/lib/eal/common/malloc_elem.c
@@ -6,17 +6,11 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/queue.h>
 
 #include <rte_memory.h>
 #include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_debug.h>
 #include <rte_common.h>
-#include <rte_spinlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c
index 55aad2711b..5ee5b07941 100644
--- a/lib/eal/common/malloc_heap.c
+++ b/lib/eal/common/malloc_heap.c
@@ -5,7 +5,6 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <sys/queue.h>
 
@@ -13,15 +12,11 @@
 #include <rte_errno.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_string_fns.h>
 #include <rte_spinlock.h>
-#include <rte_memcpy.h>
 #include <rte_memzone.h>
-#include <rte_atomic.h>
 #include <rte_fbarray.h>
 
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c
index 2e597a17a2..801b2e7fbd 100644
--- a/lib/eal/common/malloc_mp.c
+++ b/lib/eal/common/malloc_mp.c
@@ -5,7 +5,6 @@
 #include <string.h>
 #include <sys/time.h>
 
-#include <rte_alarm.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/malloc_mp.h b/lib/eal/common/malloc_mp.h
index 0095062b72..fb10817e13 100644
--- a/lib/eal/common/malloc_mp.h
+++ b/lib/eal/common/malloc_mp.h
@@ -10,8 +10,6 @@
 
 #include <rte_common.h>
 #include <rte_random.h>
-#include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 /* forward declarations */
 struct malloc_heap;
diff --git a/lib/eal/common/rte_malloc.c b/lib/eal/common/rte_malloc.c
index d0bec26920..7bcbec51a2 100644
--- a/lib/eal/common/rte_malloc.c
+++ b/lib/eal/common/rte_malloc.c
@@ -13,11 +13,6 @@
 #include <rte_memory.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_branch_prediction.h>
-#include <rte_debug.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/common/rte_random.c b/lib/eal/common/rte_random.c
index ce21c2242a..4535cc980c 100644
--- a/lib/eal/common/rte_random.c
+++ b/lib/eal/common/rte_random.c
@@ -5,14 +5,11 @@
 #ifdef __RDSEED__
 #include <x86intrin.h>
 #endif
-#include <stdlib.h>
 #include <unistd.h>
 
 #include <rte_branch_prediction.h>
 #include <rte_cycles.h>
-#include <rte_eal.h>
 #include <rte_lcore.h>
-#include <rte_memory.h>
 #include <rte_random.h>
 
 struct rte_rand_state {
diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c
index bd8fb72e78..ef31b1f63c 100644
--- a/lib/eal/common/rte_service.c
+++ b/lib/eal/common/rte_service.c
@@ -3,22 +3,16 @@
  */
 
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <limits.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_service.h>
 #include <rte_service_component.h>
 
-#include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_debug.h>
 #include <rte_cycles.h>
 #include <rte_atomic.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/include/rte_version.h b/lib/eal/include/rte_version.h
index b06a62e7a2..414b6167f2 100644
--- a/lib/eal/include/rte_version.h
+++ b/lib/eal/include/rte_version.h
@@ -14,10 +14,8 @@
 extern "C" {
 #endif
 
-#include <stdint.h>
 #include <string.h>
 #include <stdio.h>
-#include <rte_common.h>
 #include <rte_compat.h>
 
 /**
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 60b4924838..b5621e64e2 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -7,10 +7,8 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <syslog.h>
 #include <getopt.h>
 #include <sys/file.h>
 #include <dirent.h>
@@ -20,32 +18,24 @@
 #include <errno.h>
 #include <limits.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
 #include <sys/stat.h>
 #if defined(RTE_ARCH_X86)
 #include <sys/io.h>
 #endif
 #include <linux/version.h>
 
-#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_errno.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_service_component.h>
 #include <rte_log.h>
-#include <rte_random.h>
-#include <rte_cycles.h>
 #include <rte_string_fns.h>
 #include <rte_cpuflags.h>
-#include <rte_interrupts.h>
 #include <rte_bus.h>
-#include <rte_dev.h>
-#include <rte_devargs.h>
 #include <rte_version.h>
 #include <malloc_heap.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/linux/eal_alarm.c b/lib/eal/linux/eal_alarm.c
index 3b5e894595..4de67138bc 100644
--- a/lib/eal/linux/eal_alarm.c
+++ b/lib/eal/linux/eal_alarm.c
@@ -3,21 +3,14 @@
  */
 #include <stdio.h>
 #include <stdint.h>
-#include <signal.h>
 #include <errno.h>
-#include <string.h>
 #include <sys/queue.h>
 #include <sys/time.h>
 #include <sys/timerfd.h>
 
-#include <rte_memory.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_common.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_lcore.h>
 #include <rte_errno.h>
 #include <rte_spinlock.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_cpuflags.c b/lib/eal/linux/eal_cpuflags.c
index d38296e1e5..c684940e1d 100644
--- a/lib/eal/linux/eal_cpuflags.c
+++ b/lib/eal/linux/eal_cpuflags.c
@@ -5,8 +5,6 @@
 #include <elf.h>
 #include <fcntl.h>
 #include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
diff --git a/lib/eal/linux/eal_debug.c b/lib/eal/linux/eal_debug.c
index 64dab4e0da..b0ecf5a9dc 100644
--- a/lib/eal/linux/eal_debug.c
+++ b/lib/eal/linux/eal_debug.c
@@ -5,16 +5,11 @@
 #ifdef RTE_BACKTRACE
 #include <execinfo.h>
 #endif
-#include <stdarg.h>
-#include <signal.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdint.h>
 
 #include <rte_log.h>
 #include <rte_debug.h>
-#include <rte_common.h>
-#include <rte_eal.h>
 
 #define BACKTRACE_SIZE 256
 
diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c
index bde55a3d92..f6e5861221 100644
--- a/lib/eal/linux/eal_dev.c
+++ b/lib/eal/linux/eal_dev.c
@@ -4,20 +4,16 @@
 
 #include <string.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
 
 #include <rte_string_fns.h>
 #include <rte_log.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
-#include <rte_malloc.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_bus.h>
-#include <rte_eal.h>
 #include <rte_spinlock.h>
 #include <rte_errno.h>
 
diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index 9fb0e968db..3f760f85ca 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -3,7 +3,6 @@
  */
 
 #include <string.h>
-#include <sys/types.h>
 #include <sys/file.h>
 #include <dirent.h>
 #include <fcntl.h>
@@ -12,19 +11,13 @@
 #include <stdio.h>
 #include <fnmatch.h>
 #include <inttypes.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
 #include <sys/stat.h>
 
 #include <linux/mman.h> /* for hugetlb-related flags */
 
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_debug.h>
 #include <rte_log.h>
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index 70060bf3ef..d52ec8eb4c 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -7,13 +7,10 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <sys/queue.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <inttypes.h>
 #include <sys/epoll.h>
-#include <sys/signalfd.h>
 #include <sys/ioctl.h>
 #include <sys/eventfd.h>
 #include <assert.h>
@@ -21,9 +18,6 @@
 
 #include <rte_common.h>
 #include <rte_interrupts.h>
-#include <rte_memory.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_branch_prediction.h>
@@ -36,8 +30,6 @@
 #include <rte_eal_trace.h>
 
 #include "eal_private.h"
-#include "eal_vfio.h"
-#include "eal_thread.h"
 
 #define EAL_INTR_EPOLL_WAIT_FOREVER (-1)
 #define NB_OTHER_INTR               1
diff --git a/lib/eal/linux/eal_lcore.c b/lib/eal/linux/eal_lcore.c
index bc8965844c..2e6a350603 100644
--- a/lib/eal/linux/eal_lcore.c
+++ b/lib/eal/linux/eal_lcore.c
@@ -4,15 +4,8 @@
 
 #include <unistd.h>
 #include <limits.h>
-#include <string.h>
-#include <dirent.h>
 
 #include <rte_log.h>
-#include <rte_eal.h>
-#include <rte_lcore.h>
-#include <rte_common.h>
-#include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_filesystem.h"
diff --git a/lib/eal/linux/eal_log.c b/lib/eal/linux/eal_log.c
index c0aa1007c4..9e72412e2b 100644
--- a/lib/eal/linux/eal_log.c
+++ b/lib/eal/linux/eal_log.c
@@ -2,19 +2,10 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdint.h>
 #include <sys/types.h>
 #include <syslog.h>
-#include <sys/queue.h>
-
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_spinlock.h>
+
 #include <rte_log.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index 337f2bc739..3ba5ca4673 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -3,23 +3,17 @@
  */
 
 #include <errno.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <unistd.h>
 #include <limits.h>
 #include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
@@ -36,9 +30,7 @@
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_eal.h>
-#include <rte_errno.h>
 #include <rte_memory.h>
-#include <rte_spinlock.h>
 
 #include "eal_filesystem.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c
index 03a4f2dd2d..40ec9663d0 100644
--- a/lib/eal/linux/eal_memory.c
+++ b/lib/eal/linux/eal_memory.c
@@ -5,7 +5,6 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -13,19 +12,14 @@
 #include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <sys/resource.h>
 #include <unistd.h>
 #include <limits.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
-#include <linux/memfd.h>
 #define MEMFD_SUPPORTED
 #endif
 #ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
@@ -36,12 +30,9 @@
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_string_fns.h>
 
 #include "eal_private.h"
 #include "eal_memalloc.h"
diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index c7f0f9b2f7..9a0250d762 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -4,20 +4,15 @@
 
 #include <errno.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdint.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <sched.h>
-#include <sys/queue.h>
 #include <sys/syscall.h>
 
 #include <rte_debug.h>
 #include <rte_atomic.h>
 #include <rte_launch.h>
 #include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_per_lcore.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_timer.c b/lib/eal/linux/eal_timer.c
index 7cf15cabac..620baf038d 100644
--- a/lib/eal/linux/eal_timer.c
+++ b/lib/eal/linux/eal_timer.c
@@ -3,28 +3,13 @@
  * Copyright(c) 2012-2013 6WIND S.A.
  */
 
-#include <string.h>
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <sys/mman.h>
-#include <sys/queue.h>
-#include <pthread.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_log.h>
 #include <rte_cycles.h>
-#include <rte_lcore.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
-#include "eal_internal_cfg.h"
 
 enum timer_source eal_timer_source = EAL_TIMER_HPET;
 
diff --git a/lib/eal/linux/eal_vfio_mp_sync.c b/lib/eal/linux/eal_vfio_mp_sync.c
index a2accfab3a..e1776166af 100644
--- a/lib/eal/linux/eal_vfio_mp_sync.c
+++ b/lib/eal/linux/eal_vfio_mp_sync.c
@@ -5,7 +5,6 @@
 #include <unistd.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/unix/eal_file.c b/lib/eal/unix/eal_file.c
index ec554e0096..f04f5fbcbc 100644
--- a/lib/eal/unix/eal_file.c
+++ b/lib/eal/unix/eal_file.c
@@ -3,7 +3,6 @@
  */
 
 #include <sys/file.h>
-#include <sys/mman.h>
 #include <fcntl.h>
 #include <unistd.h>
 
diff --git a/lib/eal/unix/rte_thread.c b/lib/eal/unix/rte_thread.c
index c72d619ec1..c34ede9186 100644
--- a/lib/eal/unix/rte_thread.c
+++ b/lib/eal/unix/rte_thread.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_thread.h>
diff --git a/lib/eal/x86/rte_cycles.c b/lib/eal/x86/rte_cycles.c
index edd9621abb..0e695caf28 100644
--- a/lib/eal/x86/rte_cycles.c
+++ b/lib/eal/x86/rte_cycles.c
@@ -6,7 +6,6 @@
 #include <unistd.h>
 #include <cpuid.h>
 
-#include <rte_common.h>
 
 #include "eal_private.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 06/53] vhost: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (4 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 05/53] eal: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 07/53] timer: " Sean Morrissey
                         ` (47 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Maxime Coquelin, Chenbo Xia; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/vhost/fd_man.c     | 6 ------
 lib/vhost/fd_man.h     | 1 -
 lib/vhost/socket.c     | 1 -
 lib/vhost/vdpa.c       | 1 -
 lib/vhost/vhost.c      | 4 ----
 lib/vhost/vhost.h      | 6 ------
 lib/vhost/vhost_user.c | 2 --
 lib/vhost/vhost_user.h | 1 -
 8 files changed, 22 deletions(-)

diff --git a/lib/vhost/fd_man.c b/lib/vhost/fd_man.c
index 55d4856f9e..1876fada33 100644
--- a/lib/vhost/fd_man.c
+++ b/lib/vhost/fd_man.c
@@ -2,14 +2,8 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <stdint.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/types.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
diff --git a/lib/vhost/fd_man.h b/lib/vhost/fd_man.h
index 3ab5cfdd60..6f4499bdfa 100644
--- a/lib/vhost/fd_man.h
+++ b/lib/vhost/fd_man.h
@@ -4,7 +4,6 @@
 
 #ifndef _FD_MAN_H_
 #define _FD_MAN_H_
-#include <stdint.h>
 #include <pthread.h>
 #include <poll.h>
 
diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index 82963c1e6d..c22d84a2cb 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -8,7 +8,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/queue.h>
diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c
index 09ad5d866e..7c57b3f75b 100644
--- a/lib/vhost/vdpa.c
+++ b/lib/vhost/vdpa.c
@@ -8,7 +8,6 @@
  * Device specific vhost lib
  */
 
-#include <stdbool.h>
 #include <sys/queue.h>
 
 #include <rte_class.h>
diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
index 13a9bb9dd1..40703b882f 100644
--- a/lib/vhost/vhost.c
+++ b/lib/vhost/vhost.c
@@ -4,7 +4,6 @@
 
 #include <linux/vhost.h>
 #include <linux/virtio_net.h>
-#include <stddef.h>
 #include <stdint.h>
 #include <stdlib.h>
 #ifdef RTE_LIBRTE_VHOST_NUMA
@@ -13,13 +12,10 @@
 #endif
 
 #include <rte_errno.h>
-#include <rte_ethdev.h>
 #include <rte_log.h>
-#include <rte_string_fns.h>
 #include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_vhost.h>
-#include <rte_rwlock.h>
 
 #include "iotlb.h"
 #include "vhost.h"
diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
index 7085e0885c..9f9cf65f76 100644
--- a/lib/vhost/vhost.h
+++ b/lib/vhost/vhost.h
@@ -5,23 +5,17 @@
 #ifndef _VHOST_NET_CDEV_H_
 #define _VHOST_NET_CDEV_H_
 #include <stdint.h>
-#include <stdio.h>
 #include <stdbool.h>
-#include <sys/types.h>
 #include <sys/queue.h>
 #include <unistd.h>
-#include <linux/vhost.h>
 #include <linux/virtio_net.h>
-#include <sys/socket.h>
 #include <linux/if.h>
 
 #include <rte_log.h>
 #include <rte_ether.h>
-#include <rte_rwlock.h>
 #include <rte_malloc.h>
 
 #include "rte_vhost.h"
-#include "rte_vdpa.h"
 #include "vdpa_driver.h"
 
 #include "rte_vhost_async.h"
diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 5eb1dd6812..f8c216c453 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -27,10 +27,8 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/syscall.h>
-#include <assert.h>
 #ifdef RTE_LIBRTE_VHOST_NUMA
 #include <numaif.h>
 #endif
diff --git a/lib/vhost/vhost_user.h b/lib/vhost/vhost_user.h
index 16fe03f889..7d6d6ae125 100644
--- a/lib/vhost/vhost_user.h
+++ b/lib/vhost/vhost_user.h
@@ -6,7 +6,6 @@
 #define _VHOST_NET_USER_H
 
 #include <stdint.h>
-#include <linux/vhost.h>
 
 #include "rte_vhost.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 07/53] timer: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (5 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 06/53] vhost: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 08/53] table: " Sean Morrissey
                         ` (46 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Robert Sanford, Erik Gabriel Carrillo; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/timer/rte_timer.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/lib/timer/rte_timer.c b/lib/timer/rte_timer.c
index 6d19ce469b..b3f3e229f6 100644
--- a/lib/timer/rte_timer.c
+++ b/lib/timer/rte_timer.c
@@ -2,29 +2,22 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <stdbool.h>
-#include <inttypes.h>
 #include <assert.h>
 #include <sys/queue.h>
 
 #include <rte_common.h>
 #include <rte_cycles.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
 #include <rte_memory.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_branch_prediction.h>
 #include <rte_spinlock.h>
 #include <rte_random.h>
 #include <rte_pause.h>
 #include <rte_memzone.h>
-#include <rte_malloc.h>
-#include <rte_errno.h>
 
 #include "rte_timer.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 08/53] table: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (6 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 07/53] timer: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 09/53] stack: " Sean Morrissey
                         ` (45 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/table/rte_swx_table_em.c       | 1 -
 lib/table/rte_swx_table_em.h       | 1 -
 lib/table/rte_swx_table_learner.c  | 1 -
 lib/table/rte_swx_table_learner.h  | 1 -
 lib/table/rte_swx_table_selector.c | 1 -
 lib/table/rte_swx_table_wm.c       | 2 --
 lib/table/rte_swx_table_wm.h       | 1 -
 lib/table/rte_table_acl.c          | 3 ---
 lib/table/rte_table_array.c        | 2 --
 lib/table/rte_table_hash_cuckoo.c  | 2 --
 lib/table/rte_table_hash_ext.c     | 2 --
 lib/table/rte_table_hash_key16.c   | 2 --
 lib/table/rte_table_hash_key32.c   | 2 --
 lib/table/rte_table_hash_key8.c    | 2 --
 lib/table/rte_table_hash_lru.c     | 2 --
 lib/table/rte_table_lpm.c          | 2 --
 lib/table/rte_table_lpm_ipv6.c     | 3 ---
 lib/table/rte_table_stub.c         | 1 -
 lib/table/rte_table_stub.h         | 1 -
 19 files changed, 32 deletions(-)

diff --git a/lib/table/rte_swx_table_em.c b/lib/table/rte_swx_table_em.c
index 03b28c4c9d..f783cfe282 100644
--- a/lib/table/rte_swx_table_em.c
+++ b/lib/table/rte_swx_table_em.c
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2020 Intel Corporation
  */
-#include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/lib/table/rte_swx_table_em.h b/lib/table/rte_swx_table_em.h
index 909ada483b..b7423dd060 100644
--- a/lib/table/rte_swx_table_em.h
+++ b/lib/table/rte_swx_table_em.h
@@ -13,7 +13,6 @@ extern "C" {
  * RTE SWX Exact Match Table
  */
 
-#include <stdint.h>
 
 #include <rte_swx_table.h>
 
diff --git a/lib/table/rte_swx_table_learner.c b/lib/table/rte_swx_table_learner.c
index c3c840ff06..15576c2aa3 100644
--- a/lib/table/rte_swx_table_learner.c
+++ b/lib/table/rte_swx_table_learner.c
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2020 Intel Corporation
  */
-#include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/lib/table/rte_swx_table_learner.h b/lib/table/rte_swx_table_learner.h
index d6ec733655..eb9d7689fd 100644
--- a/lib/table/rte_swx_table_learner.h
+++ b/lib/table/rte_swx_table_learner.h
@@ -22,7 +22,6 @@ extern "C" {
  */
 
 #include <stdint.h>
-#include <sys/queue.h>
 
 #include <rte_compat.h>
 
diff --git a/lib/table/rte_swx_table_selector.c b/lib/table/rte_swx_table_selector.c
index 541ebc2213..ad99f18453 100644
--- a/lib/table/rte_swx_table_selector.c
+++ b/lib/table/rte_swx_table_selector.c
@@ -7,7 +7,6 @@
 #include <errno.h>
 
 #include <rte_common.h>
-#include <rte_prefetch.h>
 
 #include "rte_swx_table_selector.h"
 
diff --git a/lib/table/rte_swx_table_wm.c b/lib/table/rte_swx_table_wm.c
index e260be1062..27a67b47bd 100644
--- a/lib/table/rte_swx_table_wm.c
+++ b/lib/table/rte_swx_table_wm.c
@@ -4,10 +4,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_prefetch.h>
 #include <rte_cycles.h>
 #include <rte_acl.h>
 
diff --git a/lib/table/rte_swx_table_wm.h b/lib/table/rte_swx_table_wm.h
index 9e228f971c..4fd52c0a17 100644
--- a/lib/table/rte_swx_table_wm.h
+++ b/lib/table/rte_swx_table_wm.h
@@ -13,7 +13,6 @@ extern "C" {
  * RTE SWX Wildcard Match Table
  */
 
-#include <stdint.h>
 
 #include <rte_swx_table.h>
 
diff --git a/lib/table/rte_table_acl.c b/lib/table/rte_table_acl.c
index 14d54019f0..179a1da835 100644
--- a/lib/table/rte_table_acl.c
+++ b/lib/table/rte_table_acl.c
@@ -6,13 +6,10 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
 #include "rte_table_acl.h"
-#include <rte_ether.h>
 
 #ifdef RTE_TABLE_STATS_COLLECT
 
diff --git a/lib/table/rte_table_array.c b/lib/table/rte_table_array.c
index 8264c50c27..54a0c42f7d 100644
--- a/lib/table/rte_table_array.c
+++ b/lib/table/rte_table_array.c
@@ -6,8 +6,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_cuckoo.c b/lib/table/rte_table_hash_cuckoo.c
index f024303330..c77eccf527 100644
--- a/lib/table/rte_table_hash_cuckoo.c
+++ b/lib/table/rte_table_hash_cuckoo.c
@@ -5,8 +5,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_ext.c b/lib/table/rte_table_hash_ext.c
index 802a24fe0f..70ea84fa2e 100644
--- a/lib/table/rte_table_hash_ext.c
+++ b/lib/table/rte_table_hash_ext.c
@@ -6,8 +6,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_key16.c b/lib/table/rte_table_hash_key16.c
index c4384b114d..ea8195dc17 100644
--- a/lib/table/rte_table_hash_key16.c
+++ b/lib/table/rte_table_hash_key16.c
@@ -5,8 +5,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_key32.c b/lib/table/rte_table_hash_key32.c
index 3e0031fe1e..87f83ce6f5 100644
--- a/lib/table/rte_table_hash_key32.c
+++ b/lib/table/rte_table_hash_key32.c
@@ -5,8 +5,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_key8.c b/lib/table/rte_table_hash_key8.c
index 34e3ed1af9..7779a9d1a3 100644
--- a/lib/table/rte_table_hash_key8.c
+++ b/lib/table/rte_table_hash_key8.c
@@ -5,8 +5,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_lru.c b/lib/table/rte_table_hash_lru.c
index 5bcdb7ba02..c31acc11cf 100644
--- a/lib/table/rte_table_hash_lru.c
+++ b/lib/table/rte_table_hash_lru.c
@@ -6,8 +6,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_lpm.c b/lib/table/rte_table_lpm.c
index 4dd8289ce5..9de9e8a20d 100644
--- a/lib/table/rte_table_lpm.c
+++ b/lib/table/rte_table_lpm.c
@@ -6,8 +6,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_byteorder.h>
 #include <rte_log.h>
diff --git a/lib/table/rte_table_lpm_ipv6.c b/lib/table/rte_table_lpm_ipv6.c
index 4e068d79bf..8fde2c012f 100644
--- a/lib/table/rte_table_lpm_ipv6.c
+++ b/lib/table/rte_table_lpm_ipv6.c
@@ -6,10 +6,7 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
-#include <rte_byteorder.h>
 #include <rte_log.h>
 #include <rte_lpm6.h>
 
diff --git a/lib/table/rte_table_stub.c b/lib/table/rte_table_stub.c
index 9ce7be9cec..23d0de5c79 100644
--- a/lib/table/rte_table_stub.c
+++ b/lib/table/rte_table_stub.c
@@ -4,7 +4,6 @@
 
 #include <string.h>
 
-#include <rte_mbuf.h>
 #include <rte_malloc.h>
 
 #include "rte_table_stub.h"
diff --git a/lib/table/rte_table_stub.h b/lib/table/rte_table_stub.h
index 2b40739790..9086e4edcc 100644
--- a/lib/table/rte_table_stub.h
+++ b/lib/table/rte_table_stub.h
@@ -17,7 +17,6 @@ extern "C" {
  *
  ***/
 
-#include <stdint.h>
 
 #include "rte_table.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 09/53] stack: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (7 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 08/53] table: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 10/53] security: " Sean Morrissey
                         ` (44 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/stack/rte_stack.c | 2 --
 lib/stack/rte_stack.h | 1 -
 2 files changed, 3 deletions(-)

diff --git a/lib/stack/rte_stack.c b/lib/stack/rte_stack.c
index 56bf2c8d6d..1fabec2bfe 100644
--- a/lib/stack/rte_stack.c
+++ b/lib/stack/rte_stack.c
@@ -6,12 +6,10 @@
 #include <sys/queue.h>
 
 #include <rte_string_fns.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
 #include <rte_memzone.h>
-#include <rte_rwlock.h>
 #include <rte_tailq.h>
 
 #include "rte_stack.h"
diff --git a/lib/stack/rte_stack.h b/lib/stack/rte_stack.h
index 321f4cec1a..91fc570767 100644
--- a/lib/stack/rte_stack.h
+++ b/lib/stack/rte_stack.h
@@ -19,7 +19,6 @@
 extern "C" {
 #endif
 
-#include <rte_compat.h>
 #include <rte_debug.h>
 #include <rte_errno.h>
 #include <rte_memzone.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 10/53] security: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (8 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 09/53] stack: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 11/53] sched: " Sean Morrissey
                         ` (43 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Akhil Goyal, Declan Doherty; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/security/rte_security.c | 2 --
 lib/security/rte_security.h | 3 ---
 2 files changed, 5 deletions(-)

diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index 6e45a03fa0..4f5e4b4d49 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -5,10 +5,8 @@
  */
 
 #include <rte_cryptodev.h>
-#include <rte_malloc.h>
 #include <rte_dev.h>
 #include <rte_telemetry.h>
-#include "rte_compat.h"
 #include "rte_security.h"
 #include "rte_security_driver.h"
 
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 1228b6c8b1..d54d993ccc 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -23,10 +23,7 @@ extern "C" {
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_ip.h>
-#include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
-#include <rte_memory.h>
-#include <rte_mempool.h>
 
 /** IPSec protocol mode */
 enum rte_security_ipsec_sa_mode {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 11/53] sched: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (9 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 10/53] security: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 12/53] ring: " Sean Morrissey
                         ` (42 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Cristian Dumitrescu, Jasvinder Singh; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/sched/rte_pie.c   | 2 --
 lib/sched/rte_red.h   | 1 -
 lib/sched/rte_sched.c | 1 -
 lib/sched/rte_sched.h | 1 -
 4 files changed, 5 deletions(-)

diff --git a/lib/sched/rte_pie.c b/lib/sched/rte_pie.c
index 934e9aee50..cdb7bab697 100644
--- a/lib/sched/rte_pie.c
+++ b/lib/sched/rte_pie.c
@@ -5,8 +5,6 @@
 #include <stdlib.h>
 
 #include "rte_pie.h"
-#include <rte_common.h>
-#include <rte_cycles.h>
 #include <rte_malloc.h>
 
 #ifdef __INTEL_COMPILER
diff --git a/lib/sched/rte_red.h b/lib/sched/rte_red.h
index f5843dab1b..80b43b6da0 100644
--- a/lib/sched/rte_red.h
+++ b/lib/sched/rte_red.h
@@ -18,7 +18,6 @@ extern "C" {
 
 #include <stdint.h>
 #include <limits.h>
-#include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_cycles.h>
 #include <rte_branch_prediction.h>
diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c
index 62b3d2e315..e5c62e3d77 100644
--- a/lib/sched/rte_sched.c
+++ b/lib/sched/rte_sched.c
@@ -7,7 +7,6 @@
 
 #include <rte_common.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_cycles.h>
 #include <rte_prefetch.h>
diff --git a/lib/sched/rte_sched.h b/lib/sched/rte_sched.h
index 3c625ba169..5ece64e527 100644
--- a/lib/sched/rte_sched.h
+++ b/lib/sched/rte_sched.h
@@ -56,7 +56,6 @@ extern "C" {
  *
  */
 
-#include <sys/types.h>
 #include <rte_compat.h>
 #include <rte_mbuf.h>
 #include <rte_meter.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 12/53] ring: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (10 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 11/53] sched: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 13/53] rib: " Sean Morrissey
                         ` (41 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/ring/rte_ring.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
index bb95962b0c..7945e5d9ed 100644
--- a/lib/ring/rte_ring.c
+++ b/lib/ring/rte_ring.c
@@ -8,7 +8,6 @@
  */
 
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
 #include <stdint.h>
 #include <inttypes.h>
@@ -22,7 +21,6 @@
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
-#include <rte_spinlock.h>
 #include <rte_tailq.h>
 
 #include "rte_ring.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 13/53] rib: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (11 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 12/53] ring: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 14/53] reorder: " Sean Morrissey
                         ` (40 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Vladimir Medvedkin; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/rib/rte_rib.c  | 2 --
 lib/rib/rte_rib.h  | 1 -
 lib/rib/rte_rib6.c | 2 --
 lib/rib/rte_rib6.h | 1 -
 4 files changed, 6 deletions(-)

diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c
index 6c29e1c49a..cd9e823068 100644
--- a/lib/rib/rte_rib.c
+++ b/lib/rib/rte_rib.c
@@ -6,12 +6,10 @@
 #include <stdbool.h>
 #include <stdint.h>
 
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
 #include <rte_mempool.h>
-#include <rte_rwlock.h>
 #include <rte_string_fns.h>
 #include <rte_tailq.h>
 
diff --git a/lib/rib/rte_rib.h b/lib/rib/rte_rib.h
index bebb30f7d7..c18c4ca594 100644
--- a/lib/rib/rte_rib.h
+++ b/lib/rib/rte_rib.h
@@ -17,7 +17,6 @@
 #include <stdlib.h>
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c
index 70405113b4..042ac1f090 100644
--- a/lib/rib/rte_rib6.c
+++ b/lib/rib/rte_rib6.c
@@ -6,12 +6,10 @@
 #include <stdbool.h>
 #include <stdint.h>
 
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
 #include <rte_mempool.h>
-#include <rte_rwlock.h>
 #include <rte_string_fns.h>
 #include <rte_tailq.h>
 
diff --git a/lib/rib/rte_rib6.h b/lib/rib/rte_rib6.h
index 6f532265c6..fa8e9bf732 100644
--- a/lib/rib/rte_rib6.h
+++ b/lib/rib/rte_rib6.h
@@ -15,7 +15,6 @@
  */
 
 #include <rte_memcpy.h>
-#include <rte_compat.h>
 #include <rte_common.h>
 
 #ifdef __cplusplus
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 14/53] reorder: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (12 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 13/53] rib: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 15/53] regexdev: " Sean Morrissey
                         ` (39 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/reorder/rte_reorder.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
index 9445853b79..f40a48201f 100644
--- a/lib/reorder/rte_reorder.c
+++ b/lib/reorder/rte_reorder.c
@@ -2,7 +2,6 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <inttypes.h>
 #include <string.h>
 
 #include <rte_string_fns.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 15/53] regexdev: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (13 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 14/53] reorder: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-16  7:40         ` Ori Kam
  2022-01-14 16:23       ` [PATCH v4 16/53] rcu: " Sean Morrissey
                         ` (38 subsequent siblings)
  53 siblings, 1 reply; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Ori Kam; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/regexdev/rte_regexdev.c | 2 --
 lib/regexdev/rte_regexdev.h | 3 ---
 2 files changed, 5 deletions(-)

diff --git a/lib/regexdev/rte_regexdev.c b/lib/regexdev/rte_regexdev.c
index 04ab713730..02a388bc5d 100644
--- a/lib/regexdev/rte_regexdev.c
+++ b/lib/regexdev/rte_regexdev.c
@@ -5,8 +5,6 @@
 
 #include <string.h>
 
-#include <rte_memory.h>
-#include <rte_memcpy.h>
 #include <rte_memzone.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/regexdev/rte_regexdev.h b/lib/regexdev/rte_regexdev.h
index 0bac46cda9..4ba67b0c25 100644
--- a/lib/regexdev/rte_regexdev.h
+++ b/lib/regexdev/rte_regexdev.h
@@ -199,11 +199,8 @@ extern "C" {
 #endif
 
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_dev.h>
-#include <rte_errno.h>
 #include <rte_mbuf.h>
-#include <rte_memory.h>
 
 #define RTE_REGEXDEV_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 16/53] rcu: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (14 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 15/53] regexdev: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 17/53] rawdev: " Sean Morrissey
                         ` (37 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Honnappa Nagarahalli; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/rcu/rte_rcu_qsbr.c | 4 ----
 lib/rcu/rte_rcu_qsbr.h | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c
index 7510db2f81..17be93e830 100644
--- a/lib/rcu/rte_rcu_qsbr.c
+++ b/lib/rcu/rte_rcu_qsbr.c
@@ -13,10 +13,6 @@
 #include <rte_log.h>
 #include <rte_memory.h>
 #include <rte_malloc.h>
-#include <rte_eal.h>
-#include <rte_atomic.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_errno.h>
 #include <rte_ring_elem.h>
 
diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h
index 62a420a785..d81bf5e8db 100644
--- a/lib/rcu/rte_rcu_qsbr.h
+++ b/lib/rcu/rte_rcu_qsbr.h
@@ -32,11 +32,7 @@ extern "C" {
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <inttypes.h>
-#include <errno.h>
 #include <rte_common.h>
-#include <rte_memory.h>
-#include <rte_lcore.h>
 #include <rte_debug.h>
 #include <rte_atomic.h>
 #include <rte_ring.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 17/53] rawdev: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (15 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 16/53] rcu: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 18/53] power: " Sean Morrissey
                         ` (36 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Nipun Gupta, Hemant Agrawal; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/rawdev/rte_rawdev.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/lib/rawdev/rte_rawdev.c b/lib/rawdev/rte_rawdev.c
index a6134e76ea..2f0a4f132e 100644
--- a/lib/rawdev/rte_rawdev.c
+++ b/lib/rawdev/rte_rawdev.c
@@ -6,29 +6,15 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <stdint.h>
 #include <inttypes.h>
-#include <sys/types.h>
-#include <sys/queue.h>
 
 #include <rte_string_fns.h>
-#include <rte_byteorder.h>
 #include <rte_log.h>
-#include <rte_debug.h>
 #include <rte_dev.h>
-#include <rte_memory.h>
-#include <rte_memcpy.h>
-#include <rte_memzone.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_errno.h>
 #include <rte_telemetry.h>
 
 #include "rte_rawdev.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 18/53] power: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (16 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 17/53] rawdev: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 19/53] port: " Sean Morrissey
                         ` (35 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed. Also added rte_string_fns.h to example app
vm_power_manager for users without libbsd.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 examples/vm_power_manager/guest_cli/main.c | 1 +
 lib/power/guest_channel.c                  | 2 --
 lib/power/power_acpi_cpufreq.c             | 7 -------
 lib/power/power_acpi_cpufreq.h             | 4 ----
 lib/power/power_common.h                   | 1 -
 lib/power/power_cppc_cpufreq.c             | 1 -
 lib/power/power_cppc_cpufreq.h             | 4 ----
 lib/power/power_kvm_vm.c                   | 1 -
 lib/power/power_kvm_vm.h                   | 4 ----
 lib/power/power_pstate_cpufreq.c           | 7 -------
 lib/power/power_pstate_cpufreq.h           | 4 ----
 lib/power/rte_power.c                      | 1 -
 lib/power/rte_power.h                      | 2 --
 lib/power/rte_power_empty_poll.c           | 2 --
 14 files changed, 1 insertion(+), 40 deletions(-)

diff --git a/examples/vm_power_manager/guest_cli/main.c b/examples/vm_power_manager/guest_cli/main.c
index b8fa65ef15..9da50020ac 100644
--- a/examples/vm_power_manager/guest_cli/main.c
+++ b/examples/vm_power_manager/guest_cli/main.c
@@ -13,6 +13,7 @@
 #include <rte_debug.h>
 #include <rte_eal.h>
 #include <rte_log.h>
+#include <rte_string_fns.h>
 
 #include "vm_power_cli_guest.h"
 #include "parse.h"
diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c
index 474dd92998..969a9e5aaa 100644
--- a/lib/power/guest_channel.c
+++ b/lib/power/guest_channel.c
@@ -4,9 +4,7 @@
 
 #include <glob.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <unistd.h>
-#include <signal.h>
 #include <limits.h>
 #include <fcntl.h>
 #include <string.h>
diff --git a/lib/power/power_acpi_cpufreq.c b/lib/power/power_acpi_cpufreq.c
index 402ed8c99b..6e57aca535 100644
--- a/lib/power/power_acpi_cpufreq.c
+++ b/lib/power/power_acpi_cpufreq.c
@@ -3,17 +3,10 @@
  */
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <limits.h>
 
 #include <rte_memcpy.h>
-#include <rte_memory.h>
 #include <rte_string_fns.h>
 
 #include "power_acpi_cpufreq.h"
diff --git a/lib/power/power_acpi_cpufreq.h b/lib/power/power_acpi_cpufreq.h
index 41675b9cd9..682fd9278c 100644
--- a/lib/power/power_acpi_cpufreq.h
+++ b/lib/power/power_acpi_cpufreq.h
@@ -10,10 +10,6 @@
  * RTE Power Management via userspace ACPI cpufreq
  */
 
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_string_fns.h>
 #include "rte_power.h"
 
 /**
diff --git a/lib/power/power_common.h b/lib/power/power_common.h
index 0b264edfa5..c1c7139276 100644
--- a/lib/power/power_common.h
+++ b/lib/power/power_common.h
@@ -5,7 +5,6 @@
 #ifndef _POWER_COMMON_H_
 #define _POWER_COMMON_H_
 
-#include <inttypes.h>
 
 #include <rte_common.h>
 
diff --git a/lib/power/power_cppc_cpufreq.c b/lib/power/power_cppc_cpufreq.c
index 25185a791c..ef06fbcd9e 100644
--- a/lib/power/power_cppc_cpufreq.c
+++ b/lib/power/power_cppc_cpufreq.c
@@ -4,7 +4,6 @@
  */
 
 #include <rte_memcpy.h>
-#include <rte_memory.h>
 
 #include "power_cppc_cpufreq.h"
 #include "power_common.h"
diff --git a/lib/power/power_cppc_cpufreq.h b/lib/power/power_cppc_cpufreq.h
index 4e73c91b05..f4121b237e 100644
--- a/lib/power/power_cppc_cpufreq.h
+++ b/lib/power/power_cppc_cpufreq.h
@@ -11,10 +11,6 @@
  * RTE Power Management via userspace CPPC cpufreq
  */
 
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_string_fns.h>
 #include "rte_power.h"
 
 /**
diff --git a/lib/power/power_kvm_vm.c b/lib/power/power_kvm_vm.c
index ab7d4b8cee..6a8109d449 100644
--- a/lib/power/power_kvm_vm.c
+++ b/lib/power/power_kvm_vm.c
@@ -9,7 +9,6 @@
 #include "rte_power_guest_channel.h"
 #include "guest_channel.h"
 #include "power_kvm_vm.h"
-#include "power_common.h"
 
 #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent"
 
diff --git a/lib/power/power_kvm_vm.h b/lib/power/power_kvm_vm.h
index 9a309a300f..303fcc041b 100644
--- a/lib/power/power_kvm_vm.h
+++ b/lib/power/power_kvm_vm.h
@@ -10,10 +10,6 @@
  * RTE Power Management KVM VM
  */
 
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_string_fns.h>
 #include "rte_power.h"
 
 /**
diff --git a/lib/power/power_pstate_cpufreq.c b/lib/power/power_pstate_cpufreq.c
index 86f8a76e46..959eccffd8 100644
--- a/lib/power/power_pstate_cpufreq.c
+++ b/lib/power/power_pstate_cpufreq.c
@@ -3,20 +3,13 @@
  */
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
-#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <signal.h>
 #include <limits.h>
 #include <errno.h>
-#include <inttypes.h>
 
 #include <rte_memcpy.h>
-#include <rte_memory.h>
-#include <rte_string_fns.h>
 
 #include "power_pstate_cpufreq.h"
 #include "power_common.h"
diff --git a/lib/power/power_pstate_cpufreq.h b/lib/power/power_pstate_cpufreq.h
index 3260b32494..7bf64a518c 100644
--- a/lib/power/power_pstate_cpufreq.h
+++ b/lib/power/power_pstate_cpufreq.h
@@ -10,10 +10,6 @@
  * RTE Power Management via Intel Pstate driver
  */
 
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_string_fns.h>
 #include "rte_power.h"
 
 /**
diff --git a/lib/power/rte_power.c b/lib/power/rte_power.c
index 3cba56bac9..0a6614be77 100644
--- a/lib/power/rte_power.c
+++ b/lib/power/rte_power.c
@@ -10,7 +10,6 @@
 #include "power_cppc_cpufreq.h"
 #include "power_kvm_vm.h"
 #include "power_pstate_cpufreq.h"
-#include "power_common.h"
 
 enum power_management_env global_default_env = PM_ENV_NOT_SET;
 
diff --git a/lib/power/rte_power.h b/lib/power/rte_power.h
index c5759afa39..47345e26df 100644
--- a/lib/power/rte_power.h
+++ b/lib/power/rte_power.h
@@ -11,9 +11,7 @@
  */
 
 #include <rte_common.h>
-#include <rte_byteorder.h>
 #include <rte_log.h>
-#include <rte_string_fns.h>
 #include <rte_power_guest_channel.h>
 
 #ifdef __cplusplus
diff --git a/lib/power/rte_power_empty_poll.c b/lib/power/rte_power_empty_poll.c
index c4b5de9601..dca88555aa 100644
--- a/lib/power/rte_power_empty_poll.c
+++ b/lib/power/rte_power_empty_poll.c
@@ -5,8 +5,6 @@
 #include <string.h>
 
 #include <rte_lcore.h>
-#include <rte_cycles.h>
-#include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <inttypes.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 19/53] port: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (17 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 18/53] power: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 20/53] pipeline: " Sean Morrissey
                         ` (34 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/port/rte_port_fd.h          | 1 -
 lib/port/rte_port_frag.c        | 2 --
 lib/port/rte_port_frag.h        | 1 -
 lib/port/rte_port_kni.c         | 1 -
 lib/port/rte_port_kni.h         | 1 -
 lib/port/rte_port_ras.c         | 1 -
 lib/port/rte_port_ras.h         | 1 -
 lib/port/rte_port_ring.h        | 1 -
 lib/port/rte_port_sched.c       | 1 -
 lib/port/rte_port_source_sink.c | 1 -
 lib/port/rte_swx_port_fd.c      | 1 -
 lib/port/rte_swx_port_fd.h      | 1 -
 lib/port/rte_swx_port_ring.h    | 1 -
 13 files changed, 14 deletions(-)

diff --git a/lib/port/rte_port_fd.h b/lib/port/rte_port_fd.h
index e7620ef522..c8cfd9765a 100644
--- a/lib/port/rte_port_fd.h
+++ b/lib/port/rte_port_fd.h
@@ -20,7 +20,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_mempool.h>
 #include "rte_port.h"
 
 /** fd_reader port parameters */
diff --git a/lib/port/rte_port_frag.c b/lib/port/rte_port_frag.c
index 8a803fda11..e1f1892176 100644
--- a/lib/port/rte_port_frag.c
+++ b/lib/port/rte_port_frag.c
@@ -3,9 +3,7 @@
  */
 #include <string.h>
 
-#include <rte_ether.h>
 #include <rte_ip_frag.h>
-#include <rte_memory.h>
 
 #include "rte_port_frag.h"
 
diff --git a/lib/port/rte_port_frag.h b/lib/port/rte_port_frag.h
index 74321e4c4c..07060297f6 100644
--- a/lib/port/rte_port_frag.h
+++ b/lib/port/rte_port_frag.h
@@ -29,7 +29,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_ring.h>
 
 #include "rte_port.h"
 
diff --git a/lib/port/rte_port_kni.c b/lib/port/rte_port_kni.c
index 7b370f980a..1c7a6cb200 100644
--- a/lib/port/rte_port_kni.c
+++ b/lib/port/rte_port_kni.c
@@ -4,7 +4,6 @@
  */
 #include <string.h>
 
-#include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_kni.h>
 
diff --git a/lib/port/rte_port_kni.h b/lib/port/rte_port_kni.h
index 9d318af17e..35c6253806 100644
--- a/lib/port/rte_port_kni.h
+++ b/lib/port/rte_port_kni.h
@@ -21,7 +21,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_kni.h>
 
 #include "rte_port.h"
 
diff --git a/lib/port/rte_port_ras.c b/lib/port/rte_port_ras.c
index 8508814bb2..e5de57da42 100644
--- a/lib/port/rte_port_ras.c
+++ b/lib/port/rte_port_ras.c
@@ -3,7 +3,6 @@
  */
 #include <string.h>
 
-#include <rte_ether.h>
 #include <rte_ip_frag.h>
 #include <rte_cycles.h>
 #include <rte_log.h>
diff --git a/lib/port/rte_port_ras.h b/lib/port/rte_port_ras.h
index fa5accdc71..ee1d8ae21e 100644
--- a/lib/port/rte_port_ras.h
+++ b/lib/port/rte_port_ras.h
@@ -30,7 +30,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_ring.h>
 
 #include "rte_port.h"
 
diff --git a/lib/port/rte_port_ring.h b/lib/port/rte_port_ring.h
index c4f34e22fe..ba609b3436 100644
--- a/lib/port/rte_port_ring.h
+++ b/lib/port/rte_port_ring.h
@@ -26,7 +26,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_ring.h>
 
 #include "rte_port.h"
 
diff --git a/lib/port/rte_port_sched.c b/lib/port/rte_port_sched.c
index 1209fc121b..8a7d815ef3 100644
--- a/lib/port/rte_port_sched.c
+++ b/lib/port/rte_port_sched.c
@@ -3,7 +3,6 @@
  */
 #include <string.h>
 
-#include <rte_mbuf.h>
 #include <rte_malloc.h>
 
 #include "rte_port_sched.h"
diff --git a/lib/port/rte_port_source_sink.c b/lib/port/rte_port_source_sink.c
index 68575c9833..4928a5f706 100644
--- a/lib/port/rte_port_source_sink.c
+++ b/lib/port/rte_port_source_sink.c
@@ -5,7 +5,6 @@
 #include <string.h>
 
 #include <rte_mbuf.h>
-#include <rte_mempool.h>
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
 
diff --git a/lib/port/rte_swx_port_fd.c b/lib/port/rte_swx_port_fd.c
index aa7315a15a..51bcd3bb7b 100644
--- a/lib/port/rte_swx_port_fd.c
+++ b/lib/port/rte_swx_port_fd.c
@@ -6,7 +6,6 @@
 #include <unistd.h>
 
 #include <rte_mbuf.h>
-#include <rte_malloc.h>
 #include <rte_hexdump.h>
 
 #include "rte_swx_port_fd.h"
diff --git a/lib/port/rte_swx_port_fd.h b/lib/port/rte_swx_port_fd.h
index ecf3349f5f..c1a9200a4f 100644
--- a/lib/port/rte_swx_port_fd.h
+++ b/lib/port/rte_swx_port_fd.h
@@ -16,7 +16,6 @@ extern "C" {
  ***/
 #include <stdint.h>
 
-#include <rte_mempool.h>
 
 #include "rte_swx_port.h"
 
diff --git a/lib/port/rte_swx_port_ring.h b/lib/port/rte_swx_port_ring.h
index 859981f277..dc0ef9247c 100644
--- a/lib/port/rte_swx_port_ring.h
+++ b/lib/port/rte_swx_port_ring.h
@@ -16,7 +16,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_ring.h>
 
 #include "rte_swx_port.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 20/53] pipeline: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (18 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 19/53] port: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 21/53] pdump: " Sean Morrissey
                         ` (33 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/pipeline/rte_pipeline.c          | 4 ----
 lib/pipeline/rte_port_in_action.c    | 2 --
 lib/pipeline/rte_swx_ctl.h           | 2 --
 lib/pipeline/rte_swx_pipeline.c      | 1 -
 lib/pipeline/rte_swx_pipeline.h      | 1 -
 lib/pipeline/rte_swx_pipeline_spec.c | 1 -
 lib/pipeline/rte_table_action.c      | 2 --
 7 files changed, 13 deletions(-)

diff --git a/lib/pipeline/rte_pipeline.c b/lib/pipeline/rte_pipeline.c
index f5f397d292..ff86c7cf96 100644
--- a/lib/pipeline/rte_pipeline.c
+++ b/lib/pipeline/rte_pipeline.c
@@ -6,10 +6,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_memory.h>
-#include <rte_cycles.h>
-#include <rte_prefetch.h>
-#include <rte_branch_prediction.h>
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
 #include <rte_string_fns.h>
diff --git a/lib/pipeline/rte_port_in_action.c b/lib/pipeline/rte_port_in_action.c
index e3b00df8d2..5818973250 100644
--- a/lib/pipeline/rte_port_in_action.c
+++ b/lib/pipeline/rte_port_in_action.c
@@ -6,9 +6,7 @@
 #include <string.h>
 
 #include <rte_common.h>
-#include <rte_byteorder.h>
 #include <rte_malloc.h>
-#include <rte_memcpy.h>
 
 #include "rte_port_in_action.h"
 
diff --git a/lib/pipeline/rte_swx_ctl.h b/lib/pipeline/rte_swx_ctl.h
index 82e62e70a7..ed752ad5eb 100644
--- a/lib/pipeline/rte_swx_ctl.h
+++ b/lib/pipeline/rte_swx_ctl.h
@@ -13,7 +13,6 @@ extern "C" {
  * RTE SWX Pipeline Control
  */
 
-#include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
 
@@ -22,7 +21,6 @@ extern "C" {
 
 #include "rte_swx_port.h"
 #include "rte_swx_table.h"
-#include "rte_swx_table_selector.h"
 
 struct rte_swx_pipeline;
 
diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c
index 2145ca0a42..b39139edb8 100644
--- a/lib/pipeline/rte_swx_pipeline.c
+++ b/lib/pipeline/rte_swx_pipeline.c
@@ -4,7 +4,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <errno.h>
-#include <arpa/inet.h>
 #include <dlfcn.h>
 
 #include "rte_swx_pipeline_internal.h"
diff --git a/lib/pipeline/rte_swx_pipeline.h b/lib/pipeline/rte_swx_pipeline.h
index 77141bd341..430e458335 100644
--- a/lib/pipeline/rte_swx_pipeline.h
+++ b/lib/pipeline/rte_swx_pipeline.h
@@ -13,7 +13,6 @@ extern "C" {
  * RTE SWX Pipeline
  */
 
-#include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
 
diff --git a/lib/pipeline/rte_swx_pipeline_spec.c b/lib/pipeline/rte_swx_pipeline_spec.c
index 07a7580ac8..8165a046ea 100644
--- a/lib/pipeline/rte_swx_pipeline_spec.c
+++ b/lib/pipeline/rte_swx_pipeline_spec.c
@@ -8,7 +8,6 @@
 #include <errno.h>
 
 #include "rte_swx_pipeline.h"
-#include "rte_swx_ctl.h"
 
 #define MAX_LINE_LENGTH RTE_SWX_INSTRUCTION_SIZE
 #define MAX_TOKENS RTE_SWX_INSTRUCTION_TOKENS_MAX
diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_action.c
index ebab2444d3..b1310be565 100644
--- a/lib/pipeline/rte_table_action.c
+++ b/lib/pipeline/rte_table_action.c
@@ -11,12 +11,10 @@
 #include <rte_memcpy.h>
 #include <rte_ether.h>
 #include <rte_ip.h>
-#include <rte_esp.h>
 #include <rte_tcp.h>
 #include <rte_udp.h>
 #include <rte_vxlan.h>
 #include <rte_cryptodev.h>
-#include <cryptodev_pmd.h>
 
 #include "rte_table_action.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 21/53] pdump: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (19 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 20/53] pipeline: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 22/53] pci: " Sean Morrissey
                         ` (32 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Reshma Pattan, Stephen Hemminger; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/pdump/rte_pdump.c | 1 -
 lib/pdump/rte_pdump.h | 2 --
 2 files changed, 3 deletions(-)

diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index af450695ec..b3a62df591 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -2,7 +2,6 @@
  * Copyright(c) 2016-2018 Intel Corporation
  */
 
-#include <rte_memcpy.h>
 #include <rte_mbuf.h>
 #include <rte_ethdev.h>
 #include <rte_lcore.h>
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6efa0274f2..41c4b7800b 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -13,8 +13,6 @@
  */
 
 #include <stdint.h>
-#include <rte_mempool.h>
-#include <rte_ring.h>
 #include <rte_bpf.h>
 
 #ifdef __cplusplus
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 22/53] pci: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (20 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 21/53] pdump: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 23/53] pcapng: " Sean Morrissey
                         ` (31 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Gaetan Rivet; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/pci/rte_pci.c | 15 +--------------
 lib/pci/rte_pci.h |  2 --
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/lib/pci/rte_pci.c b/lib/pci/rte_pci.c
index c91be8b167..355772ff56 100644
--- a/lib/pci/rte_pci.c
+++ b/lib/pci/rte_pci.c
@@ -3,23 +3,10 @@
  * Copyright 2013-2014 6WIND S.A.
  */
 
-#include <string.h>
-#include <inttypes.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <sys/queue.h>
-
-#include <rte_errno.h>
-#include <rte_interrupts.h>
-#include <rte_log.h>
-#include <rte_bus.h>
-#include <rte_eal_paging.h>
-#include <rte_per_lcore.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_string_fns.h>
-#include <rte_common.h>
+
 #include <rte_debug.h>
 
 #include "rte_pci.h"
diff --git a/lib/pci/rte_pci.h b/lib/pci/rte_pci.h
index 71cbd441c7..a096946260 100644
--- a/lib/pci/rte_pci.h
+++ b/lib/pci/rte_pci.h
@@ -17,9 +17,7 @@ extern "C" {
 #endif
 
 #include <stdio.h>
-#include <limits.h>
 #include <inttypes.h>
-#include <sys/types.h>
 
 /*
  * Conventional PCI and PCI-X Mode 1 devices have 256 bytes of
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 23/53] pcapng: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (21 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 22/53] pci: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 24/53] node: " Sean Morrissey
                         ` (30 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Reshma Pattan, Stephen Hemminger; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/pcapng/rte_pcapng.c | 1 -
 lib/pcapng/rte_pcapng.h | 2 --
 2 files changed, 3 deletions(-)

diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index 03edabe73e..5ae96a5bc9 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -8,7 +8,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/uio.h>
-#include <sys/utsname.h>
 #include <time.h>
 #include <unistd.h>
 
diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
index 8d3fbb1941..7d2697c647 100644
--- a/lib/pcapng/rte_pcapng.h
+++ b/lib/pcapng/rte_pcapng.h
@@ -26,9 +26,7 @@
 #include <stdint.h>
 #include <sys/types.h>
 #include <rte_compat.h>
-#include <rte_common.h>
 #include <rte_mempool.h>
-#include <rte_ring.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 24/53] node: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (22 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 23/53] pcapng: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 25/53] net: " Sean Morrissey
                         ` (29 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Nithin Dabilpuram, Pavan Nikhilesh; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/node/ethdev_ctrl.c | 2 --
 lib/node/ethdev_rx.c   | 1 -
 lib/node/ethdev_tx.c   | 1 -
 lib/node/ip4_lookup.c  | 5 -----
 lib/node/ip4_rewrite.c | 4 ----
 lib/node/pkt_cls.c     | 4 ----
 lib/node/pkt_drop.c    | 1 -
 7 files changed, 18 deletions(-)

diff --git a/lib/node/ethdev_ctrl.c b/lib/node/ethdev_ctrl.c
index 13b8b705f0..5294607619 100644
--- a/lib/node/ethdev_ctrl.c
+++ b/lib/node/ethdev_ctrl.c
@@ -2,9 +2,7 @@
  * Copyright(C) 2020 Marvell International Ltd.
  */
 
-#include <rte_debug.h>
 #include <rte_ethdev.h>
-#include <rte_ether.h>
 #include <rte_graph.h>
 
 #include "rte_node_eth_api.h"
diff --git a/lib/node/ethdev_rx.c b/lib/node/ethdev_rx.c
index 4c23961505..a19237b42f 100644
--- a/lib/node/ethdev_rx.c
+++ b/lib/node/ethdev_rx.c
@@ -7,7 +7,6 @@
 #include <rte_ether.h>
 #include <rte_graph.h>
 #include <rte_graph_worker.h>
-#include <rte_mbuf.h>
 
 #include "ethdev_rx_priv.h"
 #include "node_private.h"
diff --git a/lib/node/ethdev_tx.c b/lib/node/ethdev_tx.c
index 075149089f..7d2d72f823 100644
--- a/lib/node/ethdev_tx.c
+++ b/lib/node/ethdev_tx.c
@@ -6,7 +6,6 @@
 #include <rte_ethdev.h>
 #include <rte_graph.h>
 #include <rte_graph_worker.h>
-#include <rte_mbuf.h>
 
 #include "ethdev_tx_priv.h"
 
diff --git a/lib/node/ip4_lookup.c b/lib/node/ip4_lookup.c
index d083a725fc..8bce03d7db 100644
--- a/lib/node/ip4_lookup.c
+++ b/lib/node/ip4_lookup.c
@@ -5,17 +5,12 @@
 #include <arpa/inet.h>
 #include <sys/socket.h>
 
-#include <rte_debug.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_graph.h>
 #include <rte_graph_worker.h>
 #include <rte_ip.h>
 #include <rte_lpm.h>
-#include <rte_mbuf.h>
-#include <rte_tcp.h>
-#include <rte_udp.h>
-#include <rte_vect.h>
 
 #include "rte_node_ip4_api.h"
 
diff --git a/lib/node/ip4_rewrite.c b/lib/node/ip4_rewrite.c
index 99ecb457ff..34a920df5e 100644
--- a/lib/node/ip4_rewrite.c
+++ b/lib/node/ip4_rewrite.c
@@ -2,16 +2,12 @@
  * Copyright(C) 2020 Marvell International Ltd.
  */
 
-#include <rte_debug.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_graph.h>
 #include <rte_graph_worker.h>
 #include <rte_ip.h>
 #include <rte_malloc.h>
-#include <rte_mbuf.h>
-#include <rte_tcp.h>
-#include <rte_udp.h>
 #include <rte_vect.h>
 
 #include "rte_node_ip4_api.h"
diff --git a/lib/node/pkt_cls.c b/lib/node/pkt_cls.c
index b95454dd72..3e75f2cf78 100644
--- a/lib/node/pkt_cls.c
+++ b/lib/node/pkt_cls.c
@@ -2,10 +2,6 @@
  * Copyright (C) 2020 Marvell.
  */
 
-#include <rte_debug.h>
-#include <rte_ether.h>
-#include <rte_ethdev.h>
-#include <rte_mbuf.h>
 #include <rte_graph.h>
 #include <rte_graph_worker.h>
 
diff --git a/lib/node/pkt_drop.c b/lib/node/pkt_drop.c
index c350013236..1ad7fccd28 100644
--- a/lib/node/pkt_drop.c
+++ b/lib/node/pkt_drop.c
@@ -2,7 +2,6 @@
  * Copyright(C) 2020 Marvell International Ltd.
  */
 
-#include <rte_debug.h>
 #include <rte_graph.h>
 #include <rte_mbuf.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 25/53] net: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (23 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 24/53] node: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 26/53] metrics: " Sean Morrissey
                         ` (28 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Jasvinder Singh, Bruce Richardson, Konstantin Ananyev, Olivier Matz
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/net/net_crc_avx512.c | 3 ---
 lib/net/net_crc_sse.c    | 1 -
 lib/net/rte_arp.c        | 1 -
 lib/net/rte_ether.h      | 1 -
 lib/net/rte_net.h        | 1 -
 lib/net/rte_net_crc.c    | 2 --
 6 files changed, 9 deletions(-)

diff --git a/lib/net/net_crc_avx512.c b/lib/net/net_crc_avx512.c
index 3740fe3c9d..f6a3ce9bcd 100644
--- a/lib/net/net_crc_avx512.c
+++ b/lib/net/net_crc_avx512.c
@@ -2,11 +2,8 @@
  * Copyright(c) 2020 Intel Corporation
  */
 
-#include <string.h>
 
 #include <rte_common.h>
-#include <rte_branch_prediction.h>
-#include <rte_cpuflags.h>
 
 #include "net_crc.h"
 
diff --git a/lib/net/net_crc_sse.c b/lib/net/net_crc_sse.c
index 053b54b390..dd75845636 100644
--- a/lib/net/net_crc_sse.c
+++ b/lib/net/net_crc_sse.c
@@ -6,7 +6,6 @@
 
 #include <rte_common.h>
 #include <rte_branch_prediction.h>
-#include <rte_cpuflags.h>
 
 #include "net_crc.h"
 
diff --git a/lib/net/rte_arp.c b/lib/net/rte_arp.c
index 9f7eb6b375..22af519586 100644
--- a/lib/net/rte_arp.c
+++ b/lib/net/rte_arp.c
@@ -3,7 +3,6 @@
  */
 
 #include <rte_arp.h>
-#include <rte_byteorder.h>
 
 #define RARP_PKT_SIZE	64
 struct rte_mbuf *
diff --git a/lib/net/rte_ether.h b/lib/net/rte_ether.h
index 3d9852d9e2..bf8a55ba06 100644
--- a/lib/net/rte_ether.h
+++ b/lib/net/rte_ether.h
@@ -18,7 +18,6 @@ extern "C" {
 #include <stdint.h>
 #include <stdio.h>
 
-#include <rte_memcpy.h>
 #include <rte_random.h>
 #include <rte_mbuf.h>
 #include <rte_byteorder.h>
diff --git a/lib/net/rte_net.h b/lib/net/rte_net.h
index 53a7f4d360..56611fc8f9 100644
--- a/lib/net/rte_net.h
+++ b/lib/net/rte_net.h
@@ -12,7 +12,6 @@ extern "C" {
 #include <rte_ip.h>
 #include <rte_udp.h>
 #include <rte_tcp.h>
-#include <rte_sctp.h>
 
 /**
  * Structure containing header lengths associated to a packet, filled
diff --git a/lib/net/rte_net_crc.c b/lib/net/rte_net_crc.c
index d9a526ab7b..a685f9e7bb 100644
--- a/lib/net/rte_net_crc.c
+++ b/lib/net/rte_net_crc.c
@@ -3,13 +3,11 @@
  */
 
 #include <stddef.h>
-#include <string.h>
 #include <stdint.h>
 
 #include <rte_cpuflags.h>
 #include <rte_common.h>
 #include <rte_net_crc.h>
-#include <rte_eal.h>
 #include <rte_log.h>
 #include <rte_vect.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 26/53] metrics: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (24 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 25/53] net: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 27/53] mempool: " Sean Morrissey
                         ` (27 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/metrics/rte_metrics.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/metrics/rte_metrics.c b/lib/metrics/rte_metrics.c
index e2a0fbeda8..0c7878e65f 100644
--- a/lib/metrics/rte_metrics.c
+++ b/lib/metrics/rte_metrics.c
@@ -3,13 +3,10 @@
  */
 
 #include <string.h>
-#include <sys/queue.h>
 
 #include <rte_common.h>
 #include <rte_string_fns.h>
-#include <rte_malloc.h>
 #include <rte_metrics.h>
-#include <rte_lcore.h>
 #include <rte_memzone.h>
 #include <rte_spinlock.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 27/53] mempool: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (25 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 26/53] metrics: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 28/53] member: " Sean Morrissey
                         ` (26 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Olivier Matz, Andrew Rybchenko; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/mempool/rte_mempool.c | 7 -------
 lib/mempool/rte_mempool.h | 4 ----
 2 files changed, 11 deletions(-)

diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index c5a699b1d6..de59009baf 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -7,7 +7,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <inttypes.h>
 #include <errno.h>
@@ -19,16 +18,10 @@
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_malloc.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
-#include <rte_spinlock.h>
 #include <rte_tailq.h>
 #include <rte_eal_paging.h>
 #include <rte_telemetry.h>
diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index 1e7a3c1527..5f9f9ead9b 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -34,17 +34,13 @@
  */
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdint.h>
-#include <errno.h>
 #include <inttypes.h>
 
 #include <rte_config.h>
 #include <rte_spinlock.h>
-#include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_lcore.h>
-#include <rte_memory.h>
 #include <rte_branch_prediction.h>
 #include <rte_ring.h>
 #include <rte_memcpy.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 28/53] member: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (26 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 27/53] mempool: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 29/53] mbuf: " Sean Morrissey
                         ` (25 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Yipeng Wang, Sameh Gobriel; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/member/rte_member.c     | 2 --
 lib/member/rte_member.h     | 1 -
 lib/member/rte_member_vbf.c | 1 -
 3 files changed, 4 deletions(-)

diff --git a/lib/member/rte_member.c b/lib/member/rte_member.c
index 9dd55a5adf..7e1632e6b5 100644
--- a/lib/member/rte_member.c
+++ b/lib/member/rte_member.c
@@ -5,9 +5,7 @@
 #include <string.h>
 
 #include <rte_string_fns.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_errno.h>
 #include <rte_tailq.h>
diff --git a/lib/member/rte_member.h b/lib/member/rte_member.h
index c0689e233e..567ee0c84b 100644
--- a/lib/member/rte_member.h
+++ b/lib/member/rte_member.h
@@ -52,7 +52,6 @@ extern "C" {
 #include <stdint.h>
 
 #include <rte_common.h>
-#include <rte_config.h>
 
 /** The set ID type that stored internally in hash table based set summary. */
 typedef uint16_t member_set_t;
diff --git a/lib/member/rte_member_vbf.c b/lib/member/rte_member_vbf.c
index 8a232bae02..9df4620cff 100644
--- a/lib/member/rte_member_vbf.c
+++ b/lib/member/rte_member_vbf.c
@@ -6,7 +6,6 @@
 #include <string.h>
 
 #include <rte_malloc.h>
-#include <rte_memory.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 29/53] mbuf: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (27 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 28/53] member: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 30/53] lpm: " Sean Morrissey
                         ` (24 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/mbuf/rte_mbuf.c          | 11 -----------
 lib/mbuf/rte_mbuf.h          |  2 --
 lib/mbuf/rte_mbuf_dyn.h      |  2 --
 lib/mbuf/rte_mbuf_pool_ops.c |  1 -
 lib/mbuf/rte_mbuf_pool_ops.h |  1 -
 5 files changed, 17 deletions(-)

diff --git a/lib/mbuf/rte_mbuf.c b/lib/mbuf/rte_mbuf.c
index 604d77bbda..87592faccb 100644
--- a/lib/mbuf/rte_mbuf.c
+++ b/lib/mbuf/rte_mbuf.c
@@ -5,28 +5,17 @@
 
 #include <string.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdint.h>
-#include <stdarg.h>
 #include <inttypes.h>
 #include <errno.h>
-#include <ctype.h>
-#include <sys/queue.h>
 
-#include <rte_compat.h>
 #include <rte_debug.h>
 #include <rte_common.h>
 #include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_branch_prediction.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_pool_ops.h>
-#include <rte_string_fns.h>
 #include <rte_hexdump.h>
 #include <rte_errno.h>
 #include <rte_memcpy.h>
diff --git a/lib/mbuf/rte_mbuf.h b/lib/mbuf/rte_mbuf.h
index dedf83c38d..9811e8c760 100644
--- a/lib/mbuf/rte_mbuf.h
+++ b/lib/mbuf/rte_mbuf.h
@@ -36,10 +36,8 @@
 #include <rte_common.h>
 #include <rte_config.h>
 #include <rte_mempool.h>
-#include <rte_memory.h>
 #include <rte_prefetch.h>
 #include <rte_branch_prediction.h>
-#include <rte_byteorder.h>
 #include <rte_mbuf_ptype.h>
 #include <rte_mbuf_core.h>
 
diff --git a/lib/mbuf/rte_mbuf_dyn.h b/lib/mbuf/rte_mbuf_dyn.h
index 29abe8da53..ed8e57b350 100644
--- a/lib/mbuf/rte_mbuf_dyn.h
+++ b/lib/mbuf/rte_mbuf_dyn.h
@@ -68,9 +68,7 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <sys/types.h>
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/mbuf/rte_mbuf_pool_ops.c b/lib/mbuf/rte_mbuf_pool_ops.c
index f0e87a1412..4c91f4ce85 100644
--- a/lib/mbuf/rte_mbuf_pool_ops.c
+++ b/lib/mbuf/rte_mbuf_pool_ops.c
@@ -3,7 +3,6 @@
  */
 
 #include <string.h>
-#include <rte_compat.h>
 #include <rte_eal.h>
 #include <rte_mbuf.h>
 #include <rte_errno.h>
diff --git a/lib/mbuf/rte_mbuf_pool_ops.h b/lib/mbuf/rte_mbuf_pool_ops.h
index 7ed95a49a4..00cddb83ba 100644
--- a/lib/mbuf/rte_mbuf_pool_ops.h
+++ b/lib/mbuf/rte_mbuf_pool_ops.h
@@ -14,7 +14,6 @@
  * the best mempool ops available.
  */
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 30/53] lpm: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (28 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 29/53] mbuf: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 31/53] latencystats: " Sean Morrissey
                         ` (23 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Bruce Richardson, Vladimir Medvedkin; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/lpm/rte_lpm.c  | 7 -------
 lib/lpm/rte_lpm.h  | 4 ----
 lib/lpm/rte_lpm6.c | 7 -------
 lib/lpm/rte_lpm6.h | 1 -
 4 files changed, 19 deletions(-)

diff --git a/lib/lpm/rte_lpm.c b/lib/lpm/rte_lpm.c
index 002811f4de..cdcd1b7f9e 100644
--- a/lib/lpm/rte_lpm.c
+++ b/lib/lpm/rte_lpm.c
@@ -6,22 +6,15 @@
 #include <string.h>
 #include <stdint.h>
 #include <errno.h>
-#include <stdarg.h>
 #include <stdio.h>
 #include <sys/queue.h>
 
 #include <rte_log.h>
-#include <rte_branch_prediction.h>
 #include <rte_common.h>
-#include <rte_memory.h>        /* for definition of RTE_CACHE_LINE_SIZE */
 #include <rte_malloc.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
 #include <rte_string_fns.h>
 #include <rte_errno.h>
-#include <rte_rwlock.h>
-#include <rte_spinlock.h>
 #include <rte_tailq.h>
 
 #include "rte_lpm.h"
diff --git a/lib/lpm/rte_lpm.h b/lib/lpm/rte_lpm.h
index 5eb14c1748..eb91960e81 100644
--- a/lib/lpm/rte_lpm.h
+++ b/lib/lpm/rte_lpm.h
@@ -12,13 +12,9 @@
  */
 
 #include <errno.h>
-#include <sys/queue.h>
 #include <stdint.h>
-#include <stdlib.h>
 #include <rte_branch_prediction.h>
 #include <rte_byteorder.h>
-#include <rte_config.h>
-#include <rte_memory.h>
 #include <rte_common.h>
 #include <rte_vect.h>
 #include <rte_rcu_qsbr.h>
diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c
index 73768fc956..8d21aeddb8 100644
--- a/lib/lpm/rte_lpm6.c
+++ b/lib/lpm/rte_lpm6.c
@@ -4,23 +4,16 @@
 #include <string.h>
 #include <stdint.h>
 #include <errno.h>
-#include <stdarg.h>
 #include <stdio.h>
 #include <sys/queue.h>
 
 #include <rte_log.h>
-#include <rte_branch_prediction.h>
 #include <rte_common.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
 #include <rte_string_fns.h>
 #include <rte_errno.h>
-#include <rte_rwlock.h>
-#include <rte_spinlock.h>
 #include <rte_hash.h>
 #include <assert.h>
 #include <rte_jhash.h>
diff --git a/lib/lpm/rte_lpm6.h b/lib/lpm/rte_lpm6.h
index f96f3372e5..9b07260d5a 100644
--- a/lib/lpm/rte_lpm6.h
+++ b/lib/lpm/rte_lpm6.h
@@ -10,7 +10,6 @@
  */
 
 #include <stdint.h>
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 31/53] latencystats: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (29 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 30/53] lpm: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 32/53] kvargs: " Sean Morrissey
                         ` (22 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/latencystats/rte_latencystats.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/lib/latencystats/rte_latencystats.c b/lib/latencystats/rte_latencystats.c
index ab8db7a139..8985a377db 100644
--- a/lib/latencystats/rte_latencystats.c
+++ b/lib/latencystats/rte_latencystats.c
@@ -2,13 +2,9 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <unistd.h>
-#include <sys/types.h>
-#include <stdbool.h>
 #include <math.h>
 
 #include <rte_string_fns.h>
-#include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 32/53] kvargs: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (30 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 31/53] latencystats: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 33/53] kni: " Sean Morrissey
                         ` (21 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/kvargs/rte_kvargs.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
index 7010d3ac51..9a59c500bf 100644
--- a/lib/kvargs/rte_kvargs.c
+++ b/lib/kvargs/rte_kvargs.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <stdbool.h>
 
-#include <rte_string_fns.h>
 
 #include "rte_kvargs.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 33/53] kni: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (31 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 32/53] kvargs: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 34/53] jobstats: " Sean Morrissey
                         ` (20 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/kni/rte_kni.c | 2 --
 lib/kni/rte_kni.h | 2 --
 2 files changed, 4 deletions(-)

diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c
index fc8f0e7b5a..7971c56bb4 100644
--- a/lib/kni/rte_kni.c
+++ b/lib/kni/rte_kni.c
@@ -12,7 +12,6 @@
 #include <sys/ioctl.h>
 #include <linux/version.h>
 
-#include <rte_spinlock.h>
 #include <rte_string_fns.h>
 #include <rte_ethdev.h>
 #include <rte_malloc.h>
@@ -20,7 +19,6 @@
 #include <rte_kni.h>
 #include <rte_memzone.h>
 #include <rte_tailq.h>
-#include <rte_rwlock.h>
 #include <rte_eal_memconfig.h>
 #include <rte_kni_common.h>
 #include "rte_kni_fifo.h"
diff --git a/lib/kni/rte_kni.h b/lib/kni/rte_kni.h
index b0eaf46104..b85d3dd32b 100644
--- a/lib/kni/rte_kni.h
+++ b/lib/kni/rte_kni.h
@@ -18,8 +18,6 @@
  */
 
 #include <rte_pci.h>
-#include <rte_memory.h>
-#include <rte_mempool.h>
 #include <rte_ether.h>
 
 #include <rte_kni_common.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 34/53] jobstats: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (32 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 33/53] kni: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 35/53] ipsec: " Sean Morrissey
                         ` (19 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/jobstats/rte_jobstats.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/jobstats/rte_jobstats.c b/lib/jobstats/rte_jobstats.c
index 9b8fde5d55..af565a14ea 100644
--- a/lib/jobstats/rte_jobstats.c
+++ b/lib/jobstats/rte_jobstats.c
@@ -7,10 +7,7 @@
 #include <errno.h>
 
 #include <rte_string_fns.h>
-#include <rte_errno.h>
 #include <rte_common.h>
-#include <rte_eal.h>
-#include <rte_log.h>
 #include <rte_cycles.h>
 #include <rte_branch_prediction.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 35/53] ipsec: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (33 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 34/53] jobstats: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 36/53] ip_frag: " Sean Morrissey
                         ` (18 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Konstantin Ananyev, Bernard Iremonger, Vladimir Medvedkin
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/ipsec/esp_inb.c   | 1 -
 lib/ipsec/esp_outb.c  | 1 -
 lib/ipsec/ipsec_sad.c | 1 -
 lib/ipsec/sa.c        | 3 ---
 lib/ipsec/sa.h        | 1 -
 5 files changed, 7 deletions(-)

diff --git a/lib/ipsec/esp_inb.c b/lib/ipsec/esp_inb.c
index 636c850fa6..f159bf7460 100644
--- a/lib/ipsec/esp_inb.c
+++ b/lib/ipsec/esp_inb.c
@@ -4,7 +4,6 @@
 
 #include <rte_ipsec.h>
 #include <rte_esp.h>
-#include <rte_ip.h>
 #include <rte_errno.h>
 #include <rte_cryptodev.h>
 
diff --git a/lib/ipsec/esp_outb.c b/lib/ipsec/esp_outb.c
index 672e56aba0..6925bb9945 100644
--- a/lib/ipsec/esp_outb.c
+++ b/lib/ipsec/esp_outb.c
@@ -4,7 +4,6 @@
 
 #include <rte_ipsec.h>
 #include <rte_esp.h>
-#include <rte_ip.h>
 #include <rte_udp.h>
 #include <rte_errno.h>
 #include <rte_cryptodev.h>
diff --git a/lib/ipsec/ipsec_sad.c b/lib/ipsec/ipsec_sad.c
index 531e1e323c..6f3860e3f5 100644
--- a/lib/ipsec/ipsec_sad.c
+++ b/lib/ipsec/ipsec_sad.c
@@ -10,7 +10,6 @@
 #include <rte_hash_crc.h>
 #include <rte_malloc.h>
 #include <rte_random.h>
-#include <rte_rwlock.h>
 #include <rte_tailq.h>
 
 #include "rte_ipsec_sad.h"
diff --git a/lib/ipsec/sa.c b/lib/ipsec/sa.c
index cdb70af0cb..1b673b6a18 100644
--- a/lib/ipsec/sa.c
+++ b/lib/ipsec/sa.c
@@ -7,14 +7,11 @@
 #include <rte_ip.h>
 #include <rte_udp.h>
 #include <rte_errno.h>
-#include <rte_cryptodev.h>
 
 #include "sa.h"
 #include "ipsec_sqn.h"
 #include "crypto.h"
-#include "iph.h"
 #include "misc.h"
-#include "pad.h"
 
 #define MBUF_MAX_L2_LEN		RTE_LEN2MASK(RTE_MBUF_L2_LEN_BITS, uint64_t)
 #define MBUF_MAX_L3_LEN		RTE_LEN2MASK(RTE_MBUF_L3_LEN_BITS, uint64_t)
diff --git a/lib/ipsec/sa.h b/lib/ipsec/sa.h
index 7503587b50..46f9a4df5b 100644
--- a/lib/ipsec/sa.h
+++ b/lib/ipsec/sa.h
@@ -5,7 +5,6 @@
 #ifndef _SA_H_
 #define _SA_H_
 
-#include <rte_rwlock.h>
 
 #define IPSEC_MAX_HDR_SIZE	64
 #define IPSEC_MAX_IV_SIZE	16
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 36/53] ip_frag: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (34 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 35/53] ipsec: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 37/53] hash: " Sean Morrissey
                         ` (17 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/ip_frag/rte_ip_frag_common.c     | 1 -
 lib/ip_frag/rte_ipv4_fragmentation.c | 2 --
 2 files changed, 3 deletions(-)

diff --git a/lib/ip_frag/rte_ip_frag_common.c b/lib/ip_frag/rte_ip_frag_common.c
index 2c781a6d33..c1de2e81b6 100644
--- a/lib/ip_frag/rte_ip_frag_common.c
+++ b/lib/ip_frag/rte_ip_frag_common.c
@@ -5,7 +5,6 @@
 #include <stddef.h>
 #include <stdio.h>
 
-#include <rte_memory.h>
 #include <rte_log.h>
 
 #include "ip_frag_common.h"
diff --git a/lib/ip_frag/rte_ipv4_fragmentation.c b/lib/ip_frag/rte_ipv4_fragmentation.c
index 2e7739d027..669682a0cf 100644
--- a/lib/ip_frag/rte_ipv4_fragmentation.c
+++ b/lib/ip_frag/rte_ipv4_fragmentation.c
@@ -6,8 +6,6 @@
 #include <errno.h>
 
 #include <rte_memcpy.h>
-#include <rte_mempool.h>
-#include <rte_debug.h>
 #include <rte_ether.h>
 
 #include "ip_frag_common.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 37/53] hash: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (35 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 36/53] ip_frag: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 38/53] gro: " Sean Morrissey
                         ` (16 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Yipeng Wang, Sameh Gobriel, Bruce Richardson, Vladimir Medvedkin
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/hash/rte_cuckoo_hash.c | 4 ----
 lib/hash/rte_fbk_hash.c    | 6 ------
 lib/hash/rte_fbk_hash.h    | 1 -
 lib/hash/rte_thash.c       | 1 -
 lib/hash/rte_thash.h       | 1 -
 5 files changed, 13 deletions(-)

diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 1191dfd81a..490f94af4b 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -7,7 +7,6 @@
 #include <stdint.h>
 #include <errno.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <sys/queue.h>
 
 #include <rte_common.h>
@@ -16,14 +15,11 @@
 #include <rte_prefetch.h>
 #include <rte_branch_prediction.h>
 #include <rte_malloc.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_cpuflags.h>
 #include <rte_rwlock.h>
-#include <rte_spinlock.h>
 #include <rte_ring_elem.h>
 #include <rte_compat.h>
 #include <rte_vect.h>
diff --git a/lib/hash/rte_fbk_hash.c b/lib/hash/rte_fbk_hash.c
index 576e8e6662..538b23a403 100644
--- a/lib/hash/rte_fbk_hash.c
+++ b/lib/hash/rte_fbk_hash.c
@@ -4,22 +4,16 @@
 
 #include <stdint.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
 #include <errno.h>
 
 #include <sys/queue.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_malloc.h>
 #include <rte_common.h>
-#include <rte_per_lcore.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
-#include <rte_cpuflags.h>
 #include <rte_log.h>
-#include <rte_spinlock.h>
 #include <rte_tailq.h>
 
 #include "rte_fbk_hash.h"
diff --git a/lib/hash/rte_fbk_hash.h b/lib/hash/rte_fbk_hash.h
index 9c3a61c1d6..b01126999b 100644
--- a/lib/hash/rte_fbk_hash.h
+++ b/lib/hash/rte_fbk_hash.h
@@ -24,7 +24,6 @@ extern "C" {
 
 #include <string.h>
 
-#include <rte_config.h>
 #include <rte_hash_crc.h>
 #include <rte_jhash.h>
 
diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c
index 6847e36f4b..0249883b8d 100644
--- a/lib/hash/rte_thash.c
+++ b/lib/hash/rte_thash.c
@@ -9,7 +9,6 @@
 #include <rte_random.h>
 #include <rte_memcpy.h>
 #include <rte_errno.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
diff --git a/lib/hash/rte_thash.h b/lib/hash/rte_thash.h
index c11ca0d5b8..451f64043a 100644
--- a/lib/hash/rte_thash.h
+++ b/lib/hash/rte_thash.h
@@ -21,7 +21,6 @@ extern "C" {
 
 #include <stdint.h>
 #include <rte_byteorder.h>
-#include <rte_config.h>
 #include <rte_ip.h>
 #include <rte_common.h>
 #include <rte_thash_gfni.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 38/53] gro: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (36 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 37/53] hash: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 39/53] graph: " Sean Morrissey
                         ` (15 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Jiayu Hu; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/gro/gro_tcp4.c       | 1 -
 lib/gro/gro_tcp4.h       | 2 --
 lib/gro/gro_udp4.c       | 1 -
 lib/gro/gro_udp4.h       | 2 --
 lib/gro/gro_vxlan_tcp4.c | 1 -
 lib/gro/gro_vxlan_udp4.c | 1 -
 lib/gro/rte_gro.c        | 1 -
 7 files changed, 9 deletions(-)

diff --git a/lib/gro/gro_tcp4.c b/lib/gro/gro_tcp4.c
index aff22178e3..7498c66141 100644
--- a/lib/gro/gro_tcp4.c
+++ b/lib/gro/gro_tcp4.c
@@ -4,7 +4,6 @@
 
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_cycles.h>
 #include <rte_ethdev.h>
 
 #include "gro_tcp4.h"
diff --git a/lib/gro/gro_tcp4.h b/lib/gro/gro_tcp4.h
index bb875a5ef0..212f97a042 100644
--- a/lib/gro/gro_tcp4.h
+++ b/lib/gro/gro_tcp4.h
@@ -5,9 +5,7 @@
 #ifndef _GRO_TCP4_H_
 #define _GRO_TCP4_H_
 
-#include <rte_ip.h>
 #include <rte_tcp.h>
-#include <rte_vxlan.h>
 
 #define INVALID_ARRAY_INDEX 0xffffffffUL
 #define GRO_TCP4_TBL_MAX_ITEM_NUM (1024UL * 1024UL)
diff --git a/lib/gro/gro_udp4.c b/lib/gro/gro_udp4.c
index e78dda7874..dd71135ada 100644
--- a/lib/gro/gro_udp4.c
+++ b/lib/gro/gro_udp4.c
@@ -4,7 +4,6 @@
 
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_cycles.h>
 #include <rte_ethdev.h>
 
 #include "gro_udp4.h"
diff --git a/lib/gro/gro_udp4.h b/lib/gro/gro_udp4.h
index d38b393f79..6467d7bc3b 100644
--- a/lib/gro/gro_udp4.h
+++ b/lib/gro/gro_udp4.h
@@ -6,8 +6,6 @@
 #define _GRO_UDP4_H_
 
 #include <rte_ip.h>
-#include <rte_udp.h>
-#include <rte_vxlan.h>
 
 #define INVALID_ARRAY_INDEX 0xffffffffUL
 #define GRO_UDP4_TBL_MAX_ITEM_NUM (1024UL * 1024UL)
diff --git a/lib/gro/gro_vxlan_tcp4.c b/lib/gro/gro_vxlan_tcp4.c
index 2005899afe..3be4deb7c7 100644
--- a/lib/gro/gro_vxlan_tcp4.c
+++ b/lib/gro/gro_vxlan_tcp4.c
@@ -4,7 +4,6 @@
 
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_cycles.h>
 #include <rte_ethdev.h>
 #include <rte_udp.h>
 
diff --git a/lib/gro/gro_vxlan_udp4.c b/lib/gro/gro_vxlan_udp4.c
index 4767c910bb..b78a7ae89e 100644
--- a/lib/gro/gro_vxlan_udp4.c
+++ b/lib/gro/gro_vxlan_udp4.c
@@ -4,7 +4,6 @@
 
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_cycles.h>
 #include <rte_ethdev.h>
 #include <rte_udp.h>
 
diff --git a/lib/gro/rte_gro.c b/lib/gro/rte_gro.c
index 8ca4da67e9..6f7dd4d709 100644
--- a/lib/gro/rte_gro.c
+++ b/lib/gro/rte_gro.c
@@ -3,7 +3,6 @@
  */
 
 #include <rte_malloc.h>
-#include <rte_mbuf.h>
 #include <rte_cycles.h>
 #include <rte_ethdev.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 39/53] graph: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (37 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 38/53] gro: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 40/53] gpudev: " Sean Morrissey
                         ` (14 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Jerin Jacob, Kiran Kumar K, Nithin Dabilpuram; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/graph/graph_debug.c    | 2 --
 lib/graph/graph_ops.c      | 1 -
 lib/graph/graph_populate.c | 2 --
 lib/graph/node.c           | 1 -
 4 files changed, 6 deletions(-)

diff --git a/lib/graph/graph_debug.c b/lib/graph/graph_debug.c
index f8aea16acb..b84412f5dd 100644
--- a/lib/graph/graph_debug.c
+++ b/lib/graph/graph_debug.c
@@ -2,8 +2,6 @@
  * Copyright(C) 2020 Marvell International Ltd.
  */
 
-#include <rte_common.h>
-#include <rte_debug.h>
 
 #include "graph_private.h"
 
diff --git a/lib/graph/graph_ops.c b/lib/graph/graph_ops.c
index 3355953118..20db58d84e 100644
--- a/lib/graph/graph_ops.c
+++ b/lib/graph/graph_ops.c
@@ -5,7 +5,6 @@
 #include <stdbool.h>
 #include <string.h>
 
-#include <rte_common.h>
 #include <rte_errno.h>
 
 #include "graph_private.h"
diff --git a/lib/graph/graph_populate.c b/lib/graph/graph_populate.c
index 093512efab..102fd6c29b 100644
--- a/lib/graph/graph_populate.c
+++ b/lib/graph/graph_populate.c
@@ -2,8 +2,6 @@
  * Copyright(C) 2020 Marvell International Ltd.
  */
 
-#include <fnmatch.h>
-#include <stdbool.h>
 
 #include <rte_common.h>
 #include <rte_errno.h>
diff --git a/lib/graph/node.c b/lib/graph/node.c
index 86ec4316f9..79230035a2 100644
--- a/lib/graph/node.c
+++ b/lib/graph/node.c
@@ -8,7 +8,6 @@
 
 #include <rte_common.h>
 #include <rte_debug.h>
-#include <rte_eal.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 40/53] gpudev: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (38 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 39/53] graph: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 41/53] flow_classify: " Sean Morrissey
                         ` (13 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Elena Agostini; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/gpudev/gpudev.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c
index 9ae36dbae9..98bb759fb2 100644
--- a/lib/gpudev/gpudev.c
+++ b/lib/gpudev/gpudev.c
@@ -4,7 +4,6 @@
 
 #include <rte_eal.h>
 #include <rte_tailq.h>
-#include <rte_rwlock.h>
 #include <rte_string_fns.h>
 #include <rte_memzone.h>
 #include <rte_malloc.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 41/53] flow_classify: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (39 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 40/53] gpudev: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 42/53] fib: " Sean Morrissey
                         ` (12 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Bernard Iremonger; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/flow_classify/rte_flow_classify.c       | 3 ---
 lib/flow_classify/rte_flow_classify.h       | 4 ----
 lib/flow_classify/rte_flow_classify_parse.c | 1 -
 lib/flow_classify/rte_flow_classify_parse.h | 1 -
 4 files changed, 9 deletions(-)

diff --git a/lib/flow_classify/rte_flow_classify.c b/lib/flow_classify/rte_flow_classify.c
index d3ba2ed227..e3667306e5 100644
--- a/lib/flow_classify/rte_flow_classify.c
+++ b/lib/flow_classify/rte_flow_classify.c
@@ -3,12 +3,9 @@
  */
 
 #include <rte_string_fns.h>
-#include <rte_compat.h>
 #include <rte_flow_classify.h>
 #include "rte_flow_classify_parse.h"
-#include <rte_flow_driver.h>
 #include <rte_table_acl.h>
-#include <stdbool.h>
 
 static uint32_t unique_id = 1;
 
diff --git a/lib/flow_classify/rte_flow_classify.h b/lib/flow_classify/rte_flow_classify.h
index 82ea92b6a6..39512b6206 100644
--- a/lib/flow_classify/rte_flow_classify.h
+++ b/lib/flow_classify/rte_flow_classify.h
@@ -45,11 +45,7 @@
 
 #include <rte_compat.h>
 #include <rte_common.h>
-#include <rte_ethdev.h>
-#include <rte_ether.h>
 #include <rte_flow.h>
-#include <rte_acl.h>
-#include <rte_table_acl.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/flow_classify/rte_flow_classify_parse.c b/lib/flow_classify/rte_flow_classify_parse.c
index 465330291f..345d129d35 100644
--- a/lib/flow_classify/rte_flow_classify_parse.c
+++ b/lib/flow_classify/rte_flow_classify_parse.c
@@ -4,7 +4,6 @@
 
 #include <rte_flow_classify.h>
 #include "rte_flow_classify_parse.h"
-#include <rte_flow_driver.h>
 
 struct classify_valid_pattern {
 	enum rte_flow_item_type *items;
diff --git a/lib/flow_classify/rte_flow_classify_parse.h b/lib/flow_classify/rte_flow_classify_parse.h
index 365a07bd6d..7943efc0d4 100644
--- a/lib/flow_classify/rte_flow_classify_parse.h
+++ b/lib/flow_classify/rte_flow_classify_parse.h
@@ -6,7 +6,6 @@
 #define _RTE_FLOW_CLASSIFY_PARSE_H_
 
 #include <rte_ethdev.h>
-#include <rte_ether.h>
 #include <rte_flow.h>
 #include <stdbool.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 42/53] fib: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (40 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 41/53] flow_classify: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:23       ` [PATCH v4 43/53] eventdev: " Sean Morrissey
                         ` (11 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Vladimir Medvedkin; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/fib/dir24_8.c  | 4 ----
 lib/fib/rte_fib.c  | 2 --
 lib/fib/rte_fib.h  | 1 -
 lib/fib/rte_fib6.c | 2 --
 lib/fib/rte_fib6.h | 1 -
 lib/fib/trie.c     | 5 -----
 lib/fib/trie.h     | 2 --
 7 files changed, 17 deletions(-)

diff --git a/lib/fib/dir24_8.c b/lib/fib/dir24_8.c
index bb3bc9753b..a8ba4f64ca 100644
--- a/lib/fib/dir24_8.c
+++ b/lib/fib/dir24_8.c
@@ -4,15 +4,11 @@
  */
 
 #include <stdint.h>
-#include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
 
 #include <rte_debug.h>
 #include <rte_malloc.h>
 #include <rte_errno.h>
-#include <rte_memory.h>
 #include <rte_vect.h>
 
 #include <rte_rib.h>
diff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c
index 0cced97a77..8af4c40919 100644
--- a/lib/fib/rte_fib.c
+++ b/lib/fib/rte_fib.c
@@ -6,11 +6,9 @@
 #include <stdint.h>
 #include <string.h>
 
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
-#include <rte_rwlock.h>
 #include <rte_string_fns.h>
 #include <rte_tailq.h>
 
diff --git a/lib/fib/rte_fib.h b/lib/fib/rte_fib.h
index e592d3251a..90f28b7e11 100644
--- a/lib/fib/rte_fib.h
+++ b/lib/fib/rte_fib.h
@@ -17,7 +17,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/fib/rte_fib6.c b/lib/fib/rte_fib6.c
index eebee297d6..4b8e22b142 100644
--- a/lib/fib/rte_fib6.c
+++ b/lib/fib/rte_fib6.c
@@ -6,11 +6,9 @@
 #include <stdint.h>
 #include <string.h>
 
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_tailq.h>
 #include <rte_errno.h>
-#include <rte_rwlock.h>
 #include <rte_malloc.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/fib/rte_fib6.h b/lib/fib/rte_fib6.h
index cb133719e1..62a425d9af 100644
--- a/lib/fib/rte_fib6.h
+++ b/lib/fib/rte_fib6.h
@@ -17,7 +17,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/fib/trie.c b/lib/fib/trie.c
index 044095bf03..3e780afdaf 100644
--- a/lib/fib/trie.c
+++ b/lib/fib/trie.c
@@ -4,16 +4,11 @@
  */
 
 #include <stdint.h>
-#include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
 
 #include <rte_debug.h>
 #include <rte_malloc.h>
 #include <rte_errno.h>
-#include <rte_memory.h>
-#include <rte_vect.h>
 
 #include <rte_rib6.h>
 #include <rte_fib6.h>
diff --git a/lib/fib/trie.h b/lib/fib/trie.h
index 9fd15ae79f..3cf161ae25 100644
--- a/lib/fib/trie.h
+++ b/lib/fib/trie.h
@@ -10,8 +10,6 @@
  * @file
  * RTE IPv6 Longest Prefix Match (LPM)
  */
-#include <rte_prefetch.h>
-#include <rte_branch_prediction.h>
 
 /* @internal Total number of tbl24 entries. */
 #define TRIE_TBL24_NUM_ENT	(1 << 24)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 43/53] eventdev: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (41 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 42/53] fib: " Sean Morrissey
@ 2022-01-14 16:23       ` Sean Morrissey
  2022-01-14 16:24       ` [PATCH v4 44/53] efd: " Sean Morrissey
                         ` (10 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:23 UTC (permalink / raw)
  To: Jerin Jacob, Erik Gabriel Carrillo; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/eventdev/rte_event_ring.c          |  6 ------
 lib/eventdev/rte_event_ring.h          |  2 --
 lib/eventdev/rte_event_timer_adapter.c |  5 -----
 lib/eventdev/rte_event_timer_adapter.h |  2 --
 lib/eventdev/rte_eventdev.c            | 11 -----------
 lib/eventdev/rte_eventdev.h            |  2 --
 6 files changed, 28 deletions(-)

diff --git a/lib/eventdev/rte_event_ring.c b/lib/eventdev/rte_event_ring.c
index d27e23901d..c070715148 100644
--- a/lib/eventdev/rte_event_ring.c
+++ b/lib/eventdev/rte_event_ring.c
@@ -3,13 +3,7 @@
  * Copyright(c) 2019 Arm Limited
  */
 
-#include <sys/queue.h>
-#include <string.h>
 
-#include <rte_tailq.h>
-#include <rte_memzone.h>
-#include <rte_rwlock.h>
-#include <rte_eal_memconfig.h>
 #include "rte_event_ring.h"
 
 int
diff --git a/lib/eventdev/rte_event_ring.h b/lib/eventdev/rte_event_ring.h
index c0861b0ec2..0a54f7fde2 100644
--- a/lib/eventdev/rte_event_ring.h
+++ b/lib/eventdev/rte_event_ring.h
@@ -17,8 +17,6 @@
 #include <stdint.h>
 
 #include <rte_common.h>
-#include <rte_memory.h>
-#include <rte_malloc.h>
 #include <rte_ring.h>
 #include <rte_ring_elem.h>
 #include "rte_eventdev.h"
diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c
index 9dad170b5a..7dc39386c9 100644
--- a/lib/eventdev/rte_event_timer_adapter.c
+++ b/lib/eventdev/rte_event_timer_adapter.c
@@ -6,19 +6,14 @@
 #include <string.h>
 #include <inttypes.h>
 #include <stdbool.h>
-#include <sys/queue.h>
 
 #include <rte_memzone.h>
-#include <rte_memory.h>
-#include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
-#include <rte_ring.h>
 #include <rte_mempool.h>
 #include <rte_common.h>
 #include <rte_timer.h>
 #include <rte_service_component.h>
-#include <rte_cycles.h>
 
 #include "event_timer_adapter_pmd.h"
 #include "eventdev_pmd.h"
diff --git a/lib/eventdev/rte_event_timer_adapter.h b/lib/eventdev/rte_event_timer_adapter.h
index 1551741820..aefa322344 100644
--- a/lib/eventdev/rte_event_timer_adapter.h
+++ b/lib/eventdev/rte_event_timer_adapter.h
@@ -111,8 +111,6 @@
 extern "C" {
 #endif
 
-#include <rte_spinlock.h>
-#include <rte_memory.h>
 
 #include "rte_eventdev.h"
 #include "rte_eventdev_trace_fp.h"
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 79b9ea3a02..1c1b66de88 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -6,26 +6,15 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <stdint.h>
 #include <inttypes.h>
-#include <sys/types.h>
-#include <sys/queue.h>
 
 #include <rte_string_fns.h>
-#include <rte_byteorder.h>
 #include <rte_log.h>
-#include <rte_debug.h>
 #include <rte_dev.h>
-#include <rte_memory.h>
-#include <rte_memcpy.h>
 #include <rte_memzone.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_errno.h>
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index eef47d8acc..5738a8d9ea 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -211,10 +211,8 @@ extern "C" {
 #endif
 
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_errno.h>
 #include <rte_mbuf_pool_ops.h>
-#include <rte_memory.h>
 #include <rte_mempool.h>
 
 #include "rte_eventdev_trace_fp.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 44/53] efd: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (42 preceding siblings ...)
  2022-01-14 16:23       ` [PATCH v4 43/53] eventdev: " Sean Morrissey
@ 2022-01-14 16:24       ` Sean Morrissey
  2022-01-14 16:24       ` [PATCH v4 45/53] eal: " Sean Morrissey
                         ` (9 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:24 UTC (permalink / raw)
  To: Byron Marohn, Yipeng Wang; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/efd/rte_efd.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c
index 86ef46863c..560cd78961 100644
--- a/lib/efd/rte_efd.c
+++ b/lib/efd/rte_efd.c
@@ -6,7 +6,6 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <errno.h>
-#include <stdarg.h>
 #include <sys/queue.h>
 
 #include <rte_string_fns.h>
@@ -21,11 +20,9 @@
 #include <rte_jhash.h>
 #include <rte_hash_crc.h>
 #include <rte_tailq.h>
-#include <rte_vect.h>
 
 #include "rte_efd.h"
 #if defined(RTE_ARCH_X86)
-#include "rte_efd_x86.h"
 #elif defined(RTE_ARCH_ARM64)
 #include "rte_efd_arm64.h"
 #endif
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 45/53] eal: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (43 preceding siblings ...)
  2022-01-14 16:24       ` [PATCH v4 44/53] efd: " Sean Morrissey
@ 2022-01-14 16:24       ` Sean Morrissey
  2022-01-14 16:24       ` [PATCH v4 46/53] dmadev: " Sean Morrissey
                         ` (8 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:24 UTC (permalink / raw)
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/eal/linux/eal_thread.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index 9a0250d762..fa6cd7e2c4 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -10,7 +10,6 @@
 #include <sys/syscall.h>
 
 #include <rte_debug.h>
-#include <rte_atomic.h>
 #include <rte_launch.h>
 #include <rte_log.h>
 #include <rte_eal.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 46/53] dmadev: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (44 preceding siblings ...)
  2022-01-14 16:24       ` [PATCH v4 45/53] eal: " Sean Morrissey
@ 2022-01-14 16:24       ` Sean Morrissey
  2022-01-14 16:24       ` [PATCH v4 47/53] distributor: " Sean Morrissey
                         ` (7 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:24 UTC (permalink / raw)
  To: Chengwen Feng, Kevin Laatz, Bruce Richardson; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/dmadev/rte_dmadev.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/dmadev/rte_dmadev.h b/lib/dmadev/rte_dmadev.h
index 4abe79c536..ad9e7a0975 100644
--- a/lib/dmadev/rte_dmadev.h
+++ b/lib/dmadev/rte_dmadev.h
@@ -149,7 +149,6 @@
 #include <rte_bitops.h>
 #include <rte_common.h>
 #include <rte_compat.h>
-#include <rte_dev.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 47/53] distributor: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (45 preceding siblings ...)
  2022-01-14 16:24       ` [PATCH v4 46/53] dmadev: " Sean Morrissey
@ 2022-01-14 16:24       ` Sean Morrissey
  2022-01-14 16:24       ` [PATCH v4 48/53] compressdev: " Sean Morrissey
                         ` (6 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:24 UTC (permalink / raw)
  To: David Hunt, Bruce Richardson, Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/distributor/rte_distributor.c           | 2 --
 lib/distributor/rte_distributor_match_sse.c | 2 --
 lib/distributor/rte_distributor_single.c    | 2 --
 3 files changed, 6 deletions(-)

diff --git a/lib/distributor/rte_distributor.c b/lib/distributor/rte_distributor.c
index c210cf86bd..3035b7a999 100644
--- a/lib/distributor/rte_distributor.c
+++ b/lib/distributor/rte_distributor.c
@@ -6,7 +6,6 @@
 #include <sys/queue.h>
 #include <string.h>
 #include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_cycles.h>
 #include <rte_memzone.h>
 #include <rte_errno.h>
@@ -14,7 +13,6 @@
 #include <rte_eal_memconfig.h>
 #include <rte_pause.h>
 #include <rte_tailq.h>
-#include <rte_vect.h>
 
 #include "rte_distributor.h"
 #include "rte_distributor_single.h"
diff --git a/lib/distributor/rte_distributor_match_sse.c b/lib/distributor/rte_distributor_match_sse.c
index e3b3b79264..11d8819278 100644
--- a/lib/distributor/rte_distributor_match_sse.c
+++ b/lib/distributor/rte_distributor_match_sse.c
@@ -3,10 +3,8 @@
  */
 
 #include <rte_mbuf.h>
-#include "rte_distributor.h"
 #include "distributor_private.h"
 #include "smmintrin.h"
-#include "nmmintrin.h"
 
 
 void
diff --git a/lib/distributor/rte_distributor_single.c b/lib/distributor/rte_distributor_single.c
index b653620688..de90aa8bb5 100644
--- a/lib/distributor/rte_distributor_single.c
+++ b/lib/distributor/rte_distributor_single.c
@@ -4,9 +4,7 @@
 
 #include <stdio.h>
 #include <sys/queue.h>
-#include <string.h>
 #include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 48/53] compressdev: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (46 preceding siblings ...)
  2022-01-14 16:24       ` [PATCH v4 47/53] distributor: " Sean Morrissey
@ 2022-01-14 16:24       ` Sean Morrissey
  2022-01-14 16:24       ` [PATCH v4 49/53] cmdline: " Sean Morrissey
                         ` (5 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:24 UTC (permalink / raw)
  To: Fan Zhang, Ashish Gupta; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/compressdev/rte_comp.c            | 1 -
 lib/compressdev/rte_comp.h            | 1 -
 lib/compressdev/rte_compressdev.c     | 1 -
 lib/compressdev/rte_compressdev.h     | 1 -
 lib/compressdev/rte_compressdev_pmd.h | 2 --
 5 files changed, 6 deletions(-)

diff --git a/lib/compressdev/rte_comp.c b/lib/compressdev/rte_comp.c
index 3b0e46f96e..320c6dab92 100644
--- a/lib/compressdev/rte_comp.c
+++ b/lib/compressdev/rte_comp.c
@@ -3,7 +3,6 @@
  */
 
 #include "rte_comp.h"
-#include "rte_compressdev.h"
 #include "rte_compressdev_internal.h"
 
 const char *
diff --git a/lib/compressdev/rte_comp.h b/lib/compressdev/rte_comp.h
index 95306c5d03..cdb55e5887 100644
--- a/lib/compressdev/rte_comp.h
+++ b/lib/compressdev/rte_comp.h
@@ -16,7 +16,6 @@
 extern "C" {
 #endif
 
-#include <rte_mempool.h>
 #include <rte_mbuf.h>
 
 /**
diff --git a/lib/compressdev/rte_compressdev.c b/lib/compressdev/rte_compressdev.c
index 2e9218af68..202ee694d8 100644
--- a/lib/compressdev/rte_compressdev.c
+++ b/lib/compressdev/rte_compressdev.c
@@ -3,7 +3,6 @@
  */
 
 #include <string.h>
-#include <stdarg.h>
 #include <stdio.h>
 #include <inttypes.h>
 
diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h
index 2840c27c6c..aa865c4c03 100644
--- a/lib/compressdev/rte_compressdev.h
+++ b/lib/compressdev/rte_compressdev.h
@@ -21,7 +21,6 @@
 extern "C" {
 #endif
 
-#include <rte_common.h>
 
 #include "rte_comp.h"
 
diff --git a/lib/compressdev/rte_compressdev_pmd.h b/lib/compressdev/rte_compressdev_pmd.h
index f9a42d1f05..9fabc399c5 100644
--- a/lib/compressdev/rte_compressdev_pmd.h
+++ b/lib/compressdev/rte_compressdev_pmd.h
@@ -19,8 +19,6 @@ extern "C" {
 
 #include <string.h>
 
-#include <rte_dev.h>
-#include <rte_common.h>
 
 #include "rte_compressdev.h"
 #include "rte_compressdev_internal.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 49/53] cmdline: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (47 preceding siblings ...)
  2022-01-14 16:24       ` [PATCH v4 48/53] compressdev: " Sean Morrissey
@ 2022-01-14 16:24       ` Sean Morrissey
  2022-01-14 16:24       ` [PATCH v4 50/53] bpf: " Sean Morrissey
                         ` (4 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:24 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/cmdline/cmdline.c                | 2 --
 lib/cmdline/cmdline_cirbuf.c         | 1 -
 lib/cmdline/cmdline_cirbuf.h         | 1 -
 lib/cmdline/cmdline_parse.c          | 3 ---
 lib/cmdline/cmdline_parse_num.c      | 4 ----
 lib/cmdline/cmdline_parse_portlist.c | 3 ---
 lib/cmdline/cmdline_parse_string.c   | 4 ----
 lib/cmdline/cmdline_rdline.c         | 2 --
 lib/cmdline/cmdline_socket.c         | 5 -----
 lib/cmdline/cmdline_socket.h         | 1 -
 lib/cmdline/cmdline_vt100.c          | 3 ---
 11 files changed, 29 deletions(-)

diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c
index 8f1854cb0b..e1009ba4c4 100644
--- a/lib/cmdline/cmdline.c
+++ b/lib/cmdline/cmdline.c
@@ -9,8 +9,6 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
-#include <inttypes.h>
-#include <fcntl.h>
 #include <errno.h>
 
 #include <rte_string_fns.h>
diff --git a/lib/cmdline/cmdline_cirbuf.c b/lib/cmdline/cmdline_cirbuf.c
index 829a8af563..f9bd7cfd61 100644
--- a/lib/cmdline/cmdline_cirbuf.c
+++ b/lib/cmdline/cmdline_cirbuf.c
@@ -6,7 +6,6 @@
 
 #include <string.h>
 #include <errno.h>
-#include <stdio.h>
 
 #include "cmdline_cirbuf.h"
 
diff --git a/lib/cmdline/cmdline_cirbuf.h b/lib/cmdline/cmdline_cirbuf.h
index c23b211ad4..c58fdabf00 100644
--- a/lib/cmdline/cmdline_cirbuf.h
+++ b/lib/cmdline/cmdline_cirbuf.h
@@ -7,7 +7,6 @@
 #ifndef _CIRBUF_H_
 #define _CIRBUF_H_
 
-#include <rte_config.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/cmdline/cmdline_parse.c b/lib/cmdline/cmdline_parse.c
index f5cc934782..349ec87bd7 100644
--- a/lib/cmdline/cmdline_parse.c
+++ b/lib/cmdline/cmdline_parse.c
@@ -5,11 +5,8 @@
  */
 
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <string.h>
-#include <inttypes.h>
-#include <ctype.h>
 
 #include <rte_string_fns.h>
 
diff --git a/lib/cmdline/cmdline_parse_num.c b/lib/cmdline/cmdline_parse_num.c
index b37dd94ae9..a4e68f262c 100644
--- a/lib/cmdline/cmdline_parse_num.c
+++ b/lib/cmdline/cmdline_parse_num.c
@@ -6,11 +6,7 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <inttypes.h>
-#include <ctype.h>
 #include <string.h>
-#include <stdarg.h>
-#include <errno.h>
 #include <rte_string_fns.h>
 
 #include "cmdline_parse.h"
diff --git a/lib/cmdline/cmdline_parse_portlist.c b/lib/cmdline/cmdline_parse_portlist.c
index e1aa07be4b..2e2294553a 100644
--- a/lib/cmdline/cmdline_parse_portlist.c
+++ b/lib/cmdline/cmdline_parse_portlist.c
@@ -6,11 +6,8 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <inttypes.h>
-#include <ctype.h>
 #include <string.h>
 #include <errno.h>
-#include <stdarg.h>
 
 #include <rte_string_fns.h>
 #include "cmdline_parse.h"
diff --git a/lib/cmdline/cmdline_parse_string.c b/lib/cmdline/cmdline_parse_string.c
index 9cf41d0f76..d756638905 100644
--- a/lib/cmdline/cmdline_parse_string.c
+++ b/lib/cmdline/cmdline_parse_string.c
@@ -5,11 +5,7 @@
  */
 
 #include <stdio.h>
-#include <inttypes.h>
-#include <ctype.h>
 #include <string.h>
-#include <stdarg.h>
-#include <errno.h>
 #include <rte_string_fns.h>
 
 #include "cmdline_parse.h"
diff --git a/lib/cmdline/cmdline_rdline.c b/lib/cmdline/cmdline_rdline.c
index d92b1cda53..5cf723a012 100644
--- a/lib/cmdline/cmdline_rdline.c
+++ b/lib/cmdline/cmdline_rdline.c
@@ -6,9 +6,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdint.h>
 #include <string.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <ctype.h>
 
diff --git a/lib/cmdline/cmdline_socket.c b/lib/cmdline/cmdline_socket.c
index ebd5343754..d6c2431cb8 100644
--- a/lib/cmdline/cmdline_socket.c
+++ b/lib/cmdline/cmdline_socket.c
@@ -5,11 +5,6 @@
  */
 
 #include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <inttypes.h>
 #include <fcntl.h>
 
 #include "cmdline.h"
diff --git a/lib/cmdline/cmdline_socket.h b/lib/cmdline/cmdline_socket.h
index 80542e5599..a9c4ea26ad 100644
--- a/lib/cmdline/cmdline_socket.h
+++ b/lib/cmdline/cmdline_socket.h
@@ -8,7 +8,6 @@
 #define _CMDLINE_SOCKET_H_
 
 #include <cmdline_parse.h>
-#include <cmdline.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/cmdline/cmdline_vt100.c b/lib/cmdline/cmdline_vt100.c
index bb968dd5fa..4c9a46c953 100644
--- a/lib/cmdline/cmdline_vt100.c
+++ b/lib/cmdline/cmdline_vt100.c
@@ -4,12 +4,9 @@
  * All rights reserved.
  */
 
-#include <stdlib.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdarg.h>
-#include <ctype.h>
 
 #include "cmdline_vt100.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 50/53] bpf: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (48 preceding siblings ...)
  2022-01-14 16:24       ` [PATCH v4 49/53] cmdline: " Sean Morrissey
@ 2022-01-14 16:24       ` Sean Morrissey
  2022-01-14 16:24       ` [PATCH v4 51/53] bbdev: " Sean Morrissey
                         ` (3 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:24 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/bpf/bpf.c          |  4 ----
 lib/bpf/bpf_exec.c     |  6 ------
 lib/bpf/bpf_jit_x86.c  |  5 -----
 lib/bpf/bpf_load.c     |  8 --------
 lib/bpf/bpf_pkt.c      | 12 ------------
 lib/bpf/bpf_validate.c |  3 ---
 6 files changed, 38 deletions(-)

diff --git a/lib/bpf/bpf.c b/lib/bpf/bpf.c
index 0caad2a8f0..1e1dd42a58 100644
--- a/lib/bpf/bpf.c
+++ b/lib/bpf/bpf.c
@@ -2,15 +2,11 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <stdio.h>
-#include <string.h>
 #include <errno.h>
 #include <stdint.h>
-#include <inttypes.h>
 
 #include <rte_common.h>
-#include <rte_eal.h>
 
 #include "bpf_impl.h"
 
diff --git a/lib/bpf/bpf_exec.c b/lib/bpf/bpf_exec.c
index b921112feb..09f4a9a571 100644
--- a/lib/bpf/bpf_exec.c
+++ b/lib/bpf/bpf_exec.c
@@ -2,18 +2,12 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <stdio.h>
-#include <string.h>
-#include <errno.h>
 #include <stdint.h>
-#include <inttypes.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_debug.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
 #include <rte_byteorder.h>
 
 #include "bpf_impl.h"
diff --git a/lib/bpf/bpf_jit_x86.c b/lib/bpf/bpf_jit_x86.c
index 518513376a..c1a30e0386 100644
--- a/lib/bpf/bpf_jit_x86.c
+++ b/lib/bpf/bpf_jit_x86.c
@@ -2,17 +2,12 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <errno.h>
 #include <stdint.h>
-#include <inttypes.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_debug.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_byteorder.h>
 
 #include "bpf_impl.h"
 
diff --git a/lib/bpf/bpf_load.c b/lib/bpf/bpf_load.c
index 272f2ba11b..0c4ac7be6c 100644
--- a/lib/bpf/bpf_load.c
+++ b/lib/bpf/bpf_load.c
@@ -2,20 +2,12 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <inttypes.h>
 
-#include <rte_common.h>
 #include <rte_log.h>
-#include <rte_debug.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_byteorder.h>
 #include <rte_errno.h>
 
 #include "bpf_impl.h"
diff --git a/lib/bpf/bpf_pkt.c b/lib/bpf/bpf_pkt.c
index af422afc07..ffd2db7840 100644
--- a/lib/bpf/bpf_pkt.c
+++ b/lib/bpf/bpf_pkt.c
@@ -2,28 +2,16 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <inttypes.h>
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
 #include <sys/queue.h>
 
 #include <rte_common.h>
-#include <rte_byteorder.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
-#include <rte_debug.h>
-#include <rte_cycles.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_atomic.h>
 #include <rte_mbuf.h>
 #include <rte_ethdev.h>
diff --git a/lib/bpf/bpf_validate.c b/lib/bpf/bpf_validate.c
index 09331258eb..9ff86fc970 100644
--- a/lib/bpf/bpf_validate.c
+++ b/lib/bpf/bpf_validate.c
@@ -2,7 +2,6 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
@@ -10,8 +9,6 @@
 #include <inttypes.h>
 
 #include <rte_common.h>
-#include <rte_eal.h>
-#include <rte_byteorder.h>
 
 #include "bpf_impl.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 51/53] bbdev: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (49 preceding siblings ...)
  2022-01-14 16:24       ` [PATCH v4 50/53] bpf: " Sean Morrissey
@ 2022-01-14 16:24       ` Sean Morrissey
  2022-01-14 16:24       ` [PATCH v4 52/53] cryptodev: " Sean Morrissey
                         ` (2 subsequent siblings)
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:24 UTC (permalink / raw)
  To: Nicolas Chautru; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/bbdev/rte_bbdev.c | 4 ----
 lib/bbdev/rte_bbdev.h | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c
index 7f353d4f7e..aaee7b7872 100644
--- a/lib/bbdev/rte_bbdev.c
+++ b/lib/bbdev/rte_bbdev.c
@@ -6,19 +6,15 @@
 #include <string.h>
 #include <stdbool.h>
 
-#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_log.h>
-#include <rte_debug.h>
 #include <rte_eal.h>
 #include <rte_malloc.h>
 #include <rte_mempool.h>
 #include <rte_memzone.h>
 #include <rte_lcore.h>
-#include <rte_dev.h>
 #include <rte_spinlock.h>
-#include <rte_tailq.h>
 #include <rte_interrupts.h>
 
 #include "rte_bbdev_op.h"
diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h
index 1dbcf73b0e..b88c88167e 100644
--- a/lib/bbdev/rte_bbdev.h
+++ b/lib/bbdev/rte_bbdev.h
@@ -26,12 +26,8 @@ extern "C" {
 
 #include <stdint.h>
 #include <stdbool.h>
-#include <string.h>
 
-#include <rte_compat.h>
-#include <rte_bus.h>
 #include <rte_cpuflags.h>
-#include <rte_memory.h>
 
 #include "rte_bbdev_op.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 52/53] cryptodev: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (50 preceding siblings ...)
  2022-01-14 16:24       ` [PATCH v4 51/53] bbdev: " Sean Morrissey
@ 2022-01-14 16:24       ` Sean Morrissey
  2022-01-14 16:24       ` [PATCH v4 53/53] acl: " Sean Morrissey
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:24 UTC (permalink / raw)
  To: Akhil Goyal, Declan Doherty; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/cryptodev/cryptodev_pmd.h |  4 ----
 lib/cryptodev/rte_cryptodev.c | 11 -----------
 lib/cryptodev/rte_cryptodev.h |  2 --
 3 files changed, 17 deletions(-)

diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index b9146f652c..8cf2da9b69 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -15,11 +15,7 @@
 
 #include <string.h>
 
-#include <rte_config.h>
-#include <rte_dev.h>
 #include <rte_malloc.h>
-#include <rte_mbuf.h>
-#include <rte_mempool.h>
 #include <rte_log.h>
 #include <rte_common.h>
 
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index a40536c5ea..8c1cccef0b 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2,36 +2,25 @@
  * Copyright(c) 2015-2020 Intel Corporation
  */
 
-#include <sys/types.h>
 #include <sys/queue.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <stdint.h>
 #include <inttypes.h>
 
-#include <rte_byteorder.h>
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_dev.h>
-#include <rte_interrupts.h>
 #include <rte_memory.h>
 #include <rte_memcpy.h>
 #include <rte_memzone.h>
-#include <rte_launch.h>
-#include <rte_tailq.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_common.h>
 #include <rte_mempool.h>
 #include <rte_malloc.h>
-#include <rte_mbuf.h>
 #include <rte_errno.h>
 #include <rte_spinlock.h>
 #include <rte_string_fns.h>
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 59ea5a54df..3493384fc7 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -20,9 +20,7 @@ extern "C" {
 
 #include "rte_kvargs.h"
 #include "rte_crypto.h"
-#include "rte_dev.h"
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_rcu_qsbr.h>
 
 #include "rte_cryptodev_trace_fp.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v4 53/53] acl: remove unneeded header includes
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (51 preceding siblings ...)
  2022-01-14 16:24       ` [PATCH v4 52/53] cryptodev: " Sean Morrissey
@ 2022-01-14 16:24       ` Sean Morrissey
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
  53 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-14 16:24 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/acl/rte_acl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/acl/rte_acl.c b/lib/acl/rte_acl.c
index 4e693b2488..a61c3ba188 100644
--- a/lib/acl/rte_acl.c
+++ b/lib/acl/rte_acl.c
@@ -6,7 +6,6 @@
 #include <rte_string_fns.h>
 #include <rte_acl.h>
 #include <rte_tailq.h>
-#include <rte_vect.h>
 
 #include "acl.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [PATCH v4 01/53] devtools: script to remove unused headers includes
  2022-01-14 16:23       ` [PATCH v4 01/53] devtools: script to remove unused headers includes Sean Morrissey
@ 2022-01-14 17:02         ` Stephen Hemminger
  2022-01-14 17:36           ` Bruce Richardson
  0 siblings, 1 reply; 147+ messages in thread
From: Stephen Hemminger @ 2022-01-14 17:02 UTC (permalink / raw)
  To: Sean Morrissey; +Cc: dev, Conor Fogarty, Bruce Richardson

On Fri, 14 Jan 2022 16:23:17 +0000
Sean Morrissey <sean.morrissey@intel.com> wrote:

> This script can be used for removing headers flagged for removal by the
> include-what-you-use (IWYU) tool. The script has the ability to remove
> headers from specified sub-directories or dpdk as a whole and tests the
> build after each removal by calling meson compile.
> 
> example usages:
> 
> Remove headers flagged by iwyu_tool output file
> $ ./devtools/process_iwyu.py iwyu.out -b build
> 
> Remove headers flagged by iwyu_tool output file from sub-directory
> $ ./devtools/process_iwyu.py iwyu.out -b build -d lib/kvargs
> 
> Remove headers directly piped from the iwyu_tool
> $ iwyu_tool -p build | ./devtools/process_iwyu.py - -b build
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
> 
> Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>

Could this be a shell script instead of python?
That would prevent having to pull in more python library dependencies.

^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [PATCH v4 01/53] devtools: script to remove unused headers includes
  2022-01-14 17:02         ` Stephen Hemminger
@ 2022-01-14 17:36           ` Bruce Richardson
  0 siblings, 0 replies; 147+ messages in thread
From: Bruce Richardson @ 2022-01-14 17:36 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Sean Morrissey, dev, Conor Fogarty

On Fri, Jan 14, 2022 at 09:02:40AM -0800, Stephen Hemminger wrote:
> On Fri, 14 Jan 2022 16:23:17 +0000
> Sean Morrissey <sean.morrissey@intel.com> wrote:
> 
> > This script can be used for removing headers flagged for removal by the
> > include-what-you-use (IWYU) tool. The script has the ability to remove
> > headers from specified sub-directories or dpdk as a whole and tests the
> > build after each removal by calling meson compile.
> > 
> > example usages:
> > 
> > Remove headers flagged by iwyu_tool output file
> > $ ./devtools/process_iwyu.py iwyu.out -b build
> > 
> > Remove headers flagged by iwyu_tool output file from sub-directory
> > $ ./devtools/process_iwyu.py iwyu.out -b build -d lib/kvargs
> > 
> > Remove headers directly piped from the iwyu_tool
> > $ iwyu_tool -p build | ./devtools/process_iwyu.py - -b build
> > 
> > Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> > Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
> > 
> > Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Could this be a shell script instead of python?
> That would prevent having to pull in more python library dependencies.

Can you clarify what python library dependencies are you concerned about?
AFAIK everything in this script is just from the standard built-in python
library - Sean, perhaps you can confirm? Converting to shell would lead to
something far less readable, IMHO, and it would be less portable to windows
too in future.

/Bruce

^ permalink raw reply	[flat|nested] 147+ messages in thread

* RE: [PATCH v4 15/53] regexdev: remove unneeded header includes
  2022-01-14 16:23       ` [PATCH v4 15/53] regexdev: " Sean Morrissey
@ 2022-01-16  7:40         ` Ori Kam
  0 siblings, 0 replies; 147+ messages in thread
From: Ori Kam @ 2022-01-16  7:40 UTC (permalink / raw)
  To: Sean Morrissey; +Cc: dev

Hi Sean,

> -----Original Message-----
> From: Sean Morrissey <sean.morrissey@intel.com>
> Sent: Friday, January 14, 2022 6:24 PM
> Subject: [PATCH v4 15/53] regexdev: remove unneeded header includes
> 
> These header includes have been flagged by the iwyu_tool
> and removed.
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
> ---
>  lib/regexdev/rte_regexdev.c | 2 --
>  lib/regexdev/rte_regexdev.h | 3 ---
>  2 files changed, 5 deletions(-)
> 
> diff --git a/lib/regexdev/rte_regexdev.c b/lib/regexdev/rte_regexdev.c
> index 04ab713730..02a388bc5d 100644
> --- a/lib/regexdev/rte_regexdev.c
> +++ b/lib/regexdev/rte_regexdev.c
> @@ -5,8 +5,6 @@
> 
>  #include <string.h>
> 
> -#include <rte_memory.h>
> -#include <rte_memcpy.h>
>  #include <rte_memzone.h>
>  #include <rte_string_fns.h>
> 
> diff --git a/lib/regexdev/rte_regexdev.h b/lib/regexdev/rte_regexdev.h
> index 0bac46cda9..4ba67b0c25 100644
> --- a/lib/regexdev/rte_regexdev.h
> +++ b/lib/regexdev/rte_regexdev.h
> @@ -199,11 +199,8 @@ extern "C" {
>  #endif
> 
>  #include <rte_common.h>
> -#include <rte_config.h>
>  #include <rte_dev.h>
> -#include <rte_errno.h>
>  #include <rte_mbuf.h>
> -#include <rte_memory.h>
> 
>  #define RTE_REGEXDEV_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
> 
> --
> 2.25.1

Acked-by: Ori Kam <orika@nvidia.com>
Best,
Ori

^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 00/50] introduce IWYU
  2022-01-14 16:23     ` [PATCH v4 00/53] introduce IWYU Sean Morrissey
                         ` (52 preceding siblings ...)
  2022-01-14 16:24       ` [PATCH v4 53/53] acl: " Sean Morrissey
@ 2022-01-17 20:18       ` Sean Morrissey
  2022-01-17 20:18         ` [PATCH v5 01/50] devtools: script to remove unused headers includes Sean Morrissey
                           ` (50 more replies)
  53 siblings, 51 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:18 UTC (permalink / raw)
  Cc: dev, Sean Morrissey

This patchset introduces the include-what-you-use script which removes
unused header includes. IWYU GitHub:

https://github.com/include-what-you-use/include-what-you-use

Along with the script there are some patches which make a start on
removing unneeded headers.

V4:
* Re-added removed headers that are now needed in order to fix build
  issues.
* Removed other unused headers from other libraries

V5:
* Fix build issues for RHEL 7.
* Squash commits for overlapping libraries.

Sean Morrissey (50):
  devtools: script to remove unused headers includes
  telemetry: remove unneeded header includes
  ring: remove unneeded header includes
  kvargs: remove unneeded header includes
  eal: remove unneeded header includes
  vhost: remove unneeded header includes
  timer: remove unneeded header includes
  table: remove unneeded header includes
  stack: remove unneeded header includes
  security: remove unneeded header includes
  sched: remove unneeded header includes
  rib: remove unneeded header includes
  reorder: remove unneeded header includes
  regexdev: remove unneeded header includes
  rcu: remove unneeded header includes
  rawdev: remove unneeded header includes
  power: remove unneeded header includes
  port: remove unneeded header includes
  pipeline: remove unneeded header includes
  pdump: remove unneeded header includes
  pci: remove unneeded header includes
  pcapng: remove unneeded header includes
  node: remove unneeded header includes
  net: remove unneeded header includes
  metrics: remove unneeded header includes
  mempool: remove unneeded header includes
  member: remove unneeded header includes
  mbuf: remove unneeded header includes
  lpm: remove unneeded header includes
  latencystats: remove unneeded header includes
  kni: remove unneeded header includes
  jobstats: remove unneeded header includes
  ipsec: remove unneeded header includes
  ip_frag: remove unneeded header includes
  hash: remove unneeded header includes
  gro: remove unneeded header includes
  graph: remove unneeded header includes
  gpudev: remove unneeded header includes
  flow_classify: remove unneeded header includes
  fib: remove unneeded header includes
  eventdev: remove unneeded header includes
  efd: remove unneeded header includes
  dmadev: remove unneeded header includes
  distributor: remove unneeded header includes
  compressdev: remove unneeded header includes
  cmdline: remove unneeded header includes
  bpf: remove unneeded header includes
  bbdev: remove unneeded header includes
  cryptodev: remove unneeded header includes
  acl: remove unneeded header includes

 devtools/process_iwyu.py                    | 109 ++++++++++++++++++++
 examples/vm_power_manager/guest_cli/main.c  |   1 +
 lib/acl/rte_acl.c                           |   1 -
 lib/bbdev/rte_bbdev.c                       |   4 -
 lib/bbdev/rte_bbdev.h                       |   4 -
 lib/bpf/bpf.c                               |   4 -
 lib/bpf/bpf_exec.c                          |   6 --
 lib/bpf/bpf_jit_x86.c                       |   5 -
 lib/bpf/bpf_load.c                          |   8 --
 lib/bpf/bpf_pkt.c                           |  12 ---
 lib/bpf/bpf_validate.c                      |   3 -
 lib/cmdline/cmdline.c                       |   2 -
 lib/cmdline/cmdline_parse.c                 |   3 -
 lib/cmdline/cmdline_parse_num.c             |   4 -
 lib/cmdline/cmdline_parse_portlist.c        |   3 -
 lib/cmdline/cmdline_parse_string.c          |   4 -
 lib/cmdline/cmdline_rdline.c                |   2 -
 lib/cmdline/cmdline_vt100.c                 |   3 -
 lib/compressdev/rte_comp.c                  |   1 -
 lib/compressdev/rte_comp.h                  |   1 -
 lib/compressdev/rte_compressdev.c           |   1 -
 lib/compressdev/rte_compressdev.h           |   1 -
 lib/compressdev/rte_compressdev_pmd.h       |   2 -
 lib/cryptodev/cryptodev_pmd.h               |   4 -
 lib/cryptodev/rte_cryptodev.c               |  11 --
 lib/cryptodev/rte_cryptodev.h               |   2 -
 lib/distributor/rte_distributor.c           |   2 -
 lib/distributor/rte_distributor_match_sse.c |   2 -
 lib/distributor/rte_distributor_single.c    |   2 -
 lib/dmadev/rte_dmadev.h                     |   1 -
 lib/eal/common/eal_common_dev.c             |   5 -
 lib/eal/common/eal_common_devargs.c         |   1 -
 lib/eal/common/eal_common_errno.c           |   4 -
 lib/eal/common/eal_common_fbarray.c         |   3 -
 lib/eal/common/eal_common_hexdump.c         |   3 -
 lib/eal/common/eal_common_launch.c          |   6 --
 lib/eal/common/eal_common_lcore.c           |   7 +-
 lib/eal/common/eal_common_log.c             |   2 -
 lib/eal/common/eal_common_memalloc.c        |   3 -
 lib/eal/common/eal_common_memory.c          |   5 -
 lib/eal/common/eal_common_memzone.c         |   4 -
 lib/eal/common/eal_common_options.c         |   2 -
 lib/eal/common/eal_common_proc.c            |   2 -
 lib/eal/common/eal_common_string_fns.c      |   2 -
 lib/eal/common/eal_common_tailqs.c          |  11 --
 lib/eal/common/eal_common_thread.c          |   3 -
 lib/eal/common/eal_common_timer.c           |   6 --
 lib/eal/common/eal_common_trace.c           |   1 -
 lib/eal/common/hotplug_mp.h                 |   1 -
 lib/eal/common/malloc_elem.c                |   6 --
 lib/eal/common/malloc_heap.c                |   5 -
 lib/eal/common/malloc_mp.c                  |   1 -
 lib/eal/common/malloc_mp.h                  |   2 -
 lib/eal/common/rte_malloc.c                 |   5 -
 lib/eal/common/rte_random.c                 |   3 -
 lib/eal/common/rte_service.c                |   6 --
 lib/eal/include/rte_version.h               |   2 -
 lib/eal/linux/eal.c                         |  10 --
 lib/eal/linux/eal_alarm.c                   |   7 --
 lib/eal/linux/eal_cpuflags.c                |   2 -
 lib/eal/linux/eal_debug.c                   |   5 -
 lib/eal/linux/eal_dev.c                     |   4 -
 lib/eal/linux/eal_hugepage_info.c           |   7 --
 lib/eal/linux/eal_interrupts.c              |   8 --
 lib/eal/linux/eal_lcore.c                   |   7 --
 lib/eal/linux/eal_log.c                     |  11 +-
 lib/eal/linux/eal_memalloc.c                |   8 --
 lib/eal/linux/eal_memory.c                  |   9 --
 lib/eal/linux/eal_thread.c                  |   6 --
 lib/eal/linux/eal_timer.c                   |  15 ---
 lib/eal/linux/eal_vfio_mp_sync.c            |   1 -
 lib/eal/unix/eal_file.c                     |   1 -
 lib/eal/unix/rte_thread.c                   |   1 -
 lib/eal/x86/rte_cycles.c                    |   1 -
 lib/efd/rte_efd.c                           |   3 -
 lib/eventdev/rte_event_ring.c               |   6 --
 lib/eventdev/rte_event_ring.h               |   2 -
 lib/eventdev/rte_event_timer_adapter.c      |   5 -
 lib/eventdev/rte_event_timer_adapter.h      |   2 -
 lib/eventdev/rte_eventdev.c                 |  11 --
 lib/eventdev/rte_eventdev.h                 |   2 -
 lib/fib/dir24_8.c                           |   4 -
 lib/fib/rte_fib.c                           |   2 -
 lib/fib/rte_fib.h                           |   1 -
 lib/fib/rte_fib6.c                          |   2 -
 lib/fib/rte_fib6.h                          |   1 -
 lib/fib/trie.c                              |   5 -
 lib/fib/trie.h                              |   2 -
 lib/flow_classify/rte_flow_classify.c       |   3 -
 lib/flow_classify/rte_flow_classify.h       |   4 -
 lib/flow_classify/rte_flow_classify_parse.c |   1 -
 lib/flow_classify/rte_flow_classify_parse.h |   1 -
 lib/gpudev/gpudev.c                         |   1 -
 lib/graph/graph_debug.c                     |   2 -
 lib/graph/graph_ops.c                       |   1 -
 lib/graph/graph_populate.c                  |   2 -
 lib/graph/node.c                            |   1 -
 lib/gro/gro_tcp4.c                          |   1 -
 lib/gro/gro_tcp4.h                          |   2 -
 lib/gro/gro_udp4.c                          |   1 -
 lib/gro/gro_udp4.h                          |   2 -
 lib/gro/gro_vxlan_tcp4.c                    |   1 -
 lib/gro/gro_vxlan_udp4.c                    |   1 -
 lib/gro/rte_gro.c                           |   1 -
 lib/hash/rte_cuckoo_hash.c                  |   4 -
 lib/hash/rte_fbk_hash.c                     |   6 --
 lib/hash/rte_fbk_hash.h                     |   1 -
 lib/hash/rte_thash.c                        |   1 -
 lib/hash/rte_thash.h                        |   1 -
 lib/ip_frag/rte_ip_frag_common.c            |   1 -
 lib/ip_frag/rte_ipv4_fragmentation.c        |   2 -
 lib/ipsec/esp_inb.c                         |   1 -
 lib/ipsec/esp_outb.c                        |   1 -
 lib/ipsec/ipsec_sad.c                       |   1 -
 lib/ipsec/sa.c                              |   3 -
 lib/ipsec/sa.h                              |   1 -
 lib/jobstats/rte_jobstats.c                 |   3 -
 lib/kni/rte_kni.c                           |   2 -
 lib/kni/rte_kni.h                           |   2 -
 lib/kvargs/rte_kvargs.c                     |   2 -
 lib/latencystats/rte_latencystats.c         |   4 -
 lib/lpm/rte_lpm.c                           |   7 --
 lib/lpm/rte_lpm.h                           |   4 -
 lib/lpm/rte_lpm6.c                          |   7 --
 lib/lpm/rte_lpm6.h                          |   1 -
 lib/mbuf/rte_mbuf.c                         |  11 --
 lib/mbuf/rte_mbuf.h                         |   2 -
 lib/mbuf/rte_mbuf_dyn.h                     |   2 -
 lib/mbuf/rte_mbuf_pool_ops.c                |   1 -
 lib/mbuf/rte_mbuf_pool_ops.h                |   1 -
 lib/member/rte_member.c                     |   2 -
 lib/member/rte_member.h                     |   1 -
 lib/member/rte_member_vbf.c                 |   1 -
 lib/mempool/rte_mempool.c                   |   7 --
 lib/mempool/rte_mempool.h                   |   4 -
 lib/metrics/rte_metrics.c                   |   3 -
 lib/net/net_crc_avx512.c                    |   3 -
 lib/net/net_crc_sse.c                       |   1 -
 lib/net/rte_arp.c                           |   1 -
 lib/net/rte_ether.h                         |   1 -
 lib/net/rte_net.h                           |   1 -
 lib/net/rte_net_crc.c                       |   2 -
 lib/node/ethdev_ctrl.c                      |   2 -
 lib/node/ethdev_rx.c                        |   1 -
 lib/node/ethdev_tx.c                        |   1 -
 lib/node/ip4_lookup.c                       |   5 -
 lib/node/ip4_rewrite.c                      |   4 -
 lib/node/pkt_cls.c                          |   4 -
 lib/node/pkt_drop.c                         |   1 -
 lib/pcapng/rte_pcapng.c                     |   1 -
 lib/pcapng/rte_pcapng.h                     |   2 -
 lib/pci/rte_pci.c                           |  15 +--
 lib/pci/rte_pci.h                           |   2 -
 lib/pdump/rte_pdump.c                       |   1 -
 lib/pdump/rte_pdump.h                       |   2 -
 lib/pipeline/rte_pipeline.c                 |   4 -
 lib/pipeline/rte_port_in_action.c           |   2 -
 lib/pipeline/rte_swx_ctl.h                  |   2 -
 lib/pipeline/rte_swx_pipeline.c             |   1 -
 lib/pipeline/rte_swx_pipeline.h             |   1 -
 lib/pipeline/rte_swx_pipeline_spec.c        |   1 -
 lib/pipeline/rte_table_action.c             |   2 -
 lib/port/rte_port_fd.h                      |   1 -
 lib/port/rte_port_frag.c                    |   2 -
 lib/port/rte_port_frag.h                    |   1 -
 lib/port/rte_port_kni.c                     |   1 -
 lib/port/rte_port_kni.h                     |   1 -
 lib/port/rte_port_ras.c                     |   1 -
 lib/port/rte_port_ras.h                     |   1 -
 lib/port/rte_port_ring.h                    |   1 -
 lib/port/rte_port_sched.c                   |   1 -
 lib/port/rte_port_source_sink.c             |   1 -
 lib/port/rte_swx_port_fd.c                  |   1 -
 lib/port/rte_swx_port_fd.h                  |   1 -
 lib/port/rte_swx_port_ring.h                |   1 -
 lib/power/guest_channel.c                   |   2 -
 lib/power/power_acpi_cpufreq.c              |   7 --
 lib/power/power_acpi_cpufreq.h              |   4 -
 lib/power/power_common.h                    |   1 -
 lib/power/power_cppc_cpufreq.c              |   1 -
 lib/power/power_cppc_cpufreq.h              |   4 -
 lib/power/power_kvm_vm.c                    |   1 -
 lib/power/power_kvm_vm.h                    |   4 -
 lib/power/power_pstate_cpufreq.c            |   7 --
 lib/power/power_pstate_cpufreq.h            |   4 -
 lib/power/rte_power.c                       |   1 -
 lib/power/rte_power.h                       |   2 -
 lib/power/rte_power_empty_poll.c            |   2 -
 lib/rawdev/rte_rawdev.c                     |  14 ---
 lib/rcu/rte_rcu_qsbr.c                      |   4 -
 lib/rcu/rte_rcu_qsbr.h                      |   4 -
 lib/regexdev/rte_regexdev.c                 |   2 -
 lib/regexdev/rte_regexdev.h                 |   3 -
 lib/reorder/rte_reorder.c                   |   1 -
 lib/rib/rte_rib.c                           |   2 -
 lib/rib/rte_rib.h                           |   1 -
 lib/rib/rte_rib6.c                          |   2 -
 lib/rib/rte_rib6.h                          |   1 -
 lib/ring/rte_ring.c                         |   9 --
 lib/sched/rte_pie.c                         |   2 -
 lib/sched/rte_red.h                         |   1 -
 lib/sched/rte_sched.c                       |   1 -
 lib/sched/rte_sched.h                       |   1 -
 lib/security/rte_security.c                 |   2 -
 lib/security/rte_security.h                 |   3 -
 lib/stack/rte_stack.c                       |   2 -
 lib/stack/rte_stack.h                       |   1 -
 lib/table/rte_swx_table_em.c                |   1 -
 lib/table/rte_swx_table_em.h                |   1 -
 lib/table/rte_swx_table_learner.c           |   1 -
 lib/table/rte_swx_table_learner.h           |   1 -
 lib/table/rte_swx_table_selector.c          |   1 -
 lib/table/rte_swx_table_wm.c                |   2 -
 lib/table/rte_swx_table_wm.h                |   1 -
 lib/table/rte_table_acl.c                   |   3 -
 lib/table/rte_table_array.c                 |   2 -
 lib/table/rte_table_hash_cuckoo.c           |   2 -
 lib/table/rte_table_hash_ext.c              |   2 -
 lib/table/rte_table_hash_key16.c            |   2 -
 lib/table/rte_table_hash_key32.c            |   2 -
 lib/table/rte_table_hash_key8.c             |   2 -
 lib/table/rte_table_hash_lru.c              |   2 -
 lib/table/rte_table_lpm.c                   |   2 -
 lib/table/rte_table_lpm_ipv6.c              |   3 -
 lib/table/rte_table_stub.c                  |   1 -
 lib/table/rte_table_stub.h                  |   1 -
 lib/telemetry/telemetry.c                   |   1 -
 lib/telemetry/telemetry_data.h              |   1 -
 lib/timer/rte_timer.c                       |   7 --
 lib/vhost/fd_man.c                          |   6 --
 lib/vhost/fd_man.h                          |   1 -
 lib/vhost/socket.c                          |   1 -
 lib/vhost/vdpa.c                            |   1 -
 lib/vhost/vhost.c                           |   4 -
 lib/vhost/vhost.h                           |   2 -
 lib/vhost/vhost_user.c                      |   2 -
 236 files changed, 113 insertions(+), 693 deletions(-)
 create mode 100755 devtools/process_iwyu.py

-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 01/50] devtools: script to remove unused headers includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
@ 2022-01-17 20:18         ` Sean Morrissey
  2022-01-20 15:00           ` Thomas Monjalon
  2022-01-17 20:18         ` [PATCH v5 02/50] telemetry: remove unneeded header includes Sean Morrissey
                           ` (49 subsequent siblings)
  50 siblings, 1 reply; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:18 UTC (permalink / raw)
  Cc: dev, Sean Morrissey, Conor Fogarty, Bruce Richardson

This script can be used for removing headers flagged for removal by the
include-what-you-use (IWYU) tool. The script has the ability to remove
headers from specified sub-directories or dpdk as a whole and tests the
build after each removal by calling meson compile.

example usages:

Remove headers flagged by iwyu_tool output file
$ ./devtools/process_iwyu.py iwyu.out -b build

Remove headers flagged by iwyu_tool output file from sub-directory
$ ./devtools/process_iwyu.py iwyu.out -b build -d lib/kvargs

Remove headers directly piped from the iwyu_tool
$ iwyu_tool -p build | ./devtools/process_iwyu.py - -b build

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>

Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/process_iwyu.py | 109 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 109 insertions(+)
 create mode 100755 devtools/process_iwyu.py

diff --git a/devtools/process_iwyu.py b/devtools/process_iwyu.py
new file mode 100755
index 0000000000..50f3d4c5c7
--- /dev/null
+++ b/devtools/process_iwyu.py
@@ -0,0 +1,109 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2021 Intel Corporation
+#
+
+import argparse
+import fileinput
+import sys
+from os.path import abspath, relpath, join
+from pathlib import Path
+from mesonbuild import mesonmain
+
+
+def args_parse():
+    "parse arguments and return the argument object back to main"
+    parser = argparse.ArgumentParser(description="This script can be used to remove includes which are not in use\n")
+    parser.add_argument('-b', '--build_dir', type=str, default='build',
+                        help="The path to the build directory in which the IWYU tool was used in.")
+    parser.add_argument('-d', '--sub_dir', type=str, default='',
+                        help="The sub-directory to remove headers from.")
+    parser.add_argument('file', type=Path,
+                        help="The path to the IWYU log file or output from stdin.")
+
+    return parser.parse_args()
+
+
+def run_meson(args):
+    "Runs a meson command logging output to process.log"
+    with open('process_iwyu.log', 'a') as sys.stdout:
+        ret = mesonmain.run(args, abspath('meson'))
+    sys.stdout = sys.__stdout__
+    return ret
+
+
+def remove_includes(filepath, include, build_dir):
+    "Attempts to remove include, if it fails then revert to original state"
+    with open(filepath) as f:
+        lines = f.readlines()  # Read lines when file is opened
+
+    with open(filepath, 'w') as f:
+        for ln in lines:  # Removes the include passed in
+            if not ln.startswith(include):
+                f.write(ln)
+
+    # run test build -> call meson on the build folder, meson compile -C build
+    ret = run_meson(['compile', '-C', build_dir])
+    if (ret == 0):  # Include is not needed -> build is successful
+        print('SUCCESS')
+    else:
+        # failed, catch the error
+        # return file to original state
+        with open(filepath, 'w') as f:
+            f.writelines(lines)
+        print('FAILED')
+
+
+def get_build_config(builddir, condition):
+    "returns contents of rte_build_config.h"
+    with open(join(builddir, 'rte_build_config.h')) as f:
+        return [ln for ln in f.readlines() if condition(ln)]
+
+
+def uses_libbsd(builddir):
+    "return whether the build uses libbsd or not"
+    return bool(get_build_config(builddir, lambda ln: 'RTE_USE_LIBBSD' in ln))
+
+
+def process(args):
+    "process the iwyu output on a set of files"
+    filepath = None
+    build_dir = abspath(args.build_dir)
+    directory = args.sub_dir
+
+    print("Warning: The results of this script may include false positives which are required for different systems",
+          file=sys.stderr)
+
+    keep_str_fns = uses_libbsd(build_dir)  # check for libbsd
+    if keep_str_fns:
+        print("Warning: libbsd is present, build will fail to detect incorrect removal of rte_string_fns.h",
+              file=sys.stderr)
+    # turn on werror
+    run_meson(['configure', build_dir, '-Dwerror=true'])
+    # Use stdin if no iwyu_tool out file given
+    for line in fileinput.input(args.file):
+        if 'should remove' in line:
+            # If the file path in the iwyu_tool output is an absolute path it
+            # means the file is outside of the dpdk directory, therefore ignore it.
+            # Also check to see if the file is within the specified sub directory.
+            filename = line.split()[0]
+            if (filename != abspath(filename) and
+                    directory in filename):
+                filepath = relpath(join(build_dir, filename))
+        elif line.startswith('-') and filepath:
+            include = '#include ' + line.split()[2]
+            print(f"Remove {include} from {filepath} ... ", end='', flush=True)
+            if keep_str_fns and '<rte_string_fns.h>' in include:
+                print('skipped')
+                continue
+            remove_includes(filepath, include, build_dir)
+        else:
+            filepath = None
+
+
+def main():
+    process(args_parse())
+
+
+if __name__ == '__main__':
+    main()
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 02/50] telemetry: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
  2022-01-17 20:18         ` [PATCH v5 01/50] devtools: script to remove unused headers includes Sean Morrissey
@ 2022-01-17 20:18         ` Sean Morrissey
  2022-01-17 20:18         ` [PATCH v5 03/50] ring: " Sean Morrissey
                           ` (48 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:18 UTC (permalink / raw)
  To: Ciara Power; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

Acked-by: Ciara Power <ciara.power@intel.com>
---
 lib/telemetry/telemetry.c      | 1 -
 lib/telemetry/telemetry_data.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index e5ccfe47f7..c6fd03a5ab 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -8,7 +8,6 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/stat.h>
-#include <dlfcn.h>
 #endif /* !RTE_EXEC_ENV_WINDOWS */
 
 /* we won't link against libbsd, so just always use DPDKs-specific strlcpy */
diff --git a/lib/telemetry/telemetry_data.h b/lib/telemetry/telemetry_data.h
index adb84a09f1..26aa28e72c 100644
--- a/lib/telemetry/telemetry_data.h
+++ b/lib/telemetry/telemetry_data.h
@@ -5,7 +5,6 @@
 #ifndef _TELEMETRY_DATA_H_
 #define _TELEMETRY_DATA_H_
 
-#include <inttypes.h>
 #include "rte_telemetry.h"
 
 enum tel_container_types {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 03/50] ring: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
  2022-01-17 20:18         ` [PATCH v5 01/50] devtools: script to remove unused headers includes Sean Morrissey
  2022-01-17 20:18         ` [PATCH v5 02/50] telemetry: remove unneeded header includes Sean Morrissey
@ 2022-01-17 20:18         ` Sean Morrissey
  2022-01-17 20:18         ` [PATCH v5 04/50] kvargs: " Sean Morrissey
                           ` (47 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:18 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/ring/rte_ring.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
index f17bd966be..7945e5d9ed 100644
--- a/lib/ring/rte_ring.c
+++ b/lib/ring/rte_ring.c
@@ -8,7 +8,6 @@
  */
 
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
 #include <stdint.h>
 #include <inttypes.h>
@@ -17,19 +16,11 @@
 
 #include <rte_common.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_malloc.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_atomic.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
-#include <rte_spinlock.h>
 #include <rte_tailq.h>
 
 #include "rte_ring.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 04/50] kvargs: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (2 preceding siblings ...)
  2022-01-17 20:18         ` [PATCH v5 03/50] ring: " Sean Morrissey
@ 2022-01-17 20:18         ` Sean Morrissey
  2022-01-17 20:18         ` [PATCH v5 05/50] eal: " Sean Morrissey
                           ` (46 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:18 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/kvargs/rte_kvargs.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/kvargs/rte_kvargs.c b/lib/kvargs/rte_kvargs.c
index 11f624ef14..9a59c500bf 100644
--- a/lib/kvargs/rte_kvargs.c
+++ b/lib/kvargs/rte_kvargs.c
@@ -7,8 +7,6 @@
 #include <stdlib.h>
 #include <stdbool.h>
 
-#include <rte_os_shim.h>
-#include <rte_string_fns.h>
 
 #include "rte_kvargs.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 05/50] eal: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (3 preceding siblings ...)
  2022-01-17 20:18         ` [PATCH v5 04/50] kvargs: " Sean Morrissey
@ 2022-01-17 20:18         ` Sean Morrissey
  2022-01-17 20:18         ` [PATCH v5 06/50] vhost: " Sean Morrissey
                           ` (45 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:18 UTC (permalink / raw)
  To: Anatoly Burakov, Jerin Jacob, Sunil Kumar Kori,
	Mattias Rönnblom, Harry van Haaren, Harman Kalra,
	Bruce Richardson, Konstantin Ananyev
  Cc: dev, Sean Morrissey, David Christensen

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>

Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>

Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
---
 lib/eal/common/eal_common_dev.c        |  5 -----
 lib/eal/common/eal_common_devargs.c    |  1 -
 lib/eal/common/eal_common_errno.c      |  4 ----
 lib/eal/common/eal_common_fbarray.c    |  3 ---
 lib/eal/common/eal_common_hexdump.c    |  3 ---
 lib/eal/common/eal_common_launch.c     |  6 ------
 lib/eal/common/eal_common_lcore.c      |  7 +------
 lib/eal/common/eal_common_log.c        |  2 --
 lib/eal/common/eal_common_memalloc.c   |  3 ---
 lib/eal/common/eal_common_memory.c     |  5 -----
 lib/eal/common/eal_common_memzone.c    |  4 ----
 lib/eal/common/eal_common_options.c    |  2 --
 lib/eal/common/eal_common_proc.c       |  2 --
 lib/eal/common/eal_common_string_fns.c |  2 --
 lib/eal/common/eal_common_tailqs.c     | 11 -----------
 lib/eal/common/eal_common_thread.c     |  3 ---
 lib/eal/common/eal_common_timer.c      |  6 ------
 lib/eal/common/eal_common_trace.c      |  1 -
 lib/eal/common/hotplug_mp.h            |  1 -
 lib/eal/common/malloc_elem.c           |  6 ------
 lib/eal/common/malloc_heap.c           |  5 -----
 lib/eal/common/malloc_mp.c             |  1 -
 lib/eal/common/malloc_mp.h             |  2 --
 lib/eal/common/rte_malloc.c            |  5 -----
 lib/eal/common/rte_random.c            |  3 ---
 lib/eal/common/rte_service.c           |  6 ------
 lib/eal/include/rte_version.h          |  2 --
 lib/eal/linux/eal.c                    | 10 ----------
 lib/eal/linux/eal_alarm.c              |  7 -------
 lib/eal/linux/eal_cpuflags.c           |  2 --
 lib/eal/linux/eal_debug.c              |  5 -----
 lib/eal/linux/eal_dev.c                |  4 ----
 lib/eal/linux/eal_hugepage_info.c      |  7 -------
 lib/eal/linux/eal_interrupts.c         |  8 --------
 lib/eal/linux/eal_lcore.c              |  7 -------
 lib/eal/linux/eal_log.c                | 11 +----------
 lib/eal/linux/eal_memalloc.c           |  8 --------
 lib/eal/linux/eal_memory.c             |  9 ---------
 lib/eal/linux/eal_thread.c             |  6 ------
 lib/eal/linux/eal_timer.c              | 15 ---------------
 lib/eal/linux/eal_vfio_mp_sync.c       |  1 -
 lib/eal/unix/eal_file.c                |  1 -
 lib/eal/unix/rte_thread.c              |  1 -
 lib/eal/x86/rte_cycles.c               |  1 -
 44 files changed, 2 insertions(+), 202 deletions(-)

diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index e1e9976d8d..c0ee4e442f 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -5,20 +5,15 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 
-#include <rte_compat.h>
 #include <rte_bus.h>
 #include <rte_class.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
-#include <rte_debug.h>
 #include <rte_errno.h>
-#include <rte_kvargs.h>
 #include <rte_log.h>
 #include <rte_spinlock.h>
-#include <rte_malloc.h>
 #include <rte_string_fns.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c
index 8c7650cf6c..c3c3a9e6e4 100644
--- a/lib/eal/common/eal_common_devargs.c
+++ b/lib/eal/common/eal_common_devargs.c
@@ -12,7 +12,6 @@
 
 #include <rte_bus.h>
 #include <rte_class.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_errno.h>
diff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c
index f86802705a..1091065568 100644
--- a/lib/eal/common/eal_common_errno.c
+++ b/lib/eal/common/eal_common_errno.c
@@ -5,15 +5,11 @@
 /* Use XSI-compliant portable version of strerror_r() */
 #undef _GNU_SOURCE
 
-#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdarg.h>
-#include <errno.h>
 
 #include <rte_per_lcore.h>
 #include <rte_errno.h>
-#include <rte_string_fns.h>
 
 #ifdef RTE_EXEC_ENV_WINDOWS
 #define strerror_r(errnum, buf, buflen) strerror_s(buf, buflen, errnum)
diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 3a28a53247..f11f87979f 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -2,7 +2,6 @@
  * Copyright(c) 2017-2018 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <inttypes.h>
 #include <limits.h>
 #include <stdint.h>
@@ -14,9 +13,7 @@
 #include <rte_eal_paging.h>
 #include <rte_errno.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 #include "eal_filesystem.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_hexdump.c b/lib/eal/common/eal_common_hexdump.c
index 2d2179d411..63bbbdcf0a 100644
--- a/lib/eal/common/eal_common_hexdump.c
+++ b/lib/eal/common/eal_common_hexdump.c
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2010-2014 Intel Corporation
  */
-#include <stdlib.h>
 #include <stdio.h>
-#include <errno.h>
-#include <stdint.h>
 #include <rte_hexdump.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/eal_common_launch.c b/lib/eal/common/eal_common_launch.c
index e95dadffb3..9f393b9bda 100644
--- a/lib/eal/common/eal_common_launch.c
+++ b/lib/eal/common/eal_common_launch.c
@@ -3,16 +3,10 @@
  */
 
 #include <errno.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <sys/queue.h>
 
 #include <rte_launch.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
 #include <rte_atomic.h>
 #include <rte_pause.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c
index 5de7570aac..11092791a4 100644
--- a/lib/eal/common/eal_common_lcore.c
+++ b/lib/eal/common/eal_common_lcore.c
@@ -2,19 +2,14 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <unistd.h>
-#include <limits.h>
 #include <string.h>
 
 #include <rte_common.h>
-#include <rte_debug.h>
-#include <rte_eal.h>
+#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_rwlock.h>
 
-#include "eal_memcfg.h"
 #include "eal_private.h"
 #include "eal_thread.h"
 
diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c
index 1be35f5397..6030927bbf 100644
--- a/lib/eal/common/eal_common_log.c
+++ b/lib/eal/common/eal_common_log.c
@@ -12,9 +12,7 @@
 #include <fnmatch.h>
 #include <sys/queue.h>
 
-#include <rte_eal.h>
 #include <rte_log.h>
-#include <rte_os_shim.h>
 #include <rte_per_lcore.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/common/eal_common_memalloc.c b/lib/eal/common/eal_common_memalloc.c
index e872c6533b..f8770ff835 100644
--- a/lib/eal/common/eal_common_memalloc.c
+++ b/lib/eal/common/eal_common_memalloc.c
@@ -5,12 +5,9 @@
 #include <string.h>
 
 #include <rte_errno.h>
-#include <rte_lcore.h>
 #include <rte_fbarray.h>
-#include <rte_memzone.h>
 #include <rte_memory.h>
 #include <rte_string_fns.h>
-#include <rte_rwlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
index 616db5ce31..e93d558a7d 100644
--- a/lib/eal/common/eal_common_memory.c
+++ b/lib/eal/common/eal_common_memory.c
@@ -2,16 +2,11 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdlib.h>
-#include <stdarg.h>
 #include <string.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/queue.h>
 
 #include <rte_fbarray.h>
 #include <rte_memory.h>
diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c
index ecde9441ee..0059de6981 100644
--- a/lib/eal/common/eal_common_memzone.c
+++ b/lib/eal/common/eal_common_memzone.c
@@ -2,20 +2,16 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <stdarg.h>
 #include <inttypes.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/queue.h>
 
 #include <rte_log.h>
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_common.h>
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index 1cfdd75f3b..071f1acf50 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -4,7 +4,6 @@
  */
 
 #include <stdlib.h>
-#include <unistd.h>
 #include <string.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <syslog.h>
@@ -17,7 +16,6 @@
 #include <dlfcn.h>
 #include <libgen.h>
 #endif
-#include <sys/types.h>
 #include <sys/stat.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <dirent.h>
diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index ebd0f6673b..575b4ca24d 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -15,7 +15,6 @@
 #include <string.h>
 #include <sys/file.h>
 #include <sys/time.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
@@ -27,7 +26,6 @@
 #include <rte_errno.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
-#include <rte_tailq.h>
 
 #include "eal_memcfg.h"
 #include "eal_private.h"
diff --git a/lib/eal/common/eal_common_string_fns.c b/lib/eal/common/eal_common_string_fns.c
index ddd1891656..0236ae4023 100644
--- a/lib/eal/common/eal_common_string_fns.c
+++ b/lib/eal/common/eal_common_string_fns.c
@@ -2,9 +2,7 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 
 #include <rte_string_fns.h>
diff --git a/lib/eal/common/eal_common_tailqs.c b/lib/eal/common/eal_common_tailqs.c
index ead06897b8..580fbf24bc 100644
--- a/lib/eal/common/eal_common_tailqs.c
+++ b/lib/eal/common/eal_common_tailqs.c
@@ -3,24 +3,13 @@
  */
 
 #include <sys/queue.h>
-#include <stdint.h>
-#include <errno.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
-#include <inttypes.h>
 
-#include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_log.h>
 #include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_memcfg.h"
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index bb6fc8084c..684bea166c 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -4,10 +4,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
 #include <pthread.h>
-#include <signal.h>
 #include <sched.h>
 #include <assert.h>
 #include <string.h>
diff --git a/lib/eal/common/eal_common_timer.c b/lib/eal/common/eal_common_timer.c
index 86f8429847..5686a5102b 100644
--- a/lib/eal/common/eal_common_timer.c
+++ b/lib/eal/common/eal_common_timer.c
@@ -2,16 +2,10 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <sys/types.h>
-#include <time.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
 #include <rte_pause.h>
diff --git a/lib/eal/common/eal_common_trace.c b/lib/eal/common/eal_common_trace.c
index 7bff1cd2ce..036f6ac348 100644
--- a/lib/eal/common/eal_common_trace.c
+++ b/lib/eal/common/eal_common_trace.c
@@ -3,7 +3,6 @@
  */
 
 #include <fnmatch.h>
-#include <inttypes.h>
 #include <sys/queue.h>
 #include <regex.h>
 
diff --git a/lib/eal/common/hotplug_mp.h b/lib/eal/common/hotplug_mp.h
index 8fcf9b52e2..066494ff27 100644
--- a/lib/eal/common/hotplug_mp.h
+++ b/lib/eal/common/hotplug_mp.h
@@ -6,7 +6,6 @@
 #define _HOTPLUG_MP_H_
 
 #include "rte_dev.h"
-#include "rte_bus.h"
 
 #define EAL_DEV_MP_ACTION_REQUEST      "eal_dev_mp_request"
 #define EAL_DEV_MP_ACTION_RESPONSE     "eal_dev_mp_response"
diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c
index bdd20a162e..c08f129c04 100644
--- a/lib/eal/common/malloc_elem.c
+++ b/lib/eal/common/malloc_elem.c
@@ -6,17 +6,11 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/queue.h>
 
 #include <rte_memory.h>
 #include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_debug.h>
 #include <rte_common.h>
-#include <rte_spinlock.h>
 
 #include "eal_private.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c
index 55aad2711b..5ee5b07941 100644
--- a/lib/eal/common/malloc_heap.c
+++ b/lib/eal/common/malloc_heap.c
@@ -5,7 +5,6 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <sys/queue.h>
 
@@ -13,15 +12,11 @@
 #include <rte_errno.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_string_fns.h>
 #include <rte_spinlock.h>
-#include <rte_memcpy.h>
 #include <rte_memzone.h>
-#include <rte_atomic.h>
 #include <rte_fbarray.h>
 
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c
index 2e597a17a2..801b2e7fbd 100644
--- a/lib/eal/common/malloc_mp.c
+++ b/lib/eal/common/malloc_mp.c
@@ -5,7 +5,6 @@
 #include <string.h>
 #include <sys/time.h>
 
-#include <rte_alarm.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/eal/common/malloc_mp.h b/lib/eal/common/malloc_mp.h
index 0095062b72..fb10817e13 100644
--- a/lib/eal/common/malloc_mp.h
+++ b/lib/eal/common/malloc_mp.h
@@ -10,8 +10,6 @@
 
 #include <rte_common.h>
 #include <rte_random.h>
-#include <rte_spinlock.h>
-#include <rte_tailq.h>
 
 /* forward declarations */
 struct malloc_heap;
diff --git a/lib/eal/common/rte_malloc.c b/lib/eal/common/rte_malloc.c
index d0bec26920..7bcbec51a2 100644
--- a/lib/eal/common/rte_malloc.c
+++ b/lib/eal/common/rte_malloc.c
@@ -13,11 +13,6 @@
 #include <rte_memory.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_branch_prediction.h>
-#include <rte_debug.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_common.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/common/rte_random.c b/lib/eal/common/rte_random.c
index ce21c2242a..4535cc980c 100644
--- a/lib/eal/common/rte_random.c
+++ b/lib/eal/common/rte_random.c
@@ -5,14 +5,11 @@
 #ifdef __RDSEED__
 #include <x86intrin.h>
 #endif
-#include <stdlib.h>
 #include <unistd.h>
 
 #include <rte_branch_prediction.h>
 #include <rte_cycles.h>
-#include <rte_eal.h>
 #include <rte_lcore.h>
-#include <rte_memory.h>
 #include <rte_random.h>
 
 struct rte_rand_state {
diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c
index bd8fb72e78..ef31b1f63c 100644
--- a/lib/eal/common/rte_service.c
+++ b/lib/eal/common/rte_service.c
@@ -3,22 +3,16 @@
  */
 
 #include <stdio.h>
-#include <unistd.h>
 #include <inttypes.h>
-#include <limits.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_service.h>
 #include <rte_service_component.h>
 
-#include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_debug.h>
 #include <rte_cycles.h>
 #include <rte_atomic.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/include/rte_version.h b/lib/eal/include/rte_version.h
index b06a62e7a2..414b6167f2 100644
--- a/lib/eal/include/rte_version.h
+++ b/lib/eal/include/rte_version.h
@@ -14,10 +14,8 @@
 extern "C" {
 #endif
 
-#include <stdint.h>
 #include <string.h>
 #include <stdio.h>
-#include <rte_common.h>
 #include <rte_compat.h>
 
 /**
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 60b4924838..b5621e64e2 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -7,10 +7,8 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <syslog.h>
 #include <getopt.h>
 #include <sys/file.h>
 #include <dirent.h>
@@ -20,32 +18,24 @@
 #include <errno.h>
 #include <limits.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
 #include <sys/stat.h>
 #if defined(RTE_ARCH_X86)
 #include <sys/io.h>
 #endif
 #include <linux/version.h>
 
-#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
 #include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_errno.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_service_component.h>
 #include <rte_log.h>
-#include <rte_random.h>
-#include <rte_cycles.h>
 #include <rte_string_fns.h>
 #include <rte_cpuflags.h>
-#include <rte_interrupts.h>
 #include <rte_bus.h>
-#include <rte_dev.h>
-#include <rte_devargs.h>
 #include <rte_version.h>
 #include <malloc_heap.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/linux/eal_alarm.c b/lib/eal/linux/eal_alarm.c
index 3b5e894595..4de67138bc 100644
--- a/lib/eal/linux/eal_alarm.c
+++ b/lib/eal/linux/eal_alarm.c
@@ -3,21 +3,14 @@
  */
 #include <stdio.h>
 #include <stdint.h>
-#include <signal.h>
 #include <errno.h>
-#include <string.h>
 #include <sys/queue.h>
 #include <sys/time.h>
 #include <sys/timerfd.h>
 
-#include <rte_memory.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_common.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_lcore.h>
 #include <rte_errno.h>
 #include <rte_spinlock.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_cpuflags.c b/lib/eal/linux/eal_cpuflags.c
index d38296e1e5..c684940e1d 100644
--- a/lib/eal/linux/eal_cpuflags.c
+++ b/lib/eal/linux/eal_cpuflags.c
@@ -5,8 +5,6 @@
 #include <elf.h>
 #include <fcntl.h>
 #include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
diff --git a/lib/eal/linux/eal_debug.c b/lib/eal/linux/eal_debug.c
index 64dab4e0da..b0ecf5a9dc 100644
--- a/lib/eal/linux/eal_debug.c
+++ b/lib/eal/linux/eal_debug.c
@@ -5,16 +5,11 @@
 #ifdef RTE_BACKTRACE
 #include <execinfo.h>
 #endif
-#include <stdarg.h>
-#include <signal.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdint.h>
 
 #include <rte_log.h>
 #include <rte_debug.h>
-#include <rte_common.h>
-#include <rte_eal.h>
 
 #define BACKTRACE_SIZE 256
 
diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c
index bde55a3d92..f6e5861221 100644
--- a/lib/eal/linux/eal_dev.c
+++ b/lib/eal/linux/eal_dev.c
@@ -4,20 +4,16 @@
 
 #include <string.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <signal.h>
 #include <sys/socket.h>
 #include <linux/netlink.h>
 
 #include <rte_string_fns.h>
 #include <rte_log.h>
-#include <rte_compat.h>
 #include <rte_dev.h>
-#include <rte_malloc.h>
 #include <rte_interrupts.h>
 #include <rte_alarm.h>
 #include <rte_bus.h>
-#include <rte_eal.h>
 #include <rte_spinlock.h>
 #include <rte_errno.h>
 
diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_hugepage_info.c
index 9fb0e968db..3f760f85ca 100644
--- a/lib/eal/linux/eal_hugepage_info.c
+++ b/lib/eal/linux/eal_hugepage_info.c
@@ -3,7 +3,6 @@
  */
 
 #include <string.h>
-#include <sys/types.h>
 #include <sys/file.h>
 #include <dirent.h>
 #include <fcntl.h>
@@ -12,19 +11,13 @@
 #include <stdio.h>
 #include <fnmatch.h>
 #include <inttypes.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
 #include <sys/stat.h>
 
 #include <linux/mman.h> /* for hugetlb-related flags */
 
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_debug.h>
 #include <rte_log.h>
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index 70060bf3ef..d52ec8eb4c 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -7,13 +7,10 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <sys/queue.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <inttypes.h>
 #include <sys/epoll.h>
-#include <sys/signalfd.h>
 #include <sys/ioctl.h>
 #include <sys/eventfd.h>
 #include <assert.h>
@@ -21,9 +18,6 @@
 
 #include <rte_common.h>
 #include <rte_interrupts.h>
-#include <rte_memory.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_branch_prediction.h>
@@ -36,8 +30,6 @@
 #include <rte_eal_trace.h>
 
 #include "eal_private.h"
-#include "eal_vfio.h"
-#include "eal_thread.h"
 
 #define EAL_INTR_EPOLL_WAIT_FOREVER (-1)
 #define NB_OTHER_INTR               1
diff --git a/lib/eal/linux/eal_lcore.c b/lib/eal/linux/eal_lcore.c
index bc8965844c..2e6a350603 100644
--- a/lib/eal/linux/eal_lcore.c
+++ b/lib/eal/linux/eal_lcore.c
@@ -4,15 +4,8 @@
 
 #include <unistd.h>
 #include <limits.h>
-#include <string.h>
-#include <dirent.h>
 
 #include <rte_log.h>
-#include <rte_eal.h>
-#include <rte_lcore.h>
-#include <rte_common.h>
-#include <rte_string_fns.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
 #include "eal_filesystem.h"
diff --git a/lib/eal/linux/eal_log.c b/lib/eal/linux/eal_log.c
index c0aa1007c4..9e72412e2b 100644
--- a/lib/eal/linux/eal_log.c
+++ b/lib/eal/linux/eal_log.c
@@ -2,19 +2,10 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
-#include <stdint.h>
 #include <sys/types.h>
 #include <syslog.h>
-#include <sys/queue.h>
-
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_launch.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_spinlock.h>
+
 #include <rte_log.h>
 
 #include "eal_log.h"
diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c
index 337f2bc739..3ba5ca4673 100644
--- a/lib/eal/linux/eal_memalloc.c
+++ b/lib/eal/linux/eal_memalloc.c
@@ -3,23 +3,17 @@
  */
 
 #include <errno.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <unistd.h>
 #include <limits.h>
 #include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
@@ -36,9 +30,7 @@
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_eal.h>
-#include <rte_errno.h>
 #include <rte_memory.h>
-#include <rte_spinlock.h>
 
 #include "eal_filesystem.h"
 #include "eal_internal_cfg.h"
diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c
index 03a4f2dd2d..40ec9663d0 100644
--- a/lib/eal/linux/eal_memory.c
+++ b/lib/eal/linux/eal_memory.c
@@ -5,7 +5,6 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <stdarg.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -13,19 +12,14 @@
 #include <inttypes.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
 #include <sys/file.h>
 #include <sys/resource.h>
 #include <unistd.h>
 #include <limits.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
 #include <signal.h>
 #include <setjmp.h>
 #ifdef F_ADD_SEALS /* if file sealing is supported, so is memfd */
-#include <linux/memfd.h>
 #define MEMFD_SUPPORTED
 #endif
 #ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES
@@ -36,12 +30,9 @@
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_memory.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 #include <rte_common.h>
-#include <rte_string_fns.h>
 
 #include "eal_private.h"
 #include "eal_memalloc.h"
diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index c7f0f9b2f7..fa6cd7e2c4 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -4,20 +4,14 @@
 
 #include <errno.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdint.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <sched.h>
-#include <sys/queue.h>
 #include <sys/syscall.h>
 
 #include <rte_debug.h>
-#include <rte_atomic.h>
 #include <rte_launch.h>
 #include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_per_lcore.h>
 #include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_eal_trace.h>
diff --git a/lib/eal/linux/eal_timer.c b/lib/eal/linux/eal_timer.c
index 7cf15cabac..620baf038d 100644
--- a/lib/eal/linux/eal_timer.c
+++ b/lib/eal/linux/eal_timer.c
@@ -3,28 +3,13 @@
  * Copyright(c) 2012-2013 6WIND S.A.
  */
 
-#include <string.h>
-#include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <inttypes.h>
-#include <sys/mman.h>
-#include <sys/queue.h>
-#include <pthread.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_log.h>
 #include <rte_cycles.h>
-#include <rte_lcore.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_debug.h>
 
 #include "eal_private.h"
-#include "eal_internal_cfg.h"
 
 enum timer_source eal_timer_source = EAL_TIMER_HPET;
 
diff --git a/lib/eal/linux/eal_vfio_mp_sync.c b/lib/eal/linux/eal_vfio_mp_sync.c
index a2accfab3a..e1776166af 100644
--- a/lib/eal/linux/eal_vfio_mp_sync.c
+++ b/lib/eal/linux/eal_vfio_mp_sync.c
@@ -5,7 +5,6 @@
 #include <unistd.h>
 #include <string.h>
 
-#include <rte_compat.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_vfio.h>
diff --git a/lib/eal/unix/eal_file.c b/lib/eal/unix/eal_file.c
index ec554e0096..f04f5fbcbc 100644
--- a/lib/eal/unix/eal_file.c
+++ b/lib/eal/unix/eal_file.c
@@ -3,7 +3,6 @@
  */
 
 #include <sys/file.h>
-#include <sys/mman.h>
 #include <fcntl.h>
 #include <unistd.h>
 
diff --git a/lib/eal/unix/rte_thread.c b/lib/eal/unix/rte_thread.c
index c72d619ec1..c34ede9186 100644
--- a/lib/eal/unix/rte_thread.c
+++ b/lib/eal/unix/rte_thread.c
@@ -7,7 +7,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 #include <rte_thread.h>
diff --git a/lib/eal/x86/rte_cycles.c b/lib/eal/x86/rte_cycles.c
index edd9621abb..0e695caf28 100644
--- a/lib/eal/x86/rte_cycles.c
+++ b/lib/eal/x86/rte_cycles.c
@@ -6,7 +6,6 @@
 #include <unistd.h>
 #include <cpuid.h>
 
-#include <rte_common.h>
 
 #include "eal_private.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 06/50] vhost: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (4 preceding siblings ...)
  2022-01-17 20:18         ` [PATCH v5 05/50] eal: " Sean Morrissey
@ 2022-01-17 20:18         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 07/50] timer: " Sean Morrissey
                           ` (44 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:18 UTC (permalink / raw)
  To: Maxime Coquelin, Chenbo Xia; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/vhost/fd_man.c     | 6 ------
 lib/vhost/fd_man.h     | 1 -
 lib/vhost/socket.c     | 1 -
 lib/vhost/vdpa.c       | 1 -
 lib/vhost/vhost.c      | 4 ----
 lib/vhost/vhost.h      | 2 --
 lib/vhost/vhost_user.c | 2 --
 7 files changed, 17 deletions(-)

diff --git a/lib/vhost/fd_man.c b/lib/vhost/fd_man.c
index 55d4856f9e..1876fada33 100644
--- a/lib/vhost/fd_man.c
+++ b/lib/vhost/fd_man.c
@@ -2,14 +2,8 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <stdint.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/types.h>
 #include <unistd.h>
-#include <string.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
diff --git a/lib/vhost/fd_man.h b/lib/vhost/fd_man.h
index 3ab5cfdd60..6f4499bdfa 100644
--- a/lib/vhost/fd_man.h
+++ b/lib/vhost/fd_man.h
@@ -4,7 +4,6 @@
 
 #ifndef _FD_MAN_H_
 #define _FD_MAN_H_
-#include <stdint.h>
 #include <pthread.h>
 #include <poll.h>
 
diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index 82963c1e6d..c22d84a2cb 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -8,7 +8,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/queue.h>
diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c
index 09ad5d866e..7c57b3f75b 100644
--- a/lib/vhost/vdpa.c
+++ b/lib/vhost/vdpa.c
@@ -8,7 +8,6 @@
  * Device specific vhost lib
  */
 
-#include <stdbool.h>
 #include <sys/queue.h>
 
 #include <rte_class.h>
diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
index 13a9bb9dd1..40703b882f 100644
--- a/lib/vhost/vhost.c
+++ b/lib/vhost/vhost.c
@@ -4,7 +4,6 @@
 
 #include <linux/vhost.h>
 #include <linux/virtio_net.h>
-#include <stddef.h>
 #include <stdint.h>
 #include <stdlib.h>
 #ifdef RTE_LIBRTE_VHOST_NUMA
@@ -13,13 +12,10 @@
 #endif
 
 #include <rte_errno.h>
-#include <rte_ethdev.h>
 #include <rte_log.h>
-#include <rte_string_fns.h>
 #include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_vhost.h>
-#include <rte_rwlock.h>
 
 #include "iotlb.h"
 #include "vhost.h"
diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
index 7085e0885c..819d361578 100644
--- a/lib/vhost/vhost.h
+++ b/lib/vhost/vhost.h
@@ -17,11 +17,9 @@
 
 #include <rte_log.h>
 #include <rte_ether.h>
-#include <rte_rwlock.h>
 #include <rte_malloc.h>
 
 #include "rte_vhost.h"
-#include "rte_vdpa.h"
 #include "vdpa_driver.h"
 
 #include "rte_vhost_async.h"
diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 5eb1dd6812..f8c216c453 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -27,10 +27,8 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/syscall.h>
-#include <assert.h>
 #ifdef RTE_LIBRTE_VHOST_NUMA
 #include <numaif.h>
 #endif
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 07/50] timer: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (5 preceding siblings ...)
  2022-01-17 20:18         ` [PATCH v5 06/50] vhost: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-18 19:43           ` Carrillo, Erik G
  2022-01-17 20:19         ` [PATCH v5 08/50] table: " Sean Morrissey
                           ` (43 subsequent siblings)
  50 siblings, 1 reply; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Robert Sanford, Erik Gabriel Carrillo; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/timer/rte_timer.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/lib/timer/rte_timer.c b/lib/timer/rte_timer.c
index 6d19ce469b..b3f3e229f6 100644
--- a/lib/timer/rte_timer.c
+++ b/lib/timer/rte_timer.c
@@ -2,29 +2,22 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <string.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <stdbool.h>
-#include <inttypes.h>
 #include <assert.h>
 #include <sys/queue.h>
 
 #include <rte_common.h>
 #include <rte_cycles.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
 #include <rte_memory.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
 #include <rte_lcore.h>
 #include <rte_branch_prediction.h>
 #include <rte_spinlock.h>
 #include <rte_random.h>
 #include <rte_pause.h>
 #include <rte_memzone.h>
-#include <rte_malloc.h>
-#include <rte_errno.h>
 
 #include "rte_timer.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 08/50] table: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (6 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 07/50] timer: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 09/50] stack: " Sean Morrissey
                           ` (42 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/table/rte_swx_table_em.c       | 1 -
 lib/table/rte_swx_table_em.h       | 1 -
 lib/table/rte_swx_table_learner.c  | 1 -
 lib/table/rte_swx_table_learner.h  | 1 -
 lib/table/rte_swx_table_selector.c | 1 -
 lib/table/rte_swx_table_wm.c       | 2 --
 lib/table/rte_swx_table_wm.h       | 1 -
 lib/table/rte_table_acl.c          | 3 ---
 lib/table/rte_table_array.c        | 2 --
 lib/table/rte_table_hash_cuckoo.c  | 2 --
 lib/table/rte_table_hash_ext.c     | 2 --
 lib/table/rte_table_hash_key16.c   | 2 --
 lib/table/rte_table_hash_key32.c   | 2 --
 lib/table/rte_table_hash_key8.c    | 2 --
 lib/table/rte_table_hash_lru.c     | 2 --
 lib/table/rte_table_lpm.c          | 2 --
 lib/table/rte_table_lpm_ipv6.c     | 3 ---
 lib/table/rte_table_stub.c         | 1 -
 lib/table/rte_table_stub.h         | 1 -
 19 files changed, 32 deletions(-)

diff --git a/lib/table/rte_swx_table_em.c b/lib/table/rte_swx_table_em.c
index 03b28c4c9d..f783cfe282 100644
--- a/lib/table/rte_swx_table_em.c
+++ b/lib/table/rte_swx_table_em.c
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2020 Intel Corporation
  */
-#include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/lib/table/rte_swx_table_em.h b/lib/table/rte_swx_table_em.h
index 909ada483b..b7423dd060 100644
--- a/lib/table/rte_swx_table_em.h
+++ b/lib/table/rte_swx_table_em.h
@@ -13,7 +13,6 @@ extern "C" {
  * RTE SWX Exact Match Table
  */
 
-#include <stdint.h>
 
 #include <rte_swx_table.h>
 
diff --git a/lib/table/rte_swx_table_learner.c b/lib/table/rte_swx_table_learner.c
index c3c840ff06..15576c2aa3 100644
--- a/lib/table/rte_swx_table_learner.c
+++ b/lib/table/rte_swx_table_learner.c
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2020 Intel Corporation
  */
-#include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/lib/table/rte_swx_table_learner.h b/lib/table/rte_swx_table_learner.h
index d6ec733655..eb9d7689fd 100644
--- a/lib/table/rte_swx_table_learner.h
+++ b/lib/table/rte_swx_table_learner.h
@@ -22,7 +22,6 @@ extern "C" {
  */
 
 #include <stdint.h>
-#include <sys/queue.h>
 
 #include <rte_compat.h>
 
diff --git a/lib/table/rte_swx_table_selector.c b/lib/table/rte_swx_table_selector.c
index 541ebc2213..ad99f18453 100644
--- a/lib/table/rte_swx_table_selector.c
+++ b/lib/table/rte_swx_table_selector.c
@@ -7,7 +7,6 @@
 #include <errno.h>
 
 #include <rte_common.h>
-#include <rte_prefetch.h>
 
 #include "rte_swx_table_selector.h"
 
diff --git a/lib/table/rte_swx_table_wm.c b/lib/table/rte_swx_table_wm.c
index e260be1062..27a67b47bd 100644
--- a/lib/table/rte_swx_table_wm.c
+++ b/lib/table/rte_swx_table_wm.c
@@ -4,10 +4,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
-#include <errno.h>
 
 #include <rte_common.h>
-#include <rte_prefetch.h>
 #include <rte_cycles.h>
 #include <rte_acl.h>
 
diff --git a/lib/table/rte_swx_table_wm.h b/lib/table/rte_swx_table_wm.h
index 9e228f971c..4fd52c0a17 100644
--- a/lib/table/rte_swx_table_wm.h
+++ b/lib/table/rte_swx_table_wm.h
@@ -13,7 +13,6 @@ extern "C" {
  * RTE SWX Wildcard Match Table
  */
 
-#include <stdint.h>
 
 #include <rte_swx_table.h>
 
diff --git a/lib/table/rte_table_acl.c b/lib/table/rte_table_acl.c
index 14d54019f0..179a1da835 100644
--- a/lib/table/rte_table_acl.c
+++ b/lib/table/rte_table_acl.c
@@ -6,13 +6,10 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
 #include "rte_table_acl.h"
-#include <rte_ether.h>
 
 #ifdef RTE_TABLE_STATS_COLLECT
 
diff --git a/lib/table/rte_table_array.c b/lib/table/rte_table_array.c
index 8264c50c27..54a0c42f7d 100644
--- a/lib/table/rte_table_array.c
+++ b/lib/table/rte_table_array.c
@@ -6,8 +6,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_cuckoo.c b/lib/table/rte_table_hash_cuckoo.c
index f024303330..c77eccf527 100644
--- a/lib/table/rte_table_hash_cuckoo.c
+++ b/lib/table/rte_table_hash_cuckoo.c
@@ -5,8 +5,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_ext.c b/lib/table/rte_table_hash_ext.c
index 802a24fe0f..70ea84fa2e 100644
--- a/lib/table/rte_table_hash_ext.c
+++ b/lib/table/rte_table_hash_ext.c
@@ -6,8 +6,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_key16.c b/lib/table/rte_table_hash_key16.c
index c4384b114d..ea8195dc17 100644
--- a/lib/table/rte_table_hash_key16.c
+++ b/lib/table/rte_table_hash_key16.c
@@ -5,8 +5,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_key32.c b/lib/table/rte_table_hash_key32.c
index 3e0031fe1e..87f83ce6f5 100644
--- a/lib/table/rte_table_hash_key32.c
+++ b/lib/table/rte_table_hash_key32.c
@@ -5,8 +5,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_key8.c b/lib/table/rte_table_hash_key8.c
index 34e3ed1af9..7779a9d1a3 100644
--- a/lib/table/rte_table_hash_key8.c
+++ b/lib/table/rte_table_hash_key8.c
@@ -5,8 +5,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_hash_lru.c b/lib/table/rte_table_hash_lru.c
index 5bcdb7ba02..c31acc11cf 100644
--- a/lib/table/rte_table_hash_lru.c
+++ b/lib/table/rte_table_hash_lru.c
@@ -6,8 +6,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
 
diff --git a/lib/table/rte_table_lpm.c b/lib/table/rte_table_lpm.c
index 4dd8289ce5..9de9e8a20d 100644
--- a/lib/table/rte_table_lpm.c
+++ b/lib/table/rte_table_lpm.c
@@ -6,8 +6,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_byteorder.h>
 #include <rte_log.h>
diff --git a/lib/table/rte_table_lpm_ipv6.c b/lib/table/rte_table_lpm_ipv6.c
index 4e068d79bf..8fde2c012f 100644
--- a/lib/table/rte_table_lpm_ipv6.c
+++ b/lib/table/rte_table_lpm_ipv6.c
@@ -6,10 +6,7 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
-#include <rte_byteorder.h>
 #include <rte_log.h>
 #include <rte_lpm6.h>
 
diff --git a/lib/table/rte_table_stub.c b/lib/table/rte_table_stub.c
index 9ce7be9cec..23d0de5c79 100644
--- a/lib/table/rte_table_stub.c
+++ b/lib/table/rte_table_stub.c
@@ -4,7 +4,6 @@
 
 #include <string.h>
 
-#include <rte_mbuf.h>
 #include <rte_malloc.h>
 
 #include "rte_table_stub.h"
diff --git a/lib/table/rte_table_stub.h b/lib/table/rte_table_stub.h
index 2b40739790..9086e4edcc 100644
--- a/lib/table/rte_table_stub.h
+++ b/lib/table/rte_table_stub.h
@@ -17,7 +17,6 @@ extern "C" {
  *
  ***/
 
-#include <stdint.h>
 
 #include "rte_table.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 09/50] stack: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (7 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 08/50] table: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 10/50] security: " Sean Morrissey
                           ` (41 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/stack/rte_stack.c | 2 --
 lib/stack/rte_stack.h | 1 -
 2 files changed, 3 deletions(-)

diff --git a/lib/stack/rte_stack.c b/lib/stack/rte_stack.c
index 56bf2c8d6d..1fabec2bfe 100644
--- a/lib/stack/rte_stack.c
+++ b/lib/stack/rte_stack.c
@@ -6,12 +6,10 @@
 #include <sys/queue.h>
 
 #include <rte_string_fns.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
 #include <rte_memzone.h>
-#include <rte_rwlock.h>
 #include <rte_tailq.h>
 
 #include "rte_stack.h"
diff --git a/lib/stack/rte_stack.h b/lib/stack/rte_stack.h
index 321f4cec1a..91fc570767 100644
--- a/lib/stack/rte_stack.h
+++ b/lib/stack/rte_stack.h
@@ -19,7 +19,6 @@
 extern "C" {
 #endif
 
-#include <rte_compat.h>
 #include <rte_debug.h>
 #include <rte_errno.h>
 #include <rte_memzone.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 10/50] security: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (8 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 09/50] stack: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 11/50] sched: " Sean Morrissey
                           ` (40 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Akhil Goyal, Declan Doherty; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/security/rte_security.c | 2 --
 lib/security/rte_security.h | 3 ---
 2 files changed, 5 deletions(-)

diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index 6e45a03fa0..4f5e4b4d49 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -5,10 +5,8 @@
  */
 
 #include <rte_cryptodev.h>
-#include <rte_malloc.h>
 #include <rte_dev.h>
 #include <rte_telemetry.h>
-#include "rte_compat.h"
 #include "rte_security.h"
 #include "rte_security_driver.h"
 
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 1228b6c8b1..d54d993ccc 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -23,10 +23,7 @@ extern "C" {
 #include <rte_common.h>
 #include <rte_crypto.h>
 #include <rte_ip.h>
-#include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
-#include <rte_memory.h>
-#include <rte_mempool.h>
 
 /** IPSec protocol mode */
 enum rte_security_ipsec_sa_mode {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 11/50] sched: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (9 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 10/50] security: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 12/50] rib: " Sean Morrissey
                           ` (39 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Cristian Dumitrescu, Jasvinder Singh; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/sched/rte_pie.c   | 2 --
 lib/sched/rte_red.h   | 1 -
 lib/sched/rte_sched.c | 1 -
 lib/sched/rte_sched.h | 1 -
 4 files changed, 5 deletions(-)

diff --git a/lib/sched/rte_pie.c b/lib/sched/rte_pie.c
index 934e9aee50..cdb7bab697 100644
--- a/lib/sched/rte_pie.c
+++ b/lib/sched/rte_pie.c
@@ -5,8 +5,6 @@
 #include <stdlib.h>
 
 #include "rte_pie.h"
-#include <rte_common.h>
-#include <rte_cycles.h>
 #include <rte_malloc.h>
 
 #ifdef __INTEL_COMPILER
diff --git a/lib/sched/rte_red.h b/lib/sched/rte_red.h
index f5843dab1b..80b43b6da0 100644
--- a/lib/sched/rte_red.h
+++ b/lib/sched/rte_red.h
@@ -18,7 +18,6 @@ extern "C" {
 
 #include <stdint.h>
 #include <limits.h>
-#include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_cycles.h>
 #include <rte_branch_prediction.h>
diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c
index 62b3d2e315..e5c62e3d77 100644
--- a/lib/sched/rte_sched.c
+++ b/lib/sched/rte_sched.c
@@ -7,7 +7,6 @@
 
 #include <rte_common.h>
 #include <rte_log.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_cycles.h>
 #include <rte_prefetch.h>
diff --git a/lib/sched/rte_sched.h b/lib/sched/rte_sched.h
index 3c625ba169..5ece64e527 100644
--- a/lib/sched/rte_sched.h
+++ b/lib/sched/rte_sched.h
@@ -56,7 +56,6 @@ extern "C" {
  *
  */
 
-#include <sys/types.h>
 #include <rte_compat.h>
 #include <rte_mbuf.h>
 #include <rte_meter.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 12/50] rib: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (10 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 11/50] sched: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 13/50] reorder: " Sean Morrissey
                           ` (38 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Vladimir Medvedkin; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/rib/rte_rib.c  | 2 --
 lib/rib/rte_rib.h  | 1 -
 lib/rib/rte_rib6.c | 2 --
 lib/rib/rte_rib6.h | 1 -
 4 files changed, 6 deletions(-)

diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c
index 6c29e1c49a..cd9e823068 100644
--- a/lib/rib/rte_rib.c
+++ b/lib/rib/rte_rib.c
@@ -6,12 +6,10 @@
 #include <stdbool.h>
 #include <stdint.h>
 
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
 #include <rte_mempool.h>
-#include <rte_rwlock.h>
 #include <rte_string_fns.h>
 #include <rte_tailq.h>
 
diff --git a/lib/rib/rte_rib.h b/lib/rib/rte_rib.h
index bebb30f7d7..c18c4ca594 100644
--- a/lib/rib/rte_rib.h
+++ b/lib/rib/rte_rib.h
@@ -17,7 +17,6 @@
 #include <stdlib.h>
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c
index 70405113b4..042ac1f090 100644
--- a/lib/rib/rte_rib6.c
+++ b/lib/rib/rte_rib6.c
@@ -6,12 +6,10 @@
 #include <stdbool.h>
 #include <stdint.h>
 
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
 #include <rte_mempool.h>
-#include <rte_rwlock.h>
 #include <rte_string_fns.h>
 #include <rte_tailq.h>
 
diff --git a/lib/rib/rte_rib6.h b/lib/rib/rte_rib6.h
index 6f532265c6..fa8e9bf732 100644
--- a/lib/rib/rte_rib6.h
+++ b/lib/rib/rte_rib6.h
@@ -15,7 +15,6 @@
  */
 
 #include <rte_memcpy.h>
-#include <rte_compat.h>
 #include <rte_common.h>
 
 #ifdef __cplusplus
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 13/50] reorder: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (11 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 12/50] rib: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 14/50] regexdev: " Sean Morrissey
                           ` (37 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/reorder/rte_reorder.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
index 9445853b79..f40a48201f 100644
--- a/lib/reorder/rte_reorder.c
+++ b/lib/reorder/rte_reorder.c
@@ -2,7 +2,6 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <inttypes.h>
 #include <string.h>
 
 #include <rte_string_fns.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 14/50] regexdev: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (12 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 13/50] reorder: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 15/50] rcu: " Sean Morrissey
                           ` (36 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Ori Kam; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

Acked-by: Ori Kam <orika@nvidia.com>
---
 lib/regexdev/rte_regexdev.c | 2 --
 lib/regexdev/rte_regexdev.h | 3 ---
 2 files changed, 5 deletions(-)

diff --git a/lib/regexdev/rte_regexdev.c b/lib/regexdev/rte_regexdev.c
index 04ab713730..02a388bc5d 100644
--- a/lib/regexdev/rte_regexdev.c
+++ b/lib/regexdev/rte_regexdev.c
@@ -5,8 +5,6 @@
 
 #include <string.h>
 
-#include <rte_memory.h>
-#include <rte_memcpy.h>
 #include <rte_memzone.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/regexdev/rte_regexdev.h b/lib/regexdev/rte_regexdev.h
index 0bac46cda9..4ba67b0c25 100644
--- a/lib/regexdev/rte_regexdev.h
+++ b/lib/regexdev/rte_regexdev.h
@@ -199,11 +199,8 @@ extern "C" {
 #endif
 
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_dev.h>
-#include <rte_errno.h>
 #include <rte_mbuf.h>
-#include <rte_memory.h>
 
 #define RTE_REGEXDEV_NAME_MAX_LEN RTE_DEV_NAME_MAX_LEN
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 15/50] rcu: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (13 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 14/50] regexdev: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 16/50] rawdev: " Sean Morrissey
                           ` (35 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Honnappa Nagarahalli; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/rcu/rte_rcu_qsbr.c | 4 ----
 lib/rcu/rte_rcu_qsbr.h | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/lib/rcu/rte_rcu_qsbr.c b/lib/rcu/rte_rcu_qsbr.c
index 7510db2f81..17be93e830 100644
--- a/lib/rcu/rte_rcu_qsbr.c
+++ b/lib/rcu/rte_rcu_qsbr.c
@@ -13,10 +13,6 @@
 #include <rte_log.h>
 #include <rte_memory.h>
 #include <rte_malloc.h>
-#include <rte_eal.h>
-#include <rte_atomic.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_errno.h>
 #include <rte_ring_elem.h>
 
diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h
index 62a420a785..d81bf5e8db 100644
--- a/lib/rcu/rte_rcu_qsbr.h
+++ b/lib/rcu/rte_rcu_qsbr.h
@@ -32,11 +32,7 @@ extern "C" {
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdint.h>
-#include <inttypes.h>
-#include <errno.h>
 #include <rte_common.h>
-#include <rte_memory.h>
-#include <rte_lcore.h>
 #include <rte_debug.h>
 #include <rte_atomic.h>
 #include <rte_ring.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 16/50] rawdev: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (14 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 15/50] rcu: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 17/50] power: " Sean Morrissey
                           ` (34 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Nipun Gupta, Hemant Agrawal; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/rawdev/rte_rawdev.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/lib/rawdev/rte_rawdev.c b/lib/rawdev/rte_rawdev.c
index a6134e76ea..2f0a4f132e 100644
--- a/lib/rawdev/rte_rawdev.c
+++ b/lib/rawdev/rte_rawdev.c
@@ -6,29 +6,15 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <stdint.h>
 #include <inttypes.h>
-#include <sys/types.h>
-#include <sys/queue.h>
 
 #include <rte_string_fns.h>
-#include <rte_byteorder.h>
 #include <rte_log.h>
-#include <rte_debug.h>
 #include <rte_dev.h>
-#include <rte_memory.h>
-#include <rte_memcpy.h>
-#include <rte_memzone.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_errno.h>
 #include <rte_telemetry.h>
 
 #include "rte_rawdev.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 17/50] power: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (15 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 16/50] rawdev: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 18/50] port: " Sean Morrissey
                           ` (33 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: David Hunt; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed. Also added rte_string_fns.h to example app
vm_power_manager for users without libbsd.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 examples/vm_power_manager/guest_cli/main.c | 1 +
 lib/power/guest_channel.c                  | 2 --
 lib/power/power_acpi_cpufreq.c             | 7 -------
 lib/power/power_acpi_cpufreq.h             | 4 ----
 lib/power/power_common.h                   | 1 -
 lib/power/power_cppc_cpufreq.c             | 1 -
 lib/power/power_cppc_cpufreq.h             | 4 ----
 lib/power/power_kvm_vm.c                   | 1 -
 lib/power/power_kvm_vm.h                   | 4 ----
 lib/power/power_pstate_cpufreq.c           | 7 -------
 lib/power/power_pstate_cpufreq.h           | 4 ----
 lib/power/rte_power.c                      | 1 -
 lib/power/rte_power.h                      | 2 --
 lib/power/rte_power_empty_poll.c           | 2 --
 14 files changed, 1 insertion(+), 40 deletions(-)

diff --git a/examples/vm_power_manager/guest_cli/main.c b/examples/vm_power_manager/guest_cli/main.c
index b8fa65ef15..9da50020ac 100644
--- a/examples/vm_power_manager/guest_cli/main.c
+++ b/examples/vm_power_manager/guest_cli/main.c
@@ -13,6 +13,7 @@
 #include <rte_debug.h>
 #include <rte_eal.h>
 #include <rte_log.h>
+#include <rte_string_fns.h>
 
 #include "vm_power_cli_guest.h"
 #include "parse.h"
diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c
index 474dd92998..969a9e5aaa 100644
--- a/lib/power/guest_channel.c
+++ b/lib/power/guest_channel.c
@@ -4,9 +4,7 @@
 
 #include <glob.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <unistd.h>
-#include <signal.h>
 #include <limits.h>
 #include <fcntl.h>
 #include <string.h>
diff --git a/lib/power/power_acpi_cpufreq.c b/lib/power/power_acpi_cpufreq.c
index 402ed8c99b..6e57aca535 100644
--- a/lib/power/power_acpi_cpufreq.c
+++ b/lib/power/power_acpi_cpufreq.c
@@ -3,17 +3,10 @@
  */
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <limits.h>
 
 #include <rte_memcpy.h>
-#include <rte_memory.h>
 #include <rte_string_fns.h>
 
 #include "power_acpi_cpufreq.h"
diff --git a/lib/power/power_acpi_cpufreq.h b/lib/power/power_acpi_cpufreq.h
index 41675b9cd9..682fd9278c 100644
--- a/lib/power/power_acpi_cpufreq.h
+++ b/lib/power/power_acpi_cpufreq.h
@@ -10,10 +10,6 @@
  * RTE Power Management via userspace ACPI cpufreq
  */
 
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_string_fns.h>
 #include "rte_power.h"
 
 /**
diff --git a/lib/power/power_common.h b/lib/power/power_common.h
index 0b264edfa5..c1c7139276 100644
--- a/lib/power/power_common.h
+++ b/lib/power/power_common.h
@@ -5,7 +5,6 @@
 #ifndef _POWER_COMMON_H_
 #define _POWER_COMMON_H_
 
-#include <inttypes.h>
 
 #include <rte_common.h>
 
diff --git a/lib/power/power_cppc_cpufreq.c b/lib/power/power_cppc_cpufreq.c
index 25185a791c..ef06fbcd9e 100644
--- a/lib/power/power_cppc_cpufreq.c
+++ b/lib/power/power_cppc_cpufreq.c
@@ -4,7 +4,6 @@
  */
 
 #include <rte_memcpy.h>
-#include <rte_memory.h>
 
 #include "power_cppc_cpufreq.h"
 #include "power_common.h"
diff --git a/lib/power/power_cppc_cpufreq.h b/lib/power/power_cppc_cpufreq.h
index 4e73c91b05..f4121b237e 100644
--- a/lib/power/power_cppc_cpufreq.h
+++ b/lib/power/power_cppc_cpufreq.h
@@ -11,10 +11,6 @@
  * RTE Power Management via userspace CPPC cpufreq
  */
 
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_string_fns.h>
 #include "rte_power.h"
 
 /**
diff --git a/lib/power/power_kvm_vm.c b/lib/power/power_kvm_vm.c
index ab7d4b8cee..6a8109d449 100644
--- a/lib/power/power_kvm_vm.c
+++ b/lib/power/power_kvm_vm.c
@@ -9,7 +9,6 @@
 #include "rte_power_guest_channel.h"
 #include "guest_channel.h"
 #include "power_kvm_vm.h"
-#include "power_common.h"
 
 #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent"
 
diff --git a/lib/power/power_kvm_vm.h b/lib/power/power_kvm_vm.h
index 9a309a300f..303fcc041b 100644
--- a/lib/power/power_kvm_vm.h
+++ b/lib/power/power_kvm_vm.h
@@ -10,10 +10,6 @@
  * RTE Power Management KVM VM
  */
 
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_string_fns.h>
 #include "rte_power.h"
 
 /**
diff --git a/lib/power/power_pstate_cpufreq.c b/lib/power/power_pstate_cpufreq.c
index 86f8a76e46..959eccffd8 100644
--- a/lib/power/power_pstate_cpufreq.c
+++ b/lib/power/power_pstate_cpufreq.c
@@ -3,20 +3,13 @@
  */
 
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
-#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <signal.h>
 #include <limits.h>
 #include <errno.h>
-#include <inttypes.h>
 
 #include <rte_memcpy.h>
-#include <rte_memory.h>
-#include <rte_string_fns.h>
 
 #include "power_pstate_cpufreq.h"
 #include "power_common.h"
diff --git a/lib/power/power_pstate_cpufreq.h b/lib/power/power_pstate_cpufreq.h
index 3260b32494..7bf64a518c 100644
--- a/lib/power/power_pstate_cpufreq.h
+++ b/lib/power/power_pstate_cpufreq.h
@@ -10,10 +10,6 @@
  * RTE Power Management via Intel Pstate driver
  */
 
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include <rte_log.h>
-#include <rte_string_fns.h>
 #include "rte_power.h"
 
 /**
diff --git a/lib/power/rte_power.c b/lib/power/rte_power.c
index 3cba56bac9..0a6614be77 100644
--- a/lib/power/rte_power.c
+++ b/lib/power/rte_power.c
@@ -10,7 +10,6 @@
 #include "power_cppc_cpufreq.h"
 #include "power_kvm_vm.h"
 #include "power_pstate_cpufreq.h"
-#include "power_common.h"
 
 enum power_management_env global_default_env = PM_ENV_NOT_SET;
 
diff --git a/lib/power/rte_power.h b/lib/power/rte_power.h
index c5759afa39..47345e26df 100644
--- a/lib/power/rte_power.h
+++ b/lib/power/rte_power.h
@@ -11,9 +11,7 @@
  */
 
 #include <rte_common.h>
-#include <rte_byteorder.h>
 #include <rte_log.h>
-#include <rte_string_fns.h>
 #include <rte_power_guest_channel.h>
 
 #ifdef __cplusplus
diff --git a/lib/power/rte_power_empty_poll.c b/lib/power/rte_power_empty_poll.c
index c4b5de9601..dca88555aa 100644
--- a/lib/power/rte_power_empty_poll.c
+++ b/lib/power/rte_power_empty_poll.c
@@ -5,8 +5,6 @@
 #include <string.h>
 
 #include <rte_lcore.h>
-#include <rte_cycles.h>
-#include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <inttypes.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 18/50] port: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (16 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 17/50] power: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 19/50] pipeline: " Sean Morrissey
                           ` (32 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/port/rte_port_fd.h          | 1 -
 lib/port/rte_port_frag.c        | 2 --
 lib/port/rte_port_frag.h        | 1 -
 lib/port/rte_port_kni.c         | 1 -
 lib/port/rte_port_kni.h         | 1 -
 lib/port/rte_port_ras.c         | 1 -
 lib/port/rte_port_ras.h         | 1 -
 lib/port/rte_port_ring.h        | 1 -
 lib/port/rte_port_sched.c       | 1 -
 lib/port/rte_port_source_sink.c | 1 -
 lib/port/rte_swx_port_fd.c      | 1 -
 lib/port/rte_swx_port_fd.h      | 1 -
 lib/port/rte_swx_port_ring.h    | 1 -
 13 files changed, 14 deletions(-)

diff --git a/lib/port/rte_port_fd.h b/lib/port/rte_port_fd.h
index e7620ef522..c8cfd9765a 100644
--- a/lib/port/rte_port_fd.h
+++ b/lib/port/rte_port_fd.h
@@ -20,7 +20,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_mempool.h>
 #include "rte_port.h"
 
 /** fd_reader port parameters */
diff --git a/lib/port/rte_port_frag.c b/lib/port/rte_port_frag.c
index 8a803fda11..e1f1892176 100644
--- a/lib/port/rte_port_frag.c
+++ b/lib/port/rte_port_frag.c
@@ -3,9 +3,7 @@
  */
 #include <string.h>
 
-#include <rte_ether.h>
 #include <rte_ip_frag.h>
-#include <rte_memory.h>
 
 #include "rte_port_frag.h"
 
diff --git a/lib/port/rte_port_frag.h b/lib/port/rte_port_frag.h
index 74321e4c4c..07060297f6 100644
--- a/lib/port/rte_port_frag.h
+++ b/lib/port/rte_port_frag.h
@@ -29,7 +29,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_ring.h>
 
 #include "rte_port.h"
 
diff --git a/lib/port/rte_port_kni.c b/lib/port/rte_port_kni.c
index 7b370f980a..1c7a6cb200 100644
--- a/lib/port/rte_port_kni.c
+++ b/lib/port/rte_port_kni.c
@@ -4,7 +4,6 @@
  */
 #include <string.h>
 
-#include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_kni.h>
 
diff --git a/lib/port/rte_port_kni.h b/lib/port/rte_port_kni.h
index 9d318af17e..35c6253806 100644
--- a/lib/port/rte_port_kni.h
+++ b/lib/port/rte_port_kni.h
@@ -21,7 +21,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_kni.h>
 
 #include "rte_port.h"
 
diff --git a/lib/port/rte_port_ras.c b/lib/port/rte_port_ras.c
index 8508814bb2..e5de57da42 100644
--- a/lib/port/rte_port_ras.c
+++ b/lib/port/rte_port_ras.c
@@ -3,7 +3,6 @@
  */
 #include <string.h>
 
-#include <rte_ether.h>
 #include <rte_ip_frag.h>
 #include <rte_cycles.h>
 #include <rte_log.h>
diff --git a/lib/port/rte_port_ras.h b/lib/port/rte_port_ras.h
index fa5accdc71..ee1d8ae21e 100644
--- a/lib/port/rte_port_ras.h
+++ b/lib/port/rte_port_ras.h
@@ -30,7 +30,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_ring.h>
 
 #include "rte_port.h"
 
diff --git a/lib/port/rte_port_ring.h b/lib/port/rte_port_ring.h
index c4f34e22fe..ba609b3436 100644
--- a/lib/port/rte_port_ring.h
+++ b/lib/port/rte_port_ring.h
@@ -26,7 +26,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_ring.h>
 
 #include "rte_port.h"
 
diff --git a/lib/port/rte_port_sched.c b/lib/port/rte_port_sched.c
index 1209fc121b..8a7d815ef3 100644
--- a/lib/port/rte_port_sched.c
+++ b/lib/port/rte_port_sched.c
@@ -3,7 +3,6 @@
  */
 #include <string.h>
 
-#include <rte_mbuf.h>
 #include <rte_malloc.h>
 
 #include "rte_port_sched.h"
diff --git a/lib/port/rte_port_source_sink.c b/lib/port/rte_port_source_sink.c
index 68575c9833..4928a5f706 100644
--- a/lib/port/rte_port_source_sink.c
+++ b/lib/port/rte_port_source_sink.c
@@ -5,7 +5,6 @@
 #include <string.h>
 
 #include <rte_mbuf.h>
-#include <rte_mempool.h>
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
 
diff --git a/lib/port/rte_swx_port_fd.c b/lib/port/rte_swx_port_fd.c
index aa7315a15a..51bcd3bb7b 100644
--- a/lib/port/rte_swx_port_fd.c
+++ b/lib/port/rte_swx_port_fd.c
@@ -6,7 +6,6 @@
 #include <unistd.h>
 
 #include <rte_mbuf.h>
-#include <rte_malloc.h>
 #include <rte_hexdump.h>
 
 #include "rte_swx_port_fd.h"
diff --git a/lib/port/rte_swx_port_fd.h b/lib/port/rte_swx_port_fd.h
index ecf3349f5f..c1a9200a4f 100644
--- a/lib/port/rte_swx_port_fd.h
+++ b/lib/port/rte_swx_port_fd.h
@@ -16,7 +16,6 @@ extern "C" {
  ***/
 #include <stdint.h>
 
-#include <rte_mempool.h>
 
 #include "rte_swx_port.h"
 
diff --git a/lib/port/rte_swx_port_ring.h b/lib/port/rte_swx_port_ring.h
index 859981f277..dc0ef9247c 100644
--- a/lib/port/rte_swx_port_ring.h
+++ b/lib/port/rte_swx_port_ring.h
@@ -16,7 +16,6 @@ extern "C" {
 
 #include <stdint.h>
 
-#include <rte_ring.h>
 
 #include "rte_swx_port.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 19/50] pipeline: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (17 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 18/50] port: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 20/50] pdump: " Sean Morrissey
                           ` (31 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Cristian Dumitrescu; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/pipeline/rte_pipeline.c          | 4 ----
 lib/pipeline/rte_port_in_action.c    | 2 --
 lib/pipeline/rte_swx_ctl.h           | 2 --
 lib/pipeline/rte_swx_pipeline.c      | 1 -
 lib/pipeline/rte_swx_pipeline.h      | 1 -
 lib/pipeline/rte_swx_pipeline_spec.c | 1 -
 lib/pipeline/rte_table_action.c      | 2 --
 7 files changed, 13 deletions(-)

diff --git a/lib/pipeline/rte_pipeline.c b/lib/pipeline/rte_pipeline.c
index f5f397d292..ff86c7cf96 100644
--- a/lib/pipeline/rte_pipeline.c
+++ b/lib/pipeline/rte_pipeline.c
@@ -6,10 +6,6 @@
 #include <stdio.h>
 
 #include <rte_common.h>
-#include <rte_memory.h>
-#include <rte_cycles.h>
-#include <rte_prefetch.h>
-#include <rte_branch_prediction.h>
 #include <rte_mbuf.h>
 #include <rte_malloc.h>
 #include <rte_string_fns.h>
diff --git a/lib/pipeline/rte_port_in_action.c b/lib/pipeline/rte_port_in_action.c
index e3b00df8d2..5818973250 100644
--- a/lib/pipeline/rte_port_in_action.c
+++ b/lib/pipeline/rte_port_in_action.c
@@ -6,9 +6,7 @@
 #include <string.h>
 
 #include <rte_common.h>
-#include <rte_byteorder.h>
 #include <rte_malloc.h>
-#include <rte_memcpy.h>
 
 #include "rte_port_in_action.h"
 
diff --git a/lib/pipeline/rte_swx_ctl.h b/lib/pipeline/rte_swx_ctl.h
index 82e62e70a7..ed752ad5eb 100644
--- a/lib/pipeline/rte_swx_ctl.h
+++ b/lib/pipeline/rte_swx_ctl.h
@@ -13,7 +13,6 @@ extern "C" {
  * RTE SWX Pipeline Control
  */
 
-#include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
 
@@ -22,7 +21,6 @@ extern "C" {
 
 #include "rte_swx_port.h"
 #include "rte_swx_table.h"
-#include "rte_swx_table_selector.h"
 
 struct rte_swx_pipeline;
 
diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c
index 2145ca0a42..b39139edb8 100644
--- a/lib/pipeline/rte_swx_pipeline.c
+++ b/lib/pipeline/rte_swx_pipeline.c
@@ -4,7 +4,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <errno.h>
-#include <arpa/inet.h>
 #include <dlfcn.h>
 
 #include "rte_swx_pipeline_internal.h"
diff --git a/lib/pipeline/rte_swx_pipeline.h b/lib/pipeline/rte_swx_pipeline.h
index 77141bd341..430e458335 100644
--- a/lib/pipeline/rte_swx_pipeline.h
+++ b/lib/pipeline/rte_swx_pipeline.h
@@ -13,7 +13,6 @@ extern "C" {
  * RTE SWX Pipeline
  */
 
-#include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
 
diff --git a/lib/pipeline/rte_swx_pipeline_spec.c b/lib/pipeline/rte_swx_pipeline_spec.c
index 07a7580ac8..8165a046ea 100644
--- a/lib/pipeline/rte_swx_pipeline_spec.c
+++ b/lib/pipeline/rte_swx_pipeline_spec.c
@@ -8,7 +8,6 @@
 #include <errno.h>
 
 #include "rte_swx_pipeline.h"
-#include "rte_swx_ctl.h"
 
 #define MAX_LINE_LENGTH RTE_SWX_INSTRUCTION_SIZE
 #define MAX_TOKENS RTE_SWX_INSTRUCTION_TOKENS_MAX
diff --git a/lib/pipeline/rte_table_action.c b/lib/pipeline/rte_table_action.c
index ebab2444d3..b1310be565 100644
--- a/lib/pipeline/rte_table_action.c
+++ b/lib/pipeline/rte_table_action.c
@@ -11,12 +11,10 @@
 #include <rte_memcpy.h>
 #include <rte_ether.h>
 #include <rte_ip.h>
-#include <rte_esp.h>
 #include <rte_tcp.h>
 #include <rte_udp.h>
 #include <rte_vxlan.h>
 #include <rte_cryptodev.h>
-#include <cryptodev_pmd.h>
 
 #include "rte_table_action.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 20/50] pdump: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (18 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 19/50] pipeline: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 21/50] pci: " Sean Morrissey
                           ` (30 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Reshma Pattan, Stephen Hemminger; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/pdump/rte_pdump.c | 1 -
 lib/pdump/rte_pdump.h | 2 --
 2 files changed, 3 deletions(-)

diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c
index af450695ec..b3a62df591 100644
--- a/lib/pdump/rte_pdump.c
+++ b/lib/pdump/rte_pdump.c
@@ -2,7 +2,6 @@
  * Copyright(c) 2016-2018 Intel Corporation
  */
 
-#include <rte_memcpy.h>
 #include <rte_mbuf.h>
 #include <rte_ethdev.h>
 #include <rte_lcore.h>
diff --git a/lib/pdump/rte_pdump.h b/lib/pdump/rte_pdump.h
index 6efa0274f2..41c4b7800b 100644
--- a/lib/pdump/rte_pdump.h
+++ b/lib/pdump/rte_pdump.h
@@ -13,8 +13,6 @@
  */
 
 #include <stdint.h>
-#include <rte_mempool.h>
-#include <rte_ring.h>
 #include <rte_bpf.h>
 
 #ifdef __cplusplus
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 21/50] pci: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (19 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 20/50] pdump: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 22/50] pcapng: " Sean Morrissey
                           ` (29 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Gaetan Rivet; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/pci/rte_pci.c | 15 +--------------
 lib/pci/rte_pci.h |  2 --
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/lib/pci/rte_pci.c b/lib/pci/rte_pci.c
index c91be8b167..355772ff56 100644
--- a/lib/pci/rte_pci.c
+++ b/lib/pci/rte_pci.c
@@ -3,23 +3,10 @@
  * Copyright 2013-2014 6WIND S.A.
  */
 
-#include <string.h>
-#include <inttypes.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <sys/queue.h>
-
-#include <rte_errno.h>
-#include <rte_interrupts.h>
-#include <rte_log.h>
-#include <rte_bus.h>
-#include <rte_eal_paging.h>
-#include <rte_per_lcore.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_string_fns.h>
-#include <rte_common.h>
+
 #include <rte_debug.h>
 
 #include "rte_pci.h"
diff --git a/lib/pci/rte_pci.h b/lib/pci/rte_pci.h
index 71cbd441c7..a096946260 100644
--- a/lib/pci/rte_pci.h
+++ b/lib/pci/rte_pci.h
@@ -17,9 +17,7 @@ extern "C" {
 #endif
 
 #include <stdio.h>
-#include <limits.h>
 #include <inttypes.h>
-#include <sys/types.h>
 
 /*
  * Conventional PCI and PCI-X Mode 1 devices have 256 bytes of
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 22/50] pcapng: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (20 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 21/50] pci: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 23/50] node: " Sean Morrissey
                           ` (28 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Reshma Pattan, Stephen Hemminger; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/pcapng/rte_pcapng.c | 1 -
 lib/pcapng/rte_pcapng.h | 2 --
 2 files changed, 3 deletions(-)

diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index 03edabe73e..5ae96a5bc9 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -8,7 +8,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/uio.h>
-#include <sys/utsname.h>
 #include <time.h>
 #include <unistd.h>
 
diff --git a/lib/pcapng/rte_pcapng.h b/lib/pcapng/rte_pcapng.h
index 8d3fbb1941..7d2697c647 100644
--- a/lib/pcapng/rte_pcapng.h
+++ b/lib/pcapng/rte_pcapng.h
@@ -26,9 +26,7 @@
 #include <stdint.h>
 #include <sys/types.h>
 #include <rte_compat.h>
-#include <rte_common.h>
 #include <rte_mempool.h>
-#include <rte_ring.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 23/50] node: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (21 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 22/50] pcapng: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 24/50] net: " Sean Morrissey
                           ` (27 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Nithin Dabilpuram, Pavan Nikhilesh; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/node/ethdev_ctrl.c | 2 --
 lib/node/ethdev_rx.c   | 1 -
 lib/node/ethdev_tx.c   | 1 -
 lib/node/ip4_lookup.c  | 5 -----
 lib/node/ip4_rewrite.c | 4 ----
 lib/node/pkt_cls.c     | 4 ----
 lib/node/pkt_drop.c    | 1 -
 7 files changed, 18 deletions(-)

diff --git a/lib/node/ethdev_ctrl.c b/lib/node/ethdev_ctrl.c
index 13b8b705f0..5294607619 100644
--- a/lib/node/ethdev_ctrl.c
+++ b/lib/node/ethdev_ctrl.c
@@ -2,9 +2,7 @@
  * Copyright(C) 2020 Marvell International Ltd.
  */
 
-#include <rte_debug.h>
 #include <rte_ethdev.h>
-#include <rte_ether.h>
 #include <rte_graph.h>
 
 #include "rte_node_eth_api.h"
diff --git a/lib/node/ethdev_rx.c b/lib/node/ethdev_rx.c
index 4c23961505..a19237b42f 100644
--- a/lib/node/ethdev_rx.c
+++ b/lib/node/ethdev_rx.c
@@ -7,7 +7,6 @@
 #include <rte_ether.h>
 #include <rte_graph.h>
 #include <rte_graph_worker.h>
-#include <rte_mbuf.h>
 
 #include "ethdev_rx_priv.h"
 #include "node_private.h"
diff --git a/lib/node/ethdev_tx.c b/lib/node/ethdev_tx.c
index 075149089f..7d2d72f823 100644
--- a/lib/node/ethdev_tx.c
+++ b/lib/node/ethdev_tx.c
@@ -6,7 +6,6 @@
 #include <rte_ethdev.h>
 #include <rte_graph.h>
 #include <rte_graph_worker.h>
-#include <rte_mbuf.h>
 
 #include "ethdev_tx_priv.h"
 
diff --git a/lib/node/ip4_lookup.c b/lib/node/ip4_lookup.c
index d083a725fc..8bce03d7db 100644
--- a/lib/node/ip4_lookup.c
+++ b/lib/node/ip4_lookup.c
@@ -5,17 +5,12 @@
 #include <arpa/inet.h>
 #include <sys/socket.h>
 
-#include <rte_debug.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_graph.h>
 #include <rte_graph_worker.h>
 #include <rte_ip.h>
 #include <rte_lpm.h>
-#include <rte_mbuf.h>
-#include <rte_tcp.h>
-#include <rte_udp.h>
-#include <rte_vect.h>
 
 #include "rte_node_ip4_api.h"
 
diff --git a/lib/node/ip4_rewrite.c b/lib/node/ip4_rewrite.c
index 99ecb457ff..34a920df5e 100644
--- a/lib/node/ip4_rewrite.c
+++ b/lib/node/ip4_rewrite.c
@@ -2,16 +2,12 @@
  * Copyright(C) 2020 Marvell International Ltd.
  */
 
-#include <rte_debug.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
 #include <rte_graph.h>
 #include <rte_graph_worker.h>
 #include <rte_ip.h>
 #include <rte_malloc.h>
-#include <rte_mbuf.h>
-#include <rte_tcp.h>
-#include <rte_udp.h>
 #include <rte_vect.h>
 
 #include "rte_node_ip4_api.h"
diff --git a/lib/node/pkt_cls.c b/lib/node/pkt_cls.c
index b95454dd72..3e75f2cf78 100644
--- a/lib/node/pkt_cls.c
+++ b/lib/node/pkt_cls.c
@@ -2,10 +2,6 @@
  * Copyright (C) 2020 Marvell.
  */
 
-#include <rte_debug.h>
-#include <rte_ether.h>
-#include <rte_ethdev.h>
-#include <rte_mbuf.h>
 #include <rte_graph.h>
 #include <rte_graph_worker.h>
 
diff --git a/lib/node/pkt_drop.c b/lib/node/pkt_drop.c
index c350013236..1ad7fccd28 100644
--- a/lib/node/pkt_drop.c
+++ b/lib/node/pkt_drop.c
@@ -2,7 +2,6 @@
  * Copyright(C) 2020 Marvell International Ltd.
  */
 
-#include <rte_debug.h>
 #include <rte_graph.h>
 #include <rte_mbuf.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 24/50] net: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (22 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 23/50] node: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 25/50] metrics: " Sean Morrissey
                           ` (26 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Jasvinder Singh, Bruce Richardson, Konstantin Ananyev, Olivier Matz
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/net/net_crc_avx512.c | 3 ---
 lib/net/net_crc_sse.c    | 1 -
 lib/net/rte_arp.c        | 1 -
 lib/net/rte_ether.h      | 1 -
 lib/net/rte_net.h        | 1 -
 lib/net/rte_net_crc.c    | 2 --
 6 files changed, 9 deletions(-)

diff --git a/lib/net/net_crc_avx512.c b/lib/net/net_crc_avx512.c
index 3740fe3c9d..f6a3ce9bcd 100644
--- a/lib/net/net_crc_avx512.c
+++ b/lib/net/net_crc_avx512.c
@@ -2,11 +2,8 @@
  * Copyright(c) 2020 Intel Corporation
  */
 
-#include <string.h>
 
 #include <rte_common.h>
-#include <rte_branch_prediction.h>
-#include <rte_cpuflags.h>
 
 #include "net_crc.h"
 
diff --git a/lib/net/net_crc_sse.c b/lib/net/net_crc_sse.c
index 053b54b390..dd75845636 100644
--- a/lib/net/net_crc_sse.c
+++ b/lib/net/net_crc_sse.c
@@ -6,7 +6,6 @@
 
 #include <rte_common.h>
 #include <rte_branch_prediction.h>
-#include <rte_cpuflags.h>
 
 #include "net_crc.h"
 
diff --git a/lib/net/rte_arp.c b/lib/net/rte_arp.c
index 9f7eb6b375..22af519586 100644
--- a/lib/net/rte_arp.c
+++ b/lib/net/rte_arp.c
@@ -3,7 +3,6 @@
  */
 
 #include <rte_arp.h>
-#include <rte_byteorder.h>
 
 #define RARP_PKT_SIZE	64
 struct rte_mbuf *
diff --git a/lib/net/rte_ether.h b/lib/net/rte_ether.h
index 3d9852d9e2..bf8a55ba06 100644
--- a/lib/net/rte_ether.h
+++ b/lib/net/rte_ether.h
@@ -18,7 +18,6 @@ extern "C" {
 #include <stdint.h>
 #include <stdio.h>
 
-#include <rte_memcpy.h>
 #include <rte_random.h>
 #include <rte_mbuf.h>
 #include <rte_byteorder.h>
diff --git a/lib/net/rte_net.h b/lib/net/rte_net.h
index 53a7f4d360..56611fc8f9 100644
--- a/lib/net/rte_net.h
+++ b/lib/net/rte_net.h
@@ -12,7 +12,6 @@ extern "C" {
 #include <rte_ip.h>
 #include <rte_udp.h>
 #include <rte_tcp.h>
-#include <rte_sctp.h>
 
 /**
  * Structure containing header lengths associated to a packet, filled
diff --git a/lib/net/rte_net_crc.c b/lib/net/rte_net_crc.c
index d9a526ab7b..a685f9e7bb 100644
--- a/lib/net/rte_net_crc.c
+++ b/lib/net/rte_net_crc.c
@@ -3,13 +3,11 @@
  */
 
 #include <stddef.h>
-#include <string.h>
 #include <stdint.h>
 
 #include <rte_cpuflags.h>
 #include <rte_common.h>
 #include <rte_net_crc.h>
-#include <rte_eal.h>
 #include <rte_log.h>
 #include <rte_vect.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 25/50] metrics: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (23 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 24/50] net: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 26/50] mempool: " Sean Morrissey
                           ` (25 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/metrics/rte_metrics.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/metrics/rte_metrics.c b/lib/metrics/rte_metrics.c
index e2a0fbeda8..0c7878e65f 100644
--- a/lib/metrics/rte_metrics.c
+++ b/lib/metrics/rte_metrics.c
@@ -3,13 +3,10 @@
  */
 
 #include <string.h>
-#include <sys/queue.h>
 
 #include <rte_common.h>
 #include <rte_string_fns.h>
-#include <rte_malloc.h>
 #include <rte_metrics.h>
-#include <rte_lcore.h>
 #include <rte_memzone.h>
 #include <rte_spinlock.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 26/50] mempool: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (24 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 25/50] metrics: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 27/50] member: " Sean Morrissey
                           ` (24 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Olivier Matz, Andrew Rybchenko; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/mempool/rte_mempool.c | 7 -------
 lib/mempool/rte_mempool.h | 4 ----
 2 files changed, 11 deletions(-)

diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index c5a699b1d6..de59009baf 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -7,7 +7,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdint.h>
-#include <stdarg.h>
 #include <unistd.h>
 #include <inttypes.h>
 #include <errno.h>
@@ -19,16 +18,10 @@
 #include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_malloc.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_branch_prediction.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
-#include <rte_spinlock.h>
 #include <rte_tailq.h>
 #include <rte_eal_paging.h>
 #include <rte_telemetry.h>
diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index 1e7a3c1527..5f9f9ead9b 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -34,17 +34,13 @@
  */
 
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdint.h>
-#include <errno.h>
 #include <inttypes.h>
 
 #include <rte_config.h>
 #include <rte_spinlock.h>
-#include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_lcore.h>
-#include <rte_memory.h>
 #include <rte_branch_prediction.h>
 #include <rte_ring.h>
 #include <rte_memcpy.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 27/50] member: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (25 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 26/50] mempool: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 28/50] mbuf: " Sean Morrissey
                           ` (23 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Yipeng Wang, Sameh Gobriel; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/member/rte_member.c     | 2 --
 lib/member/rte_member.h     | 1 -
 lib/member/rte_member_vbf.c | 1 -
 3 files changed, 4 deletions(-)

diff --git a/lib/member/rte_member.c b/lib/member/rte_member.c
index 9dd55a5adf..7e1632e6b5 100644
--- a/lib/member/rte_member.c
+++ b/lib/member/rte_member.c
@@ -5,9 +5,7 @@
 #include <string.h>
 
 #include <rte_string_fns.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_errno.h>
 #include <rte_tailq.h>
diff --git a/lib/member/rte_member.h b/lib/member/rte_member.h
index c0689e233e..567ee0c84b 100644
--- a/lib/member/rte_member.h
+++ b/lib/member/rte_member.h
@@ -52,7 +52,6 @@ extern "C" {
 #include <stdint.h>
 
 #include <rte_common.h>
-#include <rte_config.h>
 
 /** The set ID type that stored internally in hash table based set summary. */
 typedef uint16_t member_set_t;
diff --git a/lib/member/rte_member_vbf.c b/lib/member/rte_member_vbf.c
index 8a232bae02..9df4620cff 100644
--- a/lib/member/rte_member_vbf.c
+++ b/lib/member/rte_member_vbf.c
@@ -6,7 +6,6 @@
 #include <string.h>
 
 #include <rte_malloc.h>
-#include <rte_memory.h>
 #include <rte_errno.h>
 #include <rte_log.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 28/50] mbuf: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (26 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 27/50] member: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 29/50] lpm: " Sean Morrissey
                           ` (22 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/mbuf/rte_mbuf.c          | 11 -----------
 lib/mbuf/rte_mbuf.h          |  2 --
 lib/mbuf/rte_mbuf_dyn.h      |  2 --
 lib/mbuf/rte_mbuf_pool_ops.c |  1 -
 lib/mbuf/rte_mbuf_pool_ops.h |  1 -
 5 files changed, 17 deletions(-)

diff --git a/lib/mbuf/rte_mbuf.c b/lib/mbuf/rte_mbuf.c
index 604d77bbda..87592faccb 100644
--- a/lib/mbuf/rte_mbuf.c
+++ b/lib/mbuf/rte_mbuf.c
@@ -5,28 +5,17 @@
 
 #include <string.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <stdint.h>
-#include <stdarg.h>
 #include <inttypes.h>
 #include <errno.h>
-#include <ctype.h>
-#include <sys/queue.h>
 
-#include <rte_compat.h>
 #include <rte_debug.h>
 #include <rte_common.h>
 #include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_launch.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_branch_prediction.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_mbuf_pool_ops.h>
-#include <rte_string_fns.h>
 #include <rte_hexdump.h>
 #include <rte_errno.h>
 #include <rte_memcpy.h>
diff --git a/lib/mbuf/rte_mbuf.h b/lib/mbuf/rte_mbuf.h
index dedf83c38d..9811e8c760 100644
--- a/lib/mbuf/rte_mbuf.h
+++ b/lib/mbuf/rte_mbuf.h
@@ -36,10 +36,8 @@
 #include <rte_common.h>
 #include <rte_config.h>
 #include <rte_mempool.h>
-#include <rte_memory.h>
 #include <rte_prefetch.h>
 #include <rte_branch_prediction.h>
-#include <rte_byteorder.h>
 #include <rte_mbuf_ptype.h>
 #include <rte_mbuf_core.h>
 
diff --git a/lib/mbuf/rte_mbuf_dyn.h b/lib/mbuf/rte_mbuf_dyn.h
index 29abe8da53..ed8e57b350 100644
--- a/lib/mbuf/rte_mbuf_dyn.h
+++ b/lib/mbuf/rte_mbuf_dyn.h
@@ -68,9 +68,7 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <sys/types.h>
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/mbuf/rte_mbuf_pool_ops.c b/lib/mbuf/rte_mbuf_pool_ops.c
index f0e87a1412..4c91f4ce85 100644
--- a/lib/mbuf/rte_mbuf_pool_ops.c
+++ b/lib/mbuf/rte_mbuf_pool_ops.c
@@ -3,7 +3,6 @@
  */
 
 #include <string.h>
-#include <rte_compat.h>
 #include <rte_eal.h>
 #include <rte_mbuf.h>
 #include <rte_errno.h>
diff --git a/lib/mbuf/rte_mbuf_pool_ops.h b/lib/mbuf/rte_mbuf_pool_ops.h
index 7ed95a49a4..00cddb83ba 100644
--- a/lib/mbuf/rte_mbuf_pool_ops.h
+++ b/lib/mbuf/rte_mbuf_pool_ops.h
@@ -14,7 +14,6 @@
  * the best mempool ops available.
  */
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 29/50] lpm: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (27 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 28/50] mbuf: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 30/50] latencystats: " Sean Morrissey
                           ` (21 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Bruce Richardson, Vladimir Medvedkin; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/lpm/rte_lpm.c  | 7 -------
 lib/lpm/rte_lpm.h  | 4 ----
 lib/lpm/rte_lpm6.c | 7 -------
 lib/lpm/rte_lpm6.h | 1 -
 4 files changed, 19 deletions(-)

diff --git a/lib/lpm/rte_lpm.c b/lib/lpm/rte_lpm.c
index 002811f4de..cdcd1b7f9e 100644
--- a/lib/lpm/rte_lpm.c
+++ b/lib/lpm/rte_lpm.c
@@ -6,22 +6,15 @@
 #include <string.h>
 #include <stdint.h>
 #include <errno.h>
-#include <stdarg.h>
 #include <stdio.h>
 #include <sys/queue.h>
 
 #include <rte_log.h>
-#include <rte_branch_prediction.h>
 #include <rte_common.h>
-#include <rte_memory.h>        /* for definition of RTE_CACHE_LINE_SIZE */
 #include <rte_malloc.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
 #include <rte_string_fns.h>
 #include <rte_errno.h>
-#include <rte_rwlock.h>
-#include <rte_spinlock.h>
 #include <rte_tailq.h>
 
 #include "rte_lpm.h"
diff --git a/lib/lpm/rte_lpm.h b/lib/lpm/rte_lpm.h
index 5eb14c1748..eb91960e81 100644
--- a/lib/lpm/rte_lpm.h
+++ b/lib/lpm/rte_lpm.h
@@ -12,13 +12,9 @@
  */
 
 #include <errno.h>
-#include <sys/queue.h>
 #include <stdint.h>
-#include <stdlib.h>
 #include <rte_branch_prediction.h>
 #include <rte_byteorder.h>
-#include <rte_config.h>
-#include <rte_memory.h>
 #include <rte_common.h>
 #include <rte_vect.h>
 #include <rte_rcu_qsbr.h>
diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c
index 73768fc956..8d21aeddb8 100644
--- a/lib/lpm/rte_lpm6.c
+++ b/lib/lpm/rte_lpm6.c
@@ -4,23 +4,16 @@
 #include <string.h>
 #include <stdint.h>
 #include <errno.h>
-#include <stdarg.h>
 #include <stdio.h>
 #include <sys/queue.h>
 
 #include <rte_log.h>
-#include <rte_branch_prediction.h>
 #include <rte_common.h>
-#include <rte_memory.h>
 #include <rte_malloc.h>
 #include <rte_memcpy.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
 #include <rte_string_fns.h>
 #include <rte_errno.h>
-#include <rte_rwlock.h>
-#include <rte_spinlock.h>
 #include <rte_hash.h>
 #include <assert.h>
 #include <rte_jhash.h>
diff --git a/lib/lpm/rte_lpm6.h b/lib/lpm/rte_lpm6.h
index f96f3372e5..9b07260d5a 100644
--- a/lib/lpm/rte_lpm6.h
+++ b/lib/lpm/rte_lpm6.h
@@ -10,7 +10,6 @@
  */
 
 #include <stdint.h>
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 30/50] latencystats: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (28 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 29/50] lpm: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 31/50] kni: " Sean Morrissey
                           ` (20 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Reshma Pattan; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/latencystats/rte_latencystats.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/lib/latencystats/rte_latencystats.c b/lib/latencystats/rte_latencystats.c
index ab8db7a139..8985a377db 100644
--- a/lib/latencystats/rte_latencystats.c
+++ b/lib/latencystats/rte_latencystats.c
@@ -2,13 +2,9 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <unistd.h>
-#include <sys/types.h>
-#include <stdbool.h>
 #include <math.h>
 
 #include <rte_string_fns.h>
-#include <rte_mbuf.h>
 #include <rte_mbuf_dyn.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 31/50] kni: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (29 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 30/50] latencystats: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 32/50] jobstats: " Sean Morrissey
                           ` (19 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/kni/rte_kni.c | 2 --
 lib/kni/rte_kni.h | 2 --
 2 files changed, 4 deletions(-)

diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c
index fc8f0e7b5a..7971c56bb4 100644
--- a/lib/kni/rte_kni.c
+++ b/lib/kni/rte_kni.c
@@ -12,7 +12,6 @@
 #include <sys/ioctl.h>
 #include <linux/version.h>
 
-#include <rte_spinlock.h>
 #include <rte_string_fns.h>
 #include <rte_ethdev.h>
 #include <rte_malloc.h>
@@ -20,7 +19,6 @@
 #include <rte_kni.h>
 #include <rte_memzone.h>
 #include <rte_tailq.h>
-#include <rte_rwlock.h>
 #include <rte_eal_memconfig.h>
 #include <rte_kni_common.h>
 #include "rte_kni_fifo.h"
diff --git a/lib/kni/rte_kni.h b/lib/kni/rte_kni.h
index b0eaf46104..b85d3dd32b 100644
--- a/lib/kni/rte_kni.h
+++ b/lib/kni/rte_kni.h
@@ -18,8 +18,6 @@
  */
 
 #include <rte_pci.h>
-#include <rte_memory.h>
-#include <rte_mempool.h>
 #include <rte_ether.h>
 
 #include <rte_kni_common.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 32/50] jobstats: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (30 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 31/50] kni: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 33/50] ipsec: " Sean Morrissey
                           ` (18 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/jobstats/rte_jobstats.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/jobstats/rte_jobstats.c b/lib/jobstats/rte_jobstats.c
index 9b8fde5d55..af565a14ea 100644
--- a/lib/jobstats/rte_jobstats.c
+++ b/lib/jobstats/rte_jobstats.c
@@ -7,10 +7,7 @@
 #include <errno.h>
 
 #include <rte_string_fns.h>
-#include <rte_errno.h>
 #include <rte_common.h>
-#include <rte_eal.h>
-#include <rte_log.h>
 #include <rte_cycles.h>
 #include <rte_branch_prediction.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 33/50] ipsec: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (31 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 32/50] jobstats: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 34/50] ip_frag: " Sean Morrissey
                           ` (17 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Konstantin Ananyev, Bernard Iremonger, Vladimir Medvedkin
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/ipsec/esp_inb.c   | 1 -
 lib/ipsec/esp_outb.c  | 1 -
 lib/ipsec/ipsec_sad.c | 1 -
 lib/ipsec/sa.c        | 3 ---
 lib/ipsec/sa.h        | 1 -
 5 files changed, 7 deletions(-)

diff --git a/lib/ipsec/esp_inb.c b/lib/ipsec/esp_inb.c
index 636c850fa6..f159bf7460 100644
--- a/lib/ipsec/esp_inb.c
+++ b/lib/ipsec/esp_inb.c
@@ -4,7 +4,6 @@
 
 #include <rte_ipsec.h>
 #include <rte_esp.h>
-#include <rte_ip.h>
 #include <rte_errno.h>
 #include <rte_cryptodev.h>
 
diff --git a/lib/ipsec/esp_outb.c b/lib/ipsec/esp_outb.c
index 672e56aba0..6925bb9945 100644
--- a/lib/ipsec/esp_outb.c
+++ b/lib/ipsec/esp_outb.c
@@ -4,7 +4,6 @@
 
 #include <rte_ipsec.h>
 #include <rte_esp.h>
-#include <rte_ip.h>
 #include <rte_udp.h>
 #include <rte_errno.h>
 #include <rte_cryptodev.h>
diff --git a/lib/ipsec/ipsec_sad.c b/lib/ipsec/ipsec_sad.c
index 531e1e323c..6f3860e3f5 100644
--- a/lib/ipsec/ipsec_sad.c
+++ b/lib/ipsec/ipsec_sad.c
@@ -10,7 +10,6 @@
 #include <rte_hash_crc.h>
 #include <rte_malloc.h>
 #include <rte_random.h>
-#include <rte_rwlock.h>
 #include <rte_tailq.h>
 
 #include "rte_ipsec_sad.h"
diff --git a/lib/ipsec/sa.c b/lib/ipsec/sa.c
index cdb70af0cb..1b673b6a18 100644
--- a/lib/ipsec/sa.c
+++ b/lib/ipsec/sa.c
@@ -7,14 +7,11 @@
 #include <rte_ip.h>
 #include <rte_udp.h>
 #include <rte_errno.h>
-#include <rte_cryptodev.h>
 
 #include "sa.h"
 #include "ipsec_sqn.h"
 #include "crypto.h"
-#include "iph.h"
 #include "misc.h"
-#include "pad.h"
 
 #define MBUF_MAX_L2_LEN		RTE_LEN2MASK(RTE_MBUF_L2_LEN_BITS, uint64_t)
 #define MBUF_MAX_L3_LEN		RTE_LEN2MASK(RTE_MBUF_L3_LEN_BITS, uint64_t)
diff --git a/lib/ipsec/sa.h b/lib/ipsec/sa.h
index 7503587b50..46f9a4df5b 100644
--- a/lib/ipsec/sa.h
+++ b/lib/ipsec/sa.h
@@ -5,7 +5,6 @@
 #ifndef _SA_H_
 #define _SA_H_
 
-#include <rte_rwlock.h>
 
 #define IPSEC_MAX_HDR_SIZE	64
 #define IPSEC_MAX_IV_SIZE	16
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 34/50] ip_frag: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (32 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 33/50] ipsec: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 35/50] hash: " Sean Morrissey
                           ` (16 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/ip_frag/rte_ip_frag_common.c     | 1 -
 lib/ip_frag/rte_ipv4_fragmentation.c | 2 --
 2 files changed, 3 deletions(-)

diff --git a/lib/ip_frag/rte_ip_frag_common.c b/lib/ip_frag/rte_ip_frag_common.c
index 2c781a6d33..c1de2e81b6 100644
--- a/lib/ip_frag/rte_ip_frag_common.c
+++ b/lib/ip_frag/rte_ip_frag_common.c
@@ -5,7 +5,6 @@
 #include <stddef.h>
 #include <stdio.h>
 
-#include <rte_memory.h>
 #include <rte_log.h>
 
 #include "ip_frag_common.h"
diff --git a/lib/ip_frag/rte_ipv4_fragmentation.c b/lib/ip_frag/rte_ipv4_fragmentation.c
index 2e7739d027..669682a0cf 100644
--- a/lib/ip_frag/rte_ipv4_fragmentation.c
+++ b/lib/ip_frag/rte_ipv4_fragmentation.c
@@ -6,8 +6,6 @@
 #include <errno.h>
 
 #include <rte_memcpy.h>
-#include <rte_mempool.h>
-#include <rte_debug.h>
 #include <rte_ether.h>
 
 #include "ip_frag_common.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 35/50] hash: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (33 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 34/50] ip_frag: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 36/50] gro: " Sean Morrissey
                           ` (15 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Yipeng Wang, Sameh Gobriel, Bruce Richardson, Vladimir Medvedkin
  Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/hash/rte_cuckoo_hash.c | 4 ----
 lib/hash/rte_fbk_hash.c    | 6 ------
 lib/hash/rte_fbk_hash.h    | 1 -
 lib/hash/rte_thash.c       | 1 -
 lib/hash/rte_thash.h       | 1 -
 5 files changed, 13 deletions(-)

diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 1191dfd81a..490f94af4b 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -7,7 +7,6 @@
 #include <stdint.h>
 #include <errno.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <sys/queue.h>
 
 #include <rte_common.h>
@@ -16,14 +15,11 @@
 #include <rte_prefetch.h>
 #include <rte_branch_prediction.h>
 #include <rte_malloc.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
-#include <rte_per_lcore.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 #include <rte_cpuflags.h>
 #include <rte_rwlock.h>
-#include <rte_spinlock.h>
 #include <rte_ring_elem.h>
 #include <rte_compat.h>
 #include <rte_vect.h>
diff --git a/lib/hash/rte_fbk_hash.c b/lib/hash/rte_fbk_hash.c
index 576e8e6662..538b23a403 100644
--- a/lib/hash/rte_fbk_hash.c
+++ b/lib/hash/rte_fbk_hash.c
@@ -4,22 +4,16 @@
 
 #include <stdint.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
 #include <errno.h>
 
 #include <sys/queue.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_malloc.h>
 #include <rte_common.h>
-#include <rte_per_lcore.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
-#include <rte_cpuflags.h>
 #include <rte_log.h>
-#include <rte_spinlock.h>
 #include <rte_tailq.h>
 
 #include "rte_fbk_hash.h"
diff --git a/lib/hash/rte_fbk_hash.h b/lib/hash/rte_fbk_hash.h
index 9c3a61c1d6..b01126999b 100644
--- a/lib/hash/rte_fbk_hash.h
+++ b/lib/hash/rte_fbk_hash.h
@@ -24,7 +24,6 @@ extern "C" {
 
 #include <string.h>
 
-#include <rte_config.h>
 #include <rte_hash_crc.h>
 #include <rte_jhash.h>
 
diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c
index 6847e36f4b..0249883b8d 100644
--- a/lib/hash/rte_thash.c
+++ b/lib/hash/rte_thash.c
@@ -9,7 +9,6 @@
 #include <rte_random.h>
 #include <rte_memcpy.h>
 #include <rte_errno.h>
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
diff --git a/lib/hash/rte_thash.h b/lib/hash/rte_thash.h
index c11ca0d5b8..451f64043a 100644
--- a/lib/hash/rte_thash.h
+++ b/lib/hash/rte_thash.h
@@ -21,7 +21,6 @@ extern "C" {
 
 #include <stdint.h>
 #include <rte_byteorder.h>
-#include <rte_config.h>
 #include <rte_ip.h>
 #include <rte_common.h>
 #include <rte_thash_gfni.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 36/50] gro: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (34 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 35/50] hash: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 37/50] graph: " Sean Morrissey
                           ` (14 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Jiayu Hu; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/gro/gro_tcp4.c       | 1 -
 lib/gro/gro_tcp4.h       | 2 --
 lib/gro/gro_udp4.c       | 1 -
 lib/gro/gro_udp4.h       | 2 --
 lib/gro/gro_vxlan_tcp4.c | 1 -
 lib/gro/gro_vxlan_udp4.c | 1 -
 lib/gro/rte_gro.c        | 1 -
 7 files changed, 9 deletions(-)

diff --git a/lib/gro/gro_tcp4.c b/lib/gro/gro_tcp4.c
index aff22178e3..7498c66141 100644
--- a/lib/gro/gro_tcp4.c
+++ b/lib/gro/gro_tcp4.c
@@ -4,7 +4,6 @@
 
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_cycles.h>
 #include <rte_ethdev.h>
 
 #include "gro_tcp4.h"
diff --git a/lib/gro/gro_tcp4.h b/lib/gro/gro_tcp4.h
index bb875a5ef0..212f97a042 100644
--- a/lib/gro/gro_tcp4.h
+++ b/lib/gro/gro_tcp4.h
@@ -5,9 +5,7 @@
 #ifndef _GRO_TCP4_H_
 #define _GRO_TCP4_H_
 
-#include <rte_ip.h>
 #include <rte_tcp.h>
-#include <rte_vxlan.h>
 
 #define INVALID_ARRAY_INDEX 0xffffffffUL
 #define GRO_TCP4_TBL_MAX_ITEM_NUM (1024UL * 1024UL)
diff --git a/lib/gro/gro_udp4.c b/lib/gro/gro_udp4.c
index e78dda7874..dd71135ada 100644
--- a/lib/gro/gro_udp4.c
+++ b/lib/gro/gro_udp4.c
@@ -4,7 +4,6 @@
 
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_cycles.h>
 #include <rte_ethdev.h>
 
 #include "gro_udp4.h"
diff --git a/lib/gro/gro_udp4.h b/lib/gro/gro_udp4.h
index d38b393f79..6467d7bc3b 100644
--- a/lib/gro/gro_udp4.h
+++ b/lib/gro/gro_udp4.h
@@ -6,8 +6,6 @@
 #define _GRO_UDP4_H_
 
 #include <rte_ip.h>
-#include <rte_udp.h>
-#include <rte_vxlan.h>
 
 #define INVALID_ARRAY_INDEX 0xffffffffUL
 #define GRO_UDP4_TBL_MAX_ITEM_NUM (1024UL * 1024UL)
diff --git a/lib/gro/gro_vxlan_tcp4.c b/lib/gro/gro_vxlan_tcp4.c
index 2005899afe..3be4deb7c7 100644
--- a/lib/gro/gro_vxlan_tcp4.c
+++ b/lib/gro/gro_vxlan_tcp4.c
@@ -4,7 +4,6 @@
 
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_cycles.h>
 #include <rte_ethdev.h>
 #include <rte_udp.h>
 
diff --git a/lib/gro/gro_vxlan_udp4.c b/lib/gro/gro_vxlan_udp4.c
index 4767c910bb..b78a7ae89e 100644
--- a/lib/gro/gro_vxlan_udp4.c
+++ b/lib/gro/gro_vxlan_udp4.c
@@ -4,7 +4,6 @@
 
 #include <rte_malloc.h>
 #include <rte_mbuf.h>
-#include <rte_cycles.h>
 #include <rte_ethdev.h>
 #include <rte_udp.h>
 
diff --git a/lib/gro/rte_gro.c b/lib/gro/rte_gro.c
index 8ca4da67e9..6f7dd4d709 100644
--- a/lib/gro/rte_gro.c
+++ b/lib/gro/rte_gro.c
@@ -3,7 +3,6 @@
  */
 
 #include <rte_malloc.h>
-#include <rte_mbuf.h>
 #include <rte_cycles.h>
 #include <rte_ethdev.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 37/50] graph: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (35 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 36/50] gro: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 38/50] gpudev: " Sean Morrissey
                           ` (13 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Jerin Jacob, Kiran Kumar K, Nithin Dabilpuram; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/graph/graph_debug.c    | 2 --
 lib/graph/graph_ops.c      | 1 -
 lib/graph/graph_populate.c | 2 --
 lib/graph/node.c           | 1 -
 4 files changed, 6 deletions(-)

diff --git a/lib/graph/graph_debug.c b/lib/graph/graph_debug.c
index f8aea16acb..b84412f5dd 100644
--- a/lib/graph/graph_debug.c
+++ b/lib/graph/graph_debug.c
@@ -2,8 +2,6 @@
  * Copyright(C) 2020 Marvell International Ltd.
  */
 
-#include <rte_common.h>
-#include <rte_debug.h>
 
 #include "graph_private.h"
 
diff --git a/lib/graph/graph_ops.c b/lib/graph/graph_ops.c
index 3355953118..20db58d84e 100644
--- a/lib/graph/graph_ops.c
+++ b/lib/graph/graph_ops.c
@@ -5,7 +5,6 @@
 #include <stdbool.h>
 #include <string.h>
 
-#include <rte_common.h>
 #include <rte_errno.h>
 
 #include "graph_private.h"
diff --git a/lib/graph/graph_populate.c b/lib/graph/graph_populate.c
index 093512efab..102fd6c29b 100644
--- a/lib/graph/graph_populate.c
+++ b/lib/graph/graph_populate.c
@@ -2,8 +2,6 @@
  * Copyright(C) 2020 Marvell International Ltd.
  */
 
-#include <fnmatch.h>
-#include <stdbool.h>
 
 #include <rte_common.h>
 #include <rte_errno.h>
diff --git a/lib/graph/node.c b/lib/graph/node.c
index 86ec4316f9..79230035a2 100644
--- a/lib/graph/node.c
+++ b/lib/graph/node.c
@@ -8,7 +8,6 @@
 
 #include <rte_common.h>
 #include <rte_debug.h>
-#include <rte_eal.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 38/50] gpudev: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (36 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 37/50] graph: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 39/50] flow_classify: " Sean Morrissey
                           ` (12 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Elena Agostini; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/gpudev/gpudev.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c
index 9ae36dbae9..98bb759fb2 100644
--- a/lib/gpudev/gpudev.c
+++ b/lib/gpudev/gpudev.c
@@ -4,7 +4,6 @@
 
 #include <rte_eal.h>
 #include <rte_tailq.h>
-#include <rte_rwlock.h>
 #include <rte_string_fns.h>
 #include <rte_memzone.h>
 #include <rte_malloc.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 39/50] flow_classify: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (37 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 38/50] gpudev: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 40/50] fib: " Sean Morrissey
                           ` (11 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Bernard Iremonger; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/flow_classify/rte_flow_classify.c       | 3 ---
 lib/flow_classify/rte_flow_classify.h       | 4 ----
 lib/flow_classify/rte_flow_classify_parse.c | 1 -
 lib/flow_classify/rte_flow_classify_parse.h | 1 -
 4 files changed, 9 deletions(-)

diff --git a/lib/flow_classify/rte_flow_classify.c b/lib/flow_classify/rte_flow_classify.c
index d3ba2ed227..e3667306e5 100644
--- a/lib/flow_classify/rte_flow_classify.c
+++ b/lib/flow_classify/rte_flow_classify.c
@@ -3,12 +3,9 @@
  */
 
 #include <rte_string_fns.h>
-#include <rte_compat.h>
 #include <rte_flow_classify.h>
 #include "rte_flow_classify_parse.h"
-#include <rte_flow_driver.h>
 #include <rte_table_acl.h>
-#include <stdbool.h>
 
 static uint32_t unique_id = 1;
 
diff --git a/lib/flow_classify/rte_flow_classify.h b/lib/flow_classify/rte_flow_classify.h
index 82ea92b6a6..39512b6206 100644
--- a/lib/flow_classify/rte_flow_classify.h
+++ b/lib/flow_classify/rte_flow_classify.h
@@ -45,11 +45,7 @@
 
 #include <rte_compat.h>
 #include <rte_common.h>
-#include <rte_ethdev.h>
-#include <rte_ether.h>
 #include <rte_flow.h>
-#include <rte_acl.h>
-#include <rte_table_acl.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/flow_classify/rte_flow_classify_parse.c b/lib/flow_classify/rte_flow_classify_parse.c
index 465330291f..345d129d35 100644
--- a/lib/flow_classify/rte_flow_classify_parse.c
+++ b/lib/flow_classify/rte_flow_classify_parse.c
@@ -4,7 +4,6 @@
 
 #include <rte_flow_classify.h>
 #include "rte_flow_classify_parse.h"
-#include <rte_flow_driver.h>
 
 struct classify_valid_pattern {
 	enum rte_flow_item_type *items;
diff --git a/lib/flow_classify/rte_flow_classify_parse.h b/lib/flow_classify/rte_flow_classify_parse.h
index 365a07bd6d..7943efc0d4 100644
--- a/lib/flow_classify/rte_flow_classify_parse.h
+++ b/lib/flow_classify/rte_flow_classify_parse.h
@@ -6,7 +6,6 @@
 #define _RTE_FLOW_CLASSIFY_PARSE_H_
 
 #include <rte_ethdev.h>
-#include <rte_ether.h>
 #include <rte_flow.h>
 #include <stdbool.h>
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 40/50] fib: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (38 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 39/50] flow_classify: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 41/50] eventdev: " Sean Morrissey
                           ` (10 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Vladimir Medvedkin; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/fib/dir24_8.c  | 4 ----
 lib/fib/rte_fib.c  | 2 --
 lib/fib/rte_fib.h  | 1 -
 lib/fib/rte_fib6.c | 2 --
 lib/fib/rte_fib6.h | 1 -
 lib/fib/trie.c     | 5 -----
 lib/fib/trie.h     | 2 --
 7 files changed, 17 deletions(-)

diff --git a/lib/fib/dir24_8.c b/lib/fib/dir24_8.c
index bb3bc9753b..a8ba4f64ca 100644
--- a/lib/fib/dir24_8.c
+++ b/lib/fib/dir24_8.c
@@ -4,15 +4,11 @@
  */
 
 #include <stdint.h>
-#include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
 
 #include <rte_debug.h>
 #include <rte_malloc.h>
 #include <rte_errno.h>
-#include <rte_memory.h>
 #include <rte_vect.h>
 
 #include <rte_rib.h>
diff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c
index 0cced97a77..8af4c40919 100644
--- a/lib/fib/rte_fib.c
+++ b/lib/fib/rte_fib.c
@@ -6,11 +6,9 @@
 #include <stdint.h>
 #include <string.h>
 
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
-#include <rte_rwlock.h>
 #include <rte_string_fns.h>
 #include <rte_tailq.h>
 
diff --git a/lib/fib/rte_fib.h b/lib/fib/rte_fib.h
index e592d3251a..90f28b7e11 100644
--- a/lib/fib/rte_fib.h
+++ b/lib/fib/rte_fib.h
@@ -17,7 +17,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/fib/rte_fib6.c b/lib/fib/rte_fib6.c
index eebee297d6..4b8e22b142 100644
--- a/lib/fib/rte_fib6.c
+++ b/lib/fib/rte_fib6.c
@@ -6,11 +6,9 @@
 #include <stdint.h>
 #include <string.h>
 
-#include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_tailq.h>
 #include <rte_errno.h>
-#include <rte_rwlock.h>
 #include <rte_malloc.h>
 #include <rte_string_fns.h>
 
diff --git a/lib/fib/rte_fib6.h b/lib/fib/rte_fib6.h
index cb133719e1..62a425d9af 100644
--- a/lib/fib/rte_fib6.h
+++ b/lib/fib/rte_fib6.h
@@ -17,7 +17,6 @@
 
 #include <stdint.h>
 
-#include <rte_compat.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/lib/fib/trie.c b/lib/fib/trie.c
index 044095bf03..3e780afdaf 100644
--- a/lib/fib/trie.c
+++ b/lib/fib/trie.c
@@ -4,16 +4,11 @@
  */
 
 #include <stdint.h>
-#include <stdlib.h>
 #include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
 
 #include <rte_debug.h>
 #include <rte_malloc.h>
 #include <rte_errno.h>
-#include <rte_memory.h>
-#include <rte_vect.h>
 
 #include <rte_rib6.h>
 #include <rte_fib6.h>
diff --git a/lib/fib/trie.h b/lib/fib/trie.h
index 9fd15ae79f..3cf161ae25 100644
--- a/lib/fib/trie.h
+++ b/lib/fib/trie.h
@@ -10,8 +10,6 @@
  * @file
  * RTE IPv6 Longest Prefix Match (LPM)
  */
-#include <rte_prefetch.h>
-#include <rte_branch_prediction.h>
 
 /* @internal Total number of tbl24 entries. */
 #define TRIE_TBL24_NUM_ENT	(1 << 24)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 41/50] eventdev: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (39 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 40/50] fib: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-18 19:47           ` Carrillo, Erik G
  2022-01-17 20:19         ` [PATCH v5 42/50] efd: " Sean Morrissey
                           ` (9 subsequent siblings)
  50 siblings, 1 reply; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Jerin Jacob, Erik Gabriel Carrillo; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/eventdev/rte_event_ring.c          |  6 ------
 lib/eventdev/rte_event_ring.h          |  2 --
 lib/eventdev/rte_event_timer_adapter.c |  5 -----
 lib/eventdev/rte_event_timer_adapter.h |  2 --
 lib/eventdev/rte_eventdev.c            | 11 -----------
 lib/eventdev/rte_eventdev.h            |  2 --
 6 files changed, 28 deletions(-)

diff --git a/lib/eventdev/rte_event_ring.c b/lib/eventdev/rte_event_ring.c
index d27e23901d..c070715148 100644
--- a/lib/eventdev/rte_event_ring.c
+++ b/lib/eventdev/rte_event_ring.c
@@ -3,13 +3,7 @@
  * Copyright(c) 2019 Arm Limited
  */
 
-#include <sys/queue.h>
-#include <string.h>
 
-#include <rte_tailq.h>
-#include <rte_memzone.h>
-#include <rte_rwlock.h>
-#include <rte_eal_memconfig.h>
 #include "rte_event_ring.h"
 
 int
diff --git a/lib/eventdev/rte_event_ring.h b/lib/eventdev/rte_event_ring.h
index c0861b0ec2..0a54f7fde2 100644
--- a/lib/eventdev/rte_event_ring.h
+++ b/lib/eventdev/rte_event_ring.h
@@ -17,8 +17,6 @@
 #include <stdint.h>
 
 #include <rte_common.h>
-#include <rte_memory.h>
-#include <rte_malloc.h>
 #include <rte_ring.h>
 #include <rte_ring_elem.h>
 #include "rte_eventdev.h"
diff --git a/lib/eventdev/rte_event_timer_adapter.c b/lib/eventdev/rte_event_timer_adapter.c
index 9dad170b5a..7dc39386c9 100644
--- a/lib/eventdev/rte_event_timer_adapter.c
+++ b/lib/eventdev/rte_event_timer_adapter.c
@@ -6,19 +6,14 @@
 #include <string.h>
 #include <inttypes.h>
 #include <stdbool.h>
-#include <sys/queue.h>
 
 #include <rte_memzone.h>
-#include <rte_memory.h>
-#include <rte_dev.h>
 #include <rte_errno.h>
 #include <rte_malloc.h>
-#include <rte_ring.h>
 #include <rte_mempool.h>
 #include <rte_common.h>
 #include <rte_timer.h>
 #include <rte_service_component.h>
-#include <rte_cycles.h>
 
 #include "event_timer_adapter_pmd.h"
 #include "eventdev_pmd.h"
diff --git a/lib/eventdev/rte_event_timer_adapter.h b/lib/eventdev/rte_event_timer_adapter.h
index 1551741820..aefa322344 100644
--- a/lib/eventdev/rte_event_timer_adapter.h
+++ b/lib/eventdev/rte_event_timer_adapter.h
@@ -111,8 +111,6 @@
 extern "C" {
 #endif
 
-#include <rte_spinlock.h>
-#include <rte_memory.h>
 
 #include "rte_eventdev.h"
 #include "rte_eventdev_trace_fp.h"
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 79b9ea3a02..1c1b66de88 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -6,26 +6,15 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <stdint.h>
 #include <inttypes.h>
-#include <sys/types.h>
-#include <sys/queue.h>
 
 #include <rte_string_fns.h>
-#include <rte_byteorder.h>
 #include <rte_log.h>
-#include <rte_debug.h>
 #include <rte_dev.h>
-#include <rte_memory.h>
-#include <rte_memcpy.h>
 #include <rte_memzone.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_errno.h>
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index eef47d8acc..5738a8d9ea 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -211,10 +211,8 @@ extern "C" {
 #endif
 
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_errno.h>
 #include <rte_mbuf_pool_ops.h>
-#include <rte_memory.h>
 #include <rte_mempool.h>
 
 #include "rte_eventdev_trace_fp.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 42/50] efd: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (40 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 41/50] eventdev: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 43/50] dmadev: " Sean Morrissey
                           ` (8 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Byron Marohn, Yipeng Wang; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/efd/rte_efd.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c
index 86ef46863c..560cd78961 100644
--- a/lib/efd/rte_efd.c
+++ b/lib/efd/rte_efd.c
@@ -6,7 +6,6 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <errno.h>
-#include <stdarg.h>
 #include <sys/queue.h>
 
 #include <rte_string_fns.h>
@@ -21,11 +20,9 @@
 #include <rte_jhash.h>
 #include <rte_hash_crc.h>
 #include <rte_tailq.h>
-#include <rte_vect.h>
 
 #include "rte_efd.h"
 #if defined(RTE_ARCH_X86)
-#include "rte_efd_x86.h"
 #elif defined(RTE_ARCH_ARM64)
 #include "rte_efd_arm64.h"
 #endif
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 43/50] dmadev: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (41 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 42/50] efd: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 44/50] distributor: " Sean Morrissey
                           ` (7 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Chengwen Feng, Kevin Laatz, Bruce Richardson; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/dmadev/rte_dmadev.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/dmadev/rte_dmadev.h b/lib/dmadev/rte_dmadev.h
index 4abe79c536..ad9e7a0975 100644
--- a/lib/dmadev/rte_dmadev.h
+++ b/lib/dmadev/rte_dmadev.h
@@ -149,7 +149,6 @@
 #include <rte_bitops.h>
 #include <rte_common.h>
 #include <rte_compat.h>
-#include <rte_dev.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 44/50] distributor: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (42 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 43/50] dmadev: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 45/50] compressdev: " Sean Morrissey
                           ` (6 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: David Hunt, Bruce Richardson, Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/distributor/rte_distributor.c           | 2 --
 lib/distributor/rte_distributor_match_sse.c | 2 --
 lib/distributor/rte_distributor_single.c    | 2 --
 3 files changed, 6 deletions(-)

diff --git a/lib/distributor/rte_distributor.c b/lib/distributor/rte_distributor.c
index c210cf86bd..3035b7a999 100644
--- a/lib/distributor/rte_distributor.c
+++ b/lib/distributor/rte_distributor.c
@@ -6,7 +6,6 @@
 #include <sys/queue.h>
 #include <string.h>
 #include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_cycles.h>
 #include <rte_memzone.h>
 #include <rte_errno.h>
@@ -14,7 +13,6 @@
 #include <rte_eal_memconfig.h>
 #include <rte_pause.h>
 #include <rte_tailq.h>
-#include <rte_vect.h>
 
 #include "rte_distributor.h"
 #include "rte_distributor_single.h"
diff --git a/lib/distributor/rte_distributor_match_sse.c b/lib/distributor/rte_distributor_match_sse.c
index e3b3b79264..11d8819278 100644
--- a/lib/distributor/rte_distributor_match_sse.c
+++ b/lib/distributor/rte_distributor_match_sse.c
@@ -3,10 +3,8 @@
  */
 
 #include <rte_mbuf.h>
-#include "rte_distributor.h"
 #include "distributor_private.h"
 #include "smmintrin.h"
-#include "nmmintrin.h"
 
 
 void
diff --git a/lib/distributor/rte_distributor_single.c b/lib/distributor/rte_distributor_single.c
index b653620688..de90aa8bb5 100644
--- a/lib/distributor/rte_distributor_single.c
+++ b/lib/distributor/rte_distributor_single.c
@@ -4,9 +4,7 @@
 
 #include <stdio.h>
 #include <sys/queue.h>
-#include <string.h>
 #include <rte_mbuf.h>
-#include <rte_memory.h>
 #include <rte_memzone.h>
 #include <rte_errno.h>
 #include <rte_string_fns.h>
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 45/50] compressdev: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (43 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 44/50] distributor: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 46/50] cmdline: " Sean Morrissey
                           ` (5 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Fan Zhang, Ashish Gupta; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/compressdev/rte_comp.c            | 1 -
 lib/compressdev/rte_comp.h            | 1 -
 lib/compressdev/rte_compressdev.c     | 1 -
 lib/compressdev/rte_compressdev.h     | 1 -
 lib/compressdev/rte_compressdev_pmd.h | 2 --
 5 files changed, 6 deletions(-)

diff --git a/lib/compressdev/rte_comp.c b/lib/compressdev/rte_comp.c
index 3b0e46f96e..320c6dab92 100644
--- a/lib/compressdev/rte_comp.c
+++ b/lib/compressdev/rte_comp.c
@@ -3,7 +3,6 @@
  */
 
 #include "rte_comp.h"
-#include "rte_compressdev.h"
 #include "rte_compressdev_internal.h"
 
 const char *
diff --git a/lib/compressdev/rte_comp.h b/lib/compressdev/rte_comp.h
index 95306c5d03..cdb55e5887 100644
--- a/lib/compressdev/rte_comp.h
+++ b/lib/compressdev/rte_comp.h
@@ -16,7 +16,6 @@
 extern "C" {
 #endif
 
-#include <rte_mempool.h>
 #include <rte_mbuf.h>
 
 /**
diff --git a/lib/compressdev/rte_compressdev.c b/lib/compressdev/rte_compressdev.c
index 2e9218af68..202ee694d8 100644
--- a/lib/compressdev/rte_compressdev.c
+++ b/lib/compressdev/rte_compressdev.c
@@ -3,7 +3,6 @@
  */
 
 #include <string.h>
-#include <stdarg.h>
 #include <stdio.h>
 #include <inttypes.h>
 
diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h
index 2840c27c6c..aa865c4c03 100644
--- a/lib/compressdev/rte_compressdev.h
+++ b/lib/compressdev/rte_compressdev.h
@@ -21,7 +21,6 @@
 extern "C" {
 #endif
 
-#include <rte_common.h>
 
 #include "rte_comp.h"
 
diff --git a/lib/compressdev/rte_compressdev_pmd.h b/lib/compressdev/rte_compressdev_pmd.h
index f9a42d1f05..9fabc399c5 100644
--- a/lib/compressdev/rte_compressdev_pmd.h
+++ b/lib/compressdev/rte_compressdev_pmd.h
@@ -19,8 +19,6 @@ extern "C" {
 
 #include <string.h>
 
-#include <rte_dev.h>
-#include <rte_common.h>
 
 #include "rte_compressdev.h"
 #include "rte_compressdev_internal.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 46/50] cmdline: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (44 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 45/50] compressdev: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 47/50] bpf: " Sean Morrissey
                           ` (4 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/cmdline/cmdline.c                | 2 --
 lib/cmdline/cmdline_parse.c          | 3 ---
 lib/cmdline/cmdline_parse_num.c      | 4 ----
 lib/cmdline/cmdline_parse_portlist.c | 3 ---
 lib/cmdline/cmdline_parse_string.c   | 4 ----
 lib/cmdline/cmdline_rdline.c         | 2 --
 lib/cmdline/cmdline_vt100.c          | 3 ---
 7 files changed, 21 deletions(-)

diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c
index 8f1854cb0b..e1009ba4c4 100644
--- a/lib/cmdline/cmdline.c
+++ b/lib/cmdline/cmdline.c
@@ -9,8 +9,6 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdarg.h>
-#include <inttypes.h>
-#include <fcntl.h>
 #include <errno.h>
 
 #include <rte_string_fns.h>
diff --git a/lib/cmdline/cmdline_parse.c b/lib/cmdline/cmdline_parse.c
index f5cc934782..349ec87bd7 100644
--- a/lib/cmdline/cmdline_parse.c
+++ b/lib/cmdline/cmdline_parse.c
@@ -5,11 +5,8 @@
  */
 
 #include <stdio.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <string.h>
-#include <inttypes.h>
-#include <ctype.h>
 
 #include <rte_string_fns.h>
 
diff --git a/lib/cmdline/cmdline_parse_num.c b/lib/cmdline/cmdline_parse_num.c
index b37dd94ae9..a4e68f262c 100644
--- a/lib/cmdline/cmdline_parse_num.c
+++ b/lib/cmdline/cmdline_parse_num.c
@@ -6,11 +6,7 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <inttypes.h>
-#include <ctype.h>
 #include <string.h>
-#include <stdarg.h>
-#include <errno.h>
 #include <rte_string_fns.h>
 
 #include "cmdline_parse.h"
diff --git a/lib/cmdline/cmdline_parse_portlist.c b/lib/cmdline/cmdline_parse_portlist.c
index e1aa07be4b..2e2294553a 100644
--- a/lib/cmdline/cmdline_parse_portlist.c
+++ b/lib/cmdline/cmdline_parse_portlist.c
@@ -6,11 +6,8 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <inttypes.h>
-#include <ctype.h>
 #include <string.h>
 #include <errno.h>
-#include <stdarg.h>
 
 #include <rte_string_fns.h>
 #include "cmdline_parse.h"
diff --git a/lib/cmdline/cmdline_parse_string.c b/lib/cmdline/cmdline_parse_string.c
index 9cf41d0f76..d756638905 100644
--- a/lib/cmdline/cmdline_parse_string.c
+++ b/lib/cmdline/cmdline_parse_string.c
@@ -5,11 +5,7 @@
  */
 
 #include <stdio.h>
-#include <inttypes.h>
-#include <ctype.h>
 #include <string.h>
-#include <stdarg.h>
-#include <errno.h>
 #include <rte_string_fns.h>
 
 #include "cmdline_parse.h"
diff --git a/lib/cmdline/cmdline_rdline.c b/lib/cmdline/cmdline_rdline.c
index d92b1cda53..5cf723a012 100644
--- a/lib/cmdline/cmdline_rdline.c
+++ b/lib/cmdline/cmdline_rdline.c
@@ -6,9 +6,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdint.h>
 #include <string.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <ctype.h>
 
diff --git a/lib/cmdline/cmdline_vt100.c b/lib/cmdline/cmdline_vt100.c
index bb968dd5fa..4c9a46c953 100644
--- a/lib/cmdline/cmdline_vt100.c
+++ b/lib/cmdline/cmdline_vt100.c
@@ -4,12 +4,9 @@
  * All rights reserved.
  */
 
-#include <stdlib.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <stdarg.h>
-#include <ctype.h>
 
 #include "cmdline_vt100.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 47/50] bpf: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (45 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 46/50] cmdline: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 48/50] bbdev: " Sean Morrissey
                           ` (3 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/bpf/bpf.c          |  4 ----
 lib/bpf/bpf_exec.c     |  6 ------
 lib/bpf/bpf_jit_x86.c  |  5 -----
 lib/bpf/bpf_load.c     |  8 --------
 lib/bpf/bpf_pkt.c      | 12 ------------
 lib/bpf/bpf_validate.c |  3 ---
 6 files changed, 38 deletions(-)

diff --git a/lib/bpf/bpf.c b/lib/bpf/bpf.c
index 0caad2a8f0..1e1dd42a58 100644
--- a/lib/bpf/bpf.c
+++ b/lib/bpf/bpf.c
@@ -2,15 +2,11 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <stdio.h>
-#include <string.h>
 #include <errno.h>
 #include <stdint.h>
-#include <inttypes.h>
 
 #include <rte_common.h>
-#include <rte_eal.h>
 
 #include "bpf_impl.h"
 
diff --git a/lib/bpf/bpf_exec.c b/lib/bpf/bpf_exec.c
index b921112feb..09f4a9a571 100644
--- a/lib/bpf/bpf_exec.c
+++ b/lib/bpf/bpf_exec.c
@@ -2,18 +2,12 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <stdio.h>
-#include <string.h>
-#include <errno.h>
 #include <stdint.h>
-#include <inttypes.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_debug.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
 #include <rte_byteorder.h>
 
 #include "bpf_impl.h"
diff --git a/lib/bpf/bpf_jit_x86.c b/lib/bpf/bpf_jit_x86.c
index 518513376a..c1a30e0386 100644
--- a/lib/bpf/bpf_jit_x86.c
+++ b/lib/bpf/bpf_jit_x86.c
@@ -2,17 +2,12 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <errno.h>
 #include <stdint.h>
-#include <inttypes.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_debug.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_byteorder.h>
 
 #include "bpf_impl.h"
 
diff --git a/lib/bpf/bpf_load.c b/lib/bpf/bpf_load.c
index 272f2ba11b..0c4ac7be6c 100644
--- a/lib/bpf/bpf_load.c
+++ b/lib/bpf/bpf_load.c
@@ -2,20 +2,12 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <inttypes.h>
 
-#include <rte_common.h>
 #include <rte_log.h>
-#include <rte_debug.h>
-#include <rte_memory.h>
-#include <rte_eal.h>
-#include <rte_byteorder.h>
 #include <rte_errno.h>
 
 #include "bpf_impl.h"
diff --git a/lib/bpf/bpf_pkt.c b/lib/bpf/bpf_pkt.c
index af422afc07..ffd2db7840 100644
--- a/lib/bpf/bpf_pkt.c
+++ b/lib/bpf/bpf_pkt.c
@@ -2,28 +2,16 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <inttypes.h>
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
 #include <sys/queue.h>
 
 #include <rte_common.h>
-#include <rte_byteorder.h>
 #include <rte_malloc.h>
 #include <rte_log.h>
-#include <rte_debug.h>
-#include <rte_cycles.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
 #include <rte_atomic.h>
 #include <rte_mbuf.h>
 #include <rte_ethdev.h>
diff --git a/lib/bpf/bpf_validate.c b/lib/bpf/bpf_validate.c
index 09331258eb..9ff86fc970 100644
--- a/lib/bpf/bpf_validate.c
+++ b/lib/bpf/bpf_validate.c
@@ -2,7 +2,6 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
-#include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
@@ -10,8 +9,6 @@
 #include <inttypes.h>
 
 #include <rte_common.h>
-#include <rte_eal.h>
-#include <rte_byteorder.h>
 
 #include "bpf_impl.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 48/50] bbdev: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (46 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 47/50] bpf: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 49/50] cryptodev: " Sean Morrissey
                           ` (2 subsequent siblings)
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Nicolas Chautru; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/bbdev/rte_bbdev.c | 4 ----
 lib/bbdev/rte_bbdev.h | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c
index 7f353d4f7e..aaee7b7872 100644
--- a/lib/bbdev/rte_bbdev.c
+++ b/lib/bbdev/rte_bbdev.c
@@ -6,19 +6,15 @@
 #include <string.h>
 #include <stdbool.h>
 
-#include <rte_compat.h>
 #include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_log.h>
-#include <rte_debug.h>
 #include <rte_eal.h>
 #include <rte_malloc.h>
 #include <rte_mempool.h>
 #include <rte_memzone.h>
 #include <rte_lcore.h>
-#include <rte_dev.h>
 #include <rte_spinlock.h>
-#include <rte_tailq.h>
 #include <rte_interrupts.h>
 
 #include "rte_bbdev_op.h"
diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h
index 1dbcf73b0e..b88c88167e 100644
--- a/lib/bbdev/rte_bbdev.h
+++ b/lib/bbdev/rte_bbdev.h
@@ -26,12 +26,8 @@ extern "C" {
 
 #include <stdint.h>
 #include <stdbool.h>
-#include <string.h>
 
-#include <rte_compat.h>
-#include <rte_bus.h>
 #include <rte_cpuflags.h>
-#include <rte_memory.h>
 
 #include "rte_bbdev_op.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 49/50] cryptodev: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (47 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 48/50] bbdev: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-17 20:19         ` [PATCH v5 50/50] acl: " Sean Morrissey
  2022-01-20  8:29         ` [PATCH v5 00/50] introduce IWYU David Marchand
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Akhil Goyal, Declan Doherty; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/cryptodev/cryptodev_pmd.h |  4 ----
 lib/cryptodev/rte_cryptodev.c | 11 -----------
 lib/cryptodev/rte_cryptodev.h |  2 --
 3 files changed, 17 deletions(-)

diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index b9146f652c..8cf2da9b69 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -15,11 +15,7 @@
 
 #include <string.h>
 
-#include <rte_config.h>
-#include <rte_dev.h>
 #include <rte_malloc.h>
-#include <rte_mbuf.h>
-#include <rte_mempool.h>
 #include <rte_log.h>
 #include <rte_common.h>
 
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index a40536c5ea..8c1cccef0b 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2,36 +2,25 @@
  * Copyright(c) 2015-2020 Intel Corporation
  */
 
-#include <sys/types.h>
 #include <sys/queue.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdarg.h>
 #include <errno.h>
 #include <stdint.h>
 #include <inttypes.h>
 
-#include <rte_byteorder.h>
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_dev.h>
-#include <rte_interrupts.h>
 #include <rte_memory.h>
 #include <rte_memcpy.h>
 #include <rte_memzone.h>
-#include <rte_launch.h>
-#include <rte_tailq.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-#include <rte_atomic.h>
-#include <rte_branch_prediction.h>
 #include <rte_common.h>
 #include <rte_mempool.h>
 #include <rte_malloc.h>
-#include <rte_mbuf.h>
 #include <rte_errno.h>
 #include <rte_spinlock.h>
 #include <rte_string_fns.h>
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 59ea5a54df..3493384fc7 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -20,9 +20,7 @@ extern "C" {
 
 #include "rte_kvargs.h"
 #include "rte_crypto.h"
-#include "rte_dev.h"
 #include <rte_common.h>
-#include <rte_config.h>
 #include <rte_rcu_qsbr.h>
 
 #include "rte_cryptodev_trace_fp.h"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* [PATCH v5 50/50] acl: remove unneeded header includes
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (48 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 49/50] cryptodev: " Sean Morrissey
@ 2022-01-17 20:19         ` Sean Morrissey
  2022-01-20  8:29         ` [PATCH v5 00/50] introduce IWYU David Marchand
  50 siblings, 0 replies; 147+ messages in thread
From: Sean Morrissey @ 2022-01-17 20:19 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Sean Morrissey

These header includes have been flagged by the iwyu_tool
and removed.

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
---
 lib/acl/rte_acl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/acl/rte_acl.c b/lib/acl/rte_acl.c
index 4e693b2488..a61c3ba188 100644
--- a/lib/acl/rte_acl.c
+++ b/lib/acl/rte_acl.c
@@ -6,7 +6,6 @@
 #include <rte_string_fns.h>
 #include <rte_acl.h>
 #include <rte_tailq.h>
-#include <rte_vect.h>
 
 #include "acl.h"
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 147+ messages in thread

* RE: [PATCH v5 07/50] timer: remove unneeded header includes
  2022-01-17 20:19         ` [PATCH v5 07/50] timer: " Sean Morrissey
@ 2022-01-18 19:43           ` Carrillo, Erik G
  0 siblings, 0 replies; 147+ messages in thread
From: Carrillo, Erik G @ 2022-01-18 19:43 UTC (permalink / raw)
  To: Morrissey, Sean, Robert Sanford; +Cc: dev

> -----Original Message-----
> From: Morrissey, Sean <sean.morrissey@intel.com>
> Sent: Monday, January 17, 2022 2:19 PM
> To: Robert Sanford <rsanford@akamai.com>; Carrillo, Erik G
> <erik.g.carrillo@intel.com>
> Cc: dev@dpdk.org; Morrissey, Sean <sean.morrissey@intel.com>
> Subject: [PATCH v5 07/50] timer: remove unneeded header includes
> 
> These header includes have been flagged by the iwyu_tool and removed.
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

Thanks, Sean.

Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>

^ permalink raw reply	[flat|nested] 147+ messages in thread

* RE: [PATCH v5 41/50] eventdev: remove unneeded header includes
  2022-01-17 20:19         ` [PATCH v5 41/50] eventdev: " Sean Morrissey
@ 2022-01-18 19:47           ` Carrillo, Erik G
  0 siblings, 0 replies; 147+ messages in thread
From: Carrillo, Erik G @ 2022-01-18 19:47 UTC (permalink / raw)
  To: Morrissey, Sean, Jerin Jacob; +Cc: dev

> -----Original Message-----
> From: Morrissey, Sean <sean.morrissey@intel.com>
> Sent: Monday, January 17, 2022 2:20 PM
> To: Jerin Jacob <jerinj@marvell.com>; Carrillo, Erik G
> <erik.g.carrillo@intel.com>
> Cc: dev@dpdk.org; Morrissey, Sean <sean.morrissey@intel.com>
> Subject: [PATCH v5 41/50] eventdev: remove unneeded header includes
> 
> These header includes have been flagged by the iwyu_tool and removed.
> 
> Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>

Thanks, Sean.  The timer adapter changes LGTM.

Regards,
Erik

^ permalink raw reply	[flat|nested] 147+ messages in thread

* Re: [PATCH v5 00/50] introduce IWYU
  2022-01-17 20:18       ` [PATCH v5 00/50] introduce IWYU Sean Morrissey
                           ` (49 preceding siblings ...)
  2022-01-17 20:19         ` [PATCH v5 50/50] acl: " Sean Morrissey
@ 2022-01-20  8:29         ` David Marchand
  50 siblings, 0 replies; 147+ messages in thread
From: David Marchand @ 2022-01-20  8:29 UTC (permalink / raw)
  To: Sean Morrissey; +Cc: dev

Hello Sean,

On Mon, Jan 17, 2022 at 9:20 PM Sean Morrissey <sean.morrissey@intel.com> wrote:
>
> This patchset introduces the include-what-you-use script which removes
> unused header includes. IWYU GitHub:
>
> https://github.com/include-what-you-use/include-what-you-use
>
> Along with the script there are some patches which make a start on
> removing unneeded headers.

There are build errors reported by CI.

I see one issue with Windows build seen by UNH:
https://lab.dpdk.org/results/dashboard/patchsets/20695/

And two (but it could be a single issue) errors reported by Intel CI,
on RHEL 8 (+debug) and FreeBSD 13 (+debug):
http://mails.dpdk.org/archives/test-report/2022-January/252334.html


-- 
David Marchand


^ permalink raw