ensure headers have correct includes
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest19 patches 25 repliesIn review
- v120 patches 7 repliesSuperseded
Changes in v2 from the cover letter
* Add maintainers file entry for new app
* Drop patch for c11 ring header
* Use build variable "headers_no_chkincs" for tracking exceptions
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/19 | eal: fix missing header inclusionlib/ lib/ | +2 | 0 replies | |
| 2/19 | telemetry: fix missing header includelib/ | +1 | 0 replies | |
| 3/19 | ethdev: fix missing header includelib/ | +1 | 1 reply | |
| 4/19 | net: fix missing header includelib/ | +1 | 1 reply | |
| 5/19 | mbuf: fix missing header includelib/ lib/ | +4 | 1 reply | |
| 6/19 | bitratestats: fix missing header includelib/ | +1 | 0 replies | |
| 7/19 | rib: fix missing header includeslib/ | +2 | 1 reply | |
| 8/19 | vhost: fix missing header includeslib/ lib/ lib/ | +10 | 1 reply | |
| 9/19 | ipsec: fix missing header includelib/ | +1 | 4 replies | |
| 10/19 | fib: fix missing header includeslib/ lib/ | +2 | 1 reply | |
| 11/19 | table: fix missing header includelib/ | +1 | 0 replies | |
| 12/19 | pipeline: fix missing header includeslib/ lib/ | +2 | 0 replies | |
| 13/19 | metrics: fix variable declaration in headerlib/ lib/ | +2 | 0 replies | |
| 14/19 | node: fix missing header includelib/ | +1 | 0 replies | |
| 15/19 | app: fix extra include paths for app buildsapp/ | +1 | 0 replies | |
| 16/19 | app/chkincs: add chkincs app to verify headersMAINTAINERS app/ app/ +15 more | +85 | 7 replies | |
| 17/19 | eal: add missing include to mcslocklib/ | +1 | 1 reply | |
| 18/19 | eal/x86: add architecture-specific headers to chkincslib/ | +9 | 0 replies | |
| 19/19 | test-meson-builds: add includes check to default x86 builddevtools/ | +1 | 0 replies |
Reviews trailers per patch
8 of 19 patches have a Reviewed-by or Acked-by.
| Patch | Konstantin Ananyev | Vladimir Medvedkin | Honnappa Nagarahalli | Andrew Rybchenko | Ophir Munk | Maxime Coquelin |
|---|---|---|---|---|---|---|
| 1/19 | ||||||
| 2/19 | ||||||
| 3/19 | A-b | |||||
| 4/19 | A-b | |||||
| 5/19 | A-b | |||||
| 6/19 | ||||||
| 7/19 | A-b | |||||
| 8/19 | R-b | |||||
| 9/19 | A-b | A-b | ||||
| 10/19 | A-b | |||||
| 11/19 | ||||||
| 12/19 | ||||||
| 13/19 | ||||||
| 14/19 | ||||||
| 15/19 | ||||||
| 16/19 | ||||||
| 17/19 | R-b | |||||
| 18/19 | ||||||
| 19/19 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.
Cover letter [dpdk-dev] [PATCH v2 00/19] ensure headers have correct includes
As a general principle, each header file should include any other headers it needs to provide data type definitions or macros. For example, any header using the uintX_t types in structures or function prototypes should include "stdint.h" to provide those type definitions.
In practice, while many, but not all, headers in DPDK did include all necessary headers, it was never actually checked that each header could be included in a C file and compiled without having any compiler errors about missing definitions. This patchset fixes any missing includes in public headers from the DPDK "lib" folder and then adds a "chkincs" app. to verify this on an ongoing basis.
This chkincs app does nothing when run, it's for build-time checking only. Its source code consists of one C file per public DPDK header, where that C file contains nothing except an include for that header. Therefore, if any header is added to the lib folder which fails to compile when included alone, the build of chkincs will fail with a suitable error message. Since this compile checking is not needed on most builds of DPDK, the building of chkincs is disabled by default, but can be enabled by the "test_includes" meson option. To catch errors with patch submissions, the final patch of this series enables it for a single build in test-meson-builds script.
Future work could involve doing similar checks on headers for C++ compatibility, for example.
V2:
* Add maintainers file entry for new app
* Drop patch for c11 ring header
* Use build variable "headers_no_chkincs" for tracking exceptions
Bruce Richardson (19):
eal: fix missing header inclusion
telemetry: fix missing header include
ethdev: fix missing header include
net: fix missing header include
mbuf: fix missing header include
bitratestats: fix missing header include
rib: fix missing header includes
vhost: fix missing header includes
ipsec: fix missing header include
fib: fix missing header includes
table: fix missing header include
pipeline: fix missing header includes
metrics: fix variable declaration in header
node: fix missing header include
app: fix extra include paths for app builds app/chkincs: add chkincs app to verify headers
eal: add missing include to mcslock
eal/x86: add architecture-specific headers to chkincs
test-meson-builds: add includes check to default x86 build
MAINTAINERS | 4 +++ app/chkincs/gen_c_file_for_header.py | 12 +++++++++ app/chkincs/main.c | 4 +++ app/chkincs/meson.build | 28 ++++++++++++++++++++ app/meson.build | 2 ++ devtools/test-meson-builds.sh | 2 +- doc/guides/contributing/coding_style.rst | 12 +++++++++ lib/librte_bitratestats/rte_bitrate.h | 1 + lib/librte_eal/include/generic/rte_mcslock.h | 1 + lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/include/rte_reciprocal.h | 1 + lib/librte_eal/include/rte_thread.h | 1 + lib/librte_eal/x86/include/meson.build | 14 ++++++---- lib/librte_ethdev/meson.build | 4 +-- lib/librte_ethdev/rte_eth_ctrl.h | 1 + lib/librte_fib/rte_fib.h | 1 + lib/librte_fib/rte_fib6.h | 1 + lib/librte_hash/meson.build | 4 +-- lib/librte_ipsec/meson.build | 3 ++- lib/librte_ipsec/rte_ipsec_sad.h | 1 + lib/librte_lpm/meson.build | 2 +- lib/librte_mbuf/rte_mbuf_core.h | 1 + lib/librte_mbuf/rte_mbuf_dyn.h | 3 +++ lib/librte_metrics/rte_metrics_telemetry.c | 2 ++ lib/librte_metrics/rte_metrics_telemetry.h | 2 -- lib/librte_net/rte_geneve.h | 1 + lib/librte_node/rte_node_ip4_api.h | 1 + lib/librte_pipeline/rte_swx_ctl.h | 1 + lib/librte_pipeline/rte_swx_pipeline.h | 1 + lib/librte_regexdev/meson.build | 2 +- lib/librte_rib/rte_rib.h | 2 ++ lib/librte_ring/meson.build | 4 ++- lib/librte_stack/meson.build | 4 ++- lib/librte_table/meson.build | 7 +++-- lib/librte_table/rte_lru_x86.h | 1 + lib/librte_telemetry/rte_telemetry.h | 1 + lib/librte_vhost/rte_vdpa.h | 2 ++ lib/librte_vhost/rte_vdpa_dev.h | 1 + lib/librte_vhost/rte_vhost_crypto.h | 7 +++++ lib/meson.build | 3 +++ meson.build | 1 + meson_options.txt | 2 ++ 42 files changed, 128 insertions(+), 22 deletions(-) create mode 100755 app/chkincs/gen_c_file_for_header.py create mode 100644 app/chkincs/main.c create mode 100644 app/chkincs/meson.build
--
2.27.0