ensure headers have correct includes
Subsystems (6)
cover 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.
Bruce Richardson (20):
eal: fix missing header inclusion
telemetry: fix missing header include
ethdev: fix missing header include
ring: fix missing includes for c11 model header
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
app/chkincs/gen_c_file_for_header.py | 53 ++++++++++++++++++++ app/chkincs/main.c | 4 ++ app/chkincs/meson.build | 28 +++++++++++ app/meson.build | 2 + devtools/test-meson-builds.sh | 2 +- lib/librte_bitratestats/rte_bitrate.h | 1 + lib/librte_eal/include/generic/rte_mcslock.h | 1 + lib/librte_eal/include/rte_reciprocal.h | 1 + lib/librte_eal/x86/include/meson.build | 1 + lib/librte_ethdev/rte_eth_ctrl.h | 1 + lib/librte_fib/rte_fib.h | 1 + lib/librte_fib/rte_fib6.h | 1 + lib/librte_ipsec/rte_ipsec_sad.h | 1 + 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_rib/rte_rib.h | 2 + lib/librte_ring/rte_ring_c11_mem.h | 4 ++ 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 | 1 + meson.build | 1 + meson_options.txt | 2 + 31 files changed, 128 insertions(+), 3 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
PATCH 1/20 eal: fix missing header inclusion
The rte_reciprocal header file used standard __rte_always_inline from rte_common.h but does not include that header file, leading to compiler errors when the reciprocal header is included alone.
--- lib/librte_eal/include/rte_reciprocal.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_eal/include/rte_reciprocal.h +1 -0
@@ -26,6 +26,7 @@#define _RTE_RECIPROCAL_H_#include <stdint.h> +#include <rte_common.h> struct rte_reciprocal {uint32_t m;
Signature · 1 line
2.27.0
PATCH 2/20 telemetry: fix missing header include
In reply to Bruce RichardsonThe telemetry header file uses the rte_cpuset_t type, but does not include any header providing that type. Include rte_os.h to provide the necessary type.
--- lib/librte_telemetry/rte_telemetry.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_telemetry/rte_telemetry.h +1 -0
@@ -5,6 +5,7 @@#include <stdint.h> #include <sched.h> #include <rte_compat.h> +#include <rte_os.h> #ifndef _RTE_TELEMETRY_H_#define _RTE_TELEMETRY_H_
Signature · 1 line
2.27.0
PATCH 3/20 ethdev: fix missing header include
In reply to Bruce RichardsonThe define for RTE_ETH_FLOW_MAX is defined in rte_ethdev.h, so that header should be included in rte_eth_ctrl.h to allow it to be compiled independently.
--- lib/librte_ethdev/rte_eth_ctrl.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_ethdev/rte_eth_ctrl.h +1 -0
@@ -9,6 +9,7 @@#include <rte_common.h> #include <rte_ether.h> #include "rte_flow.h" +#include "rte_ethdev.h" /** * @deprecated Please use rte_flow API instead of this legacy one.
Signature · 1 line
2.27.0
PATCH 4/20 ring: fix missing includes for c11 model header
In reply to Bruce RichardsonAdd in the missing includes into the header file for c11 memory model, so it can be compiled up independently of the other headers.
--- lib/librte_ring/rte_ring_c11_mem.h | 4 ++++ 1 file changed, 4 insertions(+)
lib/librte_ring/rte_ring_c11_mem.h +4 -0
@@ -10,6 +10,10 @@#ifndef _RTE_RING_C11_MEM_H_#define _RTE_RING_C11_MEM_H_ +#include <stdint.h> +#include <rte_common.h> +#include <rte_ring_core.h> + static __rte_always_inline voidupdate_tail (struct rte_ring_headtail *ht,uint32_t old_val,uint32_t new_val,uint32_t single,uint32_t enqueue)
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH 04/20] ring: fix missing includes for c11 model header
Quoted 17 lines · Bruce Richardson
Add in the missing includes into the header file for c11 memory model, so it can be compiled up independently of the other headers.
Fixes 39368ebfc606 ("ring: introduce C11 memory model barrier option")Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_ring/rte_ring_c11_mem.h | 4 ++++ 1 file changed, 4 insertions(+)lib/librte_ring/rte_ring_c11_mem.h +0
-0
lib/librte_ring/rte_ring_c11_mem.h line 16
Quoted 7 lines
lib/librte_ring/rte_ring_c11_mem.h +4
-0@@ -10,6 +10,10 @@#ifndef _RTE_RING_C11_MEM_H_#define _RTE_RING_C11_MEM_H_ +#include <stdint.h> +#include <rte_common.h> +#include <rte_ring_core.h> +
This header is never directly included, like rte_ring_generic.h. I'd rather flag it as not being checked.
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 04/20] ring: fix missing includes for c11 model header
Quoted 23 lines
Quoted 20 lines · Bruce Richardson
Add in the missing includes into the header file for c11 memory model, so it can be compiled up independently of the other headers.
Fixes 39368ebfc606 ("ring: introduce C11 memory model barrier option")Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_ring/rte_ring_c11_mem.h | 4 ++++ 1 file changed, 4 insertions(+)lib/librte_ring/rte_ring_c11_mem.h +0
-0@@ -10,6 +10,10 @@#ifndef _RTE_RING_C11_MEM_H_#define _RTE_RING_C11_MEM_H_
Quoted 7 lines
lib/librte_ring/rte_ring_c11_mem.h line 16
Quoted 4 lines
lib/librte_ring/rte_ring_c11_mem.h +4
-0+#include <stdint.h> +#include <rte_common.h> +#include <rte_ring_core.h> +This header is never directly included, like
rte_ring_generic.h. I'd rather flag it as not being checked.
Yep, it is sort of 'internal' header that we need to keep public, because of inlined ring enqueue/dequeue functions.
Quoted 4 lines
--
David Marchand
PATCH 5/20 net: fix missing header include
In reply to Bruce RichardsonThe Geneve protocol header file is missing the rte_byteorder.h header.
--- lib/librte_net/rte_geneve.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_net/rte_geneve.h +1 -0
@@ -11,6 +11,7 @@* GENEVE-related definitions */ #include <stdint.h> +#include <rte_byteorder.h> #ifdef __cplusplusextern "C" {
Signature · 1 line
2.27.0
PATCH 6/20 mbuf: fix missing header include
In reply to Bruce RichardsonThe rte_mbuf_dyn.h header file uses a number of types and macros without including the required header files to get the definitions of those macros/types. Similarly, the rte_mbuf_core.h file was missing an include for rte_byteorder.h header.
--- lib/librte_mbuf/rte_mbuf_core.h | 1 + lib/librte_mbuf/rte_mbuf_dyn.h | 3 +++ 2 files changed, 4 insertions(+)
lib/librte_mbuf/rte_mbuf_core.h +1 -0
@@ -18,6 +18,7 @@#include <stdint.h> #include <rte_compat.h> +#include <rte_byteorder.h> #include <generic/rte_atomic.h> #ifdef __cplusplus
lib/librte_mbuf/rte_mbuf_dyn.h +3 -0
@@ -66,7 +66,10 @@* - any name that does not start with "rte_" in an application */ +#include <stdio.h> +#include <stdint.h> #include <sys/types.h> +#include <rte_compat.h> /** * Maximum length of the dynamic field or flag string. */
Signature · 1 line
2.27.0
PATCH 7/20 bitratestats: fix missing header include
In reply to Bruce RichardsonThe rte_compat.h header file must be included to get the definition of __rte_experimental.
--- lib/librte_bitratestats/rte_bitrate.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_bitratestats/rte_bitrate.h +1 -0
@@ -6,6 +6,7 @@#define _RTE_BITRATE_H_#include <stdint.h> +#include <rte_compat.h> #ifdef __cplusplusextern "C" {
Signature · 1 line
2.27.0
PATCH 8/20 rib: fix missing header includes
In reply to Bruce RichardsonThe standard integer types, and the size_t types are missing their required header includes in the rib header file.
--- lib/librte_rib/rte_rib.h | 2 ++ 1 file changed, 2 insertions(+)
lib/librte_rib/rte_rib.h +2 -0
@@ -18,6 +18,8 @@* Level compressed tree implementation for IPv4 Longest Prefix Match */ +#include <stdlib.h> +#include <stdint.h> #include <rte_compat.h> #ifdef __cplusplus
Signature · 1 line
2.27.0
PATCH 9/20 vhost: fix missing header includes
In reply to Bruce RichardsonThe vhost header files were missing definitions from headers to allow them to be compiled up individually.
--- lib/librte_vhost/rte_vdpa.h | 2 ++ lib/librte_vhost/rte_vdpa_dev.h | 1 + lib/librte_vhost/rte_vhost_crypto.h | 7 +++++++ 3 files changed, 10 insertions(+)
lib/librte_vhost/rte_vdpa.h +2 -0
@@ -11,6 +11,8 @@* Device specific vhost lib */ +#include <stdint.h> +/** Maximum name length for statistics counters */ #define RTE_VDPA_STATS_NAME_SIZE 64
lib/librte_vhost/rte_vdpa_dev.h +1 -0
@@ -8,6 +8,7 @@#include <stdbool.h> #include "rte_vhost.h" +#include "rte_vdpa.h" #define RTE_VHOST_QUEUE_ALL UINT16_MAX
lib/librte_vhost/rte_vhost_crypto.h +7 -0
@@ -5,6 +5,13 @@#ifndef _VHOST_CRYPTO_H_#define _VHOST_CRYPTO_H_ +#include <stdint.h> +#include <rte_compat.h> + +/* pre-declare structs to avoid including full headers */ +struct rte_mempool ; +struct rte_crypto_op ; +#define VHOST_CRYPTO_MBUF_POOL_SIZE (8192)#define VHOST_CRYPTO_MAX_BURST_SIZE (64)#define VHOST_CRYPTO_MAX_DATA_SIZE (4096)
Signature · 1 line
2.27.0
PATCH 10/20 ipsec: fix missing header include
In reply to Bruce RichardsonThe rte_ipsec_sad.h header used the standard uintXX_t types, but did not include stdint.h header for them.
--- lib/librte_ipsec/rte_ipsec_sad.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_ipsec/rte_ipsec_sad.h +1 -0
@@ -7,6 +7,7 @@#define _RTE_IPSEC_SAD_H_#include <rte_compat.h> +#include <stdint.h> /** * @file rte_ipsec_sad.h
Signature · 1 line
2.27.0
PATCH 11/20 fib: fix missing header includes
In reply to Bruce RichardsonAdd stdint.h to get definitions of standard integer types
--- lib/librte_fib/rte_fib.h | 1 + lib/librte_fib/rte_fib6.h | 1 + 2 files changed, 2 insertions(+)
lib/librte_fib/rte_fib.h +1 -0
@@ -19,6 +19,7 @@* for IPv4 Longest Prefix Match */ +#include <stdint.h> #include <rte_compat.h> #ifdef __cplusplus
lib/librte_fib/rte_fib6.h +1 -0
@@ -19,6 +19,7 @@* for IPv6 Longest Prefix Match */ +#include <stdint.h> #include <rte_compat.h> #ifdef __cplusplus
Signature · 1 line
2.27.0
PATCH 12/20 table: fix missing header include
In reply to Bruce RichardsonThe rte_lru_x86.h header, included from the main rte_lru.h header, uses the RTE_CC_IS_GNU macro from rte_common.h but fails to include that header file.
--- lib/librte_table/rte_lru_x86.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_table/rte_lru_x86.h +1 -0
@@ -12,6 +12,7 @@ extern "C" {#include <stdint.h> #include <rte_config.h> +#include <rte_common.h> #ifndef RTE_TABLE_HASH_LRU_STRATEGY #define RTE_TABLE_HASH_LRU_STRATEGY 2
Signature · 1 line
2.27.0
PATCH 13/20 pipeline: fix missing header includes
In reply to Bruce RichardsonThe stdio.h header needs to be included to get the definition of the FILE type.
--- lib/librte_pipeline/rte_swx_ctl.h | 1 + lib/librte_pipeline/rte_swx_pipeline.h | 1 + 2 files changed, 2 insertions(+)
lib/librte_pipeline/rte_swx_ctl.h +1 -0
@@ -15,6 +15,7 @@ extern "C" {#include <stddef.h> #include <stdint.h> +#include <stdio.h> #include <rte_compat.h>
lib/librte_pipeline/rte_swx_pipeline.h +1 -0
@@ -15,6 +15,7 @@ extern "C" {#include <stddef.h> #include <stdint.h> +#include <stdio.h> #include <rte_compat.h>
Signature · 1 line
2.27.0
PATCH 14/20 metrics: fix variable declaration in header
In reply to Bruce RichardsonThe global variable "tel_met_data" was declared in a header file, rather than in a C file, leading to duplicate definitions if more than one C file included the header.
--- lib/librte_metrics/rte_metrics_telemetry.c | 2 ++ lib/librte_metrics/rte_metrics_telemetry.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
lib/librte_metrics/rte_metrics_telemetry.c +2 -0
@@ -13,6 +13,8 @@#include "rte_metrics.h" #include "rte_metrics_telemetry.h" +struct telemetry_metrics_data tel_met_data; +int metrics_log_level;/* Logging Macros */
lib/librte_metrics/rte_metrics_telemetry.h +0 -2
@@ -34,8 +34,6 @@ struct telemetry_metrics_data {int metrics_register_done; }; -struct telemetry_metrics_data tel_met_data; -__rte_experimental int32_t rte_metrics_tel_reg_all_ethdev(int *metrics_register_done,int *reg_index_list);
Signature · 1 line
2.27.0
PATCH 15/20 node: fix missing header include
In reply to Bruce RichardsonThe rte_compat header file is needed for the '__rte_experimental' macro.
--- lib/librte_node/rte_node_ip4_api.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_node/rte_node_ip4_api.h +1 -0
@@ -21,6 +21,7 @@ extern "C" {#endif #include <rte_common.h> +#include <rte_compat.h> /** * IP4 lookup next nodes.
Signature · 1 line
2.27.0
PATCH 16/20 app: fix extra include paths for app builds
In reply to Bruce RichardsonThe "includes" variable in the app/meson.build file was ignored when building the executable, meaning that apps couldn't pass additional include paths directly back. Fix this to align with drivers and libs.
--- app/meson.build | 1 + 1 file changed, 1 insertion(+)
app/meson.build +1 -0
@@ -60,6 +60,7 @@ foreach app:apps c_args: cflags, link_whole: link_libs, dependencies: dep_objs, + include_directories: includes, install_rpath: join_paths(get_option('prefix'), driver_install_path), install: true)
Signature · 1 line
2.27.0
PATCH 17/20 app/chkincs: add chkincs app to verify headers
In reply to Bruce RichardsonTo verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
--- app/chkincs/gen_c_file_for_header.py | 49 ++++++++++++++++++++++++++++ app/chkincs/main.c | 4 +++ app/chkincs/meson.build | 28 ++++++++++++++++ app/meson.build | 1 + lib/meson.build | 1 + meson.build | 1 + meson_options.txt | 2 ++ 7 files changed, 86 insertions(+) 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
app/chkincs/gen_c_file_for_header.py new file +49 -0
@@ -0,0 +1,49 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation + +from sys import argv +from os.path import abspath + +empty_contents = 'static const char *empty __attribute__((unused)) = "empty";' +# files which are not used directly, but included via others +exceptions = [ + 'rte_cmp_arm64.h', + 'rte_cmp_x86.h', + 'rte_crc_arm64.h', + 'rte_eal_interrupts.h', + 'rte_eth_ctrl.h', + 'rte_ethdev_core.h', + 'rte_ipsec_group.h', + 'rte_lpm_altivec.h', + 'rte_lpm_neon.h', + 'rte_lpm_sse.h', + 'rte_lpm_x86.h', + 'rte_lru_arm64.h', + 'rte_lru_x86.h', + 'rte_regexdev_core.h', + 'rte_ring_core.h', + 'rte_ring_generic.h', + 'rte_ring_hts_c11_mem.h', + 'rte_ring_hts.h', + 'rte_ring_peek_c11_mem.h', + 'rte_ring_peek.h', + 'rte_ring_peek_zc.h', + 'rte_ring_rts_c11_mem.h', + 'rte_ring_rts.h', + 'rte_stack_lf_c11.h', + 'rte_stack_lf_generic.h', + 'rte_stack_lf.h', + 'rte_stack_std.h', + 'rte_table_hash_func_arm64.h', + ] + +(h_file, c_file) = argv[1:] + +contents = '#include "' + abspath(h_file) + '"' +for ex in exceptions: + if h_file.endswith(ex): + contents = empty_contents + +with open(c_file, 'w') as cf: + cf.write(contents)
app/chkincs/main.c new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2020 Intel Corporation +*/ +int main (void ) {return 0 ; }
app/chkincs/meson.build new file +28 -0
@@ -0,0 +1,28 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation + +if not get_option('test_includes') + build = false + subdir_done() +endif + +if is_windows + # for windows, the shebang line in the script won't work. + error('option "test_includes" is not supported on windows') +endif + +gen_c_file_for_header = find_program('gen_c_file_for_header.py') +gen_c_files = generator(gen_c_file_for_header, + output: '@[email protected]', + arguments: ['@INPUT@', '@OUTPUT@']) + +cflags += '-Wno-unused-function' # needed if we include generic headers + +# some ethdev headers depend on bus headers +includes += include_directories('../../drivers/bus/pci', + '../../drivers/bus/vdev') + +sources += files('main.c') +sources += gen_c_files.process(dpdk_headers) + +deps = enabled_libs
app/meson.build +1 -0
@@ -6,6 +6,7 @@ if is_windows endif apps = [ + 'chkincs', 'pdump', 'proc-info', 'test-acl',
lib/meson.build +1 -0
@@ -103,6 +103,7 @@ foreach l:libraries dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1) #old macro dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1) # new macro install_headers(headers) + dpdk_headers += headers libname = 'rte_' + name includes += include_directories(dir_name)
meson.build +1 -0
@@ -16,6 +16,7 @@ cc = meson.get_compiler('c') dpdk_conf = configuration_data() dpdk_libraries = [] dpdk_static_libraries = [] +dpdk_headers = [] dpdk_driver_classes = [] dpdk_drivers = [] dpdk_extra_ldflags = []
meson_options.txt +2 -0
@@ -32,5 +32,7 @@ option('enable_trace_fp', type: 'boolean', value: false, description: 'enable fast path trace points.') option('tests', type: 'boolean', value: true, description: 'build unit tests') +option('test_includes', type: 'boolean', value: false, + description: 'build "chkincs" to verify each header file can compile alone') option('use_hpet', type: 'boolean', value: false, description: 'use HPET timer in EAL')
--
2.27.0
Re: [dpdk-dev] [PATCH 17/20] app/chkincs: add chkincs app to verify headers
Quoted 6 lines · Bruce Richardson
To verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
Some drivers expose APIs to applications, their headers would need checks too.
Quoted 21 lines
Signed-off-by Bruce Richardson <[email protected]>--- app/chkincs/gen_c_file_for_header.py | 49 ++++++++++++++++++++++++++++ app/chkincs/main.c | 4 +++ app/chkincs/meson.build | 28 ++++++++++++++++ app/meson.build | 1 + lib/meson.build | 1 + meson.build | 1 + meson_options.txt | 2 ++ 7 files changed, 86 insertions(+) create mode 100755 app/chkincs/gen_c_file_for_header.py create mode 100644 app/chkincs/main.c create mode 100644 app/chkincs/meson.buildapp/chkincs/gen_c_file_for_header.py new file +0
-0
app/chkincs/gen_c_file_for_header.py line 3
Quoted 3 lines
app/chkincs/gen_c_file_for_header.py new file +3
-0@@ -0,0 +1,49 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation
2021*
Quoted 26 lines
app/chkincs/gen_c_file_for_header.py new file +26
-0+ +from sys import argv +from os.path import abspath + +empty_contents = 'static const char *empty __attribute__((unused)) = "empty";' +# files which are not used directly, but included via others +exceptions = [ + 'rte_cmp_arm64.h', + 'rte_cmp_x86.h', + 'rte_crc_arm64.h', + 'rte_eal_interrupts.h', + 'rte_eth_ctrl.h', + 'rte_ethdev_core.h', + 'rte_ipsec_group.h', + 'rte_lpm_altivec.h', + 'rte_lpm_neon.h', + 'rte_lpm_sse.h', + 'rte_lpm_x86.h', + 'rte_lru_arm64.h', + 'rte_lru_x86.h', + 'rte_regexdev_core.h', + 'rte_ring_core.h', + 'rte_ring_generic.h', + 'rte_ring_hts_c11_mem.h', + 'rte_ring_hts.h', + 'rte_ring_peek_c11_mem.h',
app/chkincs/gen_c_file_for_header.py line 39
Quoted 10 lines
app/chkincs/gen_c_file_for_header.py new file +10
-0+ 'rte_ring_peek.h', + 'rte_ring_peek_zc.h', + 'rte_ring_rts_c11_mem.h', + 'rte_ring_rts.h', + 'rte_stack_lf_c11.h', + 'rte_stack_lf_generic.h', + 'rte_stack_lf.h', + 'rte_stack_std.h', + 'rte_table_hash_func_arm64.h', + ]
Can we instead flag those headers from the libraries themselves? In addition of the headers current variable, something like a internal_headers or private_headers variable?
Quoted 10 lines
app/chkincs/gen_c_file_for_header.py new file +10
-0+ +(h_file, c_file) = argv[1:] + +contents = '#include "' + abspath(h_file) + '"' +for ex in exceptions: + if h_file.endswith(ex): + contents = empty_contents + +with open(c_file, 'w') as cf: + cf.write(contents)
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 17/20] app/chkincs: add chkincs app to verify headers
Quoted 11 lines · David Marchand
Quoted 6 lines · Bruce Richardson
To verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
Some drivers expose APIs to applications, their headers would need checks too.
Yes, that is something that should be checked too, but I've left it as "further work" for now, and I'm not planning it in this set, as I view it as less important and this set is big-enough as it is for now. :-)
Quoted 15 lines
Quoted 15 lines
Signed-off-by Bruce Richardson <[email protected]>--- app/chkincs/gen_c_file_for_header.py | 49 ++++++++++++++++++++++++++++ app/chkincs/main.c | 4 +++ app/chkincs/meson.build | 28 ++++++++++++++++ app/meson.build | 1 + lib/meson.build | 1 + meson.build | 1 + meson_options.txt | 2 ++ 7 files changed, 86 insertions(+) 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
Quoted 12 lines
app/chkincs/gen_c_file_for_header.py line 3
Quoted 9 lines
app/chkincs/gen_c_file_for_header.py new file +3
-0@@ -0,0 +1,49 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation2021*
Code actually was written in 2020 hence the date there.
Quoted 33 lines
Quoted 33 lines
app/chkincs/gen_c_file_for_header.py new file +32
-0+ +from sys import argv +from os.path import abspath + +empty_contents = 'static const char *empty __attribute__((unused)) = "empty";' +# files which are not used directly, but included via others +exceptions = [ + 'rte_cmp_arm64.h', + 'rte_cmp_x86.h', + 'rte_crc_arm64.h', + 'rte_eal_interrupts.h', + 'rte_eth_ctrl.h', + 'rte_ethdev_core.h', + 'rte_ipsec_group.h', + 'rte_lpm_altivec.h', + 'rte_lpm_neon.h', + 'rte_lpm_sse.h', + 'rte_lpm_x86.h', + 'rte_lru_arm64.h', + 'rte_lru_x86.h', + 'rte_regexdev_core.h', + 'rte_ring_core.h', + 'rte_ring_generic.h', + 'rte_ring_hts_c11_mem.h', + 'rte_ring_hts.h', + 'rte_ring_peek_c11_mem.h', + 'rte_ring_peek.h', + 'rte_ring_peek_zc.h', + 'rte_ring_rts_c11_mem.h', + 'rte_ring_rts.h', + 'rte_stack_lf_c11.h', + 'rte_stack_lf_generic.h',
Quoted 9 lines
app/chkincs/gen_c_file_for_header.py line 39
Quoted 4 lines
app/chkincs/gen_c_file_for_header.py new file +4
-0+ 'rte_stack_lf.h', + 'rte_stack_std.h', + 'rte_table_hash_func_arm64.h', + ]Can we instead flag those headers from the libraries themselves? In addition of the headers current variable, something like a
internal_headersorprivate_headersvariable?
Yes, we could do that, though we need a suitable name, since they aren't internal only or private. :-) Maybe just have it literally called "skip_chkincs_headers"? Open to more ideas...
Thanks for the review!
/Bruce
Re: [dpdk-dev] [PATCH 17/20] app/chkincs: add chkincs app to verify headers
Quoted 7 lines · Bruce Richardson
Quoted 4 lines
Can we instead flag those headers from the libraries themselves? In addition of the headers current variable, something like a
internal_headersorprivate_headersvariable?Yes, we could do that, though we need a suitable name, since they aren't internal only or private. :-) Maybe just have it literally called
Yes.
Quoted 2 lines
"
skip_chkincs_headers"? Open to more ideas...
People who get reports from this odd tool "chkincs" in the CI on their new shiny header, might find some info more easily if they grep for chkincs.
+1.
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 17/20] app/chkincs: add chkincs app to verify headers
In reply to Bruce RichardsonQuoted 7 lines · Bruce Richardson
To verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
Quoted 5 lines
Signed-off-by Bruce Richardson <[email protected]>--- app/chkincs/gen_c_file_for_header.py | 49 ++++++++++++++++++++++++++++ app/chkincs/main.c | 4 +++ app/chkincs/meson.build | 28 ++++++++++++++++
Those are new files, so the patch is missing a MAINTAINERS update.
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 17/20] app/chkincs: add chkincs app to verify headers
Quoted 9 lines · David Marchand
Quoted 7 lines · Bruce Richardson
To verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Bruce Richardson <[email protected]>--- app/chkincs/gen_c_file_for_header.py | 49 ++++++++++++++++++++++++++++ app/chkincs/main.c | 4 +++ app/chkincs/meson.build | 28 ++++++++++++++++Those are new files, so the patch is missing a
MAINTAINERSupdate.
Yes, forgot that. Will add in V2.
PATCH 18/20 eal: add missing include to mcslock
In reply to Bruce RichardsonInclude 'rte_branch_prediction.h' to get the likely/unlikely macro definitions.
--- lib/librte_eal/include/generic/rte_mcslock.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_eal/include/generic/rte_mcslock.h +1 -0
@@ -22,6 +22,7 @@#include <rte_lcore.h> #include <rte_common.h> #include <rte_pause.h> +#include <rte_branch_prediction.h> /** * The rte_mcslock_t type.
Signature · 1 line
2.27.0
PATCH 19/20 eal/x86: add architecture-specific headers to chkincs
In reply to Bruce RichardsonEnsure the architecture-specific header files for x86 have all necessary includes in them.
--- app/chkincs/gen_c_file_for_header.py | 4 ++++ lib/librte_eal/x86/include/meson.build | 1 + 2 files changed, 5 insertions(+)
app/chkincs/gen_c_file_for_header.py +4 -0
@@ -8,6 +8,10 @@ empty_contents = 'static const char *empty __attribute__((unused)) = "empty";' # files which are not used directly, but included via others exceptions = [ + 'rte_atomic_32.h', + 'rte_atomic_64.h', + 'rte_byteorder_32.h', + 'rte_byteorder_64.h', 'rte_cmp_arm64.h', 'rte_cmp_x86.h', 'rte_crc_arm64.h',
lib/librte_eal/x86/include/meson.build +1 -0
@@ -23,3 +23,4 @@ arch_headers = files( 'rte_vect.h', ) install_headers(arch_headers, subdir: get_option('include_subdir_arch')) +dpdk_headers += arch_headers
Signature · 1 line
2.27.0
PATCH 20/20 test-meson-builds: add includes check to default x86 build
In reply to Bruce RichardsonSince the includes check is disabled by default, we need to explicitly enable it to have it run. To minimise any extra build time when running the test-meson-builds script, we just add it to the default x86 build.
--- devtools/test-meson-builds.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/test-meson-builds.sh +1 -1
@@ -215,7 +215,7 @@ default_machine='nehalem' if ! check_cc_flags "-march=$default_machine" ; then default_machine='corei7' fi -build build-x86-default cc -Dlibdir=lib -Dmachine=$default_machine $use_shared +build build-x86-default cc -Dlibdir=lib -Dmachine=$default_machine -Dtest_includes=true $use_shared # 32-bit with default compiler if check_cc_flags '-m32' ; then
Signature · 1 line
2.27.0
v2 cover ensure headers have correct includes
In reply to Bruce RichardsonAs 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
PATCH v2 1/19 eal: fix missing header inclusion
The rte_reciprocal header file used standard __rte_always_inline from rte_common.h but does not include that header file, leading to compiler errors when the reciprocal header is included alone. Similarly, rte_thread.h was missing the compat header to get the __rte_experimental macro definition.
--- lib/librte_eal/include/rte_reciprocal.h | 1 + lib/librte_eal/include/rte_thread.h | 1 + 2 files changed, 2 insertions(+)
lib/librte_eal/include/rte_reciprocal.h +1 -0
@@ -26,6 +26,7 @@#define _RTE_RECIPROCAL_H_#include <stdint.h> +#include <rte_common.h> struct rte_reciprocal {uint32_t m;
lib/librte_eal/include/rte_thread.h +1 -0
@@ -3,6 +3,7 @@*/ #include <rte_os.h> +#include <rte_compat.h> #ifndef _RTE_THREAD_H_#define _RTE_THREAD_H_
Signature · 1 line
2.27.0
PATCH v2 2/19 telemetry: fix missing header include
In reply to Bruce RichardsonThe telemetry header file uses the rte_cpuset_t type, but does not include any header providing that type. Include rte_os.h to provide the necessary type.
--- lib/librte_telemetry/rte_telemetry.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_telemetry/rte_telemetry.h +1 -0
@@ -5,6 +5,7 @@#include <stdint.h> #include <sched.h> #include <rte_compat.h> +#include <rte_os.h> #ifndef _RTE_TELEMETRY_H_#define _RTE_TELEMETRY_H_
Signature · 1 line
2.27.0
PATCH v2 3/19 ethdev: fix missing header include
In reply to Bruce RichardsonThe define for RTE_ETH_FLOW_MAX is defined in rte_ethdev.h, so that header should be included in rte_eth_ctrl.h to allow it to be compiled independently.
--- lib/librte_ethdev/rte_eth_ctrl.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_ethdev/rte_eth_ctrl.h +1 -0
@@ -9,6 +9,7 @@#include <rte_common.h> #include <rte_ether.h> #include "rte_flow.h" +#include "rte_ethdev.h" /** * @deprecated Please use rte_flow API instead of this legacy one.
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v2 03/19] ethdev: fix missing header include
Quoted 8 lines · Bruce Richardson
The define for
RTE_ETH_FLOW_MAXis defined inrte_ethdev.h, so that header should be included inrte_eth_ctrl.hto allow it to be compiled independently.Fixes 7fa96d696f2c ("ethdev: unification of flow types")Signed-off-by Bruce Richardson <[email protected]>
PATCH v2 4/19 net: fix missing header include
In reply to Bruce RichardsonThe Geneve protocol header file is missing the rte_byteorder.h header.
--- lib/librte_net/rte_geneve.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_net/rte_geneve.h +1 -0
@@ -11,6 +11,7 @@* GENEVE-related definitions */ #include <stdint.h> +#include <rte_byteorder.h> #ifdef __cplusplusextern "C" {
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v2 04/19] net: fix missing header include
Quoted 34 lines
-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Friday, January 15, 2021 1:11 PM
To: [email protected]
Cc: [email protected]; Bruce Richardson <[email protected]>; [email protected]; Olivier Matz <[email protected]>; Ophir Munk <[email protected]>; Ferruh Yigit <[email protected]>
Subject: [PATCH v2 04/19] net: fix missing header includeThe Geneve protocol header file is missing the
rte_byteorder.hheader.Fixes ea0e711b8ae0 ("app/testpmd: add GENEVE parsing")Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_net/rte_geneve.h | 1 + 1 file changed, 1 insertion(+)lib/librte_net/rte_geneve.h index renamed from lib/librte_net/rte_geneve.h +0
-0
bb67724c31..7c3d477dcb100644lib/librte_net/rte_geneve.h +1
-1@@ -11,6 +11,7 @@* GENEVE-related definitions */ #include <stdint.h> +#include <rte_byteorder.h> #ifdef __cplusplusextern "C" { --2.27.0
PATCH v2 5/19 mbuf: fix missing header include
In reply to Bruce RichardsonThe rte_mbuf_dyn.h header file uses a number of types and macros without including the required header files to get the definitions of those macros/types. Similarly, the rte_mbuf_core.h file was missing an include for rte_byteorder.h header.
--- lib/librte_mbuf/rte_mbuf_core.h | 1 + lib/librte_mbuf/rte_mbuf_dyn.h | 3 +++ 2 files changed, 4 insertions(+)
lib/librte_mbuf/rte_mbuf_core.h +1 -0
@@ -18,6 +18,7 @@#include <stdint.h> #include <rte_compat.h> +#include <rte_byteorder.h> #include <generic/rte_atomic.h> #ifdef __cplusplus
lib/librte_mbuf/rte_mbuf_dyn.h +3 -0
@@ -66,7 +66,10 @@* - any name that does not start with "rte_" in an application */ +#include <stdio.h> +#include <stdint.h> #include <sys/types.h> +#include <rte_compat.h> #ifdef __cplusplusextern "C" {
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v2 05/19] mbuf: fix missing header include
Quoted 10 lines · Bruce Richardson
The
rte_mbuf_dyn.hheader file uses a number of types and macros without including the required header files to get the definitions of those macros/types. Similarly, therte_mbuf_core.hfile was missing an include forrte_byteorder.hheader.Fixes 4958ca3a443a ("mbuf: support dynamic fields and flags")Fixes 3eb860b08eb7 ("mbuf: move definitions into a separate file")Signed-off-by Bruce Richardson <[email protected]>
PATCH v2 6/19 bitratestats: fix missing header include
In reply to Bruce RichardsonThe rte_compat.h header file must be included to get the definition of __rte_experimental.
--- lib/librte_bitratestats/rte_bitrate.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_bitratestats/rte_bitrate.h +1 -0
@@ -6,6 +6,7 @@#define _RTE_BITRATE_H_#include <stdint.h> +#include <rte_compat.h> #ifdef __cplusplusextern "C" {
Signature · 1 line
2.27.0
PATCH v2 7/19 rib: fix missing header includes
In reply to Bruce RichardsonThe standard integer types, and the size_t types are missing their required header includes in the rib header file.
--- lib/librte_rib/rte_rib.h | 2 ++ 1 file changed, 2 insertions(+)
lib/librte_rib/rte_rib.h +2 -0
@@ -18,6 +18,8 @@* Level compressed tree implementation for IPv4 Longest Prefix Match */ +#include <stdlib.h> +#include <stdint.h> #include <rte_compat.h> #ifdef __cplusplus
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v2 07/19] rib: fix missing header includes
Quoted 17 lines · Bruce Richardson
The standard integer types, and the
size_ttypes are missing their required header includes in the rib header file.Fixes 5a5793a5ffa2 ("rib: add RIB library")Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_rib/rte_rib.h | 2 ++ 1 file changed, 2 insertions(+)lib/librte_rib/rte_rib.h +0
-0
lib/librte_rib/rte_rib.h line 25
Quoted 8 lines
lib/librte_rib/rte_rib.h +2
-0@@ -18,6 +18,8 @@* Level compressed tree implementation for IPv4 Longest Prefix Match */ +#include <stdlib.h> +#include <stdint.h> #include <rte_compat.h> #ifdef __cplusplus
Signature · 2 lines
Regards, Vladimir
PATCH v2 8/19 vhost: fix missing header includes
In reply to Bruce RichardsonThe vhost header files were missing definitions from headers to allow them to be compiled up individually.
--- lib/librte_vhost/rte_vdpa.h | 2 ++ lib/librte_vhost/rte_vdpa_dev.h | 1 + lib/librte_vhost/rte_vhost_crypto.h | 7 +++++++ 3 files changed, 10 insertions(+)
lib/librte_vhost/rte_vdpa.h +2 -0
@@ -11,6 +11,8 @@* Device specific vhost lib */ +#include <stdint.h> +/** Maximum name length for statistics counters */ #define RTE_VDPA_STATS_NAME_SIZE 64
lib/librte_vhost/rte_vdpa_dev.h +1 -0
@@ -8,6 +8,7 @@#include <stdbool.h> #include "rte_vhost.h" +#include "rte_vdpa.h" #define RTE_VHOST_QUEUE_ALL UINT16_MAX
lib/librte_vhost/rte_vhost_crypto.h +7 -0
@@ -5,6 +5,13 @@#ifndef _VHOST_CRYPTO_H_#define _VHOST_CRYPTO_H_ +#include <stdint.h> +#include <rte_compat.h> + +/* pre-declare structs to avoid including full headers */ +struct rte_mempool ; +struct rte_crypto_op ; +#define VHOST_CRYPTO_MBUF_POOL_SIZE (8192)#define VHOST_CRYPTO_MAX_BURST_SIZE (64)#define VHOST_CRYPTO_MAX_DATA_SIZE (4096)
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v2 08/19] vhost: fix missing header includes
Quoted 49 lines · Bruce Richardson
The vhost header files were missing definitions from headers to allow them to be compiled up individually.
Fixes d7280c9fffcb ("vhost: support selective datapath")Fixes a49f758d1170 ("vhost: split vDPA header file")Fixes 939066d96563 ("vhost/crypto: add public function implementation")Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_vhost/rte_vdpa.h | 2 ++ lib/librte_vhost/rte_vdpa_dev.h | 1 + lib/librte_vhost/rte_vhost_crypto.h | 7 +++++++ 3 files changed, 10 insertions(+)lib/librte_vhost/rte_vdpa.h +2
-0@@ -11,6 +11,8 @@* Device specific vhost lib */ +#include <stdint.h> +/** Maximum name length for statistics counters */ #define RTE_VDPA_STATS_NAME_SIZE 64lib/librte_vhost/rte_vdpa_dev.h +1
-0@@ -8,6 +8,7 @@#include <stdbool.h> #include "rte_vhost.h" +#include "rte_vdpa.h" #define RTE_VHOST_QUEUE_ALL UINT16_MAXlib/librte_vhost/rte_vhost_crypto.h +0
-0@@ -5,6 +5,13 @@#ifndef _VHOST_CRYPTO_H_#define _VHOST_CRYPTO_H_
lib/librte_vhost/rte_vhost_crypto.h line 17
Quoted 10 lines
lib/librte_vhost/rte_vhost_crypto.h +7
-0+#include <stdint.h> +#include <rte_compat.h> + +/* pre-declare structs to avoid including full headers */ +struct rte_mempool ; +struct rte_crypto_op ; +#define VHOST_CRYPTO_MBUF_POOL_SIZE (8192)#define VHOST_CRYPTO_MAX_BURST_SIZE (64)#define VHOST_CRYPTO_MAX_DATA_SIZE (4096)
Thanks,
Maxime
PATCH v2 9/19 ipsec: fix missing header include
In reply to Bruce RichardsonThe rte_ipsec_sad.h header used the standard uintXX_t types, but did not include stdint.h header for them.
--- lib/librte_ipsec/rte_ipsec_sad.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_ipsec/rte_ipsec_sad.h +1 -0
@@ -7,6 +7,7 @@#define _RTE_IPSEC_SAD_H_#include <rte_compat.h> +#include <stdint.h> /** * @file rte_ipsec_sad.h
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v2 09/19] ipsec: fix missing header include
Quoted 27 lines
-----Original Message-----
From: Richardson, Bruce <[email protected]>
Sent: Friday, January 15, 2021 11:11 AM
To: [email protected]
Cc: [email protected]; Richardson, Bruce <[email protected]>; [email protected]; Ananyev, Konstantin <[email protected]>; Iremonger, Bernard <[email protected]>; Medvedkin, Vladimir <[email protected]>; Akhil Goyal <[email protected]>
Subject: [PATCH v2 09/19] ipsec: fix missing header includeThe
rte_ipsec_sad.hheader used the standarduintXX_ttypes, but did not includestdint.hheader for them.Fixes 401633d9c112 ("ipsec: add inbound SAD API")Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_ipsec/rte_ipsec_sad.h | 1 + 1 file changed, 1 insertion(+)lib/librte_ipsec/rte_ipsec_sad.h +0
-0
lib/librte_ipsec/rte_ipsec_sad.h
Quoted 8 lines
lib/librte_ipsec/rte_ipsec_sad.h +1
-1@@ -7,6 +7,7 @@#define _RTE_IPSEC_SAD_H_#include <rte_compat.h> +#include <stdint.h> /** * @file rte_ipsec_sad.h --
Quoted 1 line
2.27.0
Re: [dpdk-dev] [PATCH v2 09/19] ipsec: fix missing header include
In reply to Bruce RichardsonQuoted 17 lines · Bruce Richardson
The
rte_ipsec_sad.hheader used the standarduintXX_ttypes, but did not includestdint.hheader for them.Fixes 401633d9c112 ("ipsec: add inbound SAD API")Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_ipsec/rte_ipsec_sad.h | 1 + 1 file changed, 1 insertion(+)lib/librte_ipsec/rte_ipsec_sad.h +0
-0
lib/librte_ipsec/rte_ipsec_sad.h line 13
Quoted 7 lines
lib/librte_ipsec/rte_ipsec_sad.h +1
-0@@ -7,6 +7,7 @@#define _RTE_IPSEC_SAD_H_#include <rte_compat.h> +#include <stdint.h> /** * @file rte_ipsec_sad.h
Signature · 2 lines
Regards, Vladimir
Re: [dpdk-dev] [PATCH v2 09/19] ipsec: fix missing header include
Hi Bruce,
Just a one nit, please put <stdint.h> before rte_ includes.
Quoted 28 lines · Vladimir
Quoted 16 lines · Bruce Richardson
The
rte_ipsec_sad.hheader used the standarduintXX_ttypes, but did not includestdint.hheader for them.Fixes 401633d9c112 ("ipsec: add inbound SAD API")Signed-off-by Bruce Richardson <[email protected]>---
lib/librte_ipsec/rte_ipsec_sad.h| 1 +1 file changed, 1 insertion(+)lib/librte_ipsec/rte_ipsec_sad.h +0
-0lib/librte_ipsec/rte_ipsec_sad.h line 12
Quoted 6 lines
lib/librte_ipsec/rte_ipsec_sad.h +1
-0@@ -7,6 +7,7 @@ #define _RTE_IPSEC_SAD_H_ #include <rte_compat.h> +#include <stdint.h> /*** @file rte_ipsec_sad.h
Signature · 2 lines
Regards, Vladimir
Re: [dpdk-dev] [PATCH v2 09/19] ipsec: fix missing header include
Quoted 4 lines · Vladimir
Hi Bruce,
Just a one nit, please put <
stdint.h> beforerte_includes.
Good point, I'll fix if I do a V3.
Quoted 34 lines · Vladimir
Quoted 29 lines · Bruce Richardson
Quoted 17 lines
The
rte_ipsec_sad.hheader used the standarduintXX_ttypes, but did not includestdint.hheader for them.Fixes 401633d9c112 ("ipsec: add inbound SAD API")Signed-off-by Bruce Richardson <[email protected]>---
lib/librte_ipsec/rte_ipsec_sad.h| 1 +1 file changed, 1 insertion(+)lib/librte_ipsec/rte_ipsec_sad.h +0
-0lib/librte_ipsec/rte_ipsec_sad.h line 12
Quoted 6 lines
lib/librte_ipsec/rte_ipsec_sad.h +1
-0@@ -7,6 +7,7 @@ #define _RTE_IPSEC_SAD_H_ #include <rte_compat.h> +#include <stdint.h> /*** @file rte_ipsec_sad.h Signature · 2 lines
Regards, Vladimir
PATCH v2 10/19 fib: fix missing header includes
In reply to Bruce RichardsonAdd stdint.h to get definitions of standard integer types
--- lib/librte_fib/rte_fib.h | 1 + lib/librte_fib/rte_fib6.h | 1 + 2 files changed, 2 insertions(+)
lib/librte_fib/rte_fib.h +1 -0
@@ -19,6 +19,7 @@* for IPv4 Longest Prefix Match */ +#include <stdint.h> #include <rte_compat.h> #ifdef __cplusplus
lib/librte_fib/rte_fib6.h +1 -0
@@ -19,6 +19,7 @@* for IPv6 Longest Prefix Match */ +#include <stdint.h> #include <rte_compat.h> #ifdef __cplusplus
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v2 10/19] fib: fix missing header includes
Quoted 30 lines · Bruce Richardson
Add
stdint.hto get definitions of standard integer typesFixes 39e927248416 ("fib: add FIB library")Fixes 40d41a8a7b34 ("fib: support IPv6")Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_fib/rte_fib.h | 1 + lib/librte_fib/rte_fib6.h | 1 + 2 files changed, 2 insertions(+)lib/librte_fib/rte_fib.h +1
-0@@ -19,6 +19,7 @@* for IPv4 Longest Prefix Match */ +#include <stdint.h> #include <rte_compat.h> #ifdef __cpluspluslib/librte_fib/rte_fib6.h +0
-0
lib/librte_fib/rte_fib6.h line 25
Quoted 7 lines
lib/librte_fib/rte_fib6.h +1
-0@@ -19,6 +19,7 @@* for IPv6 Longest Prefix Match */ +#include <stdint.h> #include <rte_compat.h> #ifdef __cplusplus
Signature · 2 lines
Regards, Vladimir
PATCH v2 11/19 table: fix missing header include
In reply to Bruce RichardsonThe rte_lru_x86.h header, included from the main rte_lru.h header, uses the RTE_CC_IS_GNU macro from rte_common.h but fails to include that header file.
--- lib/librte_table/rte_lru_x86.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_table/rte_lru_x86.h +1 -0
@@ -12,6 +12,7 @@ extern "C" {#include <stdint.h> #include <rte_config.h> +#include <rte_common.h> #ifndef RTE_TABLE_HASH_LRU_STRATEGY #define RTE_TABLE_HASH_LRU_STRATEGY 2
Signature · 1 line
2.27.0
PATCH v2 12/19 pipeline: fix missing header includes
In reply to Bruce RichardsonThe stdio.h header needs to be included to get the definition of the FILE type.
--- lib/librte_pipeline/rte_swx_ctl.h | 1 + lib/librte_pipeline/rte_swx_pipeline.h | 1 + 2 files changed, 2 insertions(+)
lib/librte_pipeline/rte_swx_ctl.h +1 -0
@@ -15,6 +15,7 @@ extern "C" {#include <stddef.h> #include <stdint.h> +#include <stdio.h> #include <rte_compat.h>
lib/librte_pipeline/rte_swx_pipeline.h +1 -0
@@ -15,6 +15,7 @@ extern "C" {#include <stddef.h> #include <stdint.h> +#include <stdio.h> #include <rte_compat.h>
Signature · 1 line
2.27.0
PATCH v2 13/19 metrics: fix variable declaration in header
In reply to Bruce RichardsonThe global variable "tel_met_data" was declared in a header file, rather than in a C file, leading to duplicate definitions if more than one C file included the header.
--- lib/librte_metrics/rte_metrics_telemetry.c | 2 ++ lib/librte_metrics/rte_metrics_telemetry.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
lib/librte_metrics/rte_metrics_telemetry.c +2 -0
@@ -13,6 +13,8 @@#include "rte_metrics.h" #include "rte_metrics_telemetry.h" +struct telemetry_metrics_data tel_met_data; +int metrics_log_level;/* Logging Macros */
lib/librte_metrics/rte_metrics_telemetry.h +0 -2
@@ -34,8 +34,6 @@ struct telemetry_metrics_data {int metrics_register_done; }; -struct telemetry_metrics_data tel_met_data; -__rte_experimental int32_t rte_metrics_tel_reg_all_ethdev(int *metrics_register_done,int *reg_index_list);
Signature · 1 line
2.27.0
PATCH v2 14/19 node: fix missing header include
In reply to Bruce RichardsonThe rte_compat header file is needed for the '__rte_experimental' macro.
--- lib/librte_node/rte_node_ip4_api.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_node/rte_node_ip4_api.h +1 -0
@@ -21,6 +21,7 @@ extern "C" {#endif #include <rte_common.h> +#include <rte_compat.h> /** * IP4 lookup next nodes.
Signature · 1 line
2.27.0
PATCH v2 15/19 app: fix extra include paths for app builds
In reply to Bruce RichardsonThe "includes" variable in the app/meson.build file was ignored when building the executable, meaning that apps couldn't pass additional include paths directly back. Fix this to align with drivers and libs.
--- app/meson.build | 1 + 1 file changed, 1 insertion(+)
app/meson.build +1 -0
@@ -66,6 +66,7 @@ foreach app:apps link_args: ldflags, link_whole: link_libs, dependencies: dep_objs, + include_directories: includes, install_rpath: join_paths(get_option('prefix'), driver_install_path), install: true)
Signature · 1 line
2.27.0
PATCH v2 16/19 app/chkincs: add chkincs app to verify headers
In reply to Bruce RichardsonTo verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
The list of headers to check is based of the "headers" value returned from each library's meson.build file. However, since not all headers are for direct inclusion, add a build variable "headers_no_chkincs" to list those headers and skip checking them.
---
v2:
* add maintainers entry
* distribute exception list among meson.build files.
MAINTAINERS | 4 ++++ app/chkincs/gen_c_file_for_header.py | 12 ++++++++++ app/chkincs/main.c | 4 ++++ app/chkincs/meson.build | 28 ++++++++++++++++++++++++ app/meson.build | 1 + doc/guides/contributing/coding_style.rst | 12 ++++++++++ lib/librte_eal/include/meson.build | 2 +- lib/librte_ethdev/meson.build | 4 ++-- lib/librte_hash/meson.build | 4 ++-- lib/librte_ipsec/meson.build | 3 ++- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_ring/meson.build | 4 +++- lib/librte_stack/meson.build | 4 +++- lib/librte_table/meson.build | 7 +++--- lib/meson.build | 3 +++ meson.build | 1 + meson_options.txt | 2 ++ 18 files changed, 85 insertions(+), 14 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
MAINTAINERS +4 -0
@@ -1561,6 +1561,10 @@ F: app/test/test_resource.c F: app/test/virtual_pmd.c F: app/test/virtual_pmd.h +Header build sanity checking +M: Bruce Richardson <[email protected]> +F: app/chkincs/ + Sample packet helper functions for unit test M: Reshma Pattan <[email protected]> F: app/test/sample_packet_forward.c
app/chkincs/gen_c_file_for_header.py new file +12 -0
@@ -0,0 +1,12 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020-2021 Intel Corporation + +from sys import argv +from os.path import abspath + +(h_file, c_file) = argv[1:] + +contents = '#include "' + abspath(h_file) + '"' +with open(c_file, 'w') as cf: + cf.write(contents)
app/chkincs/main.c new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2020-2021 Intel Corporation +*/ +int main (void ) {return 0 ; }
app/chkincs/meson.build new file +28 -0
@@ -0,0 +1,28 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020-2021 Intel Corporation + +if not get_option('test_includes') + build = false + subdir_done() +endif + +if is_windows + # for windows, the shebang line in the script won't work. + error('option "test_includes" is not supported on windows') +endif + +gen_c_file_for_header = find_program('gen_c_file_for_header.py') +gen_c_files = generator(gen_c_file_for_header, + output: '@[email protected]', + arguments: ['@INPUT@', '@OUTPUT@']) + +cflags += '-Wno-unused-function' # needed if we include generic headers + +# some ethdev headers depend on bus headers +includes += include_directories('../../drivers/bus/pci', + '../../drivers/bus/vdev') + +sources += files('main.c') +sources += gen_c_files.process(dpdk_chkinc_headers) + +deps = enabled_libs
app/meson.build +1 -0
@@ -6,6 +6,7 @@ if is_windows endif apps = [ + 'chkincs', 'pdump', 'proc-info', 'test-acl',
doc/guides/contributing/coding_style.rst +12 -0
@@ -891,6 +891,18 @@ headers installed to $PREFIX/include when ``ninja install`` is run. As with source files, these should be specified using the meson ``files()`` function. + When ``test_headers`` build option is set to ``true``, each header file + has additional checks performed on it, for example to ensure that it is + not missing any include statements for dependent headers. These build + checks are done by the build of the ``dpdk-chkincs`` application, and + for header files which are public, but only included indirectly in + applications, these checks can be skipped by using the ``headers_no_chkincs`` + variable rather than ``headers``. + +headers_no_chkincs + **Default Value = []**. + As with ``headers`` option above, except that the files are not checked + as part of the build of the ``dpdk-chkincs`` binary. includes: **Default Value = []**.
lib/librte_eal/include/meson.build +1 -1
@@ -16,7 +16,6 @@ headers += files( 'rte_dev.h', 'rte_devargs.h', 'rte_eal.h', - 'rte_eal_interrupts.h', 'rte_eal_memconfig.h', 'rte_eal_trace.h', 'rte_errno.h',
@@ -49,6 +48,7 @@ headers += files( 'rte_version.h', 'rte_vfio.h', ) +headers_no_chkincs += files('rte_eal_interrupts.h') # special case install the generic headers, since they go in a subdir generic_headers = files(
lib/librte_ethdev/meson.build +2 -2
@@ -12,12 +12,10 @@ sources = files('ethdev_private.c', headers = files('rte_ethdev.h', 'rte_ethdev_driver.h', - 'rte_ethdev_core.h', 'rte_ethdev_pci.h', 'rte_ethdev_trace.h', 'rte_ethdev_trace_fp.h', 'rte_ethdev_vdev.h', - 'rte_eth_ctrl.h', 'rte_dev_info.h', 'rte_flow.h', 'rte_flow_driver.h',
@@ -25,5 +23,7 @@ headers = files('rte_ethdev.h', 'rte_mtr_driver.h', 'rte_tm.h', 'rte_tm_driver.h') +headers_no_chkincs += files('rte_eth_ctrl.h', + 'rte_ethdev_core.h') deps += ['net', 'kvargs', 'meter', 'telemetry']
lib/librte_hash/meson.build +2 -2
@@ -1,12 +1,12 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -headers = files('rte_crc_arm64.h', - 'rte_fbk_hash.h', +headers = files('rte_fbk_hash.h', 'rte_hash_crc.h', 'rte_hash.h', 'rte_jhash.h', 'rte_thash.h') +headers_no_chkincs += files('rte_crc_arm64.h') sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c') deps += ['ring']
lib/librte_ipsec/meson.build +2 -1
@@ -3,6 +3,7 @@ sources = files('esp_inb.c', 'esp_outb.c', 'sa.c', 'ses.c', 'ipsec_sad.c') -headers = files('rte_ipsec.h', 'rte_ipsec_group.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h') +headers = files('rte_ipsec.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h') +headers_no_chkincs += files('rte_ipsec_group.h') deps += ['mbuf', 'net', 'cryptodev', 'security', 'hash']
lib/librte_lpm/meson.build +1 -1
@@ -5,6 +5,6 @@ sources = files('rte_lpm.c', 'rte_lpm6.c') headers = files('rte_lpm.h', 'rte_lpm6.h') # since header files have different names, we can install all vector headers # without worrying about which architecture we actually need -headers += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h') +headers_no_chkincs += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h') deps += ['hash'] deps += ['rcu']
lib/librte_regexdev/meson.build +1 -1
@@ -3,6 +3,6 @@ sources = files('rte_regexdev.c') headers = files('rte_regexdev.h', - 'rte_regexdev_core.h', 'rte_regexdev_driver.h') +headers_no_chkincs += files('rte_regexdev_core.h') deps += ['mbuf']
lib/librte_ring/meson.build +3 -1
@@ -2,7 +2,9 @@ # Copyright(c) 2017 Intel Corporation sources = files('rte_ring.c') -headers = files('rte_ring.h', +headers = files('rte_ring.h') +# most sub-headers are not for direct inclusion +headers_no_chkincs += files ( 'rte_ring_core.h', 'rte_ring_elem.h', 'rte_ring_c11_mem.h',
lib/librte_stack/meson.build +3 -1
@@ -2,7 +2,9 @@ # Copyright(c) 2019 Intel Corporation sources = files('rte_stack.c', 'rte_stack_std.c', 'rte_stack_lf.c') -headers = files('rte_stack.h', +headers = files('rte_stack.h') +# subheaders, not for direct inclusion by apps +headers_no_chkincs += files( 'rte_stack_std.h', 'rte_stack_lf.h', 'rte_stack_lf_generic.h',
lib/librte_table/meson.build +3 -4
@@ -20,7 +20,6 @@ headers = files('rte_table.h', 'rte_table_hash.h', 'rte_table_hash_cuckoo.h', 'rte_table_hash_func.h', - 'rte_table_hash_func_arm64.h', 'rte_lru.h', 'rte_table_array.h', 'rte_table_stub.h',
@@ -28,6 +27,6 @@ headers = files('rte_table.h', 'rte_swx_table_em.h',) deps += ['mbuf', 'port', 'lpm', 'hash', 'acl'] -if arch_subdir == 'x86' - headers += files('rte_lru_x86.h') -endif +headers_no_chkincs += files('rte_lru_x86.h', + 'rte_lru_arm64.h', + 'rte_table_hash_func_arm64.h')
lib/meson.build +3 -0
@@ -65,6 +65,7 @@ foreach l:libraries use_function_versioning = false sources = [] headers = [] + headers_no_chkincs = [] # public headers not directly included by apps includes = [] cflags = default_cflags objs = [] # other object files to link against, used e.g. for
@@ -103,6 +104,8 @@ foreach l:libraries dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1) #old macro dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1) # new macro install_headers(headers) + install_headers(headers_no_chkincs) + dpdk_chkinc_headers += headers libname = 'rte_' + name includes += include_directories(dir_name)
meson.build +1 -0
@@ -16,6 +16,7 @@ cc = meson.get_compiler('c') dpdk_conf = configuration_data() dpdk_libraries = [] dpdk_static_libraries = [] +dpdk_chkinc_headers = [] dpdk_driver_classes = [] dpdk_drivers = [] dpdk_extra_ldflags = []
meson_options.txt +2 -0
@@ -30,5 +30,7 @@ option('enable_trace_fp', type: 'boolean', value: false, description: 'enable fast path trace points.') option('tests', type: 'boolean', value: true, description: 'build unit tests') +option('test_includes', type: 'boolean', value: false, + description: 'build "chkincs" to verify each header file can compile alone') option('use_hpet', type: 'boolean', value: false, description: 'use HPET timer in EAL')
--
2.27.0
Re: [dpdk-dev] [PATCH v2 16/19] app/chkincs: add chkincs app to verify headers
Quoted 14 lines · Bruce Richardson
To verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
The list of headers to check is based of the "headers" value returned from each library's meson.build file. However, since not all headers are for direct inclusion, add a build variable "
headers_no_chkincs" to list those headers and skip checking them.Signed-off-by Bruce Richardson <[email protected]>---
Quoted 8 lines
v2:
* add maintainers entry
* distribute exception list among meson.build files.MAINTAINERS | 4 ++++ app/chkincs/gen_c_file_for_header.py | 12 ++++++++++ app/chkincs/main.c | 4 ++++ app/chkincs/meson.build | 28 ++++++++++++++++++++++++
+1 to have this kind of tool to check, but it is not an application like others in the 'app' folder, what do you think placing it under 'devtools' or 'buildtools'?
Re: [dpdk-dev] [PATCH v2 16/19] app/chkincs: add chkincs app to verify headers
Quoted 19 lines · Ferruh Yigit
Quoted 18 lines · Bruce Richardson
To verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
The list of headers to check is based of the "headers" value returned from each library's meson.build file. However, since not all headers are for direct inclusion, add a build variable "
headers_no_chkincs" to list those headers and skip checking them.Signed-off-by Bruce Richardson <[email protected]>---
v2:
* add maintainers entry
* distribute exception list among meson.build files.
Quoted 8 lines
Quoted 4 lines
MAINTAINERS | 4 ++++ app/chkincs/gen_c_file_for_header.py | 12 ++++++++++ app/chkincs/main.c | 4 ++++ app/chkincs/meson.build | 28 +++++++++++++++++++++++++1 to have this kind of tool to check, but it is not an application like others in the 'app' folder, what do you think placing it under 'devtools' or 'buildtools'?
Couple of reasons why it's placed in app.
1. We previously had a "chkincs" app in DPDK which was kept in the app folder
2. It allows us to reuse the build infrastructure for building apps, rather than reduplicating it.
3. We don't have any compilable code currently in the devtools folder, and even in buildtools the pmdinfogen app is going to go away.
That being said, none of those reasons are major issues that can't be worked around if the consensus is to move it.
/Bruce
Re: [dpdk-dev] [PATCH v2 16/19] app/chkincs: add chkincs app to verify headers
15/01/2021 12:59, Bruce Richardson:
Quoted 38 lines · Ferruh Yigit
Quoted 19 lines · Bruce Richardson
Quoted 18 lines
To verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
The list of headers to check is based of the "headers" value returned from each library's meson.build file. However, since not all headers are for direct inclusion, add a build variable "
headers_no_chkincs" to list those headers and skip checking them.Signed-off-by Bruce Richardson <[email protected]>---
v2:
* add maintainers entry
* distribute exception list among meson.build files.Quoted 8 lines
Quoted 4 lines
MAINTAINERS | 4 ++++ app/chkincs/gen_c_file_for_header.py | 12 ++++++++++ app/chkincs/main.c | 4 ++++ app/chkincs/meson.build | 28 +++++++++++++++++++++++++1 to have this kind of tool to check, but it is not an application like others in the 'app' folder, what do you think placing it under 'devtools' or 'buildtools'?
Couple of reasons why it's placed in app.
1. We previously had a "chkincs" app in DPDK which was kept in the app folder
2. It allows us to reuse the build infrastructure for building apps, rather than reduplicating it.
3. We don't have any compilable code currently in the devtools folder, and even in buildtools the pmdinfogen app is going to go away.
Quoted 2 lines
That being said, none of those reasons are major issues that can't be worked around if the consensus is to move it.
It could be easily in devtools if it was a script. By the way, we already have devtools/check-includes.sh If your solution is better, please remove this script.
Re: [dpdk-dev] [PATCH v2 16/19] app/chkincs: add chkincs app to verify headers
Quoted 39 lines · Thomas Monjalon
15/01/2021 12:59, Bruce Richardson:
Quoted 38 lines · Ferruh Yigit
Quoted 19 lines · Bruce Richardson
Quoted 18 lines
To verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
The list of headers to check is based of the "headers" value returned from each library's meson.build file. However, since not all headers are for direct inclusion, add a build variable "
headers_no_chkincs" to list those headers and skip checking them.Signed-off-by Bruce Richardson <[email protected]>---
v2:
* add maintainers entry
* distribute exception list among meson.build files.Quoted 8 lines
Quoted 4 lines
MAINTAINERS | 4 ++++ app/chkincs/gen_c_file_for_header.py | 12 ++++++++++ app/chkincs/main.c | 4 ++++ app/chkincs/meson.build | 28 +++++++++++++++++++++++++1 to have this kind of tool to check, but it is not an application like others in the 'app' folder, what do you think placing it under 'devtools' or 'buildtools'?
Couple of reasons why it's placed in app.
1. We previously had a "chkincs" app in DPDK which was kept in the app folder
2. It allows us to reuse the build infrastructure for building apps, rather than reduplicating it.
3. We don't have any compilable code currently in the devtools folder, and even in buildtools the pmdinfogen app is going to go away.
Quoted 7 lines
Quoted 2 lines
That being said, none of those reasons are major issues that can't be worked around if the consensus is to move it.
It could be easily in devtools if it was a script. By the way, we already have
devtools/check-includes.shIf your solution is better, please remove this script.
I only discovered the script existed when doing the v2 of this patchset, since it showed up in some grep calls I did for exception cases. I'm not sure that either approach is necessarily better, it's just right now that the script is unused (and also unknown) which is why I did this cleanup work.
Here is how I see the current comparison between two approaches:
* Script as advantage in that it performs C++ checks as well as C
* Script also allows passing arbitrary additional C flags into checks for higher levels of compliance, but I'm not sure this is something I like as I'd rather have standardisation here across all headers than have some headers more pedantic-friendly than others.
* Main downside of the script is that is works off directories rather than a list of files, which means it requires maintenance of the exception list in the script, rather than in the build definition files where we call out the headers to be installed
I'm honestly fine either way on this (as with directory where implementation lives) - main thing is to have the checking done, rather than ignored.
/Bruce
Re: [dpdk-dev] [PATCH v2 16/19] app/chkincs: add chkincs app to verify headers
Quoted 64 lines · Bruce Richardson
Quoted 39 lines · Thomas Monjalon
15/01/2021 12:59, Bruce Richardson:
Quoted 38 lines · Ferruh Yigit
Quoted 19 lines · Bruce Richardson
Quoted 18 lines
To verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
The list of headers to check is based of the "headers" value returned from each library's meson.build file. However, since not all headers are for direct inclusion, add a build variable "
headers_no_chkincs" to list those headers and skip checking them.Signed-off-by Bruce Richardson <[email protected]>---
v2:
* add maintainers entry
* distribute exception list among meson.build files.Quoted 8 lines
Quoted 4 lines
MAINTAINERS | 4 ++++ app/chkincs/gen_c_file_for_header.py | 12 ++++++++++ app/chkincs/main.c | 4 ++++ app/chkincs/meson.build | 28 +++++++++++++++++++++++++1 to have this kind of tool to check, but it is not an application like others in the 'app' folder, what do you think placing it under 'devtools' or 'buildtools'?
Couple of reasons why it's placed in app.
1. We previously had a "chkincs" app in DPDK which was kept in the app folder
2. It allows us to reuse the build infrastructure for building apps, rather than reduplicating it.
3. We don't have any compilable code currently in the devtools folder, and even in buildtools the pmdinfogen app is going to go away.Quoted 7 lines
Quoted 2 lines
That being said, none of those reasons are major issues that can't be worked around if the consensus is to move it.
It could be easily in devtools if it was a script. By the way, we already have
devtools/check-includes.shIf your solution is better, please remove this script.I only discovered the script existed when doing the v2 of this patchset, since it showed up in some grep calls I did for exception cases. I'm not sure that either approach is necessarily better, it's just right now that the script is unused (and also unknown) which is why I did this cleanup work.
Here is how I see the current comparison between two approaches:
* Script as advantage in that it performs C++ checks as well as C
* Script also allows passing arbitrary additional C flags into checks for higher levels of compliance, but I'm not sure this is something I like as I'd rather have standardisation here across all headers than have some headers more pedantic-friendly than others.
* Main downside of the script is that is works off directories rather than a list of files, which means it requires maintenance of the exception list in the script, rather than in the build definition files where we call out the headers to be installed
Quoted 4 lines
I'm honestly fine either way on this (as with directory where implementation lives) - main thing is to have the checking done, rather than ignored.
And I (obviously) forgot to mention that the existing script is not currently integrated into existing build or build-test scripts. I haven't looked into how complex this would be, but it would require investigation time.
Re: [dpdk-dev] [PATCH v2 16/19] app/chkincs: add chkincs app to verify headers
Quoted 65 lines · Bruce Richardson
Quoted 64 lines · Bruce Richardson
Quoted 39 lines · Thomas Monjalon
15/01/2021 12:59, Bruce Richardson:
Quoted 38 lines · Ferruh Yigit
Quoted 19 lines · Bruce Richardson
Quoted 18 lines
To verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
The list of headers to check is based of the "headers" value returned from each library's meson.build file. However, since not all headers are for direct inclusion, add a build variable "
headers_no_chkincs" to list those headers and skip checking them.Signed-off-by Bruce Richardson <[email protected]>---
v2:
* add maintainers entry
* distribute exception list among meson.build files.Quoted 8 lines
Quoted 4 lines
MAINTAINERS | 4 ++++ app/chkincs/gen_c_file_for_header.py | 12 ++++++++++ app/chkincs/main.c | 4 ++++ app/chkincs/meson.build | 28 +++++++++++++++++++++++++1 to have this kind of tool to check, but it is not an application like others in the 'app' folder, what do you think placing it under 'devtools' or 'buildtools'?
Couple of reasons why it's placed in app.
1. We previously had a "chkincs" app in DPDK which was kept in the app folder
2. It allows us to reuse the build infrastructure for building apps, rather than reduplicating it.
3. We don't have any compilable code currently in the devtools folder, and even in buildtools the pmdinfogen app is going to go away.Quoted 7 lines
Quoted 2 lines
That being said, none of those reasons are major issues that can't be worked around if the consensus is to move it.
It could be easily in devtools if it was a script. By the way, we already have
devtools/check-includes.shIf your solution is better, please remove this script.I only discovered the script existed when doing the v2 of this patchset, since it showed up in some grep calls I did for exception cases. I'm not sure that either approach is necessarily better, it's just right now that the script is unused (and also unknown) which is why I did this cleanup work.
Here is how I see the current comparison between two approaches:
* Script as advantage in that it performs C++ checks as well as C
* Script also allows passing arbitrary additional C flags into checks for higher levels of compliance, but I'm not sure this is something I like as I'd rather have standardisation here across all headers than have some headers more pedantic-friendly than others.
* Main downside of the script is that is works off directories rather than a list of files, which means it requires maintenance of the exception list in the script, rather than in the build definition files where we call out the headers to be installed
Quoted 7 lines
Quoted 4 lines
I'm honestly fine either way on this (as with directory where implementation lives) - main thing is to have the checking done, rather than ignored.
And I (obviously) forgot to mention that the existing script is not currently integrated into existing build or build-test scripts. I haven't looked into how complex this would be, but it would require investigation time.
I do plan to look into re-using the script and other options around this area - hopefully in RC2 timeframe. However, to make the patchset rework a little easier, perhaps the small header fixes could be picked up for ahead of any rework?
/Bruce
Re: [dpdk-dev] [PATCH v2 16/19] app/chkincs: add chkincs app to verify headers
Quoted 7 lines · Bruce Richardson
Quoted 6 lines · Bruce Richardson
Quoted 5 lines · Bruce Richardson
On Fri, Jan 15, 2021 at 03:09:25PM +0100, Thomas Monjalon wrote:
I'm honestly fine either way on this (as with directory where implementation lives) - main thing is to have the checking done, rather than ignored.
Quoted 8 lines
Quoted 3 lines
And I (obviously) forgot to mention that the existing script is not currently integrated into existing build or build-test scripts. I haven't looked into how complex this would be, but it would require investigation time.
I do plan to look into re-using the script and other options around this area - hopefully in RC2 timeframe. However, to make the patchset rework a little easier, perhaps the small header fixes could be picked up for ahead of any rework?
I'll merge those fixes hopefully tomorrow.
Signature · 1 line
David Marchand
PATCH v2 17/19 eal: add missing include to mcslock
In reply to Bruce RichardsonInclude 'rte_branch_prediction.h' to get the likely/unlikely macro definitions.
--- lib/librte_eal/include/generic/rte_mcslock.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_eal/include/generic/rte_mcslock.h +1 -0
@@ -22,6 +22,7 @@#include <rte_lcore.h> #include <rte_common.h> #include <rte_pause.h> +#include <rte_branch_prediction.h> /** * The rte_mcslock_t type.
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v2 17/19] eal: add missing include to mcslock
<snip>
Quoted 7 lines
Include '
rte_branch_prediction.h' to get the likely/unlikely macro definitions.Fixes 2173f3333b61 ("mcslock: add MCS queued lock implementation")Signed-off-by Bruce Richardson <[email protected]>
Quoted 19 lines
--- lib/librte_eal/include/generic/rte_mcslock.h | 1 + 1 file changed, 1 insertion(+)lib/librte_eal/include/generic/rte_mcslock.h +1
-1@@ -22,6 +22,7 @@#include <rte_lcore.h> #include <rte_common.h> #include <rte_pause.h> +#include <rte_branch_prediction.h> /** * The rte_mcslock_t type. -- 2.27.0
PATCH v2 18/19 eal/x86: add architecture-specific headers to chkincs
In reply to Bruce RichardsonEnsure the architecture-specific header files for x86 have all necessary includes in them.
--- lib/librte_eal/x86/include/meson.build | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
lib/librte_eal/x86/include/meson.build +9 -5
@@ -2,11 +2,7 @@ # Copyright(c) 2017 Intel Corporation arch_headers = files( - 'rte_atomic_32.h', - 'rte_atomic_64.h', 'rte_atomic.h', - 'rte_byteorder_32.h', - 'rte_byteorder_64.h', 'rte_byteorder.h', 'rte_cpuflags.h', 'rte_cycles.h',
@@ -22,4 +18,12 @@ arch_headers = files( 'rte_ticketlock.h', 'rte_vect.h', ) -install_headers(arch_headers, subdir: get_option('include_subdir_arch')) +arch_headers_no_chkincs = files( + 'rte_atomic_32.h', + 'rte_atomic_64.h', + 'rte_byteorder_32.h', + 'rte_byteorder_64.h', +) +install_headers(arch_headers + arch_headers_no_chkincs, + subdir: get_option('include_subdir_arch')) +dpdk_chkinc_headers += arch_headers
Signature · 1 line
2.27.0
PATCH v2 19/19 test-meson-builds: add includes check to default x86 build
In reply to Bruce RichardsonSince the includes check is disabled by default, we need to explicitly enable it to have it run. To minimise any extra build time when running the test-meson-builds script, we just add it to the default x86 build.
--- devtools/test-meson-builds.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/test-meson-builds.sh +1 -1
@@ -220,7 +220,7 @@ default_machine='nehalem' if ! check_cc_flags "-march=$default_machine" ; then default_machine='corei7' fi -build build-x86-default cc -Dlibdir=lib -Dmachine=$default_machine $use_shared +build build-x86-default cc -Dlibdir=lib -Dmachine=$default_machine -Dtest_includes=true $use_shared # 32-bit with default compiler if check_cc_flags '-m32' ; then
Signature · 1 line
2.27.0
Quoted 27 lines · Bruce Richardson
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_ttypes 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.
Quoted 7 lines
V2:
* Add maintainers file entry for new app
* Drop patch for c11 ring header
* Use build variable "headers_no_chkincs" for tracking exceptionsBruce Richardson (19):
eal: fix missing header inclusion
I split this as two patches since the rte_thread.h only applies to 21.02.
Quoted 2 lines
telemetry: fix missing header include
ethdev: fix missing header include
Patch 3 seems unnecessary, we skip rte_eth_ctrl.h validation later but I took it anyway.
Quoted 2 lines
net: fix missing header include
mbuf: fix missing header include
Is rte_byteorder.h inclusion in rte_mbuf.h still necessary?
Quoted 10 lines
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
Reviewed and applied patches 1-15, thanks Bruce.
Signature · 1 line
David Marchand
Quoted 43 lines · David Marchand
Quoted 27 lines · Bruce Richardson
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_ttypes 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.
Quoted 7 lines
V2:
* Add maintainers file entry for new app
* Drop patch for c11 ring header
* Use build variable "headers_no_chkincs" for tracking exceptionsBruce Richardson (19):
eal: fix missing header inclusionI split this as two patches since the
rte_thread.honly applies to 21.02.Quoted 2 lines
telemetry: fix missing header include
ethdev: fix missing header include
Quoted 8 lines
Patch 3 seems unnecessary, we skip
rte_eth_ctrl.hvalidation later but I took it anyway.Quoted 2 lines
net: fix missing header include
mbuf: fix missing header includeIs
rte_byteorder.hinclusion inrte_mbuf.hstill necessary?
Good question. The checks I was doing were only for missing headers. Checking for superfluous headers is more complicated and not something I've looked at. I know it was previously suggested to use the "include-what-you-use" tool on DPDK, if anyone wants to attempt that.
Quoted 12 lines
Quoted 11 lines
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
Quoted 2 lines
Reviewed and applied patches 1-15, thanks Bruce.
Thanks for the bits of rework, David.
21/01/2021 10:33, Bruce Richardson:
Quoted 7 lines · David Marchand
Quoted 2 lines
Is
rte_byteorder.hinclusion inrte_mbuf.hstill necessary?Good question. The checks I was doing were only for missing headers. Checking for superfluous headers is more complicated and not something I've looked at. I know it was previously suggested to use the "include-what-you-use" tool on DPDK, if anyone wants to attempt that.
I would love having an integration of include-what-you-use in our build system. I don't know whether it's trivial or difficult with meson.
Quoted 4 lines · Thomas Monjalon
21/01/2021 10:33, Bruce Richardson:
Quoted 3 lines · David Marchand
Quoted 2 lines
Is
rte_byteorder.hinclusion inrte_mbuf.hstill necessary?
Quoted 8 lines
Quoted 4 lines
Good question. The checks I was doing were only for missing headers. Checking for superfluous headers is more complicated and not something I've looked at. I know it was previously suggested to use the "include-what-you-use" tool on DPDK, if anyone wants to attempt that.
I would love having an integration of include-what-you-use in our build system. I don't know whether it's trivial or difficult with meson.
+1 to that.
I'm not familiar enough with the tool to comment on how hard or difficult it would be. I try it once a few years ago, and I don't think I managed to get it working successfully standalone, let alone as part of a build system. However, I'm sure IWYU has moved on quite a bit since then...
Quoted 4 lines · Thomas Monjalon
21/01/2021 10:33, Bruce Richardson:
Quoted 3 lines · David Marchand
Quoted 2 lines
Is
rte_byteorder.hinclusion inrte_mbuf.hstill necessary?
Quoted 8 lines
Quoted 4 lines
Good question. The checks I was doing were only for missing headers. Checking for superfluous headers is more complicated and not something I've looked at. I know it was previously suggested to use the "include-what-you-use" tool on DPDK, if anyone wants to attempt that.
I would love having an integration of include-what-you-use in our build system. I don't know whether it's trivial or difficult with meson.
Did some initial investigation here, and here are some basic instructions based on how I got it running on my Ubuntu 20.10 system. The positive is that "iwyu_tool" can run on DPDK build dirs without any extra work on our part.
1. Install iwyu from Ubuntu packaging.
2. Install clang-9 package:
* This is not a dependency of iwyu, but probably should be
* The version of clang installed *must* match that used to build iwyu [I had clang-10 installed which didn't work for this]
* If you get errors about missing standard headers e.g. stddef.h, the version mismatch is likely the issue.
3. Configure a clang build of DPDK:
* CC=clang meson <args> build-clang
4. "iwyu_tool" supports the build database format used by meson, so just
run: "iwyu_tool -p build-clang"
Be warned, this runs really slowly and produces lots of output!
Regards,
/Bruce
21/01/2021 16:15, Bruce Richardson:
Quoted 10 lines · Thomas Monjalon
Quoted 9 lines
21/01/2021 10:33, Bruce Richardson:
Quoted 7 lines · David Marchand
Quoted 2 lines
Is
rte_byteorder.hinclusion inrte_mbuf.hstill necessary?Good question. The checks I was doing were only for missing headers. Checking for superfluous headers is more complicated and not something I've looked at. I know it was previously suggested to use the "include-what-you-use" tool on DPDK, if anyone wants to attempt that.
Quoted 8 lines
Quoted 3 lines
I would love having an integration of include-what-you-use in our build system. I don't know whether it's trivial or difficult with meson.
Did some initial investigation here, and here are some basic instructions based on how I got it running on my Ubuntu 20.10 system. The positive is that "
iwyu_tool" can run on DPDK build dirs without any extra work on our part.
I had looked at it recently but didn't try thinking meson was not compatible. Thank you, it works :)
Quoted 12 lines
1. Install iwyu from Ubuntu packaging.
2. Install clang-9 package:
* This is not a dependency of iwyu, but probably should be
* The version of clang installed *must* match that used to build iwyu [I had clang-10 installed which didn't work for this]
* If you get errors about missing standard headers e.g.stddef.h, the version mismatch is likely the issue.
3. Configure a clang build of DPDK:
* CC=clang meson <args> build-clang
4. "iwyu_tool" supports the build database format used by meson, so just
run: "iwyu_tool-p build-clang"
Quoted 1 line
Be warned, this runs really slowly and produces lots of output!
We need to filter only reports of useless includes and do the cleaning...
The difficult part is that some includes may be useless on Linux but required on FreeBSD.
Quoted 35 lines · Thomas Monjalon
21/01/2021 16:15, Bruce Richardson:
Quoted 10 lines · Thomas Monjalon
Quoted 9 lines
21/01/2021 10:33, Bruce Richardson:
Quoted 7 lines · David Marchand
Quoted 2 lines
Is
rte_byteorder.hinclusion inrte_mbuf.hstill necessary?Good question. The checks I was doing were only for missing headers. Checking for superfluous headers is more complicated and not something I've looked at. I know it was previously suggested to use the "include-what-you-use" tool on DPDK, if anyone wants to attempt that.
Quoted 8 lines
Quoted 3 lines
I would love having an integration of include-what-you-use in our build system. I don't know whether it's trivial or difficult with meson.
Did some initial investigation here, and here are some basic instructions based on how I got it running on my Ubuntu 20.10 system. The positive is that "
iwyu_tool" can run on DPDK build dirs without any extra work on our part.I had looked at it recently but didn't try thinking meson was not compatible. Thank you, it works :)
Quoted 12 lines
1. Install iwyu from Ubuntu packaging.
2. Install clang-9 package:
* This is not a dependency of iwyu, but probably should be
* The version of clang installed *must* match that used to build iwyu [I had clang-10 installed which didn't work for this]
* If you get errors about missing standard headers e.g.stddef.h, the version mismatch is likely the issue.
3. Configure a clang build of DPDK:
* CC=clang meson <args> build-clang
4. "iwyu_tool" supports the build database format used by meson, so just
run: "iwyu_tool-p build-clang"
Quoted 8 lines
Quoted 1 line
Be warned, this runs really slowly and produces lots of output!
We need to filter only reports of useless includes and do the cleaning...
The difficult part is that some includes may be useless on Linux but required on FreeBSD.
And that some "useless" includes in headers are required by the corresponding C file which then needs the include added there. :-(
However, thinking a bit more after sending that email yesterday and looking at the results, I came to the same conclusion as you - we should use it to primarily remove unused headers. That will be slowed down by the need for additional fixup, but it's doable if someone has a bit of time.
/Bruce
v3 cover add checking of header includes
In reply to Bruce RichardsonAs 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. The script "check-includes.sh" could be used for this job, but it was not called out in the documentation, so many contributors may not have been aware of it's existance. It also was difficult to run from a source-code directory, as the script did not automatically allow finding of headers from one DPDK library directory to another [this was probably based on running it on a build created by the "make" build system, where all headers were in a single directory]. To attempt to have a build-system integrated replacement, this patchset adds a "chkincs" app in the buildtools directory to verify this on an ongoing basis.
This chkincs app does nothing when run, and is not installed as part of a DPDK "ninja install", 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, which was something done by the check-includes.sh script but which is missing here..
V3:
* Shrunk patchset as most header fixes already applied
* Moved chkincs from "apps" to the "buildtools" directory, which is a better location for something not for installation for end-user use.
* Added patch to drop check-includes script.
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 (4):
eal: add missing include to mcslock
build: separate out headers for include checking buildtools/chkincs: add app to verify header includes
devtools: remove check-includes script
MAINTAINERS | 5 +- buildtools/chkincs/gen_c_file_for_header.py | 12 + buildtools/chkincs/main.c | 4 + buildtools/chkincs/meson.build | 40 +++ devtools/check-includes.sh | 259 ------------------- devtools/test-meson-builds.sh | 2 +- doc/guides/contributing/coding_style.rst | 12 + lib/librte_eal/include/generic/rte_mcslock.h | 1 + lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/x86/include/meson.build | 14 +- lib/librte_ethdev/meson.build | 4 +- lib/librte_hash/meson.build | 4 +- lib/librte_ipsec/meson.build | 3 +- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_ring/meson.build | 4 +- lib/librte_stack/meson.build | 4 +- lib/librte_table/meson.build | 7 +- lib/meson.build | 3 + meson.build | 6 + meson_options.txt | 2 + 21 files changed, 112 insertions(+), 280 deletions(-) create mode 100755 buildtools/chkincs/gen_c_file_for_header.py create mode 100644 buildtools/chkincs/main.c create mode 100644 buildtools/chkincs/meson.build delete mode 100755 devtools/check-includes.sh
--
2.27.0
PATCH v3 1/4 eal: add missing include to mcslock
Include 'rte_branch_prediction.h' to get the likely/unlikely macro definitions.
--- lib/librte_eal/include/generic/rte_mcslock.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_eal/include/generic/rte_mcslock.h +1 -0
@@ -22,6 +22,7 @@#include <rte_lcore.h> #include <rte_common.h> #include <rte_pause.h> +#include <rte_branch_prediction.h> /** * The rte_mcslock_t type.
Signature · 1 line
2.27.0
PATCH v3 2/4 build: separate out headers for include checking
In reply to Bruce RichardsonFor some libraries, there may be some header files which are not for direct inclusion, but rather are to be included via other header files. To allow later checking of these files for missing includes, we separate out the indirect include files from the direct ones.
--- doc/guides/contributing/coding_style.rst | 12 ++++++++++++ lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/x86/include/meson.build | 14 +++++++++----- lib/librte_ethdev/meson.build | 4 ++-- lib/librte_hash/meson.build | 4 ++-- lib/librte_ipsec/meson.build | 3 ++- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_ring/meson.build | 4 +++- lib/librte_stack/meson.build | 4 +++- lib/librte_table/meson.build | 7 +++---- lib/meson.build | 3 +++ meson.build | 1 + meson_options.txt | 2 ++ 14 files changed, 45 insertions(+), 19 deletions(-)
doc/guides/contributing/coding_style.rst +12 -0
@@ -891,6 +891,18 @@ headers installed to $PREFIX/include when ``ninja install`` is run. As with source files, these should be specified using the meson ``files()`` function. + When ``check_includes`` build option is set to ``true``, each header file + has additional checks performed on it, for example to ensure that it is + not missing any include statements for dependent headers. + For header files which are public, but only included indirectly in + applications, these checks can be skipped by using the ``headers_no_chkincs`` + variable rather than ``headers``. + +headers_no_chkincs + **Default Value = []**. + As with ``headers`` option above, except that the files are not checked + for all needed include files as part of a DPDK build when + ``check_includes`` is set to ``true``. includes: **Default Value = []**.
lib/librte_eal/include/meson.build +1 -1
@@ -16,7 +16,6 @@ headers += files( 'rte_dev.h', 'rte_devargs.h', 'rte_eal.h', - 'rte_eal_interrupts.h', 'rte_eal_memconfig.h', 'rte_eal_trace.h', 'rte_errno.h',
@@ -49,6 +48,7 @@ headers += files( 'rte_version.h', 'rte_vfio.h', ) +headers_no_chkincs += files('rte_eal_interrupts.h') # special case install the generic headers, since they go in a subdir generic_headers = files(
lib/librte_eal/x86/include/meson.build +9 -5
@@ -2,11 +2,7 @@ # Copyright(c) 2017 Intel Corporation arch_headers = files( - 'rte_atomic_32.h', - 'rte_atomic_64.h', 'rte_atomic.h', - 'rte_byteorder_32.h', - 'rte_byteorder_64.h', 'rte_byteorder.h', 'rte_cpuflags.h', 'rte_cycles.h',
@@ -22,4 +18,12 @@ arch_headers = files( 'rte_ticketlock.h', 'rte_vect.h', ) -install_headers(arch_headers, subdir: get_option('include_subdir_arch')) +arch_headers_no_chkincs = files( + 'rte_atomic_32.h', + 'rte_atomic_64.h', + 'rte_byteorder_32.h', + 'rte_byteorder_64.h', +) +install_headers(arch_headers + arch_headers_no_chkincs, + subdir: get_option('include_subdir_arch')) +dpdk_chkinc_headers += arch_headers
lib/librte_ethdev/meson.build +2 -2
@@ -12,12 +12,10 @@ sources = files('ethdev_private.c', headers = files('rte_ethdev.h', 'rte_ethdev_driver.h', - 'rte_ethdev_core.h', 'rte_ethdev_pci.h', 'rte_ethdev_trace.h', 'rte_ethdev_trace_fp.h', 'rte_ethdev_vdev.h', - 'rte_eth_ctrl.h', 'rte_dev_info.h', 'rte_flow.h', 'rte_flow_driver.h',
@@ -25,5 +23,7 @@ headers = files('rte_ethdev.h', 'rte_mtr_driver.h', 'rte_tm.h', 'rte_tm_driver.h') +headers_no_chkincs += files('rte_eth_ctrl.h', + 'rte_ethdev_core.h') deps += ['net', 'kvargs', 'meter', 'telemetry']
lib/librte_hash/meson.build +2 -2
@@ -1,12 +1,12 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -headers = files('rte_crc_arm64.h', - 'rte_fbk_hash.h', +headers = files('rte_fbk_hash.h', 'rte_hash_crc.h', 'rte_hash.h', 'rte_jhash.h', 'rte_thash.h') +headers_no_chkincs += files('rte_crc_arm64.h') sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c') deps += ['ring']
lib/librte_ipsec/meson.build +2 -1
@@ -3,6 +3,7 @@ sources = files('esp_inb.c', 'esp_outb.c', 'sa.c', 'ses.c', 'ipsec_sad.c') -headers = files('rte_ipsec.h', 'rte_ipsec_group.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h') +headers = files('rte_ipsec.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h') +headers_no_chkincs += files('rte_ipsec_group.h') deps += ['mbuf', 'net', 'cryptodev', 'security', 'hash']
lib/librte_lpm/meson.build +1 -1
@@ -5,6 +5,6 @@ sources = files('rte_lpm.c', 'rte_lpm6.c') headers = files('rte_lpm.h', 'rte_lpm6.h') # since header files have different names, we can install all vector headers # without worrying about which architecture we actually need -headers += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h') +headers_no_chkincs += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h') deps += ['hash'] deps += ['rcu']
lib/librte_regexdev/meson.build +1 -1
@@ -3,6 +3,6 @@ sources = files('rte_regexdev.c') headers = files('rte_regexdev.h', - 'rte_regexdev_core.h', 'rte_regexdev_driver.h') +headers_no_chkincs += files('rte_regexdev_core.h') deps += ['mbuf']
lib/librte_ring/meson.build +3 -1
@@ -2,7 +2,9 @@ # Copyright(c) 2017 Intel Corporation sources = files('rte_ring.c') -headers = files('rte_ring.h', +headers = files('rte_ring.h') +# most sub-headers are not for direct inclusion +headers_no_chkincs += files ( 'rte_ring_core.h', 'rte_ring_elem.h', 'rte_ring_c11_mem.h',
lib/librte_stack/meson.build +3 -1
@@ -2,7 +2,9 @@ # Copyright(c) 2019 Intel Corporation sources = files('rte_stack.c', 'rte_stack_std.c', 'rte_stack_lf.c') -headers = files('rte_stack.h', +headers = files('rte_stack.h') +# subheaders, not for direct inclusion by apps +headers_no_chkincs += files( 'rte_stack_std.h', 'rte_stack_lf.h', 'rte_stack_lf_generic.h',
lib/librte_table/meson.build +3 -4
@@ -20,7 +20,6 @@ headers = files('rte_table.h', 'rte_table_hash.h', 'rte_table_hash_cuckoo.h', 'rte_table_hash_func.h', - 'rte_table_hash_func_arm64.h', 'rte_lru.h', 'rte_table_array.h', 'rte_table_stub.h',
@@ -28,6 +27,6 @@ headers = files('rte_table.h', 'rte_swx_table_em.h',) deps += ['mbuf', 'port', 'lpm', 'hash', 'acl'] -if arch_subdir == 'x86' - headers += files('rte_lru_x86.h') -endif +headers_no_chkincs += files('rte_lru_x86.h', + 'rte_lru_arm64.h', + 'rte_table_hash_func_arm64.h')
lib/meson.build +3 -0
@@ -66,6 +66,7 @@ foreach l:libraries use_function_versioning = false sources = [] headers = [] + headers_no_chkincs = [] # public headers not directly included by apps includes = [] cflags = default_cflags objs = [] # other object files to link against, used e.g. for
@@ -103,6 +104,8 @@ foreach l:libraries enabled_libs += name dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1) install_headers(headers) + install_headers(headers_no_chkincs) + dpdk_chkinc_headers += headers libname = 'rte_' + name includes += include_directories(dir_name)
meson.build +1 -0
@@ -16,6 +16,7 @@ cc = meson.get_compiler('c') dpdk_conf = configuration_data() dpdk_libraries = [] dpdk_static_libraries = [] +dpdk_chkinc_headers = [] dpdk_driver_classes = [] dpdk_drivers = [] dpdk_extra_ldflags = []
meson_options.txt +2 -0
@@ -1,5 +1,7 @@ # Please keep these options sorted alphabetically. +option('check_includes', type: 'boolean', value: false, + description: 'build "chkincs" to verify each header file can compile alone') option('disable_drivers', type: 'string', value: '', description: 'Comma-separated list of drivers to explicitly disable.') option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
Signature · 1 line
2.27.0
PATCH v3 3/4 buildtools/chkincs: add app to verify header includes
In reply to Bruce RichardsonTo verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
To ensure ongoing compliance, we enable this build test as part of the default x86 build in "test-meson-builds.sh".
--- MAINTAINERS | 4 +++ buildtools/chkincs/gen_c_file_for_header.py | 12 +++++++ buildtools/chkincs/main.c | 4 +++ buildtools/chkincs/meson.build | 40 +++++++++++++++++++++ devtools/test-meson-builds.sh | 2 +- meson.build | 5 +++ 6 files changed, 66 insertions(+), 1 deletion(-) create mode 100755 buildtools/chkincs/gen_c_file_for_header.py create mode 100644 buildtools/chkincs/main.c create mode 100644 buildtools/chkincs/meson.build
MAINTAINERS +4 -0
@@ -1560,6 +1560,10 @@ F: app/test/test_resource.c F: app/test/virtual_pmd.c F: app/test/virtual_pmd.h +Header build sanity checking +M: Bruce Richardson <[email protected]> +F: buildtools/chkincs/ + Sample packet helper functions for unit test M: Reshma Pattan <[email protected]> F: app/test/sample_packet_forward.c
buildtools/chkincs/gen_c_file_for_header.py new file +12 -0
@@ -0,0 +1,12 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2021 Intel Corporation + +from sys import argv +from os.path import abspath + +(h_file, c_file) = argv[1:] + +contents = '#include "' + abspath(h_file) + '"' +with open(c_file, 'w') as cf: + cf.write(contents)
buildtools/chkincs/main.c new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2021 Intel Corporation +*/ +int main (void ) {return 0 ; }
buildtools/chkincs/meson.build new file +40 -0
@@ -0,0 +1,40 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2021 Intel Corporation + +if not get_option('check_includes') + build = false + subdir_done() +endif + +if is_windows + # for windows, the shebang line in the script won't work. + error('option "check_includes" is not supported on windows') +endif + +gen_c_file_for_header = find_program('gen_c_file_for_header.py') +gen_c_files = generator(gen_c_file_for_header, + output: '@[email protected]', + arguments: ['@INPUT@', '@OUTPUT@']) + +cflags = machine_args +cflags += '-Wno-unused-function' # needed if we include generic headers +cflags += '-DALLOW_EXPERIMENTAL_API' + +# some ethdev headers depend on bus headers +includes = include_directories('../../drivers/bus/pci', + '../../drivers/bus/vdev') + +sources = files('main.c') +sources += gen_c_files.process(dpdk_chkinc_headers) + +deps = [] +foreach l:enabled_libs + deps += get_variable('static_rte_' + l) +endforeach + +executable('chkincs', sources, + c_args: cflags, + include_directories: includes, + dependencies: deps, + link_whole: dpdk_static_libraries + dpdk_drivers, + install: false)
devtools/test-meson-builds.sh +1 -1
@@ -227,7 +227,7 @@ default_machine='nehalem' if ! check_cc_flags "-march=$default_machine" ; then default_machine='corei7' fi -build build-x86-default cc skipABI \ +build build-x86-default cc skipABI -Dcheck_includes=true\ -Dlibdir=lib -Dmachine=$default_machine $use_shared # 32-bit with default compiler
meson.build +5 -0
@@ -69,6 +69,11 @@ if get_option('enable_kmods') subdir('kernel') endif +# check header includes if requested +if get_option('check_includes') + subdir('buildtools/chkincs') +endif + # write the build config build_cfg = 'rte_build_config.h' configure_file(output: build_cfg,
Signature · 1 line
2.27.0
PATCH v3 4/4 devtools: remove check-includes script
In reply to Bruce RichardsonThe check-includes script allowed checking header files in a given directory to ensure that each header compiled alone without requiring any other header inclusions.
With header checking now being done by the chkincs app in the build system this script can be removed.
--- MAINTAINERS | 1 - devtools/check-includes.sh | 259 ------------------------------------- 2 files changed, 260 deletions(-) delete mode 100755 devtools/check-includes.sh
MAINTAINERS +0 -1
@@ -81,7 +81,6 @@ F: devtools/check-dup-includes.sh F: devtools/check-maintainers.sh F: devtools/check-forbidden-tokens.awk F: devtools/check-git-log.sh -F: devtools/check-includes.sh F: devtools/check-spdx-tag.sh F: devtools/check-symbol-maps.sh F: devtools/checkpatches.sh
devtools/check-includes.sh deleted +0 -259
259 lines not on this page · raw message
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v3 0/4] add checking of header includes
In reply to Bruce RichardsonQuoted 71 lines · Bruce Richardson
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_ttypes 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. The script "
check-includes.sh" could be used for this job, but it was not called out in the documentation, so many contributors may not have been aware of it's existance. It also was difficult to run from a source-code directory, as the script did not automatically allow finding of headers from one DPDK library directory to another [this was probably based on running it on a build created by the "make" build system, where all headers were in a single directory]. To attempt to have a build-system integrated replacement, this patchset adds a "chkincs" app in the buildtools directory to verify this on an ongoing basis.This chkincs app does nothing when run, and is not installed as part of a DPDK "ninja install", 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, which was something done by the
check-includes.shscript but which is missing here..V3:
* Shrunk patchset as most header fixes already applied
* Moved chkincs from "apps" to the "buildtools" directory, which is a better location for something not for installation for end-user use.
* Added patch to drop check-includes script.V2:
* Add maintainers file entry for new app
* Drop patch for c11 ring header
* Use build variable "headers_no_chkincs" for tracking exceptionsBruce Richardson (4):
eal: add missing include to mcslock
build: separate out headers for include checking buildtools/chkincs: add app to verify header includes
devtools: remove check-includes scriptMAINTAINERS | 5 +- buildtools/chkincs/gen_c_file_for_header.py | 12 + buildtools/chkincs/main.c | 4 + buildtools/chkincs/meson.build | 40 +++ devtools/check-includes.sh | 259 ------------------- devtools/test-meson-builds.sh | 2 +- doc/guides/contributing/coding_style.rst | 12 + lib/librte_eal/include/generic/rte_mcslock.h | 1 + lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/x86/include/meson.build | 14 +- lib/librte_ethdev/meson.build | 4 +- lib/librte_hash/meson.build | 4 +- lib/librte_ipsec/meson.build | 3 +- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_ring/meson.build | 4 +- lib/librte_stack/meson.build | 4 +- lib/librte_table/meson.build | 7 +-
Quoted 8 lines
lib/meson.build | 3 + meson.build | 6 + meson_options.txt | 2 + 21 files changed, 112 insertions(+), 280 deletions(-) create mode 100755 buildtools/chkincs/gen_c_file_for_header.py create mode 100644 buildtools/chkincs/main.c create mode 100644 buildtools/chkincs/meson.build delete mode 100755 devtools/check-includes.sh
- clang is not happy when enabling the check:
$ meson configure $HOME/builds/build-clang-static -Dcheck_includes=true
$ devtools/test-meson-builds.sh
...
[362/464] Compiling C object
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o
FAILED: buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o
clang -Ibuildtools/chkincs/chkincs.p -Ibuildtools/chkincs
-I../../dpdk/buildtools/chkincs -Idrivers/bus/pci
-I../../dpdk/drivers/bus/pci -Idrivers/bus/vdev
-I../../dpdk/drivers/bus/vdev -I. -I../../dpdk -Iconfig
-I../../dpdk/config -Ilib/librte_eal/include
-I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include
-I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include
-I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_kvargs
-I../../dpdk/lib/librte_kvargs -Ilib/librte_metrics
-I../../dpdk/lib/librte_metrics -Ilib/librte_telemetry
-I../../dpdk/lib/librte_telemetry -Ilib/librte_eal/common
-I../../dpdk/lib/librte_eal/common -Ilib/librte_eal
-I../../dpdk/lib/librte_eal -Ilib/librte_ring
-I../../dpdk/lib/librte_ring -Ilib/librte_rcu
-I../../dpdk/lib/librte_rcu -Ilib/librte_mempool
-I../../dpdk/lib/librte_mempool -Ilib/librte_mbuf
-I../../dpdk/lib/librte_mbuf -Ilib/librte_net
-I../../dpdk/lib/librte_net -Ilib/librte_meter
-I../../dpdk/lib/librte_meter -Ilib/librte_ethdev
-I../../dpdk/lib/librte_ethdev -Ilib/librte_pci
-I../../dpdk/lib/librte_pci -Ilib/librte_cmdline
-I../../dpdk/lib/librte_cmdline -Ilib/librte_hash
-I../../dpdk/lib/librte_hash -Ilib/librte_timer
-I../../dpdk/lib/librte_timer -Ilib/librte_acl
-I../../dpdk/lib/librte_acl -Ilib/librte_bbdev
-I../../dpdk/lib/librte_bbdev -Ilib/librte_bitratestats
-I../../dpdk/lib/librte_bitratestats -Ilib/librte_cfgfile
-I../../dpdk/lib/librte_cfgfile -Ilib/librte_compressdev
-I../../dpdk/lib/librte_compressdev -Ilib/librte_cryptodev
-I../../dpdk/lib/librte_cryptodev -Ilib/librte_distributor
-I../../dpdk/lib/librte_distributor -Ilib/librte_efd
-I../../dpdk/lib/librte_efd -Ilib/librte_eventdev
-I../../dpdk/lib/librte_eventdev -Ilib/librte_gro
-I../../dpdk/lib/librte_gro -Ilib/librte_gso
-I../../dpdk/lib/librte_gso -Ilib/librte_ip_frag
-I../../dpdk/lib/librte_ip_frag -Ilib/librte_jobstats
-I../../dpdk/lib/librte_jobstats -Ilib/librte_kni
-I../../dpdk/lib/librte_kni -Ilib/librte_latencystats
-I../../dpdk/lib/librte_latencystats -Ilib/librte_lpm
-I../../dpdk/lib/librte_lpm -Ilib/librte_member
-I../../dpdk/lib/librte_member -Ilib/librte_power
-I../../dpdk/lib/librte_power -Ilib/librte_pdump
-I../../dpdk/lib/librte_pdump -Ilib/librte_rawdev
-I../../dpdk/lib/librte_rawdev -Ilib/librte_regexdev
-I../../dpdk/lib/librte_regexdev -Ilib/librte_rib
-I../../dpdk/lib/librte_rib -Ilib/librte_reorder
-I../../dpdk/lib/librte_reorder -Ilib/librte_sched
-I../../dpdk/lib/librte_sched -Ilib/librte_security
-I../../dpdk/lib/librte_security -Ilib/librte_stack
-I../../dpdk/lib/librte_stack -Ilib/librte_vhost
-I../../dpdk/lib/librte_vhost -Ilib/librte_ipsec
-I../../dpdk/lib/librte_ipsec -Ilib/librte_fib
-I../../dpdk/lib/librte_fib -Ilib/librte_port
-I../../dpdk/lib/librte_port -Ilib/librte_table
-I../../dpdk/lib/librte_table -Ilib/librte_pipeline
-I../../dpdk/lib/librte_pipeline -Ilib/librte_flow_classify
-I../../dpdk/lib/librte_flow_classify -Ilib/librte_bpf
-I../../dpdk/lib/librte_bpf -Ilib/librte_graph
-I../../dpdk/lib/librte_graph -Ilib/librte_node
-I../../dpdk/lib/librte_node
-I/home/dmarchan/intel-ipsec-mb/install/include -Xclang
-fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch
-Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual -Wdeprecated
-Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -Wold-style-definition
-Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef
-Wwrite-strings -Wno-address-of-packed-member
-Wno-missing-field-initializers -D_GNU_SOURCE -march=native
-Wno-unused-function -DALLOW_EXPERIMENTAL_API -MD -MQ
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o -MF
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o.d -o
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o -c
buildtools/chkincs/chkincs.p/rte_ethdev_vdev.c
In file included from buildtools/chkincs/chkincs.p/rte_ethdev_vdev.c:1:
In file included from
/home/dmarchan/dpdk/lib/librte_ethdev/rte_ethdev_vdev.h:12:
../../dpdk/lib/librte_ethdev/rte_ethdev_driver.h:964:1: error: unknown
attribute 'error' ignored [-Werror,-Wunknown-attributes]
__rte_internal
^
../../dpdk/lib/librte_eal/include/rte_compat.h:25:16: note: expanded
from macro '__rte_internal'
__attribute__((error("Symbol is not public ABI"), \
^- Other issues with ARM builds (arch-specific headers probably the reason):
$ meson configure $HOME/builds/build-arm64-bluefield -Dcheck_includes=true
$ devtools/test-meson-builds.sh
...
In file included from buildtools/chkincs/chkincs.p/rte_rib6.c:1:
/home/dmarchan/dpdk/lib/librte_rib/rte_rib6.h: In function ‘get_msk_part’:
/home/dmarchan/dpdk/lib/librte_rib/rte_rib6.h:112:10: error: implicit
declaration of function ‘RTE_MIN’; did you mean ‘INT8_MIN’?
[-Werror=implicit-function-declaration]
depth = RTE_MIN(depth, 128);
^~~~~~~
INT8_MIN
/home/dmarchan/dpdk/lib/librte_rib/rte_rib6.h:112:10: error: nested
extern declaration of ‘RTE_MIN’ [-Werror=nested-externs]
/home/dmarchan/dpdk/lib/librte_rib/rte_rib6.h:113:9: error: implicit
declaration of function ‘RTE_MAX’; did you mean ‘INT8_MAX’?
[-Werror=implicit-function-declaration]
part = RTE_MAX((int16_t)depth - (byte * 8), 0);
^~~~~~~
INT8_MAX
/home/dmarchan/dpdk/lib/librte_rib/rte_rib6.h:113:9: error: nested
extern declaration of ‘RTE_MAX’ [-Werror=nested-externs]
cc1: all warnings being treated as errors- This check should be enabled for x86 and aarch cross build in GHA.
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH v3 0/4] add checking of header includes
Quoted 200 lines · David Marchand
Quoted 71 lines · Bruce Richardson
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_ttypes 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. The script "
check-includes.sh" could be used for this job, but it was not called out in the documentation, so many contributors may not have been aware of it's existance. It also was difficult to run from a source-code directory, as the script did not automatically allow finding of headers from one DPDK library directory to another [this was probably based on running it on a build created by the "make" build system, where all headers were in a single directory]. To attempt to have a build-system integrated replacement, this patchset adds a "chkincs" app in the buildtools directory to verify this on an ongoing basis.This chkincs app does nothing when run, and is not installed as part of a DPDK "ninja install", 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, which was something done by the
check-includes.shscript but which is missing here..V3:
* Shrunk patchset as most header fixes already applied
* Moved chkincs from "apps" to the "buildtools" directory, which is a better location for something not for installation for end-user use.
* Added patch to drop check-includes script.V2:
* Add maintainers file entry for new app
* Drop patch for c11 ring header
* Use build variable "headers_no_chkincs" for tracking exceptionsBruce Richardson (4):
eal: add missing include to mcslock
build: separate out headers for include checking buildtools/chkincs: add app to verify header includes
devtools: remove check-includes scriptMAINTAINERS | 5 +- buildtools/chkincs/gen_c_file_for_header.py | 12 + buildtools/chkincs/main.c | 4 + buildtools/chkincs/meson.build | 40 +++ devtools/check-includes.sh | 259 ------------------- devtools/test-meson-builds.sh | 2 +- doc/guides/contributing/coding_style.rst | 12 + lib/librte_eal/include/generic/rte_mcslock.h | 1 + lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/x86/include/meson.build | 14 +- lib/librte_ethdev/meson.build | 4 +- lib/librte_hash/meson.build | 4 +- lib/librte_ipsec/meson.build | 3 +- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_ring/meson.build | 4 +- lib/librte_stack/meson.build | 4 +- lib/librte_table/meson.build | 7 +-Quoted 8 lines
lib/meson.build | 3 + meson.build | 6 + meson_options.txt | 2 + 21 files changed, 112 insertions(+), 280 deletions(-) create mode 100755 buildtools/chkincs/gen_c_file_for_header.py create mode 100644 buildtools/chkincs/main.c create mode 100644 buildtools/chkincs/meson.build delete mode 100755 devtools/check-includes.sh- clang is not happy when enabling the check:
$ meson configure $HOME/builds/build-clang-static -Dcheck_includes=true $ devtools/test-meson-builds.sh ... [362/464] Compiling C object buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o FAILED: buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o clang -Ibuildtools/chkincs/chkincs.p -Ibuildtools/chkincs(quoted diff) +0
-68-I../../dpdk/buildtools/chkincs -Idrivers/bus/pci -I../../dpdk/drivers/bus/pci -Idrivers/bus/vdev -I../../dpdk/drivers/bus/vdev -I. -I../../dpdk -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -Ilib/librte_metrics -I../../dpdk/lib/librte_metrics -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_ring -I../../dpdk/lib/librte_ring -Ilib/librte_rcu -I../../dpdk/lib/librte_rcu -Ilib/librte_mempool -I../../dpdk/lib/librte_mempool -Ilib/librte_mbuf -I../../dpdk/lib/librte_mbuf -Ilib/librte_net -I../../dpdk/lib/librte_net -Ilib/librte_meter -I../../dpdk/lib/librte_meter -Ilib/librte_ethdev -I../../dpdk/lib/librte_ethdev -Ilib/librte_pci -I../../dpdk/lib/librte_pci -Ilib/librte_cmdline -I../../dpdk/lib/librte_cmdline -Ilib/librte_hash -I../../dpdk/lib/librte_hash -Ilib/librte_timer -I../../dpdk/lib/librte_timer -Ilib/librte_acl -I../../dpdk/lib/librte_acl -Ilib/librte_bbdev -I../../dpdk/lib/librte_bbdev -Ilib/librte_bitratestats -I../../dpdk/lib/librte_bitratestats -Ilib/librte_cfgfile -I../../dpdk/lib/librte_cfgfile -Ilib/librte_compressdev -I../../dpdk/lib/librte_compressdev -Ilib/librte_cryptodev -I../../dpdk/lib/librte_cryptodev -Ilib/librte_distributor -I../../dpdk/lib/librte_distributor -Ilib/librte_efd -I../../dpdk/lib/librte_efd -Ilib/librte_eventdev -I../../dpdk/lib/librte_eventdev -Ilib/librte_gro -I../../dpdk/lib/librte_gro -Ilib/librte_gso -I../../dpdk/lib/librte_gso -Ilib/librte_ip_frag -I../../dpdk/lib/librte_ip_frag -Ilib/librte_jobstats -I../../dpdk/lib/librte_jobstats -Ilib/librte_kni -I../../dpdk/lib/librte_kni -Ilib/librte_latencystats -I../../dpdk/lib/librte_latencystats -Ilib/librte_lpm -I../../dpdk/lib/librte_lpm -Ilib/librte_member -I../../dpdk/lib/librte_member -Ilib/librte_power -I../../dpdk/lib/librte_power -Ilib/librte_pdump -I../../dpdk/lib/librte_pdump -Ilib/librte_rawdev -I../../dpdk/lib/librte_rawdev -Ilib/librte_regexdev -I../../dpdk/lib/librte_regexdev -Ilib/librte_rib -I../../dpdk/lib/librte_rib -Ilib/librte_reorder -I../../dpdk/lib/librte_reorder -Ilib/librte_sched -I../../dpdk/lib/librte_sched -Ilib/librte_security -I../../dpdk/lib/librte_security -Ilib/librte_stack -I../../dpdk/lib/librte_stack -Ilib/librte_vhost -I../../dpdk/lib/librte_vhost -Ilib/librte_ipsec -I../../dpdk/lib/librte_ipsec -Ilib/librte_fib -I../../dpdk/lib/librte_fib -Ilib/librte_port -I../../dpdk/lib/librte_port -Ilib/librte_table -I../../dpdk/lib/librte_table -Ilib/librte_pipeline -I../../dpdk/lib/librte_pipeline -Ilib/librte_flow_classify -I../../dpdk/lib/librte_flow_classify -Ilib/librte_bpf -I../../dpdk/lib/librte_bpf -Ilib/librte_graph -I../../dpdk/lib/librte_graph -Ilib/librte_node -I../../dpdk/lib/librte_node -I/home/dmarchan/intel-ipsec-mb/install/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-missing-field-initializers -D_GNU_SOURCE -march=native -Wno-unused-function -DALLOW_EXPERIMENTAL_API -MD -MQ
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o-MF buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o.d -obuildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o-cbuildtools/chkincs/chkincs.p/rte_ethdev_vdev.c
In file included frombuildtools/chkincs/chkincs.p/rte_ethdev_vdev.c:1:
In file included from/home/dmarchan/dpdk/lib/librte_ethdev/rte_ethdev_vdev.h:12:../../dpdk/lib/librte_ethdev/rte_ethdev_driver.h:964:1: error: unknown attribute 'error' ignored [-Werror,-Wunknown-attributes]__rte_internal
^../../dpdk/lib/librte_eal/include/rte_compat.h:25:16: note: expanded from macro '__rte_internal'__attribute__((error("Symbol is not public ABI"), \ ^- Other issues with ARM builds (arch-specific headers probably the reason):
$ meson configure $HOME/builds/build-arm64-bluefield -Dcheck_includes=true $ devtools/test-meson-builds.sh ... In file included from buildtools/chkincs/chkincs.p/rte_rib6.c:1: /home/dmarchan/dpdk/lib/librte_rib/rte_rib6.h: In function ‘get_msk_part’: /home/dmarchan/dpdk/lib/librte_rib/rte_rib6.h:112:10: error: implicit declaration of function ‘RTE_MIN’; did you mean ‘INT8_MIN’? [-Werror=implicit-function-declaration] depth = RTE_MIN(depth, 128); ^~~~~~~ INT8_MIN /home/dmarchan/dpdk/lib/librte_rib/rte_rib6.h:112:10: error: nested extern declaration of ‘RTE_MIN’ [-Werror=nested-externs] /home/dmarchan/dpdk/lib/librte_rib/rte_rib6.h:113:9: error: implicit declaration of function ‘RTE_MAX’; did you mean ‘INT8_MAX’? [-Werror=implicit-function-declaration] part = RTE_MAX((int16_t)depth - (byte * 8), 0); ^~~~~~~ INT8_MAX /home/dmarchan/dpdk/lib/librte_rib/rte_rib6.h:113:9: error: nested extern declaration of ‘RTE_MAX’ [-Werror=nested-externs] cc1: all warnings being treated as errors
Quoted 2 lines
- This check should be enabled for x86 and aarch cross build in GHA.
Sure, will look into all of these.
/Bruce
Re: [dpdk-dev] [PATCH v3 0/4] add checking of header includes
In reply to David MarchandQuoted 171 lines · David Marchand
Quoted 71 lines · Bruce Richardson
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_ttypes 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. The script "
check-includes.sh" could be used for this job, but it was not called out in the documentation, so many contributors may not have been aware of it's existance. It also was difficult to run from a source-code directory, as the script did not automatically allow finding of headers from one DPDK library directory to another [this was probably based on running it on a build created by the "make" build system, where all headers were in a single directory]. To attempt to have a build-system integrated replacement, this patchset adds a "chkincs" app in the buildtools directory to verify this on an ongoing basis.This chkincs app does nothing when run, and is not installed as part of a DPDK "ninja install", 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, which was something done by the
check-includes.shscript but which is missing here..V3:
* Shrunk patchset as most header fixes already applied
* Moved chkincs from "apps" to the "buildtools" directory, which is a better location for something not for installation for end-user use.
* Added patch to drop check-includes script.V2:
* Add maintainers file entry for new app
* Drop patch for c11 ring header
* Use build variable "headers_no_chkincs" for tracking exceptionsBruce Richardson (4):
eal: add missing include to mcslock
build: separate out headers for include checking buildtools/chkincs: add app to verify header includes
devtools: remove check-includes scriptMAINTAINERS | 5 +- buildtools/chkincs/gen_c_file_for_header.py | 12 + buildtools/chkincs/main.c | 4 + buildtools/chkincs/meson.build | 40 +++ devtools/check-includes.sh | 259 ------------------- devtools/test-meson-builds.sh | 2 +- doc/guides/contributing/coding_style.rst | 12 + lib/librte_eal/include/generic/rte_mcslock.h | 1 + lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/x86/include/meson.build | 14 +- lib/librte_ethdev/meson.build | 4 +- lib/librte_hash/meson.build | 4 +- lib/librte_ipsec/meson.build | 3 +- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_ring/meson.build | 4 +- lib/librte_stack/meson.build | 4 +- lib/librte_table/meson.build | 7 +-Quoted 8 lines
lib/meson.build | 3 + meson.build | 6 + meson_options.txt | 2 + 21 files changed, 112 insertions(+), 280 deletions(-) create mode 100755 buildtools/chkincs/gen_c_file_for_header.py create mode 100644 buildtools/chkincs/main.c create mode 100644 buildtools/chkincs/meson.build delete mode 100755 devtools/check-includes.sh- clang is not happy when enabling the check:
$ meson configure $HOME/builds/build-clang-static -Dcheck_includes=true $ devtools/test-meson-builds.sh ... [362/464] Compiling C object buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o FAILED: buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o clang -Ibuildtools/chkincs/chkincs.p -Ibuildtools/chkincs(quoted diff) +0
-68-I../../dpdk/buildtools/chkincs -Idrivers/bus/pci -I../../dpdk/drivers/bus/pci -Idrivers/bus/vdev -I../../dpdk/drivers/bus/vdev -I. -I../../dpdk -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -Ilib/librte_metrics -I../../dpdk/lib/librte_metrics -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_ring -I../../dpdk/lib/librte_ring -Ilib/librte_rcu -I../../dpdk/lib/librte_rcu -Ilib/librte_mempool -I../../dpdk/lib/librte_mempool -Ilib/librte_mbuf -I../../dpdk/lib/librte_mbuf -Ilib/librte_net -I../../dpdk/lib/librte_net -Ilib/librte_meter -I../../dpdk/lib/librte_meter -Ilib/librte_ethdev -I../../dpdk/lib/librte_ethdev -Ilib/librte_pci -I../../dpdk/lib/librte_pci -Ilib/librte_cmdline -I../../dpdk/lib/librte_cmdline -Ilib/librte_hash -I../../dpdk/lib/librte_hash -Ilib/librte_timer -I../../dpdk/lib/librte_timer -Ilib/librte_acl -I../../dpdk/lib/librte_acl -Ilib/librte_bbdev -I../../dpdk/lib/librte_bbdev -Ilib/librte_bitratestats -I../../dpdk/lib/librte_bitratestats -Ilib/librte_cfgfile -I../../dpdk/lib/librte_cfgfile -Ilib/librte_compressdev -I../../dpdk/lib/librte_compressdev -Ilib/librte_cryptodev -I../../dpdk/lib/librte_cryptodev -Ilib/librte_distributor -I../../dpdk/lib/librte_distributor -Ilib/librte_efd -I../../dpdk/lib/librte_efd -Ilib/librte_eventdev -I../../dpdk/lib/librte_eventdev -Ilib/librte_gro -I../../dpdk/lib/librte_gro -Ilib/librte_gso -I../../dpdk/lib/librte_gso -Ilib/librte_ip_frag -I../../dpdk/lib/librte_ip_frag -Ilib/librte_jobstats -I../../dpdk/lib/librte_jobstats -Ilib/librte_kni -I../../dpdk/lib/librte_kni -Ilib/librte_latencystats -I../../dpdk/lib/librte_latencystats -Ilib/librte_lpm -I../../dpdk/lib/librte_lpm -Ilib/librte_member -I../../dpdk/lib/librte_member -Ilib/librte_power -I../../dpdk/lib/librte_power -Ilib/librte_pdump -I../../dpdk/lib/librte_pdump -Ilib/librte_rawdev -I../../dpdk/lib/librte_rawdev -Ilib/librte_regexdev -I../../dpdk/lib/librte_regexdev -Ilib/librte_rib -I../../dpdk/lib/librte_rib -Ilib/librte_reorder -I../../dpdk/lib/librte_reorder -Ilib/librte_sched -I../../dpdk/lib/librte_sched -Ilib/librte_security -I../../dpdk/lib/librte_security -Ilib/librte_stack -I../../dpdk/lib/librte_stack -Ilib/librte_vhost -I../../dpdk/lib/librte_vhost -Ilib/librte_ipsec -I../../dpdk/lib/librte_ipsec -Ilib/librte_fib -I../../dpdk/lib/librte_fib -Ilib/librte_port -I../../dpdk/lib/librte_port -Ilib/librte_table -I../../dpdk/lib/librte_table -Ilib/librte_pipeline -I../../dpdk/lib/librte_pipeline -Ilib/librte_flow_classify -I../../dpdk/lib/librte_flow_classify -Ilib/librte_bpf -I../../dpdk/lib/librte_bpf -Ilib/librte_graph -I../../dpdk/lib/librte_graph -Ilib/librte_node -I../../dpdk/lib/librte_node -I/home/dmarchan/intel-ipsec-mb/install/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-missing-field-initializers -D_GNU_SOURCE -march=native -Wno-unused-function -DALLOW_EXPERIMENTAL_API -MD -MQ
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o-MF buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o.d -obuildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o-cbuildtools/chkincs/chkincs.p/rte_ethdev_vdev.c
In file included frombuildtools/chkincs/chkincs.p/rte_ethdev_vdev.c:1:
In file included from/home/dmarchan/dpdk/lib/librte_ethdev/rte_ethdev_vdev.h:12:../../dpdk/lib/librte_ethdev/rte_ethdev_driver.h:964:1: error: unknown attribute 'error' ignored [-Werror,-Wunknown-attributes]__rte_internal
^../../dpdk/lib/librte_eal/include/rte_compat.h:25:16: note: expanded from macro '__rte_internal'
Quoted 3 lines
__attribute__((error("Symbol is not public ABI"), \
^This looks to be a real issue with our header file - clang does not have an "error" attribute. The closest equivalent I can see is "diagnose_if". Therefore, I'd suggest we need to change compat.h to be something like:
#if !defined ALLOW_INTERNAL_API && __has_attribute(error) /* For GCC */
#define __rte_internal \
__attribute__((error("Symbol is not public ABI"), \
section(".text.internal")))
#elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* For clang */
#define __rte_internal \
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
section(".text.internal")))
#else
#define __rte_internal \
__attribute__((section(".text.internal")))
#endifAny thoughts or suggestions for better alternatives here?
/Bruce
Re: [dpdk-dev] [PATCH v3 0/4] add checking of header includes
Quoted 171 lines · Bruce Richardson
Quoted 169 lines · David Marchand
Quoted 71 lines · Bruce Richardson
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_ttypes 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. The script "
check-includes.sh" could be used for this job, but it was not called out in the documentation, so many contributors may not have been aware of it's existance. It also was difficult to run from a source-code directory, as the script did not automatically allow finding of headers from one DPDK library directory to another [this was probably based on running it on a build created by the "make" build system, where all headers were in a single directory]. To attempt to have a build-system integrated replacement, this patchset adds a "chkincs" app in the buildtools directory to verify this on an ongoing basis.This chkincs app does nothing when run, and is not installed as part of a DPDK "ninja install", 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, which was something done by the
check-includes.shscript but which is missing here..V3:
* Shrunk patchset as most header fixes already applied
* Moved chkincs from "apps" to the "buildtools" directory, which is a better location for something not for installation for end-user use.
* Added patch to drop check-includes script.V2:
* Add maintainers file entry for new app
* Drop patch for c11 ring header
* Use build variable "headers_no_chkincs" for tracking exceptionsBruce Richardson (4):
eal: add missing include to mcslock
build: separate out headers for include checking buildtools/chkincs: add app to verify header includes
devtools: remove check-includes scriptMAINTAINERS | 5 +- buildtools/chkincs/gen_c_file_for_header.py | 12 + buildtools/chkincs/main.c | 4 + buildtools/chkincs/meson.build | 40 +++ devtools/check-includes.sh | 259 ------------------- devtools/test-meson-builds.sh | 2 +- doc/guides/contributing/coding_style.rst | 12 + lib/librte_eal/include/generic/rte_mcslock.h | 1 + lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/x86/include/meson.build | 14 +- lib/librte_ethdev/meson.build | 4 +- lib/librte_hash/meson.build | 4 +- lib/librte_ipsec/meson.build | 3 +- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_ring/meson.build | 4 +- lib/librte_stack/meson.build | 4 +- lib/librte_table/meson.build | 7 +-Quoted 8 lines
lib/meson.build | 3 + meson.build | 6 + meson_options.txt | 2 + 21 files changed, 112 insertions(+), 280 deletions(-) create mode 100755 buildtools/chkincs/gen_c_file_for_header.py create mode 100644 buildtools/chkincs/main.c create mode 100644 buildtools/chkincs/meson.build delete mode 100755 devtools/check-includes.sh- clang is not happy when enabling the check:
$ meson configure $HOME/builds/build-clang-static -Dcheck_includes=true $ devtools/test-meson-builds.sh ... [362/464] Compiling C object buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o FAILED: buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o clang -Ibuildtools/chkincs/chkincs.p -Ibuildtools/chkincs(quoted diff) +0
-68-I../../dpdk/buildtools/chkincs -Idrivers/bus/pci -I../../dpdk/drivers/bus/pci -Idrivers/bus/vdev -I../../dpdk/drivers/bus/vdev -I. -I../../dpdk -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -Ilib/librte_metrics -I../../dpdk/lib/librte_metrics -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_ring -I../../dpdk/lib/librte_ring -Ilib/librte_rcu -I../../dpdk/lib/librte_rcu -Ilib/librte_mempool -I../../dpdk/lib/librte_mempool -Ilib/librte_mbuf -I../../dpdk/lib/librte_mbuf -Ilib/librte_net -I../../dpdk/lib/librte_net -Ilib/librte_meter -I../../dpdk/lib/librte_meter -Ilib/librte_ethdev -I../../dpdk/lib/librte_ethdev -Ilib/librte_pci -I../../dpdk/lib/librte_pci -Ilib/librte_cmdline -I../../dpdk/lib/librte_cmdline -Ilib/librte_hash -I../../dpdk/lib/librte_hash -Ilib/librte_timer -I../../dpdk/lib/librte_timer -Ilib/librte_acl -I../../dpdk/lib/librte_acl -Ilib/librte_bbdev -I../../dpdk/lib/librte_bbdev -Ilib/librte_bitratestats -I../../dpdk/lib/librte_bitratestats -Ilib/librte_cfgfile -I../../dpdk/lib/librte_cfgfile -Ilib/librte_compressdev -I../../dpdk/lib/librte_compressdev -Ilib/librte_cryptodev -I../../dpdk/lib/librte_cryptodev -Ilib/librte_distributor -I../../dpdk/lib/librte_distributor -Ilib/librte_efd -I../../dpdk/lib/librte_efd -Ilib/librte_eventdev -I../../dpdk/lib/librte_eventdev -Ilib/librte_gro -I../../dpdk/lib/librte_gro -Ilib/librte_gso -I../../dpdk/lib/librte_gso -Ilib/librte_ip_frag -I../../dpdk/lib/librte_ip_frag -Ilib/librte_jobstats -I../../dpdk/lib/librte_jobstats -Ilib/librte_kni -I../../dpdk/lib/librte_kni -Ilib/librte_latencystats -I../../dpdk/lib/librte_latencystats -Ilib/librte_lpm -I../../dpdk/lib/librte_lpm -Ilib/librte_member -I../../dpdk/lib/librte_member -Ilib/librte_power -I../../dpdk/lib/librte_power -Ilib/librte_pdump -I../../dpdk/lib/librte_pdump -Ilib/librte_rawdev -I../../dpdk/lib/librte_rawdev -Ilib/librte_regexdev -I../../dpdk/lib/librte_regexdev -Ilib/librte_rib -I../../dpdk/lib/librte_rib -Ilib/librte_reorder -I../../dpdk/lib/librte_reorder -Ilib/librte_sched -I../../dpdk/lib/librte_sched -Ilib/librte_security -I../../dpdk/lib/librte_security -Ilib/librte_stack -I../../dpdk/lib/librte_stack -Ilib/librte_vhost -I../../dpdk/lib/librte_vhost -Ilib/librte_ipsec -I../../dpdk/lib/librte_ipsec -Ilib/librte_fib -I../../dpdk/lib/librte_fib -Ilib/librte_port -I../../dpdk/lib/librte_port -Ilib/librte_table -I../../dpdk/lib/librte_table -Ilib/librte_pipeline -I../../dpdk/lib/librte_pipeline -Ilib/librte_flow_classify -I../../dpdk/lib/librte_flow_classify -Ilib/librte_bpf -I../../dpdk/lib/librte_bpf -Ilib/librte_graph -I../../dpdk/lib/librte_graph -Ilib/librte_node -I../../dpdk/lib/librte_node -I/home/dmarchan/intel-ipsec-mb/install/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-missing-field-initializers -D_GNU_SOURCE -march=native -Wno-unused-function -DALLOW_EXPERIMENTAL_API -MD -MQ
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o-MF buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o.d -obuildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o-cbuildtools/chkincs/chkincs.p/rte_ethdev_vdev.c
In file included frombuildtools/chkincs/chkincs.p/rte_ethdev_vdev.c:1:
In file included from/home/dmarchan/dpdk/lib/librte_ethdev/rte_ethdev_vdev.h:12:../../dpdk/lib/librte_ethdev/rte_ethdev_driver.h:964:1: error: unknown attribute 'error' ignored [-Werror,-Wunknown-attributes]__rte_internal
^
Quoted 8 lines
Quoted 5 lines
../../dpdk/lib/librte_eal/include/rte_compat.h:25:16: note: expanded from macro '__rte_internal'__attribute__((error("Symbol is not public ABI"), \ ^This looks to be a real issue with our header file - clang does not have an "error" attribute. The closest equivalent I can see is "
diagnose_if".
Indeed, it does trigger a build error, so it works as expected ;-).
On the header check itself, even if we find a way to properly tag those symbols with the macro in rte_compat.h, the next issue is that clang complains about such marked symbols without the ALLOW_INTERNAL_API build flag.
FAILED: buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.o clang -Ibuildtools/chkincs/chkincs.p -Ibuildtools/chkincs -I../../dpdk/buildtools/chkincs -Idrivers/bus/pci -I../../dpdk/drivers/bus/pci -Idrivers/bus/vdev -I../../dpdk/drivers/bus/vdev -I. -I../../dpdk -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -Ilib/librte_metrics -I../../dpdk/lib/librte_metrics -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_ring -I../../dpdk/lib/librte_ring -Ilib/librte_rcu -I../../dpdk/lib/librte_rcu -Ilib/librte_mempool -I../../dpdk/lib/librte_mempool -Ilib/librte_mbuf -I../../dpdk/lib/librte_mbuf -Ilib/librte_net -I../../dpdk/lib/librte_net -Ilib/librte_meter -I../../dpdk/lib/librte_meter -Ilib/librte_ethdev -I../../dpdk/lib/librte_ethdev -Ilib/librte_pci -I../../dpdk/lib/librte_pci -Ilib/librte_cmdline -I../../dpdk/lib/librte_cmdline -Ilib/librte_hash -I../../dpdk/lib/librte_hash -Ilib/librte_timer -I../../dpdk/lib/librte_timer -Ilib/librte_acl -I../../dpdk/lib/librte_acl -Ilib/librte_bbdev -I../../dpdk/lib/librte_bbdev -Ilib/librte_bitratestats -I../../dpdk/lib/librte_bitratestats -Ilib/librte_cfgfile -I../../dpdk/lib/librte_cfgfile -Ilib/librte_compressdev -I../../dpdk/lib/librte_compressdev -Ilib/librte_cryptodev -I../../dpdk/lib/librte_cryptodev -Ilib/librte_distributor -I../../dpdk/lib/librte_distributor -Ilib/librte_efd -I../../dpdk/lib/librte_efd -Ilib/librte_eventdev -I../../dpdk/lib/librte_eventdev -Ilib/librte_gro -I../../dpdk/lib/librte_gro -Ilib/librte_gso -I../../dpdk/lib/librte_gso -Ilib/librte_ip_frag -I../../dpdk/lib/librte_ip_frag -Ilib/librte_jobstats -I../../dpdk/lib/librte_jobstats -Ilib/librte_kni -I../../dpdk/lib/librte_kni -Ilib/librte_latencystats -I../../dpdk/lib/librte_latencystats -Ilib/librte_lpm -I../../dpdk/lib/librte_lpm -Ilib/librte_member -I../../dpdk/lib/librte_member -Ilib/librte_power -I../../dpdk/lib/librte_power -Ilib/librte_pdump -I../../dpdk/lib/librte_pdump -Ilib/librte_rawdev -I../../dpdk/lib/librte_rawdev -Ilib/librte_regexdev -I../../dpdk/lib/librte_regexdev -Ilib/librte_rib -I../../dpdk/lib/librte_rib -Ilib/librte_reorder -I../../dpdk/lib/librte_reorder -Ilib/librte_sched -I../../dpdk/lib/librte_sched -Ilib/librte_security -I../../dpdk/lib/librte_security -Ilib/librte_stack -I../../dpdk/lib/librte_stack -Ilib/librte_vhost -I../../dpdk/lib/librte_vhost -Ilib/librte_ipsec -I../../dpdk/lib/librte_ipsec -Ilib/librte_fib -I../../dpdk/lib/librte_fib -Ilib/librte_port -I../../dpdk/lib/librte_port -Ilib/librte_table -I../../dpdk/lib/librte_table -Ilib/librte_pipeline -I../../dpdk/lib/librte_pipeline -Ilib/librte_flow_classify -I../../dpdk/lib/librte_flow_classify -Ilib/librte_bpf -I../../dpdk/lib/librte_bpf -Ilib/librte_graph -I../../dpdk/lib/librte_graph -Ilib/librte_node -I../../dpdk/lib/librte_node -I/home/dmarchan/intel-ipsec-mb/install/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-missing-field-initializers -D_GNU_SOURCE -march=native -Wno-unused-function -DALLOW_EXPERIMENTAL_API -MD -MQ buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.o -MF buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.o.d -o buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.o -c buildtools/chkincs/chkincs.p/rte_ethdev_pci.c
In file included from buildtools/chkincs/chkincs.p/rte_ethdev_pci.c:1:/home/dmarchan/dpdk/lib/librte_ethdev/rte_ethdev_pci.h:86:13: error:
Symbol is not public ABI
eth_dev = rte_eth_dev_allocate(name);
^../../dpdk/lib/librte_ethdev/rte_ethdev_driver.h:1003:1: note: from 'diagnose_if' attribute on 'rte_eth_dev_allocate':__rte_internal
^~~~~~~~~~~~~~ ../../dpdk/lib/librte_eal/include/rte_compat.h:30:16: note: expanded from macro '__rte_internal'
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
^ ~
[...]
gcc seems more lenient about this.
Quoted 21 lines
Therefore, I'd suggest we need to change
compat.hto be something like:#if !defined ALLOW_INTERNAL_API && __has_attribute(error) /* For GCC */ #define __rte_internal \ __attribute__((error("Symbol is not public ABI"), \ section(".text.internal"))) #elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* For clang */ #define __rte_internal \ __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ section(".text.internal"))) #else #define __rte_internal \ __attribute__((section(".text.internal"))) #endif
Quoted 1 line
Any thoughts or suggestions for better alternatives here?
I'd rather leave a build error on an unknown attribute than silence this check (which happens in your snippet, where it falls back to the #else part).
Did you consider the deprecated() like for the experimental tag?
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH v3 0/4] add checking of header includes
Quoted 305 lines · David Marchand
Quoted 171 lines · Bruce Richardson
Quoted 169 lines · David Marchand
Quoted 71 lines · Bruce Richardson
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_ttypes 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. The script "
check-includes.sh" could be used for this job, but it was not called out in the documentation, so many contributors may not have been aware of it's existance. It also was difficult to run from a source-code directory, as the script did not automatically allow finding of headers from one DPDK library directory to another [this was probably based on running it on a build created by the "make" build system, where all headers were in a single directory]. To attempt to have a build-system integrated replacement, this patchset adds a "chkincs" app in the buildtools directory to verify this on an ongoing basis.This chkincs app does nothing when run, and is not installed as part of a DPDK "ninja install", 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, which was something done by the
check-includes.shscript but which is missing here..V3:
* Shrunk patchset as most header fixes already applied
* Moved chkincs from "apps" to the "buildtools" directory, which is a better location for something not for installation for end-user use.
* Added patch to drop check-includes script.V2:
* Add maintainers file entry for new app
* Drop patch for c11 ring header
* Use build variable "headers_no_chkincs" for tracking exceptionsBruce Richardson (4):
eal: add missing include to mcslock
build: separate out headers for include checking buildtools/chkincs: add app to verify header includes
devtools: remove check-includes scriptMAINTAINERS | 5 +- buildtools/chkincs/gen_c_file_for_header.py | 12 + buildtools/chkincs/main.c | 4 + buildtools/chkincs/meson.build | 40 +++ devtools/check-includes.sh | 259 ------------------- devtools/test-meson-builds.sh | 2 +- doc/guides/contributing/coding_style.rst | 12 + lib/librte_eal/include/generic/rte_mcslock.h | 1 + lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/x86/include/meson.build | 14 +- lib/librte_ethdev/meson.build | 4 +- lib/librte_hash/meson.build | 4 +- lib/librte_ipsec/meson.build | 3 +- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_ring/meson.build | 4 +- lib/librte_stack/meson.build | 4 +- lib/librte_table/meson.build | 7 +-Quoted 8 lines
lib/meson.build | 3 + meson.build | 6 + meson_options.txt | 2 + 21 files changed, 112 insertions(+), 280 deletions(-) create mode 100755 buildtools/chkincs/gen_c_file_for_header.py create mode 100644 buildtools/chkincs/main.c create mode 100644 buildtools/chkincs/meson.build delete mode 100755 devtools/check-includes.sh- clang is not happy when enabling the check:
$ meson configure $HOME/builds/build-clang-static -Dcheck_includes=true $ devtools/test-meson-builds.sh ... [362/464] Compiling C object buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o FAILED: buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o clang -Ibuildtools/chkincs/chkincs.p -Ibuildtools/chkincs(quoted diff) +0
-68-I../../dpdk/buildtools/chkincs -Idrivers/bus/pci -I../../dpdk/drivers/bus/pci -Idrivers/bus/vdev -I../../dpdk/drivers/bus/vdev -I. -I../../dpdk -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -Ilib/librte_metrics -I../../dpdk/lib/librte_metrics -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_ring -I../../dpdk/lib/librte_ring -Ilib/librte_rcu -I../../dpdk/lib/librte_rcu -Ilib/librte_mempool -I../../dpdk/lib/librte_mempool -Ilib/librte_mbuf -I../../dpdk/lib/librte_mbuf -Ilib/librte_net -I../../dpdk/lib/librte_net -Ilib/librte_meter -I../../dpdk/lib/librte_meter -Ilib/librte_ethdev -I../../dpdk/lib/librte_ethdev -Ilib/librte_pci -I../../dpdk/lib/librte_pci -Ilib/librte_cmdline -I../../dpdk/lib/librte_cmdline -Ilib/librte_hash -I../../dpdk/lib/librte_hash -Ilib/librte_timer -I../../dpdk/lib/librte_timer -Ilib/librte_acl -I../../dpdk/lib/librte_acl -Ilib/librte_bbdev -I../../dpdk/lib/librte_bbdev -Ilib/librte_bitratestats -I../../dpdk/lib/librte_bitratestats -Ilib/librte_cfgfile -I../../dpdk/lib/librte_cfgfile -Ilib/librte_compressdev -I../../dpdk/lib/librte_compressdev -Ilib/librte_cryptodev -I../../dpdk/lib/librte_cryptodev -Ilib/librte_distributor -I../../dpdk/lib/librte_distributor -Ilib/librte_efd -I../../dpdk/lib/librte_efd -Ilib/librte_eventdev -I../../dpdk/lib/librte_eventdev -Ilib/librte_gro -I../../dpdk/lib/librte_gro -Ilib/librte_gso -I../../dpdk/lib/librte_gso -Ilib/librte_ip_frag -I../../dpdk/lib/librte_ip_frag -Ilib/librte_jobstats -I../../dpdk/lib/librte_jobstats -Ilib/librte_kni -I../../dpdk/lib/librte_kni -Ilib/librte_latencystats -I../../dpdk/lib/librte_latencystats -Ilib/librte_lpm -I../../dpdk/lib/librte_lpm -Ilib/librte_member -I../../dpdk/lib/librte_member -Ilib/librte_power -I../../dpdk/lib/librte_power -Ilib/librte_pdump -I../../dpdk/lib/librte_pdump -Ilib/librte_rawdev -I../../dpdk/lib/librte_rawdev -Ilib/librte_regexdev -I../../dpdk/lib/librte_regexdev -Ilib/librte_rib -I../../dpdk/lib/librte_rib -Ilib/librte_reorder -I../../dpdk/lib/librte_reorder -Ilib/librte_sched -I../../dpdk/lib/librte_sched -Ilib/librte_security -I../../dpdk/lib/librte_security -Ilib/librte_stack -I../../dpdk/lib/librte_stack -Ilib/librte_vhost -I../../dpdk/lib/librte_vhost -Ilib/librte_ipsec -I../../dpdk/lib/librte_ipsec -Ilib/librte_fib -I../../dpdk/lib/librte_fib -Ilib/librte_port -I../../dpdk/lib/librte_port -Ilib/librte_table -I../../dpdk/lib/librte_table -Ilib/librte_pipeline -I../../dpdk/lib/librte_pipeline -Ilib/librte_flow_classify -I../../dpdk/lib/librte_flow_classify -Ilib/librte_bpf -I../../dpdk/lib/librte_bpf -Ilib/librte_graph -I../../dpdk/lib/librte_graph -Ilib/librte_node -I../../dpdk/lib/librte_node -I/home/dmarchan/intel-ipsec-mb/install/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-missing-field-initializers -D_GNU_SOURCE -march=native -Wno-unused-function -DALLOW_EXPERIMENTAL_API -MD -MQ
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o-MF buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o.d -obuildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o-cbuildtools/chkincs/chkincs.p/rte_ethdev_vdev.c
In file included frombuildtools/chkincs/chkincs.p/rte_ethdev_vdev.c:1:
In file included from/home/dmarchan/dpdk/lib/librte_ethdev/rte_ethdev_vdev.h:12:../../dpdk/lib/librte_ethdev/rte_ethdev_driver.h:964:1: error: unknown attribute 'error' ignored [-Werror,-Wunknown-attributes]__rte_internal
^Quoted 8 lines
Quoted 5 lines
../../dpdk/lib/librte_eal/include/rte_compat.h:25:16: note: expanded from macro '__rte_internal'__attribute__((error("Symbol is not public ABI"), \ ^This looks to be a real issue with our header file - clang does not have an "error" attribute. The closest equivalent I can see is "
diagnose_if".Indeed, it does trigger a build error, so it works as expected ;-).
On the header check itself, even if we find a way to properly tag those symbols with the macro in
rte_compat.h, the next issue is that clang complains about such marked symbols without theALLOW_INTERNAL_APIbuild flag.FAILED:
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.oclang -Ibuildtools/chkincs/chkincs.p -Ibuildtools/chkincs(quoted diff) +0
-68-I../../dpdk/buildtools/chkincs -Idrivers/bus/pci -I../../dpdk/drivers/bus/pci -Idrivers/bus/vdev -I../../dpdk/drivers/bus/vdev -I. -I../../dpdk -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -Ilib/librte_metrics -I../../dpdk/lib/librte_metrics -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_ring -I../../dpdk/lib/librte_ring -Ilib/librte_rcu -I../../dpdk/lib/librte_rcu -Ilib/librte_mempool -I../../dpdk/lib/librte_mempool -Ilib/librte_mbuf -I../../dpdk/lib/librte_mbuf -Ilib/librte_net -I../../dpdk/lib/librte_net -Ilib/librte_meter -I../../dpdk/lib/librte_meter -Ilib/librte_ethdev -I../../dpdk/lib/librte_ethdev -Ilib/librte_pci -I../../dpdk/lib/librte_pci -Ilib/librte_cmdline -I../../dpdk/lib/librte_cmdline -Ilib/librte_hash -I../../dpdk/lib/librte_hash -Ilib/librte_timer -I../../dpdk/lib/librte_timer -Ilib/librte_acl -I../../dpdk/lib/librte_acl -Ilib/librte_bbdev -I../../dpdk/lib/librte_bbdev -Ilib/librte_bitratestats -I../../dpdk/lib/librte_bitratestats -Ilib/librte_cfgfile -I../../dpdk/lib/librte_cfgfile -Ilib/librte_compressdev -I../../dpdk/lib/librte_compressdev -Ilib/librte_cryptodev -I../../dpdk/lib/librte_cryptodev -Ilib/librte_distributor -I../../dpdk/lib/librte_distributor -Ilib/librte_efd -I../../dpdk/lib/librte_efd -Ilib/librte_eventdev -I../../dpdk/lib/librte_eventdev -Ilib/librte_gro -I../../dpdk/lib/librte_gro -Ilib/librte_gso -I../../dpdk/lib/librte_gso -Ilib/librte_ip_frag -I../../dpdk/lib/librte_ip_frag -Ilib/librte_jobstats -I../../dpdk/lib/librte_jobstats -Ilib/librte_kni -I../../dpdk/lib/librte_kni -Ilib/librte_latencystats -I../../dpdk/lib/librte_latencystats -Ilib/librte_lpm -I../../dpdk/lib/librte_lpm -Ilib/librte_member -I../../dpdk/lib/librte_member -Ilib/librte_power -I../../dpdk/lib/librte_power -Ilib/librte_pdump -I../../dpdk/lib/librte_pdump -Ilib/librte_rawdev -I../../dpdk/lib/librte_rawdev -Ilib/librte_regexdev -I../../dpdk/lib/librte_regexdev -Ilib/librte_rib -I../../dpdk/lib/librte_rib -Ilib/librte_reorder -I../../dpdk/lib/librte_reorder -Ilib/librte_sched -I../../dpdk/lib/librte_sched -Ilib/librte_security -I../../dpdk/lib/librte_security -Ilib/librte_stack -I../../dpdk/lib/librte_stack -Ilib/librte_vhost -I../../dpdk/lib/librte_vhost -Ilib/librte_ipsec -I../../dpdk/lib/librte_ipsec -Ilib/librte_fib -I../../dpdk/lib/librte_fib -Ilib/librte_port -I../../dpdk/lib/librte_port -Ilib/librte_table -I../../dpdk/lib/librte_table -Ilib/librte_pipeline -I../../dpdk/lib/librte_pipeline -Ilib/librte_flow_classify -I../../dpdk/lib/librte_flow_classify -Ilib/librte_bpf -I../../dpdk/lib/librte_bpf -Ilib/librte_graph -I../../dpdk/lib/librte_graph -Ilib/librte_node -I../../dpdk/lib/librte_node -I/home/dmarchan/intel-ipsec-mb/install/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-missing-field-initializers -D_GNU_SOURCE -march=native -Wno-unused-function -DALLOW_EXPERIMENTAL_API -MD -MQ
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.o-MF buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.o.d -obuildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.o-cbuildtools/chkincs/chkincs.p/rte_ethdev_pci.c
In file included frombuildtools/chkincs/chkincs.p/rte_ethdev_pci.c:1:/home/dmarchan/dpdk/lib/librte_ethdev/rte_ethdev_pci.h:86:13: error:
Symbol is not public ABIeth_dev = rte_eth_dev_allocate(name); ^
../../dpdk/lib/librte_ethdev/rte_ethdev_driver.h:1003:1: note: from 'diagnose_if' attribute on 'rte_eth_dev_allocate':__rte_internal
^~~~~~~~~~~~~~../../dpdk/lib/librte_eal/include/rte_compat.h:30:16: note: expanded from macro '__rte_internal'
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
^ ~
[...]gcc seems more lenient about this.
Quoted 21 lines
Therefore, I'd suggest we need to change
compat.hto be something like:#if !defined ALLOW_INTERNAL_API && __has_attribute(error) /* For GCC */ #define __rte_internal \ __attribute__((error("Symbol is not public ABI"), \ section(".text.internal"))) #elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* For clang */ #define __rte_internal \ __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ section(".text.internal"))) #else #define __rte_internal \ __attribute__((section(".text.internal"))) #endif
Quoted 8 lines
Quoted 1 line
Any thoughts or suggestions for better alternatives here?
I'd rather leave a build error on an unknown attribute than silence this check (which happens in your snippet, where it falls back to the #else part).
Did you consider the
deprecated()like for the experimental tag?
I've added the ALLOW_INTERNAL_API define to the build of these headers in v4.
Re: [dpdk-dev] [PATCH v3 0/4] add checking of header includes
Quoted 312 lines · Bruce Richardson
Quoted 311 lines · David Marchand
Quoted 171 lines · Bruce Richardson
Quoted 169 lines · David Marchand
Quoted 71 lines · Bruce Richardson
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_ttypes 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. The script "
check-includes.sh" could be used for this job, but it was not called out in the documentation, so many contributors may not have been aware of it's existance. It also was difficult to run from a source-code directory, as the script did not automatically allow finding of headers from one DPDK library directory to another [this was probably based on running it on a build created by the "make" build system, where all headers were in a single directory]. To attempt to have a build-system integrated replacement, this patchset adds a "chkincs" app in the buildtools directory to verify this on an ongoing basis.This chkincs app does nothing when run, and is not installed as part of a DPDK "ninja install", 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, which was something done by the
check-includes.shscript but which is missing here..V3:
* Shrunk patchset as most header fixes already applied
* Moved chkincs from "apps" to the "buildtools" directory, which is a better location for something not for installation for end-user use.
* Added patch to drop check-includes script.V2:
* Add maintainers file entry for new app
* Drop patch for c11 ring header
* Use build variable "headers_no_chkincs" for tracking exceptionsBruce Richardson (4):
eal: add missing include to mcslock
build: separate out headers for include checking buildtools/chkincs: add app to verify header includes
devtools: remove check-includes scriptMAINTAINERS | 5 +- buildtools/chkincs/gen_c_file_for_header.py | 12 + buildtools/chkincs/main.c | 4 + buildtools/chkincs/meson.build | 40 +++ devtools/check-includes.sh | 259 ------------------- devtools/test-meson-builds.sh | 2 +- doc/guides/contributing/coding_style.rst | 12 + lib/librte_eal/include/generic/rte_mcslock.h | 1 + lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/x86/include/meson.build | 14 +- lib/librte_ethdev/meson.build | 4 +- lib/librte_hash/meson.build | 4 +- lib/librte_ipsec/meson.build | 3 +- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_ring/meson.build | 4 +- lib/librte_stack/meson.build | 4 +- lib/librte_table/meson.build | 7 +-Quoted 8 lines
lib/meson.build | 3 + meson.build | 6 + meson_options.txt | 2 + 21 files changed, 112 insertions(+), 280 deletions(-) create mode 100755 buildtools/chkincs/gen_c_file_for_header.py create mode 100644 buildtools/chkincs/main.c create mode 100644 buildtools/chkincs/meson.build delete mode 100755 devtools/check-includes.sh- clang is not happy when enabling the check:
$ meson configure $HOME/builds/build-clang-static -Dcheck_includes=true $ devtools/test-meson-builds.sh ... [362/464] Compiling C object buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o FAILED: buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o clang -Ibuildtools/chkincs/chkincs.p -Ibuildtools/chkincs(quoted diff) +0
-68-I../../dpdk/buildtools/chkincs -Idrivers/bus/pci -I../../dpdk/drivers/bus/pci -Idrivers/bus/vdev -I../../dpdk/drivers/bus/vdev -I. -I../../dpdk -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -Ilib/librte_metrics -I../../dpdk/lib/librte_metrics -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_ring -I../../dpdk/lib/librte_ring -Ilib/librte_rcu -I../../dpdk/lib/librte_rcu -Ilib/librte_mempool -I../../dpdk/lib/librte_mempool -Ilib/librte_mbuf -I../../dpdk/lib/librte_mbuf -Ilib/librte_net -I../../dpdk/lib/librte_net -Ilib/librte_meter -I../../dpdk/lib/librte_meter -Ilib/librte_ethdev -I../../dpdk/lib/librte_ethdev -Ilib/librte_pci -I../../dpdk/lib/librte_pci -Ilib/librte_cmdline -I../../dpdk/lib/librte_cmdline -Ilib/librte_hash -I../../dpdk/lib/librte_hash -Ilib/librte_timer -I../../dpdk/lib/librte_timer -Ilib/librte_acl -I../../dpdk/lib/librte_acl -Ilib/librte_bbdev -I../../dpdk/lib/librte_bbdev -Ilib/librte_bitratestats -I../../dpdk/lib/librte_bitratestats -Ilib/librte_cfgfile -I../../dpdk/lib/librte_cfgfile -Ilib/librte_compressdev -I../../dpdk/lib/librte_compressdev -Ilib/librte_cryptodev -I../../dpdk/lib/librte_cryptodev -Ilib/librte_distributor -I../../dpdk/lib/librte_distributor -Ilib/librte_efd -I../../dpdk/lib/librte_efd -Ilib/librte_eventdev -I../../dpdk/lib/librte_eventdev -Ilib/librte_gro -I../../dpdk/lib/librte_gro -Ilib/librte_gso -I../../dpdk/lib/librte_gso -Ilib/librte_ip_frag -I../../dpdk/lib/librte_ip_frag -Ilib/librte_jobstats -I../../dpdk/lib/librte_jobstats -Ilib/librte_kni -I../../dpdk/lib/librte_kni -Ilib/librte_latencystats -I../../dpdk/lib/librte_latencystats -Ilib/librte_lpm -I../../dpdk/lib/librte_lpm -Ilib/librte_member -I../../dpdk/lib/librte_member -Ilib/librte_power -I../../dpdk/lib/librte_power -Ilib/librte_pdump -I../../dpdk/lib/librte_pdump -Ilib/librte_rawdev -I../../dpdk/lib/librte_rawdev -Ilib/librte_regexdev -I../../dpdk/lib/librte_regexdev -Ilib/librte_rib -I../../dpdk/lib/librte_rib -Ilib/librte_reorder -I../../dpdk/lib/librte_reorder -Ilib/librte_sched -I../../dpdk/lib/librte_sched -Ilib/librte_security -I../../dpdk/lib/librte_security -Ilib/librte_stack -I../../dpdk/lib/librte_stack -Ilib/librte_vhost -I../../dpdk/lib/librte_vhost -Ilib/librte_ipsec -I../../dpdk/lib/librte_ipsec -Ilib/librte_fib -I../../dpdk/lib/librte_fib -Ilib/librte_port -I../../dpdk/lib/librte_port -Ilib/librte_table -I../../dpdk/lib/librte_table -Ilib/librte_pipeline -I../../dpdk/lib/librte_pipeline -Ilib/librte_flow_classify -I../../dpdk/lib/librte_flow_classify -Ilib/librte_bpf -I../../dpdk/lib/librte_bpf -Ilib/librte_graph -I../../dpdk/lib/librte_graph -Ilib/librte_node -I../../dpdk/lib/librte_node -I/home/dmarchan/intel-ipsec-mb/install/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-missing-field-initializers -D_GNU_SOURCE -march=native -Wno-unused-function -DALLOW_EXPERIMENTAL_API -MD -MQ
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o-MF buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o.d -obuildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_vdev.c.o-cbuildtools/chkincs/chkincs.p/rte_ethdev_vdev.c
In file included frombuildtools/chkincs/chkincs.p/rte_ethdev_vdev.c:1:
In file included from/home/dmarchan/dpdk/lib/librte_ethdev/rte_ethdev_vdev.h:12:../../dpdk/lib/librte_ethdev/rte_ethdev_driver.h:964:1: error: unknown attribute 'error' ignored [-Werror,-Wunknown-attributes]__rte_internal
^Quoted 8 lines
Quoted 5 lines
../../dpdk/lib/librte_eal/include/rte_compat.h:25:16: note: expanded from macro '__rte_internal'__attribute__((error("Symbol is not public ABI"), \ ^This looks to be a real issue with our header file - clang does not have an "error" attribute. The closest equivalent I can see is "
diagnose_if".Indeed, it does trigger a build error, so it works as expected ;-).
On the header check itself, even if we find a way to properly tag those symbols with the macro in
rte_compat.h, the next issue is that clang complains about such marked symbols without theALLOW_INTERNAL_APIbuild flag.FAILED:
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.oclang -Ibuildtools/chkincs/chkincs.p -Ibuildtools/chkincs(quoted diff) +0
-68-I../../dpdk/buildtools/chkincs -Idrivers/bus/pci -I../../dpdk/drivers/bus/pci -Idrivers/bus/vdev -I../../dpdk/drivers/bus/vdev -I. -I../../dpdk -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../../dpdk/lib/librte_eal/x86/include -Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -Ilib/librte_metrics -I../../dpdk/lib/librte_metrics -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_ring -I../../dpdk/lib/librte_ring -Ilib/librte_rcu -I../../dpdk/lib/librte_rcu -Ilib/librte_mempool -I../../dpdk/lib/librte_mempool -Ilib/librte_mbuf -I../../dpdk/lib/librte_mbuf -Ilib/librte_net -I../../dpdk/lib/librte_net -Ilib/librte_meter -I../../dpdk/lib/librte_meter -Ilib/librte_ethdev -I../../dpdk/lib/librte_ethdev -Ilib/librte_pci -I../../dpdk/lib/librte_pci -Ilib/librte_cmdline -I../../dpdk/lib/librte_cmdline -Ilib/librte_hash -I../../dpdk/lib/librte_hash -Ilib/librte_timer -I../../dpdk/lib/librte_timer -Ilib/librte_acl -I../../dpdk/lib/librte_acl -Ilib/librte_bbdev -I../../dpdk/lib/librte_bbdev -Ilib/librte_bitratestats -I../../dpdk/lib/librte_bitratestats -Ilib/librte_cfgfile -I../../dpdk/lib/librte_cfgfile -Ilib/librte_compressdev -I../../dpdk/lib/librte_compressdev -Ilib/librte_cryptodev -I../../dpdk/lib/librte_cryptodev -Ilib/librte_distributor -I../../dpdk/lib/librte_distributor -Ilib/librte_efd -I../../dpdk/lib/librte_efd -Ilib/librte_eventdev -I../../dpdk/lib/librte_eventdev -Ilib/librte_gro -I../../dpdk/lib/librte_gro -Ilib/librte_gso -I../../dpdk/lib/librte_gso -Ilib/librte_ip_frag -I../../dpdk/lib/librte_ip_frag -Ilib/librte_jobstats -I../../dpdk/lib/librte_jobstats -Ilib/librte_kni -I../../dpdk/lib/librte_kni -Ilib/librte_latencystats -I../../dpdk/lib/librte_latencystats -Ilib/librte_lpm -I../../dpdk/lib/librte_lpm -Ilib/librte_member -I../../dpdk/lib/librte_member -Ilib/librte_power -I../../dpdk/lib/librte_power -Ilib/librte_pdump -I../../dpdk/lib/librte_pdump -Ilib/librte_rawdev -I../../dpdk/lib/librte_rawdev -Ilib/librte_regexdev -I../../dpdk/lib/librte_regexdev -Ilib/librte_rib -I../../dpdk/lib/librte_rib -Ilib/librte_reorder -I../../dpdk/lib/librte_reorder -Ilib/librte_sched -I../../dpdk/lib/librte_sched -Ilib/librte_security -I../../dpdk/lib/librte_security -Ilib/librte_stack -I../../dpdk/lib/librte_stack -Ilib/librte_vhost -I../../dpdk/lib/librte_vhost -Ilib/librte_ipsec -I../../dpdk/lib/librte_ipsec -Ilib/librte_fib -I../../dpdk/lib/librte_fib -Ilib/librte_port -I../../dpdk/lib/librte_port -Ilib/librte_table -I../../dpdk/lib/librte_table -Ilib/librte_pipeline -I../../dpdk/lib/librte_pipeline -Ilib/librte_flow_classify -I../../dpdk/lib/librte_flow_classify -Ilib/librte_bpf -I../../dpdk/lib/librte_bpf -Ilib/librte_graph -I../../dpdk/lib/librte_graph -Ilib/librte_node -I../../dpdk/lib/librte_node -I/home/dmarchan/intel-ipsec-mb/install/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-address-of-packed-member -Wno-missing-field-initializers -D_GNU_SOURCE -march=native -Wno-unused-function -DALLOW_EXPERIMENTAL_API -MD -MQ
buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.o-MF buildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.o.d -obuildtools/chkincs/chkincs.p/meson-generated_rte_ethdev_pci.c.o-cbuildtools/chkincs/chkincs.p/rte_ethdev_pci.c
In file included frombuildtools/chkincs/chkincs.p/rte_ethdev_pci.c:1:/home/dmarchan/dpdk/lib/librte_ethdev/rte_ethdev_pci.h:86:13: error:
Symbol is not public ABIeth_dev = rte_eth_dev_allocate(name); ^
../../dpdk/lib/librte_ethdev/rte_ethdev_driver.h:1003:1: note: from 'diagnose_if' attribute on 'rte_eth_dev_allocate':__rte_internal
^~~~~~~~~~~~~~../../dpdk/lib/librte_eal/include/rte_compat.h:30:16: note: expanded from macro '__rte_internal'
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
^ ~
[...]gcc seems more lenient about this.
Quoted 21 lines
Therefore, I'd suggest we need to change
compat.hto be something like:#if !defined ALLOW_INTERNAL_API && __has_attribute(error) /* For GCC */ #define __rte_internal \ __attribute__((error("Symbol is not public ABI"), \ section(".text.internal"))) #elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* For clang */ #define __rte_internal \ __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ section(".text.internal"))) #else #define __rte_internal \ __attribute__((section(".text.internal"))) #endifQuoted 1 line
Any thoughts or suggestions for better alternatives here?
I'd rather leave a build error on an unknown attribute than silence this check (which happens in your snippet, where it falls back to the #else part).
Quoted 5 lines
Quoted 2 lines
Did you consider the
deprecated()like for the experimental tag?I've added the
ALLOW_INTERNAL_APIdefine to the build of these headers in v4.
+Ferruh, Thomas
Removing the ALLOW_INTERNAL_API is probably a good idea, but it does indeed throw up the errors with clang - but not gcc, which is strange. The offending headers seem to be (initially):
* rte_ethdev_vdev.h
* rte_ethdev_pci.h
Are these public header files, or should they skip header checking - and installation - as internal-only?
/Bruce
Re: [dpdk-dev] [PATCH v3 0/4] add checking of header includes
26/01/2021 15:39, Bruce Richardson:
Quoted 9 lines
Removing the
ALLOW_INTERNAL_APIis probably a good idea, but it does indeed throw up the errors with clang - but not gcc, which is strange. The offending headers seem to be (initially):*
rte_ethdev_vdev.h
*rte_ethdev_pci.hAre these public header files, or should they skip header checking - and installation - as internal-only?
They are helpers for the drivers, so should be internal.
Re: [dpdk-dev] [PATCH v3 0/4] add checking of header includes
Quoted 5 lines · Thomas Monjalon
26/01/2021 15:39, Bruce Richardson:
Quoted 4 lines
Removing the
ALLOW_INTERNAL_APIis probably a good idea, but it does indeed throw up the errors with clang - but not gcc, which is strange. The offending headers seem to be (initially):
Quoted 8 lines
Quoted 5 lines
*
rte_ethdev_vdev.h
*rte_ethdev_pci.hAre these public header files, or should they skip header checking - and installation - as internal-only?
They are helpers for the drivers, so should be internal.
Just to confirm, by that you mean that they should not be installed for end-application use?
In which case, I believe that "rte_ethdev_driver", "rte_ethdev_vdev" and "rte_ethdev_pci" should be removed from the "headers" list in "librte_ethdev/meson.build". Current file list there is:
headers = files('rte_ethdev.h',
'rte_ethdev_driver.h',
'rte_ethdev_pci.h',
'rte_ethdev_trace.h',
'rte_ethdev_trace_fp.h',
'rte_ethdev_vdev.h',
'rte_dev_info.h',
'rte_flow.h',
'rte_flow_driver.h',
'rte_mtr.h',
'rte_mtr_driver.h',
'rte_tm.h',
'rte_tm_driver.h')
headers_no_chkincs += files('rte_eth_ctrl.h',
'rte_ethdev_core.h')[Note that the "headers_no_chkincs" files still get installed, they just skip header checking as indirect includes.]
Anything else that should be removed.
Also, tangential to this, it would probably be good if we could come up with a different naming scheme for internal-only headers, to make the difference between what is to be installed or not, a lot clearer!
/Bruce
Re: [dpdk-dev] [PATCH v3 0/4] add checking of header includes
26/01/2021 16:42, Bruce Richardson:
Quoted 9 lines · Thomas Monjalon
Quoted 8 lines
26/01/2021 15:39, Bruce Richardson:
Quoted 7 lines
Removing the
ALLOW_INTERNAL_APIis probably a good idea, but it does indeed throw up the errors with clang - but not gcc, which is strange. The offending headers seem to be (initially):*
rte_ethdev_vdev.h
*rte_ethdev_pci.h
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Are these public header files, or should they skip header checking - and installation - as internal-only?
They are helpers for the drivers, so should be internal.
Just to confirm, by that you mean that they should not be installed for end-application use?
I think yes they are not needed to be installed.
Quoted 20 lines
In which case, I believe that "
rte_ethdev_driver", "rte_ethdev_vdev" and "rte_ethdev_pci" should be removed from the "headers" list in "librte_ethdev/meson.build". Current file list there is:headers = files('rte_ethdev.h',
'rte_ethdev_driver.h', 'rte_ethdev_pci.h', 'rte_ethdev_trace.h', 'rte_ethdev_trace_fp.h', 'rte_ethdev_vdev.h', 'rte_dev_info.h', 'rte_flow.h', 'rte_flow_driver.h', 'rte_mtr.h', 'rte_mtr_driver.h', 'rte_tm.h', 'rte_tm_driver.h') headers_no_chkincs += files('rte_eth_ctrl.h', 'rte_ethdev_core.h')
Quoted 7 lines
[Note that the "
headers_no_chkincs" files still get installed, they just skip header checking as indirect includes.]
Anything else that should be removed.Also, tangential to this, it would probably be good if we could come up with a different naming scheme for internal-only headers, to make the difference between what is to be installed or not, a lot clearer!
The difference is supposed to be the rte_ prefix in the file name. Doxygen will parse only these files:
FILE_PATTERNS = rte_*.h cmdline.h
I agree we should fix the internal filenames and not install them.
v4 cover add checking of header includes
In reply to Bruce RichardsonAs 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. The script "check-includes.sh" could be used for this job, but it was not called out in the documentation, so many contributors may not have been aware of it's existance. It also was difficult to run from a source-code directory, as the script did not automatically allow finding of headers from one DPDK library directory to another [this was probably based on running it on a build created by the "make" build system, where all headers were in a single directory]. To attempt to have a build-system integrated replacement, this patchset adds a "chkincs" app in the buildtools directory to verify this on an ongoing basis.
This chkincs app does nothing when run, and is not installed as part of a DPDK "ninja install", 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, which was something done by the check-includes.sh script but which is missing here.
V4:
* Fixed build errors with clang and arm builds
* Added support for running chkincs as part of github actions CI
V3:
* Shrunk patchset as most header fixes already applied
* Moved chkincs from "apps" to the "buildtools" directory, which is a better location for something not for installation for end-user use.
* Added patch to drop check-includes script.
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 (7):
eal: add missing include to mcslock
eal: fix error attribute use for clang
rib: fix missing header include
build: separate out headers for include checking buildtools/chkincs: add app to verify header includes
devtools: remove check-includes script
ci: add checking of includes to CI builds
.ci/linux-build.sh | 1 + MAINTAINERS | 5 +- buildtools/chkincs/gen_c_file_for_header.py | 12 + buildtools/chkincs/main.c | 4 + buildtools/chkincs/meson.build | 41 +++ devtools/check-includes.sh | 259 ------------------- devtools/test-meson-builds.sh | 2 +- doc/guides/contributing/coding_style.rst | 12 + lib/librte_eal/include/generic/rte_mcslock.h | 1 + lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/include/rte_compat.h | 8 +- lib/librte_eal/x86/include/meson.build | 14 +- lib/librte_ethdev/meson.build | 4 +- lib/librte_hash/meson.build | 4 +- lib/librte_ipsec/meson.build | 3 +- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_rib/rte_rib6.h | 1 + lib/librte_ring/meson.build | 4 +- lib/librte_stack/meson.build | 4 +- lib/librte_table/meson.build | 7 +- lib/meson.build | 3 + meson.build | 6 + meson_options.txt | 2 + 24 files changed, 122 insertions(+), 281 deletions(-) create mode 100755 buildtools/chkincs/gen_c_file_for_header.py create mode 100644 buildtools/chkincs/main.c create mode 100644 buildtools/chkincs/meson.build delete mode 100755 devtools/check-includes.sh
--
2.27.0
PATCH v4 1/7 eal: add missing include to mcslock
Include 'rte_branch_prediction.h' to get the likely/unlikely macro definitions.
--- lib/librte_eal/include/generic/rte_mcslock.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_eal/include/generic/rte_mcslock.h +1 -0
@@ -22,6 +22,7 @@#include <rte_lcore.h> #include <rte_common.h> #include <rte_pause.h> +#include <rte_branch_prediction.h> /** * The rte_mcslock_t type.
Signature · 1 line
2.27.0
PATCH v4 2/7 eal: fix error attribute use for clang
In reply to Bruce RichardsonClang does not have an "error" attribute for functions, so for marking internal functions we need to check for the error attribute, and provide a fallback if it is not present. For clang, we can use "diagnose_if" attribute, similarly checking for its presence before use.
--- lib/librte_eal/include/rte_compat.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
lib/librte_eal/include/rte_compat.h +7 -1
@@ -19,12 +19,18 @@ __attribute__((section(".text.experimental")))#endif -#ifndef ALLOW_INTERNAL_API +#if !definedALLOW_INTERNAL_API &&__has_attribute (error)/* For GCC */ #define __rte_internal \ __attribute__((error("Symbol is not public ABI"), \ section(".text.internal"))) +#elif !definedALLOW_INTERNAL_API &&__has_attribute (diagnose_if)/* For clang */ + +#define __rte_internal \ +__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ +section(".text.internal"))) +#else #define __rte_internal \
Signature · 1 line
2.27.0
PATCH v4 3/7 rib: fix missing header include
In reply to Bruce RichardsonThe rte_rib6 header was using RTE_MIN macro from rte_common.h but not including the header file.
--- lib/librte_rib/rte_rib6.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_rib/rte_rib6.h +1 -0
@@ -20,6 +20,7 @@#include <rte_memcpy.h> #include <rte_compat.h> +#include <rte_common.h> #ifdef __cplusplusextern "C" {
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v4 3/7] rib: fix missing header include
Quoted 17 lines · Bruce Richardson
The
rte_rib6header was usingRTE_MINmacro fromrte_common.hbut not including the header file.Fixes f7e861e21c46 ("rib: support IPv6")Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_rib/rte_rib6.h | 1 + 1 file changed, 1 insertion(+)lib/librte_rib/rte_rib6.h +0
-0
lib/librte_rib/rte_rib6.h line 26
Quoted 7 lines
lib/librte_rib/rte_rib6.h +1
-0@@ -20,6 +20,7 @@#include <rte_memcpy.h> #include <rte_compat.h> +#include <rte_common.h> #ifdef __cplusplusextern "C" {
Signature · 2 lines
Regards, Vladimir
PATCH v4 4/7 build: separate out headers for include checking
In reply to Bruce RichardsonFor some libraries, there may be some header files which are not for direct inclusion, but rather are to be included via other header files. To allow later checking of these files for missing includes, we separate out the indirect include files from the direct ones.
--- doc/guides/contributing/coding_style.rst | 12 ++++++++++++ lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/x86/include/meson.build | 14 +++++++++----- lib/librte_ethdev/meson.build | 4 ++-- lib/librte_hash/meson.build | 4 ++-- lib/librte_ipsec/meson.build | 3 ++- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_ring/meson.build | 4 +++- lib/librte_stack/meson.build | 4 +++- lib/librte_table/meson.build | 7 +++---- lib/meson.build | 3 +++ meson.build | 1 + meson_options.txt | 2 ++ 14 files changed, 45 insertions(+), 19 deletions(-)
doc/guides/contributing/coding_style.rst +12 -0
@@ -891,6 +891,18 @@ headers installed to $PREFIX/include when ``ninja install`` is run. As with source files, these should be specified using the meson ``files()`` function. + When ``check_includes`` build option is set to ``true``, each header file + has additional checks performed on it, for example to ensure that it is + not missing any include statements for dependent headers. + For header files which are public, but only included indirectly in + applications, these checks can be skipped by using the ``headers_no_chkincs`` + variable rather than ``headers``. + +headers_no_chkincs + **Default Value = []**. + As with ``headers`` option above, except that the files are not checked + for all needed include files as part of a DPDK build when + ``check_includes`` is set to ``true``. includes: **Default Value = []**.
lib/librte_eal/include/meson.build +1 -1
@@ -16,7 +16,6 @@ headers += files( 'rte_dev.h', 'rte_devargs.h', 'rte_eal.h', - 'rte_eal_interrupts.h', 'rte_eal_memconfig.h', 'rte_eal_trace.h', 'rte_errno.h',
@@ -49,6 +48,7 @@ headers += files( 'rte_version.h', 'rte_vfio.h', ) +headers_no_chkincs += files('rte_eal_interrupts.h') # special case install the generic headers, since they go in a subdir generic_headers = files(
lib/librte_eal/x86/include/meson.build +9 -5
@@ -2,11 +2,7 @@ # Copyright(c) 2017 Intel Corporation arch_headers = files( - 'rte_atomic_32.h', - 'rte_atomic_64.h', 'rte_atomic.h', - 'rte_byteorder_32.h', - 'rte_byteorder_64.h', 'rte_byteorder.h', 'rte_cpuflags.h', 'rte_cycles.h',
@@ -22,4 +18,12 @@ arch_headers = files( 'rte_ticketlock.h', 'rte_vect.h', ) -install_headers(arch_headers, subdir: get_option('include_subdir_arch')) +arch_headers_no_chkincs = files( + 'rte_atomic_32.h', + 'rte_atomic_64.h', + 'rte_byteorder_32.h', + 'rte_byteorder_64.h', +) +install_headers(arch_headers + arch_headers_no_chkincs, + subdir: get_option('include_subdir_arch')) +dpdk_chkinc_headers += arch_headers
lib/librte_ethdev/meson.build +2 -2
@@ -12,12 +12,10 @@ sources = files('ethdev_private.c', headers = files('rte_ethdev.h', 'rte_ethdev_driver.h', - 'rte_ethdev_core.h', 'rte_ethdev_pci.h', 'rte_ethdev_trace.h', 'rte_ethdev_trace_fp.h', 'rte_ethdev_vdev.h', - 'rte_eth_ctrl.h', 'rte_dev_info.h', 'rte_flow.h', 'rte_flow_driver.h',
@@ -25,5 +23,7 @@ headers = files('rte_ethdev.h', 'rte_mtr_driver.h', 'rte_tm.h', 'rte_tm_driver.h') +headers_no_chkincs += files('rte_eth_ctrl.h', + 'rte_ethdev_core.h') deps += ['net', 'kvargs', 'meter', 'telemetry']
lib/librte_hash/meson.build +2 -2
@@ -1,12 +1,12 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -headers = files('rte_crc_arm64.h', - 'rte_fbk_hash.h', +headers = files('rte_fbk_hash.h', 'rte_hash_crc.h', 'rte_hash.h', 'rte_jhash.h', 'rte_thash.h') +headers_no_chkincs += files('rte_crc_arm64.h') sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c') deps += ['ring']
lib/librte_ipsec/meson.build +2 -1
@@ -3,6 +3,7 @@ sources = files('esp_inb.c', 'esp_outb.c', 'sa.c', 'ses.c', 'ipsec_sad.c') -headers = files('rte_ipsec.h', 'rte_ipsec_group.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h') +headers = files('rte_ipsec.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h') +headers_no_chkincs += files('rte_ipsec_group.h') deps += ['mbuf', 'net', 'cryptodev', 'security', 'hash']
lib/librte_lpm/meson.build +1 -1
@@ -5,6 +5,6 @@ sources = files('rte_lpm.c', 'rte_lpm6.c') headers = files('rte_lpm.h', 'rte_lpm6.h') # since header files have different names, we can install all vector headers # without worrying about which architecture we actually need -headers += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h') +headers_no_chkincs += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h') deps += ['hash'] deps += ['rcu']
lib/librte_regexdev/meson.build +1 -1
@@ -3,6 +3,6 @@ sources = files('rte_regexdev.c') headers = files('rte_regexdev.h', - 'rte_regexdev_core.h', 'rte_regexdev_driver.h') +headers_no_chkincs += files('rte_regexdev_core.h') deps += ['mbuf']
lib/librte_ring/meson.build +3 -1
@@ -2,7 +2,9 @@ # Copyright(c) 2017 Intel Corporation sources = files('rte_ring.c') -headers = files('rte_ring.h', +headers = files('rte_ring.h') +# most sub-headers are not for direct inclusion +headers_no_chkincs += files ( 'rte_ring_core.h', 'rte_ring_elem.h', 'rte_ring_c11_mem.h',
lib/librte_stack/meson.build +3 -1
@@ -2,7 +2,9 @@ # Copyright(c) 2019 Intel Corporation sources = files('rte_stack.c', 'rte_stack_std.c', 'rte_stack_lf.c') -headers = files('rte_stack.h', +headers = files('rte_stack.h') +# subheaders, not for direct inclusion by apps +headers_no_chkincs += files( 'rte_stack_std.h', 'rte_stack_lf.h', 'rte_stack_lf_generic.h',
lib/librte_table/meson.build +3 -4
@@ -20,7 +20,6 @@ headers = files('rte_table.h', 'rte_table_hash.h', 'rte_table_hash_cuckoo.h', 'rte_table_hash_func.h', - 'rte_table_hash_func_arm64.h', 'rte_lru.h', 'rte_table_array.h', 'rte_table_stub.h',
@@ -28,6 +27,6 @@ headers = files('rte_table.h', 'rte_swx_table_em.h',) deps += ['mbuf', 'port', 'lpm', 'hash', 'acl'] -if arch_subdir == 'x86' - headers += files('rte_lru_x86.h') -endif +headers_no_chkincs += files('rte_lru_x86.h', + 'rte_lru_arm64.h', + 'rte_table_hash_func_arm64.h')
lib/meson.build +3 -0
@@ -66,6 +66,7 @@ foreach l:libraries use_function_versioning = false sources = [] headers = [] + headers_no_chkincs = [] # public headers not directly included by apps includes = [] cflags = default_cflags objs = [] # other object files to link against, used e.g. for
@@ -103,6 +104,8 @@ foreach l:libraries enabled_libs += name dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1) install_headers(headers) + install_headers(headers_no_chkincs) + dpdk_chkinc_headers += headers libname = 'rte_' + name includes += include_directories(dir_name)
meson.build +1 -0
@@ -16,6 +16,7 @@ cc = meson.get_compiler('c') dpdk_conf = configuration_data() dpdk_libraries = [] dpdk_static_libraries = [] +dpdk_chkinc_headers = [] dpdk_driver_classes = [] dpdk_drivers = [] dpdk_extra_ldflags = []
meson_options.txt +2 -0
@@ -1,5 +1,7 @@ # Please keep these options sorted alphabetically. +option('check_includes', type: 'boolean', value: false, + description: 'build "chkincs" to verify each header file can compile alone') option('disable_drivers', type: 'string', value: '', description: 'Comma-separated list of drivers to explicitly disable.') option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
Signature · 1 line
2.27.0
PATCH v4 5/7 buildtools/chkincs: add app to verify header includes
In reply to Bruce RichardsonTo verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
To ensure ongoing compliance, we enable this build test as part of the default x86 build in "test-meson-builds.sh".
--- MAINTAINERS | 4 ++ buildtools/chkincs/gen_c_file_for_header.py | 12 ++++++ buildtools/chkincs/main.c | 4 ++ buildtools/chkincs/meson.build | 41 +++++++++++++++++++++ devtools/test-meson-builds.sh | 2 +- meson.build | 5 +++ 6 files changed, 67 insertions(+), 1 deletion(-) create mode 100755 buildtools/chkincs/gen_c_file_for_header.py create mode 100644 buildtools/chkincs/main.c create mode 100644 buildtools/chkincs/meson.build
MAINTAINERS +4 -0
@@ -1562,6 +1562,10 @@ F: app/test/test_resource.c F: app/test/virtual_pmd.c F: app/test/virtual_pmd.h +Header build sanity checking +M: Bruce Richardson <[email protected]> +F: buildtools/chkincs/ + Sample packet helper functions for unit test M: Reshma Pattan <[email protected]> F: app/test/sample_packet_forward.c
buildtools/chkincs/gen_c_file_for_header.py new file +12 -0
@@ -0,0 +1,12 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2021 Intel Corporation + +from sys import argv +from os.path import abspath + +(h_file, c_file) = argv[1:] + +contents = '#include "' + abspath(h_file) + '"' +with open(c_file, 'w') as cf: + cf.write(contents)
buildtools/chkincs/main.c new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2021 Intel Corporation +*/ +int main (void ) {return 0 ; }
buildtools/chkincs/meson.build new file +41 -0
41 lines not on this page · raw message
devtools/test-meson-builds.sh +1 -1
@@ -227,7 +227,7 @@ default_machine='nehalem' if ! check_cc_flags "-march=$default_machine" ; then default_machine='corei7' fi -build build-x86-default cc skipABI \ +build build-x86-default cc skipABI -Dcheck_includes=true\ -Dlibdir=lib -Dmachine=$default_machine $use_shared # 32-bit with default compiler
meson.build +5 -0
@@ -68,6 +68,11 @@ if get_option('enable_kmods') subdir('kernel') endif +# check header includes if requested +if get_option('check_includes') + subdir('buildtools/chkincs') +endif + # write the build config build_cfg = 'rte_build_config.h' configure_file(output: build_cfg,
Signature · 1 line
2.27.0
PATCH v4 6/7 devtools: remove check-includes script
In reply to Bruce RichardsonThe check-includes script allowed checking header files in a given directory to ensure that each header compiled alone without requiring any other header inclusions.
With header checking now being done by the chkincs app in the build system this script can be removed.
--- MAINTAINERS | 1 - devtools/check-includes.sh | 259 ------------------------------------- 2 files changed, 260 deletions(-) delete mode 100755 devtools/check-includes.sh
MAINTAINERS +0 -1
@@ -81,7 +81,6 @@ F: devtools/check-dup-includes.sh F: devtools/check-maintainers.sh F: devtools/check-forbidden-tokens.awk F: devtools/check-git-log.sh -F: devtools/check-includes.sh F: devtools/check-spdx-tag.sh F: devtools/check-symbol-maps.sh F: devtools/checkpatches.sh
devtools/check-includes.sh deleted +0 -259
259 lines not on this page · raw message
Signature · 1 line
2.27.0
PATCH v4 7/7 ci: add checking of includes to CI builds
In reply to Bruce RichardsonFor CI builds, turn on the checking of includes.
---
For simplicity, this patch just enables the header includes checks globally, rather than just limiting it to certain builds. Since the C files generated are all just a single #include line , the extra compilation time is fairly short compared to the overall existing build time in the CI.
--- .ci/linux-build.sh | 1 + 1 file changed, 1 insertion(+)
.ci/linux-build.sh +1 -0
@@ -57,6 +57,7 @@ fi OPTS="$OPTS -Dmachine=default" OPTS="$OPTS --default-library=$DEF_LIB" OPTS="$OPTS --buildtype=debugoptimized" +OPTS="$OPTS -Dcheck_includes=true" meson build --werror $OPTS ninja -C build
--
2.27.0
v5 cover add checking of header includes
In reply to Bruce RichardsonAs 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. The script "check-includes.sh" could be used for this job, but it was not called out in the documentation, so many contributors may not have been aware of it's existance. It also was difficult to run from a source-code directory, as the script did not automatically allow finding of headers from one DPDK library directory to another [this was probably based on running it on a build created by the "make" build system, where all headers were in a single directory]. To attempt to have a build-system integrated replacement, this patchset adds a "chkincs" app in the buildtools directory to verify this on an ongoing basis.
This chkincs app does nothing when run, and is not installed as part of a DPDK "ninja install", 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, which was something done by the check-includes.sh script but which is missing here.
V5:
* Removed private ethdev headers from checks and installing
* Removed the ALLOW_INTERNAL_APIS macro from chkincs build.
V4:
* Fixed build errors with clang and arm builds
* Added support for running chkincs as part of github actions CI
V3:
* Shrunk patchset as most header fixes already applied
* Moved chkincs from "apps" to the "buildtools" directory, which is a better location for something not for installation for end-user use.
* Added patch to drop check-includes script.
V2:
* Add maintainers file entry for new app
* Drop patch for c11 ring header
* Use build variable "headers_no_chkincs" for tracking exceptions
*** SUBJECT HERE ***
*** BLURB HERE ***
Bruce Richardson (8):
eal: add missing include to mcslock
eal: fix error attribute use for clang
ethdev: make driver-only headers private
rib: fix missing header include
build: separate out headers for include checking buildtools/chkincs: add app to verify header includes
devtools: remove check-includes script
ci: add checking of includes to CI builds
.ci/linux-build.sh | 1 +
MAINTAINERS | 5 +-
app/test/test_link_bonding.c | 2 +-
app/test/test_pdump.c | 2 +-
app/test/virtual_pmd.c | 2 +-
buildtools/chkincs/gen_c_file_for_header.py | 12 +
buildtools/chkincs/main.c | 4 +
buildtools/chkincs/meson.build | 40 +++
devtools/check-includes.sh | 259 ------------------
devtools/test-meson-builds.sh | 2 +-
doc/guides/contributing/coding_style.rst | 12 +
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/fman.h | 2 +-
drivers/bus/fslmc/fslmc_bus.c | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 2 +-
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +-
drivers/event/octeontx/ssovf_evdev.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
drivers/net/af_packet/rte_eth_af_packet.c | 4 +-
drivers/net/af_xdp/rte_eth_af_xdp.c | 4 +-
drivers/net/ark/ark_ethdev.c | 2 +-
drivers/net/ark/ark_ethdev_rx.h | 2 +-
drivers/net/ark/ark_ethdev_tx.h | 2 +-
drivers/net/ark/ark_ext.h | 2 +-
drivers/net/ark/ark_global.h | 2 +-
drivers/net/ark/ark_pktchkr.c | 2 +-
drivers/net/ark/ark_pktgen.c | 2 +-
drivers/net/atlantic/atl_ethdev.c | 2 +-
drivers/net/atlantic/atl_rxtx.c | 2 +-
drivers/net/atlantic/rte_pmd_atlantic.c | 2 +-
drivers/net/avp/avp_ethdev.c | 4 +-
drivers/net/axgbe/axgbe_common.h | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.c | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.h | 2 +-
drivers/net/bnxt/bnxt.h | 2 +-
drivers/net/bnxt/bnxt_ethdev.c | 4 +-
drivers/net/bnxt/bnxt_stats.h | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
drivers/net/bonding/eth_bond_private.h | 2 +-
drivers/net/bonding/rte_eth_bond_api.c | 2 +-
drivers/net/bonding/rte_eth_bond_pmd.c | 4 +-
drivers/net/cxgbe/base/t4_hw.c | 2 +-
drivers/net/cxgbe/base/t4vf_hw.c | 2 +-
drivers/net/cxgbe/cxgbe_ethdev.c | 4 +-
drivers/net/cxgbe/cxgbe_main.c | 4 +-
drivers/net/cxgbe/cxgbevf_ethdev.c | 4 +-
drivers/net/cxgbe/cxgbevf_main.c | 4 +-
drivers/net/cxgbe/sge.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.c | 2 +-
drivers/net/dpaa2/dpaa2_rxtx.c | 2 +-
drivers/net/e1000/em_ethdev.c | 4 +-
drivers/net/e1000/em_rxtx.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 4 +-
drivers/net/e1000/igb_flow.c | 4 +-
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 2 +-
drivers/net/ena/ena_ethdev.c | 4 +-
drivers/net/enetc/enetc_ethdev.c | 2 +-
drivers/net/enic/enic_ethdev.c | 4 +-
drivers/net/enic/enic_flow.c | 2 +-
drivers/net/enic/enic_fm_flow.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_res.c | 2 +-
drivers/net/enic/enic_rxtx.c | 2 +-
drivers/net/enic/enic_rxtx_vec_avx2.c | 2 +-
drivers/net/enic/enic_vf_representor.c | 4 +-
drivers/net/failsafe/failsafe.c | 4 +-
drivers/net/failsafe/failsafe_ops.c | 2 +-
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/failsafe/failsafe_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_ethdev.c | 4 +-
drivers/net/fm10k/fm10k_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_rxtx_vec.c | 2 +-
drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +-
drivers/net/hinic/hinic_pmd_ethdev.c | 2 +-
drivers/net/hinic/hinic_pmd_ethdev.h | 2 +-
drivers/net/hns3/hns3_cmd.c | 2 +-
drivers/net/hns3/hns3_ethdev.c | 2 +-
drivers/net/hns3/hns3_ethdev.h | 2 +-
drivers/net/hns3/hns3_ethdev_vf.c | 2 +-
drivers/net/hns3/hns3_fdir.c | 2 +-
drivers/net/hns3/hns3_mbx.c | 2 +-
drivers/net/hns3/hns3_mp.c | 2 +-
drivers/net/hns3/hns3_regs.c | 2 +-
drivers/net/hns3/hns3_rxtx.c | 2 +-
drivers/net/hns3/hns3_rxtx_vec.c | 2 +-
drivers/net/hns3/hns3_rxtx_vec_sve.c | 2 +-
drivers/net/i40e/i40e_ethdev.c | 4 +-
drivers/net/i40e/i40e_ethdev_vf.c | 4 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_flow.c | 2 +-
drivers/net/i40e/i40e_pf.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_avx2.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_avx512.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_common.h | 2 +-
drivers/net/i40e/i40e_rxtx_vec_neon.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_sse.c | 2 +-
drivers/net/i40e/i40e_vf_representor.c | 2 +-
drivers/net/iavf/iavf_ethdev.c | 4 +-
drivers/net/iavf/iavf_fdir.c | 2 +-
drivers/net/iavf/iavf_generic_flow.c | 2 +-
drivers/net/iavf/iavf_hash.c | 2 +-
drivers/net/iavf/iavf_rxtx.c | 2 +-
drivers/net/iavf/iavf_rxtx_vec_common.h | 2 +-
drivers/net/iavf/iavf_rxtx_vec_sse.c | 2 +-
drivers/net/iavf/iavf_vchnl.c | 4 +-
drivers/net/ice/ice_acl_filter.c | 2 +-
drivers/net/ice/ice_dcf.c | 4 +-
drivers/net/ice/ice_dcf.h | 2 +-
drivers/net/ice/ice_dcf_ethdev.c | 2 +-
drivers/net/ice/ice_ethdev.c | 2 +-
drivers/net/ice/ice_ethdev.h | 2 +-
drivers/net/ice/ice_generic_flow.c | 2 +-
drivers/net/ice/ice_hash.c | 2 +-
drivers/net/ice/ice_rxtx.c | 2 +-
drivers/net/ice/ice_switch_filter.c | 2 +-
drivers/net/igc/igc_ethdev.c | 4 +-
drivers/net/igc/igc_filter.h | 2 +-
drivers/net/igc/igc_txrx.c | 2 +-
drivers/net/ionic/ionic_ethdev.c | 4 +-
drivers/net/ionic/ionic_lif.c | 2 +-
drivers/net/ionic/ionic_rxtx.c | 2 +-
drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +-
drivers/net/ipn3ke/ipn3ke_ethdev.h | 4 +-
drivers/net/ipn3ke/ipn3ke_flow.c | 2 +-
drivers/net/ipn3ke/ipn3ke_representor.c | 2 +-
drivers/net/ipn3ke/ipn3ke_tm.c | 2 +-
drivers/net/ixgbe/ixgbe_bypass.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 4 +-
drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/ixgbe/ixgbe_ipsec.c | 4 +-
drivers/net/ixgbe/ixgbe_pf.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 2 +-
drivers/net/ixgbe/ixgbe_vf_representor.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 2 +-
drivers/net/kni/rte_eth_kni.c | 4 +-
drivers/net/liquidio/base/lio_23xx_vf.c | 2 +-
drivers/net/liquidio/base/lio_mbox.c | 2 +-
drivers/net/liquidio/lio_ethdev.c | 4 +-
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/memif/memif_socket.c | 4 +-
drivers/net/memif/rte_eth_memif.c | 4 +-
drivers/net/memif/rte_eth_memif.h | 2 +-
drivers/net/mlx4/mlx4.c | 4 +-
drivers/net/mlx4/mlx4.h | 2 +-
drivers/net/mlx4/mlx4_ethdev.c | 2 +-
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 2 +-
drivers/net/mlx4/mlx4_intr.c | 2 +-
drivers/net/mlx4/mlx4_mp.c | 2 +-
drivers/net/mlx4/mlx4_rxq.c | 2 +-
drivers/net/mlx4/mlx4_rxtx.h | 2 +-
drivers/net/mlx4/mlx4_txq.c | 2 +-
drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +-
drivers/net/mlx5/linux/mlx5_mp_os.c | 2 +-
drivers/net/mlx5/linux/mlx5_os.c | 4 +-
drivers/net/mlx5/linux/mlx5_verbs.c | 2 +-
drivers/net/mlx5/linux/mlx5_vlan_os.c | 2 +-
drivers/net/mlx5/mlx5.c | 4 +-
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_defs.h | 2 +-
drivers/net/mlx5/mlx5_ethdev.c | 2 +-
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
drivers/net/mlx5/mlx5_flow_verbs.c | 2 +-
drivers/net/mlx5/mlx5_mac.c | 2 +-
drivers/net/mlx5/mlx5_rss.c | 2 +-
drivers/net/mlx5/mlx5_rxmode.c | 2 +-
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_stats.c | 2 +-
drivers/net/mlx5/mlx5_trigger.c | 2 +-
drivers/net/mlx5/mlx5_txpp.c | 2 +-
drivers/net/mlx5/mlx5_txq.c | 2 +-
drivers/net/mlx5/mlx5_vlan.c | 2 +-
drivers/net/mlx5/windows/mlx5_ethdev_os.c | 2 +-
drivers/net/mlx5/windows/mlx5_mp_os.c | 2 +-
drivers/net/mlx5/windows/mlx5_os.c | 2 +-
drivers/net/mlx5/windows/mlx5_vlan_os.c | 2 +-
drivers/net/mvneta/mvneta_ethdev.c | 2 +-
drivers/net/mvpp2/mrvl_ethdev.c | 2 +-
drivers/net/netvsc/hn_ethdev.c | 2 +-
drivers/net/netvsc/hn_rndis.c | 2 +-
drivers/net/netvsc/hn_vf.c | 2 +-
drivers/net/nfb/nfb_ethdev.c | 2 +-
drivers/net/nfb/nfb_tx.h | 2 +-
drivers/net/nfp/nfp_net.c | 4 +-
drivers/net/nfp/nfpcore/nfp_cpp.h | 2 +-
drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 2 +-
drivers/net/nfp/nfpcore/nfp_cppcore.c | 2 +-
drivers/net/null/rte_eth_null.c | 4 +-
drivers/net/octeontx/octeontx_ethdev.h | 2 +-
drivers/net/octeontx/octeontx_rxtx.c | 2 +-
drivers/net/octeontx/octeontx_rxtx.h | 2 +-
drivers/net/octeontx2/otx2_ethdev.c | 2 +-
drivers/net/octeontx2/otx2_link.c | 2 +-
drivers/net/octeontx2/otx2_ptp.c | 2 +-
drivers/net/pcap/rte_eth_pcap.c | 4 +-
drivers/net/pfe/pfe_eth.h | 2 +-
drivers/net/pfe/pfe_ethdev.c | 2 +-
drivers/net/qede/qede_ethdev.h | 4 +-
drivers/net/ring/rte_eth_ring.c | 2 +-
drivers/net/sfc/sfc.h | 2 +-
drivers/net/sfc/sfc_dp_rx.h | 2 +-
drivers/net/sfc/sfc_dp_tx.h | 2 +-
drivers/net/sfc/sfc_ethdev.c | 4 +-
drivers/net/sfc/sfc_ev.h | 2 +-
drivers/net/sfc/sfc_flow.c | 2 +-
drivers/net/sfc/sfc_rx.h | 2 +-
drivers/net/sfc/sfc_tx.h | 2 +-
drivers/net/softnic/rte_eth_softnic.c | 4 +-
.../net/softnic/rte_eth_softnic_internals.h | 2 +-
drivers/net/szedata2/rte_eth_szedata2.c | 4 +-
drivers/net/tap/rte_eth_tap.c | 4 +-
drivers/net/tap/rte_eth_tap.h | 2 +-
drivers/net/thunderx/nicvf_ethdev.c | 4 +-
drivers/net/thunderx/nicvf_ethdev.h | 2 +-
drivers/net/thunderx/nicvf_rxtx.c | 2 +-
drivers/net/thunderx/nicvf_rxtx.h | 2 +-
drivers/net/thunderx/nicvf_struct.h | 2 +-
drivers/net/txgbe/txgbe_ethdev.c | 2 +-
drivers/net/txgbe/txgbe_ipsec.c | 2 +-
drivers/net/txgbe/txgbe_pf.c | 2 +-
drivers/net/txgbe/txgbe_rxtx.c | 2 +-
drivers/net/vhost/rte_eth_vhost.c | 4 +-
drivers/net/virtio/virtio_ethdev.c | 4 +-
drivers/net/virtio/virtio_pci.h | 2 +-
drivers/net/virtio/virtio_rxtx.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple.c | 2 +-
.../net/virtio/virtio_rxtx_simple_altivec.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_neon.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +-
drivers/net/virtio/virtio_user_ethdev.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
lib/librte_eal/include/generic/rte_mcslock.h | 1 +
lib/librte_eal/include/meson.build | 2 +-
lib/librte_eal/include/rte_compat.h | 8 +-
lib/librte_eal/x86/include/meson.build | 14 +-
.../{rte_ethdev_driver.h => ethdev_driver.h} | 0
.../{rte_ethdev_pci.h => ethdev_pci.h} | 2 +-
lib/librte_ethdev/ethdev_private.c | 2 +-
.../{rte_ethdev_vdev.h => ethdev_vdev.h} | 2 +-
lib/librte_ethdev/meson.build | 8 +-
lib/librte_ethdev/rte_class_eth.c | 2 +-
lib/librte_ethdev/rte_ethdev.c | 2 +-
lib/librte_ethdev/rte_ethdev.h | 2 +-
lib/librte_ethdev/rte_flow_driver.h | 2 +-
lib/librte_ethdev/rte_mtr_driver.h | 2 +-
lib/librte_ethdev/rte_tm_driver.h | 2 +-
lib/librte_hash/meson.build | 4 +-
lib/librte_ipsec/meson.build | 3 +-
lib/librte_lpm/meson.build | 2 +-
lib/librte_regexdev/meson.build | 2 +-
lib/librte_rib/rte_rib6.h | 1 +
lib/librte_ring/meson.build | 4 +-
lib/librte_stack/meson.build | 4 +-
lib/librte_table/meson.build | 7 +-
lib/meson.build | 3 +
meson.build | 6 +
meson_options.txt | 2 +
274 files changed, 417 insertions(+), 579 deletions(-)
create mode 100755 buildtools/chkincs/gen_c_file_for_header.py
create mode 100644 buildtools/chkincs/main.c
create mode 100644 buildtools/chkincs/meson.build
delete mode 100755 devtools/check-includes.sh
rename lib/librte_ethdev/{rte_ethdev_driver.h => ethdev_driver.h} (100%)
rename lib/librte_ethdev/{rte_ethdev_pci.h => ethdev_pci.h} (99%)
rename lib/librte_ethdev/{rte_ethdev_vdev.h => ethdev_vdev.h} (97%)--
2.27.0
PATCH v5 1/8 eal: add missing include to mcslock
Include 'rte_branch_prediction.h' to get the likely/unlikely macro definitions.
--- lib/librte_eal/include/generic/rte_mcslock.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_eal/include/generic/rte_mcslock.h +1 -0
@@ -22,6 +22,7 @@#include <rte_lcore.h> #include <rte_common.h> #include <rte_pause.h> +#include <rte_branch_prediction.h> /** * The rte_mcslock_t type.
Signature · 1 line
2.27.0
PATCH v5 2/8 eal: fix error attribute use for clang
In reply to Bruce RichardsonClang does not have an "error" attribute for functions, so for marking internal functions we need to check for the error attribute, and provide a fallback if it is not present. For clang, we can use "diagnose_if" attribute, similarly checking for its presence before use.
--- lib/librte_eal/include/rte_compat.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
lib/librte_eal/include/rte_compat.h +7 -1
@@ -19,12 +19,18 @@ __attribute__((section(".text.experimental")))#endif -#ifndef ALLOW_INTERNAL_API +#if !definedALLOW_INTERNAL_API &&__has_attribute (error)/* For GCC */ #define __rte_internal \ __attribute__((error("Symbol is not public ABI"), \ section(".text.internal"))) +#elif !definedALLOW_INTERNAL_API &&__has_attribute (diagnose_if)/* For clang */ + +#define __rte_internal \ +__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ +section(".text.internal"))) +#else #define __rte_internal \
Signature · 1 line
2.27.0
PATCH v5 3/8 ethdev: make driver-only headers private
In reply to Bruce RichardsonThe rte_ethdev_driver.h, rte_ethdev_vdev.h and rte_ethdev_pci.h files are for drivers only and should be a private to DPDK and not installed.
---
app/test/test_link_bonding.c | 2 +-
app/test/test_pdump.c | 2 +-
app/test/virtual_pmd.c | 2 +-
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/fman.h | 2 +-
drivers/bus/fslmc/fslmc_bus.c | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 2 +-
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +-
drivers/event/octeontx/ssovf_evdev.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
drivers/net/af_packet/rte_eth_af_packet.c | 4 ++--
drivers/net/af_xdp/rte_eth_af_xdp.c | 4 ++--
drivers/net/ark/ark_ethdev.c | 2 +-
drivers/net/ark/ark_ethdev_rx.h | 2 +-
drivers/net/ark/ark_ethdev_tx.h | 2 +-
drivers/net/ark/ark_ext.h | 2 +-
drivers/net/ark/ark_global.h | 2 +-
drivers/net/ark/ark_pktchkr.c | 2 +-
drivers/net/ark/ark_pktgen.c | 2 +-
drivers/net/atlantic/atl_ethdev.c | 2 +-
drivers/net/atlantic/atl_rxtx.c | 2 +-
drivers/net/atlantic/rte_pmd_atlantic.c | 2 +-
drivers/net/avp/avp_ethdev.c | 4 ++--
drivers/net/axgbe/axgbe_common.h | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.c | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.h | 2 +-
drivers/net/bnxt/bnxt.h | 2 +-
drivers/net/bnxt/bnxt_ethdev.c | 4 ++--
drivers/net/bnxt/bnxt_stats.h | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
drivers/net/bonding/eth_bond_private.h | 2 +-
drivers/net/bonding/rte_eth_bond_api.c | 2 +-
drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++--
drivers/net/cxgbe/base/t4_hw.c | 2 +-
drivers/net/cxgbe/base/t4vf_hw.c | 2 +-
drivers/net/cxgbe/cxgbe_ethdev.c | 4 ++--
drivers/net/cxgbe/cxgbe_main.c | 4 ++--
drivers/net/cxgbe/cxgbevf_ethdev.c | 4 ++--
drivers/net/cxgbe/cxgbevf_main.c | 4 ++--
drivers/net/cxgbe/sge.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.c | 2 +-
drivers/net/dpaa2/dpaa2_rxtx.c | 2 +-
drivers/net/e1000/em_ethdev.c | 4 ++--
drivers/net/e1000/em_rxtx.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 4 ++--
drivers/net/e1000/igb_flow.c | 4 ++--
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 2 +-
drivers/net/ena/ena_ethdev.c | 4 ++--
drivers/net/enetc/enetc_ethdev.c | 2 +-
drivers/net/enic/enic_ethdev.c | 4 ++--
drivers/net/enic/enic_flow.c | 2 +-
drivers/net/enic/enic_fm_flow.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_res.c | 2 +-
drivers/net/enic/enic_rxtx.c | 2 +-
drivers/net/enic/enic_rxtx_vec_avx2.c | 2 +-
drivers/net/enic/enic_vf_representor.c | 4 ++--
drivers/net/failsafe/failsafe.c | 4 ++--
drivers/net/failsafe/failsafe_ops.c | 2 +-
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/failsafe/failsafe_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_ethdev.c | 4 ++--
drivers/net/fm10k/fm10k_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_rxtx_vec.c | 2 +-
drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +-
drivers/net/hinic/hinic_pmd_ethdev.c | 2 +-
drivers/net/hinic/hinic_pmd_ethdev.h | 2 +-
drivers/net/hns3/hns3_cmd.c | 2 +-
drivers/net/hns3/hns3_ethdev.c | 2 +-
drivers/net/hns3/hns3_ethdev.h | 2 +-
drivers/net/hns3/hns3_ethdev_vf.c | 2 +-
drivers/net/hns3/hns3_fdir.c | 2 +-
drivers/net/hns3/hns3_mbx.c | 2 +-
drivers/net/hns3/hns3_mp.c | 2 +-
drivers/net/hns3/hns3_regs.c | 2 +-
drivers/net/hns3/hns3_rxtx.c | 2 +-
drivers/net/hns3/hns3_rxtx_vec.c | 2 +-
drivers/net/hns3/hns3_rxtx_vec_sve.c | 2 +-
drivers/net/i40e/i40e_ethdev.c | 4 ++--
drivers/net/i40e/i40e_ethdev_vf.c | 4 ++--
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_flow.c | 2 +-
drivers/net/i40e/i40e_pf.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_avx2.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_avx512.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_common.h | 2 +-
drivers/net/i40e/i40e_rxtx_vec_neon.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_sse.c | 2 +-
drivers/net/i40e/i40e_vf_representor.c | 2 +-
drivers/net/iavf/iavf_ethdev.c | 4 ++--
drivers/net/iavf/iavf_fdir.c | 2 +-
drivers/net/iavf/iavf_generic_flow.c | 2 +-
drivers/net/iavf/iavf_hash.c | 2 +-
drivers/net/iavf/iavf_rxtx.c | 2 +-
drivers/net/iavf/iavf_rxtx_vec_common.h | 2 +-
drivers/net/iavf/iavf_rxtx_vec_sse.c | 2 +-
drivers/net/iavf/iavf_vchnl.c | 4 ++--
drivers/net/ice/ice_acl_filter.c | 2 +-
drivers/net/ice/ice_dcf.c | 4 ++--
drivers/net/ice/ice_dcf.h | 2 +-
drivers/net/ice/ice_dcf_ethdev.c | 2 +-
drivers/net/ice/ice_ethdev.c | 2 +-
drivers/net/ice/ice_ethdev.h | 2 +-
drivers/net/ice/ice_generic_flow.c | 2 +-
drivers/net/ice/ice_hash.c | 2 +-
drivers/net/ice/ice_rxtx.c | 2 +-
drivers/net/ice/ice_switch_filter.c | 2 +-
drivers/net/igc/igc_ethdev.c | 4 ++--
drivers/net/igc/igc_filter.h | 2 +-
drivers/net/igc/igc_txrx.c | 2 +-
drivers/net/ionic/ionic_ethdev.c | 4 ++--
drivers/net/ionic/ionic_lif.c | 2 +-
drivers/net/ionic/ionic_rxtx.c | 2 +-
drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +-
drivers/net/ipn3ke/ipn3ke_ethdev.h | 4 ++--
drivers/net/ipn3ke/ipn3ke_flow.c | 2 +-
drivers/net/ipn3ke/ipn3ke_representor.c | 2 +-
drivers/net/ipn3ke/ipn3ke_tm.c | 2 +-
drivers/net/ixgbe/ixgbe_bypass.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++--
drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/ixgbe/ixgbe_ipsec.c | 4 ++--
drivers/net/ixgbe/ixgbe_pf.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 2 +-
drivers/net/ixgbe/ixgbe_vf_representor.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 2 +-
drivers/net/kni/rte_eth_kni.c | 4 ++--
drivers/net/liquidio/base/lio_23xx_vf.c | 2 +-
drivers/net/liquidio/base/lio_mbox.c | 2 +-
drivers/net/liquidio/lio_ethdev.c | 4 ++--
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/memif/memif_socket.c | 4 ++--
drivers/net/memif/rte_eth_memif.c | 4 ++--
drivers/net/memif/rte_eth_memif.h | 2 +-
drivers/net/mlx4/mlx4.c | 4 ++--
drivers/net/mlx4/mlx4.h | 2 +-
drivers/net/mlx4/mlx4_ethdev.c | 2 +-
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 2 +-
drivers/net/mlx4/mlx4_intr.c | 2 +-
drivers/net/mlx4/mlx4_mp.c | 2 +-
drivers/net/mlx4/mlx4_rxq.c | 2 +-
drivers/net/mlx4/mlx4_rxtx.h | 2 +-
drivers/net/mlx4/mlx4_txq.c | 2 +-
drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +-
drivers/net/mlx5/linux/mlx5_mp_os.c | 2 +-
drivers/net/mlx5/linux/mlx5_os.c | 4 ++--
drivers/net/mlx5/linux/mlx5_verbs.c | 2 +-
drivers/net/mlx5/linux/mlx5_vlan_os.c | 2 +-
drivers/net/mlx5/mlx5.c | 4 ++--
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_defs.h | 2 +-
drivers/net/mlx5/mlx5_ethdev.c | 2 +-
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
drivers/net/mlx5/mlx5_flow_verbs.c | 2 +-
drivers/net/mlx5/mlx5_mac.c | 2 +-
drivers/net/mlx5/mlx5_rss.c | 2 +-
drivers/net/mlx5/mlx5_rxmode.c | 2 +-
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_stats.c | 2 +-
drivers/net/mlx5/mlx5_trigger.c | 2 +-
drivers/net/mlx5/mlx5_txpp.c | 2 +-
drivers/net/mlx5/mlx5_txq.c | 2 +-
drivers/net/mlx5/mlx5_vlan.c | 2 +-
drivers/net/mlx5/windows/mlx5_ethdev_os.c | 2 +-
drivers/net/mlx5/windows/mlx5_mp_os.c | 2 +-
drivers/net/mlx5/windows/mlx5_os.c | 2 +-
drivers/net/mlx5/windows/mlx5_vlan_os.c | 2 +-
drivers/net/mvneta/mvneta_ethdev.c | 2 +-
drivers/net/mvpp2/mrvl_ethdev.c | 2 +-
drivers/net/netvsc/hn_ethdev.c | 2 +-
drivers/net/netvsc/hn_rndis.c | 2 +-
drivers/net/netvsc/hn_vf.c | 2 +-
drivers/net/nfb/nfb_ethdev.c | 2 +-
drivers/net/nfb/nfb_tx.h | 2 +-
drivers/net/nfp/nfp_net.c | 4 ++--
drivers/net/nfp/nfpcore/nfp_cpp.h | 2 +-
drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 2 +-
drivers/net/nfp/nfpcore/nfp_cppcore.c | 2 +-
drivers/net/null/rte_eth_null.c | 4 ++--
drivers/net/octeontx/octeontx_ethdev.h | 2 +-
drivers/net/octeontx/octeontx_rxtx.c | 2 +-
drivers/net/octeontx/octeontx_rxtx.h | 2 +-
drivers/net/octeontx2/otx2_ethdev.c | 2 +-
drivers/net/octeontx2/otx2_link.c | 2 +-
drivers/net/octeontx2/otx2_ptp.c | 2 +-
drivers/net/pcap/rte_eth_pcap.c | 4 ++--
drivers/net/pfe/pfe_eth.h | 2 +-
drivers/net/pfe/pfe_ethdev.c | 2 +-
drivers/net/qede/qede_ethdev.h | 4 ++--
drivers/net/ring/rte_eth_ring.c | 2 +-
drivers/net/sfc/sfc.h | 2 +-
drivers/net/sfc/sfc_dp_rx.h | 2 +-
drivers/net/sfc/sfc_dp_tx.h | 2 +-
drivers/net/sfc/sfc_ethdev.c | 4 ++--
drivers/net/sfc/sfc_ev.h | 2 +-
drivers/net/sfc/sfc_flow.c | 2 +-
drivers/net/sfc/sfc_rx.h | 2 +-
drivers/net/sfc/sfc_tx.h | 2 +-
drivers/net/softnic/rte_eth_softnic.c | 4 ++--
drivers/net/softnic/rte_eth_softnic_internals.h | 2 +-
drivers/net/szedata2/rte_eth_szedata2.c | 4 ++--
drivers/net/tap/rte_eth_tap.c | 4 ++--
drivers/net/tap/rte_eth_tap.h | 2 +-
drivers/net/thunderx/nicvf_ethdev.c | 4 ++--
drivers/net/thunderx/nicvf_ethdev.h | 2 +-
drivers/net/thunderx/nicvf_rxtx.c | 2 +-
drivers/net/thunderx/nicvf_rxtx.h | 2 +-
drivers/net/thunderx/nicvf_struct.h | 2 +-
drivers/net/txgbe/txgbe_ethdev.c | 2 +-
drivers/net/txgbe/txgbe_ipsec.c | 2 +-
drivers/net/txgbe/txgbe_pf.c | 2 +-
drivers/net/txgbe/txgbe_rxtx.c | 2 +-
drivers/net/vhost/rte_eth_vhost.c | 4 ++--
drivers/net/virtio/virtio_ethdev.c | 4 ++--
drivers/net/virtio/virtio_pci.h | 2 +-
drivers/net/virtio/virtio_rxtx.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_altivec.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_neon.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +-
drivers/net/virtio/virtio_user_ethdev.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 ++--
drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
lib/librte_ethdev/{rte_ethdev_driver.h => ethdev_driver.h} | 0
lib/librte_ethdev/{rte_ethdev_pci.h => ethdev_pci.h} | 2 +-
lib/librte_ethdev/ethdev_private.c | 2 +-
lib/librte_ethdev/{rte_ethdev_vdev.h => ethdev_vdev.h} | 2 +-
lib/librte_ethdev/meson.build | 3 ---
lib/librte_ethdev/rte_class_eth.c | 2 +-
lib/librte_ethdev/rte_ethdev.c | 2 +-
lib/librte_ethdev/rte_ethdev.h | 2 +-
lib/librte_ethdev/rte_flow_driver.h | 2 +-
lib/librte_ethdev/rte_mtr_driver.h | 2 +-
lib/librte_ethdev/rte_tm_driver.h | 2 +-
251 files changed, 295 insertions(+), 298 deletions(-)
rename lib/librte_ethdev/{rte_ethdev_driver.h => ethdev_driver.h} (100%)
rename lib/librte_ethdev/{rte_ethdev_pci.h => ethdev_pci.h} (99%)
rename lib/librte_ethdev/{rte_ethdev_vdev.h => ethdev_vdev.h} (97%)app/test/test_link_bonding.c +1 -1
@@ -17,7 +17,7 @@#include <rte_common.h> #include <rte_debug.h> #include <rte_ethdev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_log.h> #include <rte_lcore.h> #include <rte_memory.h>
app/test/test_pdump.c +1 -1
@@ -6,7 +6,7 @@#include <stdint.h> #include <limits.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_pdump.h> #include "rte_eal.h" #include "rte_lcore.h"
app/test/virtual_pmd.c +1 -1
@@ -4,7 +4,7 @@#include <rte_mbuf.h> #include <rte_ethdev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_malloc.h>
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -27,7 +27,7 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_ring.h> #include <rte_bus.h>
drivers/bus/dpaa/include/fman.h +1 -1
@@ -12,7 +12,7 @@#include <stdbool.h> #include <net/if.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ether.h> #include <compat.h>
drivers/bus/fslmc/fslmc_bus.c +1 -1
@@ -13,7 +13,7 @@#include <rte_malloc.h> #include <rte_devargs.h> #include <rte_memcpy.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_mbuf_dyn.h> #include <rte_fslmc.h>
drivers/bus/fslmc/fslmc_vfio.c +1 -1
@@ -22,7 +22,7 @@#include <eal_filesystem.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_string_fns.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +1 -1
@@ -19,7 +19,7 @@#include <rte_cycles.h> #include <rte_kvargs.h> #include <rte_dev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_mbuf_pool_ops.h> #include <fslmc_logs.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +1 -1
@@ -18,7 +18,7 @@#include <rte_cycles.h> #include <rte_kvargs.h> #include <rte_dev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <fslmc_logs.h> #include <rte_fslmc.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +1 -1
@@ -24,7 +24,7 @@#include <sys/eventfd.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_string_fns.h>
drivers/event/dpaa2/dpaa2_eventdev.c +1 -1
@@ -24,7 +24,7 @@#include <rte_memory.h> #include <rte_pci.h> #include <rte_bus_vdev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_cryptodev.h> #include <rte_event_eth_rx_adapter.h> #include <rte_event_eth_tx_adapter.h>
drivers/event/dpaa2/dpaa2_hw_dpcon.c +1 -1
@@ -18,7 +18,7 @@#include <rte_cycles.h> #include <rte_kvargs.h> #include <rte_dev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_fslmc.h> #include <mc/fsl_dpcon.h>
drivers/event/octeontx/ssovf_evdev.c +1 -1
@@ -8,7 +8,7 @@#include <rte_debug.h> #include <rte_dev.h> #include <rte_eal.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_event_eth_rx_adapter.h> #include <rte_kvargs.h> #include <rte_lcore.h>
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +1 -1
@@ -14,7 +14,7 @@#include <errno.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_string_fns.h>
drivers/net/af_packet/rte_eth_af_packet.c +2 -2
@@ -8,8 +8,8 @@#include <rte_string_fns.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_kvargs.h> #include <rte_bus_vdev.h>
drivers/net/af_xdp/rte_eth_af_xdp.c +2 -2
@@ -19,8 +19,8 @@#include <bpf/xsk.h> #include <rte_ethdev.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_kvargs.h> #include <rte_bus_vdev.h> #include <rte_string_fns.h>
drivers/net/ark/ark_ethdev.c +1 -1
@@ -7,7 +7,7 @@#include <dlfcn.h> #include <rte_bus_pci.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_kvargs.h> #include "rte_pmd_ark.h"
drivers/net/ark/ark_ethdev_rx.h +1 -1
@@ -9,7 +9,7 @@#include <rte_mbuf.h> #include <rte_mempool.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> extern uint64_t ark_timestamp_rx_dynflag;extern int ark_timestamp_dynfield_offset;
drivers/net/ark/ark_ethdev_tx.h +1 -1
@@ -7,7 +7,7 @@#include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> uint16_t eth_ark_xmit_pkts_noop(void *vtxq,
drivers/net/ark/ark_ext.h +1 -1
@@ -5,7 +5,7 @@#ifndef _ARK_EXT_H_#define _ARK_EXT_H_ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> /* * This is the template file for users who which to define a dynamic
drivers/net/ark/ark_global.h +1 -1
@@ -9,7 +9,7 @@#include <assert.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_string_fns.h>
drivers/net/ark/ark_pktchkr.c +1 -1
@@ -8,7 +8,7 @@#include <unistd.h> #include <rte_string_fns.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include "ark_pktchkr.h"
drivers/net/ark/ark_pktgen.c +1 -1
@@ -10,7 +10,7 @@#include <rte_string_fns.h> #include <rte_eal.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include "ark_pktgen.h"
drivers/net/atlantic/atl_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_string_fns.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_alarm.h> #include "atl_ethdev.h"
drivers/net/atlantic/atl_rxtx.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_malloc.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_net.h> #include "atl_ethdev.h"
drivers/net/atlantic/rte_pmd_atlantic.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018 Aquantia Corporation */ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "rte_pmd_atlantic.h" #include "atl_ethdev.h"
drivers/net/avp/avp_ethdev.c +2 -2
@@ -8,8 +8,8 @@#include <errno.h> #include <unistd.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_malloc.h>
drivers/net/axgbe/axgbe_common.h +1 -1
@@ -35,7 +35,7 @@#include <rte_ethdev.h> #include <rte_dev.h> #include <rte_errno.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_common.h> #include <rte_cycles.h> #include <rte_io.h>
drivers/net/bnx2x/bnx2x_ethdev.c +1 -1
@@ -10,7 +10,7 @@#include <rte_string_fns.h> #include <rte_dev.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_alarm.h> /*
drivers/net/bnx2x/bnx2x_ethdev.h +1 -1
@@ -31,7 +31,7 @@#include <rte_debug.h> #include <rte_pci.h> #include <rte_malloc.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_spinlock.h> #include <rte_eal.h> #include <rte_mempool.h>
drivers/net/bnxt/bnxt.h +1 -1
@@ -12,7 +12,7 @@#include <rte_pci.h> #include <rte_bus_pci.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_memory.h> #include <rte_lcore.h> #include <rte_spinlock.h>
drivers/net/bnxt/bnxt_ethdev.c +2 -2
@@ -7,8 +7,8 @@#include <stdbool.h> #include <rte_dev.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_cycles.h> #include <rte_alarm.h>
drivers/net/bnxt/bnxt_stats.h +1 -1
@@ -6,7 +6,7 @@#ifndef _BNXT_STATS_H_#define _BNXT_STATS_H_ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> void bnxt_free_stats (struct bnxt *bp); int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
@@ -8,7 +8,7 @@#include <unistd.h> #include <rte_dev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_cycles.h> #include <rte_byteorder.h>
drivers/net/bonding/eth_bond_private.h +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <sys/queue.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_flow.h> #include <rte_spinlock.h> #include <rte_bitmap.h>
drivers/net/bonding/rte_eth_bond_api.c +1 -1
@@ -6,7 +6,7 @@#include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_tcp.h> #include <rte_bus_vdev.h> #include <rte_kvargs.h>
drivers/net/bonding/rte_eth_bond_pmd.c +2 -2
@@ -7,8 +7,8 @@#include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_tcp.h> #include <rte_udp.h> #include <rte_ip.h>
drivers/net/cxgbe/base/t4_hw.c +1 -1
@@ -16,7 +16,7 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_random.h> #include <rte_dev.h>
drivers/net/cxgbe/base/t4vf_hw.c +1 -1
@@ -3,7 +3,7 @@* All rights reserved. */ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ether.h> #include "common.h"
drivers/net/cxgbe/cxgbe_ethdev.c +2 -2
@@ -28,8 +28,8 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_random.h> #include <rte_dev.h>
drivers/net/cxgbe/cxgbe_main.c +2 -2
@@ -27,8 +27,8 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_random.h> #include <rte_dev.h> #include <rte_kvargs.h>
drivers/net/cxgbe/cxgbevf_ethdev.c +2 -2
@@ -3,8 +3,8 @@* All rights reserved. */ -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include "cxgbe.h" #include "cxgbe_pfvf.h"
drivers/net/cxgbe/cxgbevf_main.c +2 -2
@@ -3,8 +3,8 @@* All rights reserved. */ -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_malloc.h> #include "base/common.h"
drivers/net/cxgbe/sge.c +1 -1
@@ -28,7 +28,7 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_random.h> #include <rte_dev.h>
drivers/net/dpaa/dpaa_ethdev.c +1 -1
@@ -29,7 +29,7 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_ring.h>
drivers/net/dpaa/dpaa_ethdev.h +1 -1
@@ -9,7 +9,7 @@/* System headers */ #include <stdbool.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_event_eth_rx_adapter.h> #include <fsl_usd.h>
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -26,7 +26,7 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_ring.h> #include <rte_ip.h>
drivers/net/dpaa2/base/dpaa2_hw_dpni.c +1 -1
@@ -9,7 +9,7 @@#include <net/if.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_string_fns.h>
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -9,7 +9,7 @@#include <net/if.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_string_fns.h>
drivers/net/dpaa2/dpaa2_rxtx.c +1 -1
@@ -9,7 +9,7 @@#include <net/if.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_string_fns.h>
drivers/net/e1000/em_ethdev.c +2 -2
@@ -15,8 +15,8 @@#include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_memory.h> #include <rte_eal.h> #include <rte_malloc.h>
drivers/net/e1000/em_rxtx.c +1 -1
@@ -32,7 +32,7 @@#include <rte_malloc.h> #include <rte_mbuf.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_prefetch.h> #include <rte_ip.h> #include <rte_udp.h>
drivers/net/e1000/igb_ethdev.c +2 -2
@@ -17,8 +17,8 @@#include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_memory.h> #include <rte_eal.h> #include <rte_malloc.h>
drivers/net/e1000/igb_flow.c +2 -2
@@ -15,8 +15,8 @@#include <rte_debug.h> #include <rte_pci.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_memory.h> #include <rte_eal.h> #include <rte_atomic.h>
drivers/net/e1000/igb_pf.c +1 -1
@@ -16,7 +16,7 @@#include <rte_debug.h> #include <rte_eal.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_memcpy.h> #include <rte_malloc.h> #include <rte_random.h>
drivers/net/e1000/igb_rxtx.c +1 -1
@@ -31,7 +31,7 @@#include <rte_malloc.h> #include <rte_mbuf.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_prefetch.h> #include <rte_udp.h> #include <rte_tcp.h>
drivers/net/ena/ena_ethdev.c +2 -2
@@ -5,8 +5,8 @@#include <rte_string_fns.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_tcp.h> #include <rte_atomic.h> #include <rte_dev.h>
drivers/net/enetc/enetc_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdbool.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_random.h> #include <dpaax_iova_table.h>
drivers/net/enic/enic_ethdev.c +2 -2
@@ -9,8 +9,8 @@#include <rte_dev.h> #include <rte_pci.h> #include <rte_bus_pci.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_kvargs.h> #include <rte_string_fns.h>
drivers/net/enic/enic_flow.c +1 -1
@@ -5,7 +5,7 @@#include <errno.h> #include <stdint.h> #include <rte_log.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_flow_driver.h> #include <rte_ether.h> #include <rte_ip.h>
drivers/net/enic/enic_fm_flow.c +1 -1
@@ -5,7 +5,7 @@#include <errno.h> #include <stdint.h> #include <rte_log.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_flow_driver.h> #include <rte_ether.h> #include <rte_hash.h>
drivers/net/enic/enic_main.c +1 -1
@@ -15,7 +15,7 @@#include <rte_malloc.h> #include <rte_mbuf.h> #include <rte_string_fns.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "enic_compat.h" #include "enic.h"
drivers/net/enic/enic_res.c +1 -1
@@ -4,7 +4,7 @@*/ #include "enic_compat.h" -#include "rte_ethdev_driver.h" +#include "ethdev_driver.h" #include "wq_enet_desc.h" #include "rq_enet_desc.h" #include "cq_enet_desc.h"
drivers/net/enic/enic_rxtx.c +1 -1
@@ -4,7 +4,7 @@*/ #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_net.h> #include <rte_prefetch.h>
drivers/net/enic/enic_rxtx_vec_avx2.c +1 -1
@@ -4,7 +4,7 @@*/ #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_vect.h> #include "enic_compat.h"
drivers/net/enic/enic_vf_representor.c +2 -2
@@ -8,8 +8,8 @@#include <rte_bus_pci.h> #include <rte_common.h> #include <rte_dev.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_flow_driver.h> #include <rte_kvargs.h> #include <rte_pci.h>
drivers/net/failsafe/failsafe.c +2 -2
@@ -7,8 +7,8 @@#include <rte_alarm.h> #include <rte_malloc.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_devargs.h> #include <rte_kvargs.h> #include <rte_bus_vdev.h>
drivers/net/failsafe/failsafe_ops.c +1 -1
@@ -9,7 +9,7 @@#include <rte_debug.h> #include <rte_atomic.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_flow.h> #include <rte_cycles.h>
drivers/net/failsafe/failsafe_private.h +1 -1
@@ -12,7 +12,7 @@#include <rte_atomic.h> #include <rte_dev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_devargs.h> #include <rte_flow.h> #include <rte_interrupts.h>
drivers/net/failsafe/failsafe_rxtx.c +1 -1
@@ -6,7 +6,7 @@#include <rte_atomic.h> #include <rte_debug.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "failsafe_private.h"
drivers/net/fm10k/fm10k_ethdev.c +2 -2
@@ -2,8 +2,8 @@* Copyright(c) 2013-2016 Intel Corporation */ -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_memzone.h> #include <rte_string_fns.h>
drivers/net/fm10k/fm10k_rxtx.c +1 -1
@@ -4,7 +4,7 @@#include <inttypes.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_common.h> #include <rte_net.h> #include "fm10k.h"
drivers/net/fm10k/fm10k_rxtx_vec.c +1 -1
@@ -4,7 +4,7 @@#include <inttypes.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_common.h> #include "fm10k.h" #include "base/fm10k_type.h"
drivers/net/hinic/base/hinic_pmd_hwdev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2017 Huawei Technologies Co., Ltd */ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_bus_pci.h> #include <rte_hash.h> #include <rte_jhash.h>
drivers/net/hinic/hinic_pmd_ethdev.c +1 -1
@@ -4,7 +4,7 @@#include <rte_pci.h> #include <rte_bus_pci.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_memcpy.h>
drivers/net/hinic/hinic_pmd_ethdev.h +1 -1
@@ -7,7 +7,7 @@#include <rte_ethdev.h> #include <rte_ethdev_core.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "base/hinic_compat.h" #include "base/hinic_pmd_cfg.h"
drivers/net/hns3/hns3_cmd.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018-2019 Hisilicon Limited. */ -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_io.h> #include "hns3_ethdev.h"
drivers/net/hns3/hns3_ethdev.c +1 -1
@@ -4,7 +4,7 @@#include <rte_alarm.h> #include <rte_bus_pci.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_pci.h> #include "hns3_ethdev.h"
drivers/net/hns3/hns3_ethdev.h +1 -1
@@ -6,7 +6,7 @@#define _HNS3_ETHDEV_H_#include <sys/time.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_byteorder.h> #include <rte_io.h> #include <rte_spinlock.h>
drivers/net/hns3/hns3_ethdev_vf.c +1 -1
@@ -4,7 +4,7 @@#include <linux/pci_regs.h> #include <rte_alarm.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_io.h> #include <rte_pci.h> #include <rte_vfio.h>
drivers/net/hns3/hns3_fdir.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018-2019 Hisilicon Limited. */ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_hash.h> #include <rte_hash_crc.h> #include <rte_io.h>
drivers/net/hns3/hns3_mbx.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018-2019 Hisilicon Limited. */ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_io.h> #include "hns3_ethdev.h"
drivers/net/hns3/hns3_mp.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_eal.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_string_fns.h> #include <rte_io.h>
drivers/net/hns3/hns3_regs.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018-2019 Hisilicon Limited. */ -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_io.h> #include "hns3_ethdev.h"
drivers/net/hns3/hns3_rxtx.c +1 -1
@@ -6,7 +6,7 @@#include <rte_common.h> #include <rte_cycles.h> #include <rte_vxlan.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_io.h> #include <rte_net.h> #include <rte_malloc.h>
drivers/net/hns3/hns3_rxtx_vec.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_io.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "hns3_ethdev.h" #include "hns3_rxtx.h"
drivers/net/hns3/hns3_rxtx_vec_sve.c +1 -1
@@ -4,7 +4,7 @@#include <arm_sve.h> #include <rte_io.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "hns3_ethdev.h" #include "hns3_rxtx.h"
drivers/net/i40e/i40e_ethdev.c +2 -2
@@ -17,8 +17,8 @@#include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_memzone.h> #include <rte_malloc.h> #include <rte_memcpy.h>
drivers/net/i40e/i40e_ethdev_vf.c +2 -2
@@ -25,8 +25,8 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_dev.h>
drivers/net/i40e/i40e_fdir.c +1 -1
@@ -11,7 +11,7 @@#include <stdarg.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_log.h> #include <rte_memzone.h> #include <rte_malloc.h>
drivers/net/i40e/i40e_flow.c +1 -1
@@ -12,7 +12,7 @@#include <rte_debug.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_log.h> #include <rte_malloc.h> #include <rte_tailq.h>
drivers/net/i40e/i40e_pf.c +1 -1
@@ -14,7 +14,7 @@#include <rte_string_fns.h> #include <rte_pci.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h>
drivers/net/i40e/i40e_rxtx.c +1 -1
@@ -17,7 +17,7 @@#include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_tcp.h> #include <rte_sctp.h> #include <rte_udp.h>
drivers/net/i40e/i40e_rxtx_vec_altivec.c +1 -1
@@ -4,7 +4,7 @@*/ #include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include "base/i40e_prototype.h"
drivers/net/i40e/i40e_rxtx_vec_avx2.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include "base/i40e_prototype.h"
drivers/net/i40e/i40e_rxtx_vec_avx512.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include "base/i40e_prototype.h"
drivers/net/i40e/i40e_rxtx_vec_common.h +1 -1
@@ -5,7 +5,7 @@#ifndef _I40E_RXTX_VEC_COMMON_H_#define _I40E_RXTX_VEC_COMMON_H_#include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include "i40e_ethdev.h"
drivers/net/i40e/i40e_rxtx_vec_neon.c +1 -1
@@ -4,7 +4,7 @@*/ #include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_vect.h>
drivers/net/i40e/i40e_rxtx_vec_sse.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include "base/i40e_prototype.h"
drivers/net/i40e/i40e_vf_representor.c +1 -1
@@ -7,7 +7,7 @@#include <rte_pci.h> #include <rte_malloc.h> -#include "rte_ethdev_driver.h" +#include "ethdev_driver.h" #include "base/i40e_type.h" #include "base/virtchnl.h" #include "i40e_ethdev.h"
drivers/net/iavf/iavf_ethdev.c +2 -2
@@ -19,8 +19,8 @@#include <rte_atomic.h> #include <rte_eal.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_memzone.h> #include <rte_dev.h>
drivers/net/iavf/iavf_fdir.c +1 -1
@@ -11,7 +11,7 @@#include <stdarg.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_tailq.h>
drivers/net/iavf/iavf_generic_flow.c +1 -1
@@ -11,7 +11,7 @@#include <stdarg.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_tailq.h>
drivers/net/iavf/iavf_hash.c +1 -1
@@ -12,7 +12,7 @@#include <rte_debug.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_log.h> #include <rte_malloc.h> #include <rte_eth_ctrl.h>
drivers/net/iavf/iavf_rxtx.c +1 -1
@@ -17,7 +17,7 @@#include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_tcp.h> #include <rte_sctp.h> #include <rte_udp.h>
drivers/net/iavf/iavf_rxtx_vec_common.h +1 -1
@@ -5,7 +5,7 @@#ifndef _IAVF_RXTX_VEC_COMMON_H_#define _IAVF_RXTX_VEC_COMMON_H_#include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include "iavf.h"
drivers/net/iavf/iavf_rxtx_vec_sse.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include "iavf.h"
drivers/net/iavf/iavf_vchnl.c +2 -2
@@ -16,8 +16,8 @@#include <rte_atomic.h> #include <rte_eal.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_dev.h> #include "iavf.h"
drivers/net/ice/ice_acl_filter.c +1 -1
@@ -11,7 +11,7 @@#include <stdarg.h> #include <rte_debug.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_log.h> #include <rte_malloc.h> #include <rte_eth_ctrl.h>
drivers/net/ice/ice_dcf.c +2 -2
@@ -17,8 +17,8 @@#include <rte_atomic.h> #include <rte_eal.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_memzone.h> #include <rte_dev.h>
drivers/net/ice/ice_dcf.h +1 -1
@@ -5,7 +5,7 @@#ifndef _ICE_DCF_H_#define _ICE_DCF_H_ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <iavf_prototype.h> #include <iavf_adminq_cmd.h>
drivers/net/ice/ice_dcf_ethdev.c +1 -1
@@ -14,7 +14,7 @@#include <rte_atomic.h> #include <rte_eal.h> #include <rte_ether.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_kvargs.h> #include <rte_malloc.h> #include <rte_memzone.h>
drivers/net/ice/ice_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_string_fns.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <stdio.h> #include <sys/types.h>
drivers/net/ice/ice_ethdev.h +1 -1
@@ -7,7 +7,7 @@#include <rte_kvargs.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "base/ice_common.h" #include "base/ice_adminq_cmd.h"
drivers/net/ice/ice_generic_flow.c +1 -1
@@ -11,7 +11,7 @@#include <stdarg.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_tailq.h>
drivers/net/ice/ice_hash.c +1 -1
@@ -12,7 +12,7 @@#include <rte_debug.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_log.h> #include <rte_malloc.h> #include <rte_eth_ctrl.h>
drivers/net/ice/ice_rxtx.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018 Intel Corporation */ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_net.h> #include <rte_vect.h>
drivers/net/ice/ice_switch_filter.c +1 -1
@@ -11,7 +11,7 @@#include <stdarg.h> #include <rte_debug.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_log.h> #include <rte_malloc.h> #include <rte_eth_ctrl.h>
drivers/net/igc/igc_ethdev.c +2 -2
@@ -8,8 +8,8 @@#include <rte_string_fns.h> #include <rte_pci.h> #include <rte_bus_pci.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_alarm.h>
drivers/net/igc/igc_filter.h +1 -1
@@ -8,7 +8,7 @@#include <rte_ethdev.h> #include <rte_ethdev_core.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_eth_ctrl.h> #include "igc_ethdev.h"
drivers/net/igc/igc_txrx.c +1 -1
@@ -4,7 +4,7 @@#include <rte_config.h> #include <rte_malloc.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_net.h> #include "igc_logs.h"
drivers/net/ionic/ionic_ethdev.c +2 -2
@@ -5,9 +5,9 @@#include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_ethdev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include "ionic_logs.h" #include "ionic.h"
drivers/net/ionic/ionic_lif.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_malloc.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "ionic.h" #include "ionic_logs.h"
drivers/net/ionic/ionic_rxtx.c +1 -1
@@ -31,7 +31,7 @@#include <rte_malloc.h> #include <rte_mbuf.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_prefetch.h> #include <rte_udp.h> #include <rte_tcp.h>
drivers/net/ipn3ke/ipn3ke_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <rte_mbuf.h> #include <rte_sched.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_io.h> #include <rte_rawdev.h>
drivers/net/ipn3ke/ipn3ke_ethdev.h +2 -2
@@ -15,8 +15,8 @@#include <rte_mbuf.h> #include <rte_flow_driver.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_bus_vdev.h>
drivers/net/ipn3ke/ipn3ke_flow.c +1 -1
@@ -13,7 +13,7 @@#include <rte_io.h> #include <rte_debug.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_log.h> #include <rte_malloc.h> #include <rte_eth_ctrl.h>
drivers/net/ipn3ke/ipn3ke_representor.c +1 -1
@@ -12,7 +12,7 @@#include <rte_mbuf.h> #include <rte_sched.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_spinlock.h> #include <rte_io.h>
drivers/net/ipn3ke/ipn3ke_tm.c +1 -1
@@ -14,7 +14,7 @@#include <rte_mbuf.h> #include <rte_sched.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_io.h> #include <rte_rawdev.h>
drivers/net/ixgbe/ixgbe_bypass.c +1 -1
@@ -4,7 +4,7 @@#include <time.h> #include <rte_atomic.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "ixgbe_ethdev.h" #include "ixgbe_bypass_api.h" #include "rte_pmd_ixgbe.h"
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
@@ -27,8 +27,8 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_random.h> #include <rte_dev.h>
drivers/net/ixgbe/ixgbe_fdir.c +1 -1
@@ -13,7 +13,7 @@#include <rte_debug.h> #include <rte_pci.h> #include <rte_vxlan.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include "ixgbe_logs.h"
drivers/net/ixgbe/ixgbe_flow.c +1 -1
@@ -25,7 +25,7 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_random.h> #include <rte_dev.h>
drivers/net/ixgbe/ixgbe_ipsec.c +2 -2
@@ -2,8 +2,8 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_ip.h> #include <rte_jhash.h> #include <rte_security_driver.h>
drivers/net/ixgbe/ixgbe_pf.c +1 -1
@@ -15,7 +15,7 @@#include <rte_debug.h> #include <rte_eal.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_memcpy.h> #include <rte_malloc.h> #include <rte_random.h>
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
@@ -33,7 +33,7 @@#include <rte_malloc.h> #include <rte_mbuf.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_security_driver.h> #include <rte_prefetch.h> #include <rte_udp.h>
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h +1 -1
@@ -5,7 +5,7 @@#ifndef _IXGBE_RXTX_VEC_COMMON_H_#define _IXGBE_RXTX_VEC_COMMON_H_#include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "ixgbe_ethdev.h" #include "ixgbe_rxtx.h"
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_vect.h>
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include "ixgbe_ethdev.h"
drivers/net/ixgbe/ixgbe_vf_representor.c +1 -1
@@ -6,7 +6,7 @@#include <rte_pci.h> #include <rte_malloc.h> -#include "rte_ethdev_driver.h" +#include "ethdev_driver.h" #include "base/ixgbe_type.h" #include "base/ixgbe_vf.h" #include "ixgbe_ethdev.h"
drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "base/ixgbe_api.h" #include "base/ixgbe_x550.h"
drivers/net/kni/rte_eth_kni.c +2 -2
@@ -7,8 +7,8 @@#include <unistd.h> #include <rte_string_fns.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_kni.h> #include <rte_kvargs.h> #include <rte_malloc.h>
drivers/net/liquidio/base/lio_23xx_vf.c +1 -1
@@ -4,7 +4,7 @@#include <string.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_cycles.h> #include <rte_malloc.h>
drivers/net/liquidio/base/lio_mbox.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2017 Cavium, Inc */ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_cycles.h> #include "lio_logs.h"
drivers/net/liquidio/lio_ethdev.c +2 -2
@@ -3,8 +3,8 @@*/ #include <rte_string_fns.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_cycles.h> #include <rte_malloc.h> #include <rte_alarm.h>
drivers/net/liquidio/lio_rxtx.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2017 Cavium, Inc */ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_cycles.h> #include <rte_malloc.h>
drivers/net/memif/memif_socket.c +2 -2
@@ -13,8 +13,8 @@#include <rte_version.h> #include <rte_mbuf.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_kvargs.h> #include <rte_bus_vdev.h>
drivers/net/memif/rte_eth_memif.c +2 -2
@@ -17,8 +17,8 @@#include <rte_version.h> #include <rte_mbuf.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_kvargs.h> #include <rte_bus_vdev.h>
drivers/net/memif/rte_eth_memif.h +1 -1
@@ -11,7 +11,7 @@#include <sys/queue.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ether.h> #include <rte_interrupts.h>
drivers/net/mlx4/mlx4.c +2 -2
@@ -33,8 +33,8 @@#include <rte_common.h> #include <rte_dev.h> #include <rte_errno.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_ether.h> #include <rte_flow.h> #include <rte_interrupts.h>
drivers/net/mlx4/mlx4.h +1 -1
@@ -19,7 +19,7 @@#pragma GCC diagnostic error "-Wpedantic"#endif -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ether.h> #include <rte_interrupts.h> #include <rte_mempool.h>
drivers/net/mlx4/mlx4_ethdev.c +1 -1
@@ -34,7 +34,7 @@#include <rte_bus_pci.h> #include <rte_errno.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ether.h> #include <rte_flow.h> #include <rte_pci.h>
drivers/net/mlx4/mlx4_flow.c +1 -1
@@ -27,7 +27,7 @@#include <rte_byteorder.h> #include <rte_errno.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ether.h> #include <rte_flow.h> #include <rte_flow_driver.h>
drivers/net/mlx4/mlx4_flow.h +1 -1
@@ -18,7 +18,7 @@#pragma GCC diagnostic error "-Wpedantic"#endif -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_flow.h> #include <rte_flow_driver.h> #include <rte_byteorder.h>
drivers/net/mlx4/mlx4_intr.c +1 -1
@@ -23,7 +23,7 @@#include <rte_alarm.h> #include <rte_errno.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_io.h> #include <rte_interrupts.h>
drivers/net/mlx4/mlx4_mp.c +1 -1
@@ -7,7 +7,7 @@#include <time.h> #include <rte_eal.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_string_fns.h> #include "mlx4.h"
drivers/net/mlx4/mlx4_rxq.c +1 -1
@@ -26,7 +26,7 @@#include <rte_byteorder.h> #include <rte_common.h> #include <rte_errno.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_flow.h> #include <rte_malloc.h> #include <rte_mbuf.h>
drivers/net/mlx4/mlx4_rxtx.h +1 -1
@@ -19,7 +19,7 @@#pragma GCC diagnostic error "-Wpedantic"#endif -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_mbuf.h> #include <rte_mempool.h>
drivers/net/mlx4/mlx4_txq.c +1 -1
@@ -27,7 +27,7 @@#include <rte_common.h> #include <rte_errno.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_mbuf.h> #include <rte_mempool.h>
drivers/net/mlx5/linux/mlx5_ethdev_os.c +1 -1
@@ -24,7 +24,7 @@#include <sys/un.h> #include <time.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_bus_pci.h> #include <rte_mbuf.h> #include <rte_common.h>
drivers/net/mlx5/linux/mlx5_mp_os.c +1 -1
@@ -7,7 +7,7 @@#include <time.h> #include <rte_eal.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_string_fns.h> #include <mlx5_common_mp.h>
drivers/net/mlx5/linux/mlx5_os.c +2 -2
@@ -16,8 +16,8 @@#include <fcntl.h> #include <rte_malloc.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_common.h>
drivers/net/mlx5/linux/mlx5_verbs.c +1 -1
@@ -14,7 +14,7 @@#include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_common.h> #include <mlx5_glue.h>
drivers/net/mlx5/linux/mlx5_vlan_os.c +1 -1
@@ -14,7 +14,7 @@*/ #include <sys/types.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_common.h> #include <rte_malloc.h> #include <rte_hypervisor.h>
drivers/net/mlx5/mlx5.c +2 -2
@@ -11,8 +11,8 @@#include <errno.h> #include <rte_malloc.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_common.h>
drivers/net/mlx5/mlx5.h +1 -1
@@ -15,7 +15,7 @@#include <rte_pci.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_rwlock.h> #include <rte_interrupts.h> #include <rte_errno.h>
drivers/net/mlx5/mlx5_defs.h +1 -1
@@ -6,7 +6,7 @@#ifndef RTE_PMD_MLX5_DEFS_H_ #define RTE_PMD_MLX5_DEFS_H_ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_vxlan.h> #include "mlx5_autoconf.h"
drivers/net/mlx5/mlx5_ethdev.c +1 -1
@@ -10,7 +10,7 @@#include <stdlib.h> #include <errno.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_bus_pci.h> #include <rte_mbuf.h> #include <rte_common.h>
drivers/net/mlx5/mlx5_flow.c +1 -1
@@ -12,7 +12,7 @@#include <rte_common.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_eal_paging.h> #include <rte_flow.h> #include <rte_cycles.h>
drivers/net/mlx5/mlx5_flow_dv.c +1 -1
@@ -10,7 +10,7 @@#include <rte_common.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_flow.h> #include <rte_flow_driver.h> #include <rte_malloc.h>
drivers/net/mlx5/mlx5_flow_verbs.c +1 -1
@@ -10,7 +10,7 @@#include <rte_common.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_flow.h> #include <rte_flow_driver.h> #include <rte_malloc.h>
drivers/net/mlx5/mlx5_mac.c +1 -1
@@ -11,7 +11,7 @@#include <netinet/in.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_common.h> #include "mlx5_defs.h"
drivers/net/mlx5/mlx5_rss.c +1 -1
@@ -9,7 +9,7 @@#include <string.h> #include <rte_malloc.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <mlx5_malloc.h>
drivers/net/mlx5/mlx5_rxmode.c +1 -1
@@ -7,7 +7,7 @@#include <errno.h> #include <string.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <mlx5_glue.h> #include "mlx5.h"
drivers/net/mlx5/mlx5_rxq.c +1 -1
@@ -12,7 +12,7 @@#include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_common.h> #include <rte_interrupts.h> #include <rte_debug.h>
drivers/net/mlx5/mlx5_stats.c +1 -1
@@ -8,7 +8,7 @@#include <stdio.h> #include <unistd.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_common.h> #include <rte_malloc.h>
drivers/net/mlx5/mlx5_trigger.c +1 -1
@@ -6,7 +6,7 @@#include <unistd.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_interrupts.h> #include <rte_alarm.h> #include <rte_cycles.h>
drivers/net/mlx5/mlx5_txpp.c +1 -1
@@ -5,7 +5,7 @@#include <stdint.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_interrupts.h> #include <rte_alarm.h> #include <rte_malloc.h>
drivers/net/mlx5/mlx5_txq.c +1 -1
@@ -12,7 +12,7 @@#include <rte_mbuf.h> #include <rte_malloc.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_common.h> #include <rte_eal_paging.h>
drivers/net/mlx5/mlx5_vlan.c +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <unistd.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_common.h> #include <rte_malloc.h> #include <rte_hypervisor.h>
drivers/net/mlx5/windows/mlx5_ethdev_os.c +1 -1
@@ -5,7 +5,7 @@#include <rte_errno.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_interrupts.h> #include <mlx5_glue.h>
drivers/net/mlx5/windows/mlx5_mp_os.c +1 -1
@@ -6,7 +6,7 @@#include <time.h> #include <rte_eal.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_string_fns.h> #include <mlx5_common_mp.h>
drivers/net/mlx5/windows/mlx5_os.c +1 -1
@@ -9,7 +9,7 @@#include <stdlib.h> #include <rte_windows.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <mlx5_glue.h> #include <mlx5_devx_cmds.h>
drivers/net/mlx5/windows/mlx5_vlan_os.c +1 -1
@@ -13,7 +13,7 @@*/ #include <sys/types.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_common.h> #include <mlx5.h>
drivers/net/mvneta/mvneta_ethdev.c +1 -1
@@ -5,7 +5,7 @@*/ #include <rte_string_fns.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_kvargs.h> #include <rte_bus_vdev.h>
drivers/net/mvpp2/mrvl_ethdev.c +1 -1
@@ -5,7 +5,7 @@*/ #include <rte_string_fns.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_kvargs.h> #include <rte_log.h> #include <rte_malloc.h>
drivers/net/netvsc/hn_ethdev.c +1 -1
@@ -24,7 +24,7 @@#include <rte_atomic.h> #include <rte_branch_prediction.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_cycles.h> #include <rte_errno.h> #include <rte_memory.h>
drivers/net/netvsc/hn_rndis.c +1 -1
@@ -12,7 +12,7 @@#include <unistd.h> #include <time.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ethdev.h> #include <rte_string_fns.h> #include <rte_memzone.h>
drivers/net/netvsc/hn_vf.c +1 -1
@@ -16,7 +16,7 @@#include <rte_ether.h> #include <rte_ethdev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_lcore.h> #include <rte_memory.h> #include <rte_bus_vmbus.h>
drivers/net/nfb/nfb_ethdev.c +1 -1
@@ -9,7 +9,7 @@#include <netcope/rxmac.h> #include <netcope/txmac.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_kvargs.h> #include "nfb_stats.h"
drivers/net/nfb/nfb_tx.h +1 -1
@@ -10,7 +10,7 @@#include <nfb/nfb.h> #include <nfb/ndp.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ethdev.h> #include <rte_malloc.h>
drivers/net/nfp/nfp_net.c +2 -2
@@ -17,8 +17,8 @@#include <rte_common.h> #include <rte_log.h> #include <rte_debug.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_dev.h> #include <rte_ether.h> #include <rte_malloc.h>
drivers/net/nfp/nfpcore/nfp_cpp.h +1 -1
@@ -6,7 +6,7 @@#ifndef __NFP_CPP_H__#define __NFP_CPP_H__ -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include "nfp-common/nfp_platform.h" #include "nfp-common/nfp_resid.h"
drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c +1 -1
@@ -33,7 +33,7 @@#include <sys/file.h> #include <sys/stat.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_string_fns.h> #include "nfp_cpp.h"
drivers/net/nfp/nfpcore/nfp_cppcore.c +1 -1
@@ -12,7 +12,7 @@#include <sys/types.h> #include <rte_byteorder.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include "nfp_cpp.h" #include "nfp_target.h"
drivers/net/null/rte_eth_null.c +2 -2
@@ -4,8 +4,8 @@*/ #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_bus_vdev.h>
drivers/net/octeontx/octeontx_ethdev.h +1 -1
@@ -8,7 +8,7 @@#include <stdbool.h> #include <rte_common.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_eventdev.h> #include <rte_mempool.h> #include <rte_memory.h>
drivers/net/octeontx/octeontx_rxtx.c +1 -1
@@ -9,7 +9,7 @@#include <rte_atomic.h> #include <rte_common.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ether.h> #include <rte_log.h> #include <rte_mbuf.h>
drivers/net/octeontx/octeontx_rxtx.h +1 -1
@@ -5,7 +5,7 @@#ifndef __OCTEONTX_RXTX_H__#define __OCTEONTX_RXTX_H__ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #define OFFLOAD_FLAGS \ uint16_t rx_offload_flags; \
drivers/net/octeontx2/otx2_ethdev.c +1 -1
@@ -4,7 +4,7 @@#include <inttypes.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_io.h> #include <rte_malloc.h> #include <rte_mbuf.h>
drivers/net/octeontx2/otx2_link.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_common.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include "otx2_ethdev.h"
drivers/net/octeontx2/otx2_ptp.c +1 -1
@@ -2,7 +2,7 @@* Copyright(C) 2019 Marvell International Ltd. */ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "otx2_ethdev.h"
drivers/net/pcap/rte_eth_pcap.c +2 -2
@@ -19,8 +19,8 @@#include <pcap.h> #include <rte_cycles.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_kvargs.h> #include <rte_malloc.h> #include <rte_mbuf.h>
drivers/net/pfe/pfe_eth.h +1 -1
@@ -7,7 +7,7 @@#include <compat.h> #include <rte_ethdev.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_vdev.h> #define ETH_ALEN 6#define GEMAC_NO_PHY BIT(0)
drivers/net/pfe/pfe_ethdev.c +1 -1
@@ -5,7 +5,7 @@#include <sys/ioctl.h> #include <sys/epoll.h> #include <rte_kvargs.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_vdev.h> #include <rte_bus_vdev.h> #include <rte_ether.h> #include <dpaa_of.h>
drivers/net/qede/qede_ethdev.h +2 -2
@@ -11,8 +11,8 @@#include <sys/queue.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_dev.h> #include <rte_ip.h>
drivers/net/ring/rte_eth_ring.c +1 -1
@@ -4,7 +4,7 @@#include "rte_eth_ring.h" #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_string_fns.h>
drivers/net/sfc/sfc.h +1 -1
@@ -14,7 +14,7 @@#include <rte_pci.h> #include <rte_bus_pci.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_kvargs.h> #include <rte_spinlock.h> #include <rte_atomic.h>
drivers/net/sfc/sfc_dp_rx.h +1 -1
@@ -11,7 +11,7 @@#define _SFC_DP_RX_H#include <rte_mempool.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "sfc_dp.h"
drivers/net/sfc/sfc_dp_tx.h +1 -1
@@ -10,7 +10,7 @@#ifndef _SFC_DP_TX_H#define _SFC_DP_TX_H -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "sfc_dp.h" #include "sfc_debug.h"
drivers/net/sfc/sfc_ethdev.c +2 -2
@@ -8,8 +8,8 @@*/ #include <rte_dev.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_errno.h>
drivers/net/sfc/sfc_ev.h +1 -1
@@ -10,7 +10,7 @@#ifndef _SFC_EV_H_#define _SFC_EV_H_ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "efx.h"
drivers/net/sfc/sfc_flow.c +1 -1
@@ -10,7 +10,7 @@#include <rte_byteorder.h> #include <rte_tailq.h> #include <rte_common.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ether.h> #include <rte_flow.h> #include <rte_flow_driver.h>
drivers/net/sfc/sfc_rx.h +1 -1
@@ -12,7 +12,7 @@#include <rte_mbuf.h> #include <rte_mempool.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "efx.h"
drivers/net/sfc/sfc_tx.h +1 -1
@@ -11,7 +11,7 @@#define _SFC_TX_H#include <rte_mbuf.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include "efx.h"
drivers/net/softnic/rte_eth_softnic.c +2 -2
@@ -6,8 +6,8 @@#include <stdlib.h> #include <string.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_bus_vdev.h> #include <rte_kvargs.h>
drivers/net/softnic/rte_eth_softnic_internals.h +1 -1
@@ -19,7 +19,7 @@#include <rte_pipeline.h> #include <rte_ethdev_core.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_tm_driver.h> #include <rte_flow_driver.h> #include <rte_mtr_driver.h>
drivers/net/szedata2/rte_eth_szedata2.c +2 -2
@@ -15,8 +15,8 @@#include <libsze2.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_kvargs.h>
drivers/net/tap/rte_eth_tap.c +2 -2
@@ -7,8 +7,8 @@#include <rte_byteorder.h> #include <rte_common.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_bus_vdev.h> #include <rte_kvargs.h>
drivers/net/tap/rte_eth_tap.h +1 -1
@@ -13,7 +13,7 @@#include <linux/if_tun.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ether.h> #include <rte_gso.h> #include "tap_log.h"
drivers/net/thunderx/nicvf_ethdev.c +2 -2
@@ -23,8 +23,8 @@#include <rte_dev.h> #include <rte_eal.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_interrupts.h> #include <rte_log.h> #include <rte_memory.h>
drivers/net/thunderx/nicvf_ethdev.h +1 -1
@@ -5,7 +5,7 @@#ifndef __THUNDERX_NICVF_ETHDEV_H__#define __THUNDERX_NICVF_ETHDEV_H__ -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #define THUNDERX_NICVF_PMD_VERSION "2.0"#define THUNDERX_REG_BYTES 8
drivers/net/thunderx/nicvf_rxtx.c +1 -1
@@ -13,7 +13,7 @@#include <rte_common.h> #include <rte_cycles.h> #include <rte_errno.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_ether.h> #include <rte_log.h> #include <rte_mbuf.h>
drivers/net/thunderx/nicvf_rxtx.h +1 -1
@@ -6,7 +6,7 @@#define __THUNDERX_NICVF_RXTX_H__#include <rte_byteorder.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #define NICVF_RX_OFFLOAD_NONE 0x1#define NICVF_RX_OFFLOAD_CKSUM 0x2
drivers/net/thunderx/nicvf_struct.h +1 -1
@@ -11,7 +11,7 @@#include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_interrupts.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_memory.h> struct nicvf_rbdr {
drivers/net/txgbe/txgbe_ethdev.c +1 -1
@@ -7,7 +7,7 @@#include <stdint.h> #include <string.h> #include <rte_common.h> -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_interrupts.h> #include <rte_log.h>
drivers/net/txgbe/txgbe_ipsec.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2015-2020 */ -#include <rte_ethdev_pci.h> +#include <ethdev_pci.h> #include <rte_security_driver.h> #include <rte_cryptodev.h>
drivers/net/txgbe/txgbe_pf.c +1 -1
@@ -15,7 +15,7 @@#include <rte_debug.h> #include <rte_eal.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_memcpy.h> #include <rte_malloc.h> #include <rte_random.h>
drivers/net/txgbe/txgbe_rxtx.c +1 -1
@@ -19,7 +19,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_ethdev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_security_driver.h> #include <rte_memzone.h> #include <rte_atomic.h>
drivers/net/vhost/rte_eth_vhost.c +2 -2
@@ -8,8 +8,8 @@#include <sys/epoll.h> #include <rte_mbuf.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_driver.h> +#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_bus_vdev.h>
drivers/net/virtio/virtio_ethdev.c +2 -2
@@ -8,8 +8,8 @@#include <errno.h> #include <unistd.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_memcpy.h> #include <rte_string_fns.h> #include <rte_memzone.h>
drivers/net/virtio/virtio_pci.h +1 -1
@@ -10,7 +10,7 @@#include <rte_pci.h> #include <rte_bus_pci.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> struct virtqueue ;struct virtnet_ctl ;
drivers/net/virtio/virtio_rxtx.c +1 -1
@@ -15,7 +15,7 @@#include <rte_malloc.h> #include <rte_mbuf.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_prefetch.h> #include <rte_string_fns.h> #include <rte_errno.h>
drivers/net/virtio/virtio_rxtx_simple.c +1 -1
@@ -15,7 +15,7 @@#include <rte_malloc.h> #include <rte_mbuf.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_prefetch.h> #include <rte_string_fns.h> #include <rte_errno.h>
drivers/net/virtio/virtio_rxtx_simple_altivec.c +1 -1
@@ -14,7 +14,7 @@#include <rte_branch_prediction.h> #include <rte_cycles.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_errno.h> #include <rte_memory.h> #include <rte_mempool.h>
drivers/net/virtio/virtio_rxtx_simple_neon.c +1 -1
@@ -12,7 +12,7 @@#include <rte_branch_prediction.h> #include <rte_cycles.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_errno.h> #include <rte_memory.h> #include <rte_mempool.h>
drivers/net/virtio/virtio_rxtx_simple_sse.c +1 -1
@@ -14,7 +14,7 @@#include <rte_branch_prediction.h> #include <rte_cycles.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_errno.h> #include <rte_memory.h> #include <rte_mempool.h>
drivers/net/virtio/virtio_user_ethdev.c +1 -1
@@ -13,7 +13,7 @@#include <rte_malloc.h> #include <rte_kvargs.h> -#include <rte_ethdev_vdev.h> +#include <ethdev_vdev.h> #include <rte_bus_vdev.h> #include <rte_alarm.h> #include <rte_cycles.h>
drivers/net/vmxnet3/vmxnet3_ethdev.c +2 -2
@@ -26,8 +26,8 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> -#include <rte_ethdev_pci.h> +#include <ethdev_driver.h> +#include <ethdev_pci.h> #include <rte_string_fns.h> #include <rte_malloc.h> #include <rte_dev.h>
drivers/net/vmxnet3/vmxnet3_rxtx.c +1 -1
@@ -32,7 +32,7 @@#include <rte_malloc.h> #include <rte_mbuf.h> #include <rte_ether.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> #include <rte_prefetch.h> #include <rte_ip.h> #include <rte_udp.h>
lib/librte_ethdev/ethdev_driver.h renamed from lib/librte_ethdev/rte_ethdev_driver.h +0 -0
lib/librte_ethdev/ethdev_pci.h renamed from lib/librte_ethdev/rte_ethdev_pci.h +1 -1
@@ -10,7 +10,7 @@#include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_config.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> /** * Copy pci device info to the Ethernet device data.
lib/librte_ethdev/ethdev_private.c +1 -1
@@ -3,7 +3,7 @@*/ #include "rte_ethdev.h" -#include "rte_ethdev_driver.h" +#include "ethdev_driver.h" #include "ethdev_private.h" uint16_t
lib/librte_ethdev/ethdev_vdev.h renamed from lib/librte_ethdev/rte_ethdev_vdev.h +1 -1
@@ -9,7 +9,7 @@#include <rte_config.h> #include <rte_malloc.h> #include <rte_bus_vdev.h> -#include <rte_ethdev_driver.h> +#include <ethdev_driver.h> /** * @internal
lib/librte_ethdev/meson.build +0 -3
@@ -11,12 +11,9 @@ sources = files('ethdev_private.c', 'rte_tm.c') headers = files('rte_ethdev.h', - 'rte_ethdev_driver.h', 'rte_ethdev_core.h', - 'rte_ethdev_pci.h', 'rte_ethdev_trace.h', 'rte_ethdev_trace_fp.h', - 'rte_ethdev_vdev.h', 'rte_eth_ctrl.h', 'rte_dev_info.h', 'rte_flow.h',
lib/librte_ethdev/rte_class_eth.c +1 -1
@@ -12,7 +12,7 @@#include "rte_ethdev.h" #include "rte_ethdev_core.h" -#include "rte_ethdev_driver.h" +#include "ethdev_driver.h" #include "ethdev_private.h" enum eth_params {
lib/librte_ethdev/rte_ethdev.c +1 -1
@@ -41,7 +41,7 @@#include "rte_ethdev_trace.h" #include "rte_ethdev.h" -#include "rte_ethdev_driver.h" +#include "ethdev_driver.h" #include "ethdev_profile.h" #include "ethdev_private.h"
lib/librte_ethdev/rte_ethdev.h +1 -1
@@ -20,7 +20,7 @@* - The driver-oriented Ethernet API that exports functions allowing * an Ethernet Poll Mode Driver (PMD) to allocate an Ethernet device instance, * create memzone for HW rings and process registered callbacks, and so on. -* PMDs should include rte_ethdev_driver.h instead of this header. +* PMDs should include ethdev_driver.h instead of this header. * * By default, all the functions of the Ethernet Device API exported by a PMD * are lock-free functions which assume to not be invoked in parallel on
lib/librte_ethdev/rte_flow_driver.h +1 -1
@@ -18,7 +18,7 @@#include <stdint.h> #include "rte_ethdev.h" -#include "rte_ethdev_driver.h" +#include "ethdev_driver.h" #include "rte_flow.h" #ifdef __cplusplus
lib/librte_ethdev/rte_mtr_driver.h +1 -1
@@ -18,7 +18,7 @@#include <rte_errno.h> #include "rte_ethdev.h" -#include "rte_ethdev_driver.h" +#include "ethdev_driver.h" #include "rte_mtr.h" #ifdef __cplusplus
lib/librte_ethdev/rte_tm_driver.h +1 -1
@@ -18,7 +18,7 @@#include <rte_errno.h> #include "rte_ethdev.h" -#include "rte_ethdev_driver.h" +#include "ethdev_driver.h" #include "rte_tm.h" #ifdef __cplusplus
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v5 3/8] ethdev: make driver-only headers private
Quoted 3 lines · Bruce Richardson
The
rte_ethdev_driver.h,rte_ethdev_vdev.handrte_ethdev_pci.hfiles are for drivers only and should be a private to DPDK and not installed.
I agree applications don't need them.
This breaks OOT drivers on the other hand.
We don't take special care not to break such drivers, but we must announce the change, at least in the release notes.
Signature · 1 line
David Marchand
PATCH v5 4/8 rib: fix missing header include
In reply to Bruce RichardsonThe rte_rib6 header was using RTE_MIN macro from rte_common.h but not including the header file.
--- lib/librte_rib/rte_rib6.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_rib/rte_rib6.h +1 -0
@@ -20,6 +20,7 @@#include <rte_memcpy.h> #include <rte_compat.h> +#include <rte_common.h> #ifdef __cplusplusextern "C" {
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v5 4/8] rib: fix missing header include
Quoted 17 lines · Bruce Richardson
The
rte_rib6header was usingRTE_MINmacro fromrte_common.hbut not including the header file.Fixes f7e861e21c46 ("rib: support IPv6")Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_rib/rte_rib6.h | 1 + 1 file changed, 1 insertion(+)lib/librte_rib/rte_rib6.h +0
-0
lib/librte_rib/rte_rib6.h line 26
Quoted 7 lines
lib/librte_rib/rte_rib6.h +1
-0@@ -20,6 +20,7 @@#include <rte_memcpy.h> #include <rte_compat.h> +#include <rte_common.h> #ifdef __cplusplusextern "C" {
Signature · 2 lines
Regards, Vladimir
PATCH v5 5/8 build: separate out headers for include checking
In reply to Bruce RichardsonFor some libraries, there may be some header files which are not for direct inclusion, but rather are to be included via other header files. To allow later checking of these files for missing includes, we separate out the indirect include files from the direct ones.
--- doc/guides/contributing/coding_style.rst | 12 ++++++++++++ lib/librte_eal/include/meson.build | 2 +- lib/librte_eal/x86/include/meson.build | 14 +++++++++----- lib/librte_ethdev/meson.build | 5 +++-- lib/librte_hash/meson.build | 4 ++-- lib/librte_ipsec/meson.build | 3 ++- lib/librte_lpm/meson.build | 2 +- lib/librte_regexdev/meson.build | 2 +- lib/librte_ring/meson.build | 4 +++- lib/librte_stack/meson.build | 4 +++- lib/librte_table/meson.build | 7 +++---- lib/meson.build | 3 +++ meson.build | 1 + meson_options.txt | 2 ++ 14 files changed, 46 insertions(+), 19 deletions(-)
doc/guides/contributing/coding_style.rst +12 -0
@@ -891,6 +891,18 @@ headers installed to $PREFIX/include when ``ninja install`` is run. As with source files, these should be specified using the meson ``files()`` function. + When ``check_includes`` build option is set to ``true``, each header file + has additional checks performed on it, for example to ensure that it is + not missing any include statements for dependent headers. + For header files which are public, but only included indirectly in + applications, these checks can be skipped by using the ``headers_no_chkincs`` + variable rather than ``headers``. + +headers_no_chkincs + **Default Value = []**. + As with ``headers`` option above, except that the files are not checked + for all needed include files as part of a DPDK build when + ``check_includes`` is set to ``true``. includes: **Default Value = []**.
lib/librte_eal/include/meson.build +1 -1
@@ -16,7 +16,6 @@ headers += files( 'rte_dev.h', 'rte_devargs.h', 'rte_eal.h', - 'rte_eal_interrupts.h', 'rte_eal_memconfig.h', 'rte_eal_trace.h', 'rte_errno.h',
@@ -49,6 +48,7 @@ headers += files( 'rte_version.h', 'rte_vfio.h', ) +headers_no_chkincs += files('rte_eal_interrupts.h') # special case install the generic headers, since they go in a subdir generic_headers = files(
lib/librte_eal/x86/include/meson.build +9 -5
@@ -2,11 +2,7 @@ # Copyright(c) 2017 Intel Corporation arch_headers = files( - 'rte_atomic_32.h', - 'rte_atomic_64.h', 'rte_atomic.h', - 'rte_byteorder_32.h', - 'rte_byteorder_64.h', 'rte_byteorder.h', 'rte_cpuflags.h', 'rte_cycles.h',
@@ -22,4 +18,12 @@ arch_headers = files( 'rte_ticketlock.h', 'rte_vect.h', ) -install_headers(arch_headers, subdir: get_option('include_subdir_arch')) +arch_headers_no_chkincs = files( + 'rte_atomic_32.h', + 'rte_atomic_64.h', + 'rte_byteorder_32.h', + 'rte_byteorder_64.h', +) +install_headers(arch_headers + arch_headers_no_chkincs, + subdir: get_option('include_subdir_arch')) +dpdk_chkinc_headers += arch_headers
lib/librte_ethdev/meson.build +3 -2
@@ -11,10 +11,8 @@ sources = files('ethdev_private.c', 'rte_tm.c') headers = files('rte_ethdev.h', - 'rte_ethdev_core.h', 'rte_ethdev_trace.h', 'rte_ethdev_trace_fp.h', - 'rte_eth_ctrl.h', 'rte_dev_info.h', 'rte_flow.h', 'rte_flow_driver.h',
@@ -22,5 +20,8 @@ headers = files('rte_ethdev.h', 'rte_mtr_driver.h', 'rte_tm.h', 'rte_tm_driver.h') +headers_no_chkincs += files( + 'rte_ethdev_core.h', + 'rte_eth_ctrl.h') deps += ['net', 'kvargs', 'meter', 'telemetry']
lib/librte_hash/meson.build +2 -2
@@ -1,12 +1,12 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -headers = files('rte_crc_arm64.h', - 'rte_fbk_hash.h', +headers = files('rte_fbk_hash.h', 'rte_hash_crc.h', 'rte_hash.h', 'rte_jhash.h', 'rte_thash.h') +headers_no_chkincs += files('rte_crc_arm64.h') sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c') deps += ['ring']
lib/librte_ipsec/meson.build +2 -1
@@ -3,6 +3,7 @@ sources = files('esp_inb.c', 'esp_outb.c', 'sa.c', 'ses.c', 'ipsec_sad.c') -headers = files('rte_ipsec.h', 'rte_ipsec_group.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h') +headers = files('rte_ipsec.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h') +headers_no_chkincs += files('rte_ipsec_group.h') deps += ['mbuf', 'net', 'cryptodev', 'security', 'hash']
lib/librte_lpm/meson.build +1 -1
@@ -5,6 +5,6 @@ sources = files('rte_lpm.c', 'rte_lpm6.c') headers = files('rte_lpm.h', 'rte_lpm6.h') # since header files have different names, we can install all vector headers # without worrying about which architecture we actually need -headers += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h') +headers_no_chkincs += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h') deps += ['hash'] deps += ['rcu']
lib/librte_regexdev/meson.build +1 -1
@@ -3,6 +3,6 @@ sources = files('rte_regexdev.c') headers = files('rte_regexdev.h', - 'rte_regexdev_core.h', 'rte_regexdev_driver.h') +headers_no_chkincs += files('rte_regexdev_core.h') deps += ['mbuf']
lib/librte_ring/meson.build +3 -1
@@ -2,7 +2,9 @@ # Copyright(c) 2017 Intel Corporation sources = files('rte_ring.c') -headers = files('rte_ring.h', +headers = files('rte_ring.h') +# most sub-headers are not for direct inclusion +headers_no_chkincs += files ( 'rte_ring_core.h', 'rte_ring_elem.h', 'rte_ring_c11_mem.h',
lib/librte_stack/meson.build +3 -1
@@ -2,7 +2,9 @@ # Copyright(c) 2019 Intel Corporation sources = files('rte_stack.c', 'rte_stack_std.c', 'rte_stack_lf.c') -headers = files('rte_stack.h', +headers = files('rte_stack.h') +# subheaders, not for direct inclusion by apps +headers_no_chkincs += files( 'rte_stack_std.h', 'rte_stack_lf.h', 'rte_stack_lf_generic.h',
lib/librte_table/meson.build +3 -4
@@ -20,7 +20,6 @@ headers = files('rte_table.h', 'rte_table_hash.h', 'rte_table_hash_cuckoo.h', 'rte_table_hash_func.h', - 'rte_table_hash_func_arm64.h', 'rte_lru.h', 'rte_table_array.h', 'rte_table_stub.h',
@@ -28,6 +27,6 @@ headers = files('rte_table.h', 'rte_swx_table_em.h',) deps += ['mbuf', 'port', 'lpm', 'hash', 'acl'] -if arch_subdir == 'x86' - headers += files('rte_lru_x86.h') -endif +headers_no_chkincs += files('rte_lru_x86.h', + 'rte_lru_arm64.h', + 'rte_table_hash_func_arm64.h')
lib/meson.build +3 -0
@@ -66,6 +66,7 @@ foreach l:libraries use_function_versioning = false sources = [] headers = [] + headers_no_chkincs = [] # public headers not directly included by apps includes = [] cflags = default_cflags objs = [] # other object files to link against, used e.g. for
@@ -103,6 +104,8 @@ foreach l:libraries enabled_libs += name dpdk_conf.set('RTE_LIB_' + name.to_upper(), 1) install_headers(headers) + install_headers(headers_no_chkincs) + dpdk_chkinc_headers += headers libname = 'rte_' + name includes += include_directories(dir_name)
meson.build +1 -0
@@ -16,6 +16,7 @@ cc = meson.get_compiler('c') dpdk_conf = configuration_data() dpdk_libraries = [] dpdk_static_libraries = [] +dpdk_chkinc_headers = [] dpdk_driver_classes = [] dpdk_drivers = [] dpdk_extra_ldflags = []
meson_options.txt +2 -0
@@ -1,5 +1,7 @@ # Please keep these options sorted alphabetically. +option('check_includes', type: 'boolean', value: false, + description: 'build "chkincs" to verify each header file can compile alone') option('disable_drivers', type: 'string', value: '', description: 'Comma-separated list of drivers to explicitly disable.') option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-<VERSION>',
Signature · 1 line
2.27.0
PATCH v5 6/8 buildtools/chkincs: add app to verify header includes
In reply to Bruce RichardsonTo verify that all DPDK headers are ok for inclusion directly in a C file, and are not missing any other pre-requisite headers, we can auto-generate for each header an empty C file that includes that header. Compiling these files will throw errors if any header has unmet dependencies.
To ensure ongoing compliance, we enable this build test as part of the default x86 build in "test-meson-builds.sh".
--- MAINTAINERS | 4 +++ buildtools/chkincs/gen_c_file_for_header.py | 12 +++++++ buildtools/chkincs/main.c | 4 +++ buildtools/chkincs/meson.build | 40 +++++++++++++++++++++ devtools/test-meson-builds.sh | 2 +- meson.build | 5 +++ 6 files changed, 66 insertions(+), 1 deletion(-) create mode 100755 buildtools/chkincs/gen_c_file_for_header.py create mode 100644 buildtools/chkincs/main.c create mode 100644 buildtools/chkincs/meson.build
MAINTAINERS +4 -0
@@ -1562,6 +1562,10 @@ F: app/test/test_resource.c F: app/test/virtual_pmd.c F: app/test/virtual_pmd.h +Header build sanity checking +M: Bruce Richardson <[email protected]> +F: buildtools/chkincs/ + Sample packet helper functions for unit test M: Reshma Pattan <[email protected]> F: app/test/sample_packet_forward.c
buildtools/chkincs/gen_c_file_for_header.py new file +12 -0
@@ -0,0 +1,12 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2021 Intel Corporation + +from sys import argv +from os.path import abspath + +(h_file, c_file) = argv[1:] + +contents = '#include "' + abspath(h_file) + '"' +with open(c_file, 'w') as cf: + cf.write(contents)
buildtools/chkincs/main.c new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2021 Intel Corporation +*/ +int main (void ) {return 0 ; }
buildtools/chkincs/meson.build new file +40 -0
@@ -0,0 +1,40 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2021 Intel Corporation + +if not get_option('check_includes') + build = false + subdir_done() +endif + +if is_windows + # for windows, the shebang line in the script won't work. + error('option "check_includes" is not supported on windows') +endif + +gen_c_file_for_header = find_program('gen_c_file_for_header.py') +gen_c_files = generator(gen_c_file_for_header, + output: '@[email protected]', + arguments: ['@INPUT@', '@OUTPUT@']) + +cflags = machine_args +cflags += '-Wno-unused-function' # needed if we include generic headers +cflags += '-DALLOW_EXPERIMENTAL_API' + +# some ethdev headers depend on bus headers +includes = include_directories('../../drivers/bus/pci', + '../../drivers/bus/vdev') + +sources = files('main.c') +sources += gen_c_files.process(dpdk_chkinc_headers) + +deps = [] +foreach l:enabled_libs + deps += get_variable('static_rte_' + l) +endforeach + +executable('chkincs', sources, + c_args: cflags, + include_directories: includes, + dependencies: deps, + link_whole: dpdk_static_libraries + dpdk_drivers, + install: false)
devtools/test-meson-builds.sh +1 -1
@@ -227,7 +227,7 @@ default_machine='nehalem' if ! check_cc_flags "-march=$default_machine" ; then default_machine='corei7' fi -build build-x86-default cc skipABI \ +build build-x86-default cc skipABI -Dcheck_includes=true\ -Dlibdir=lib -Dmachine=$default_machine $use_shared # 32-bit with default compiler
meson.build +5 -0
@@ -68,6 +68,11 @@ if get_option('enable_kmods') subdir('kernel') endif +# check header includes if requested +if get_option('check_includes') + subdir('buildtools/chkincs') +endif + # write the build config build_cfg = 'rte_build_config.h' configure_file(output: build_cfg,
Signature · 1 line
2.27.0
PATCH v5 7/8 devtools: remove check-includes script
In reply to Bruce RichardsonThe check-includes script allowed checking header files in a given directory to ensure that each header compiled alone without requiring any other header inclusions.
With header checking now being done by the chkincs app in the build system this script can be removed.
--- MAINTAINERS | 1 - devtools/check-includes.sh | 259 ------------------------------------- 2 files changed, 260 deletions(-) delete mode 100755 devtools/check-includes.sh
MAINTAINERS +0 -1
@@ -81,7 +81,6 @@ F: devtools/check-dup-includes.sh F: devtools/check-maintainers.sh F: devtools/check-forbidden-tokens.awk F: devtools/check-git-log.sh -F: devtools/check-includes.sh F: devtools/check-spdx-tag.sh F: devtools/check-symbol-maps.sh F: devtools/checkpatches.sh
devtools/check-includes.sh deleted +0 -259
259 lines not on this page · raw message
Signature · 1 line
2.27.0
PATCH v5 8/8 ci: add checking of includes to CI builds
In reply to Bruce RichardsonFor CI builds, turn on the checking of includes.
--- .ci/linux-build.sh | 1 + 1 file changed, 1 insertion(+)
.ci/linux-build.sh +1 -0
@@ -57,6 +57,7 @@ fi OPTS="$OPTS -Dmachine=default" OPTS="$OPTS --default-library=$DEF_LIB" OPTS="$OPTS --buildtype=debugoptimized" +OPTS="$OPTS -Dcheck_includes=true" meson build --werror $OPTS ninja -C build
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v5 8/8] ci: add checking of includes to CI builds
Quoted 4 lines · Bruce Richardson
For CI builds, turn on the checking of includes.
Signed-off-by Bruce Richardson <[email protected]>---
Thanks for the efforts here.
v6 cover add checking of header includes
In reply to Bruce RichardsonAs 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. The script "check-includes.sh" could be used for this job, but it was not called out in the documentation, so many contributors may not have been aware of it's existance. It also was difficult to run from a source-code directory, as the script did not automatically allow finding of headers from one DPDK library directory to another [this was probably based on running it on a build created by the "make" build system, where all headers were in a single directory]. To attempt to have a build-system integrated replacement, this patchset adds a "chkincs" app in the buildtools directory to verify this on an ongoing basis.
This chkincs app does nothing when run, and is not installed as part of a DPDK "ninja install", 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, which was something done by the check-includes.sh script but which is missing here.
V6:
* Added release notes updates for:
- renamed, no-longer-installed header files
- new "check_includes" build option
- removal of old check_includes script
* Included acks from previous versions
V5:
* Removed private ethdev headers from checks and installing
* Removed the ALLOW_INTERNAL_APIS macro from chkincs build.
V4:
* Fixed build errors with clang and arm builds
* Added support for running chkincs as part of github actions CI
V3:
* Shrunk patchset as most header fixes already applied
* Moved chkincs from "apps" to the "buildtools" directory, which is a better location for something not for installation for end-user use.
* Added patch to drop check-includes script.
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 (8):
eal: add missing include to mcslock
eal: fix error attribute use for clang
rib: fix missing header include
ethdev: make driver-only headers private
build: separate out headers for include checking buildtools/chkincs: add app to verify header includes
devtools: remove check-includes script
ci: add checking of includes to CI builds
.ci/linux-build.sh | 1 +
MAINTAINERS | 5 +-
app/test/test_link_bonding.c | 2 +-
app/test/test_pdump.c | 2 +-
app/test/virtual_pmd.c | 2 +-
buildtools/chkincs/gen_c_file_for_header.py | 12 +
buildtools/chkincs/main.c | 4 +
buildtools/chkincs/meson.build | 40 +++
devtools/check-includes.sh | 259 ------------------
devtools/test-meson-builds.sh | 2 +-
doc/guides/contributing/coding_style.rst | 12 +
doc/guides/rel_notes/release_21_02.rst | 18 ++
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/bus/dpaa/include/fman.h | 2 +-
drivers/bus/fslmc/fslmc_bus.c | 2 +-
drivers/bus/fslmc/fslmc_vfio.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 2 +-
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +-
drivers/event/octeontx/ssovf_evdev.c | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
drivers/net/af_packet/rte_eth_af_packet.c | 4 +-
drivers/net/af_xdp/rte_eth_af_xdp.c | 4 +-
drivers/net/ark/ark_ethdev.c | 2 +-
drivers/net/ark/ark_ethdev_rx.h | 2 +-
drivers/net/ark/ark_ethdev_tx.h | 2 +-
drivers/net/ark/ark_ext.h | 2 +-
drivers/net/ark/ark_global.h | 2 +-
drivers/net/ark/ark_pktchkr.c | 2 +-
drivers/net/ark/ark_pktgen.c | 2 +-
drivers/net/atlantic/atl_ethdev.c | 2 +-
drivers/net/atlantic/atl_rxtx.c | 2 +-
drivers/net/atlantic/rte_pmd_atlantic.c | 2 +-
drivers/net/avp/avp_ethdev.c | 4 +-
drivers/net/axgbe/axgbe_common.h | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.c | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.h | 2 +-
drivers/net/bnxt/bnxt.h | 2 +-
drivers/net/bnxt/bnxt_ethdev.c | 4 +-
drivers/net/bnxt/bnxt_stats.h | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
drivers/net/bonding/eth_bond_private.h | 2 +-
drivers/net/bonding/rte_eth_bond_api.c | 2 +-
drivers/net/bonding/rte_eth_bond_pmd.c | 4 +-
drivers/net/cxgbe/base/t4_hw.c | 2 +-
drivers/net/cxgbe/base/t4vf_hw.c | 2 +-
drivers/net/cxgbe/cxgbe_ethdev.c | 4 +-
drivers/net/cxgbe/cxgbe_main.c | 4 +-
drivers/net/cxgbe/cxgbevf_ethdev.c | 4 +-
drivers/net/cxgbe/cxgbevf_main.c | 4 +-
drivers/net/cxgbe/sge.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.h | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.c | 2 +-
drivers/net/dpaa2/dpaa2_rxtx.c | 2 +-
drivers/net/e1000/em_ethdev.c | 4 +-
drivers/net/e1000/em_rxtx.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 4 +-
drivers/net/e1000/igb_flow.c | 4 +-
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/e1000/igb_rxtx.c | 2 +-
drivers/net/ena/ena_ethdev.c | 4 +-
drivers/net/enetc/enetc_ethdev.c | 2 +-
drivers/net/enic/enic_ethdev.c | 4 +-
drivers/net/enic/enic_flow.c | 2 +-
drivers/net/enic/enic_fm_flow.c | 2 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_res.c | 2 +-
drivers/net/enic/enic_rxtx.c | 2 +-
drivers/net/enic/enic_rxtx_vec_avx2.c | 2 +-
drivers/net/enic/enic_vf_representor.c | 4 +-
drivers/net/failsafe/failsafe.c | 4 +-
drivers/net/failsafe/failsafe_ops.c | 2 +-
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/failsafe/failsafe_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_ethdev.c | 4 +-
drivers/net/fm10k/fm10k_rxtx.c | 2 +-
drivers/net/fm10k/fm10k_rxtx_vec.c | 2 +-
drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +-
drivers/net/hinic/hinic_pmd_ethdev.c | 2 +-
drivers/net/hinic/hinic_pmd_ethdev.h | 2 +-
drivers/net/hns3/hns3_cmd.c | 2 +-
drivers/net/hns3/hns3_ethdev.c | 2 +-
drivers/net/hns3/hns3_ethdev.h | 2 +-
drivers/net/hns3/hns3_ethdev_vf.c | 2 +-
drivers/net/hns3/hns3_fdir.c | 2 +-
drivers/net/hns3/hns3_mbx.c | 2 +-
drivers/net/hns3/hns3_mp.c | 2 +-
drivers/net/hns3/hns3_regs.c | 2 +-
drivers/net/hns3/hns3_rxtx.c | 2 +-
drivers/net/hns3/hns3_rxtx_vec.c | 2 +-
drivers/net/hns3/hns3_rxtx_vec_sve.c | 2 +-
drivers/net/i40e/i40e_ethdev.c | 4 +-
drivers/net/i40e/i40e_ethdev_vf.c | 4 +-
drivers/net/i40e/i40e_fdir.c | 2 +-
drivers/net/i40e/i40e_flow.c | 2 +-
drivers/net/i40e/i40e_pf.c | 2 +-
drivers/net/i40e/i40e_rxtx.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_altivec.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_avx2.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_avx512.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_common.h | 2 +-
drivers/net/i40e/i40e_rxtx_vec_neon.c | 2 +-
drivers/net/i40e/i40e_rxtx_vec_sse.c | 2 +-
drivers/net/i40e/i40e_vf_representor.c | 2 +-
drivers/net/iavf/iavf_ethdev.c | 4 +-
drivers/net/iavf/iavf_fdir.c | 2 +-
drivers/net/iavf/iavf_generic_flow.c | 2 +-
drivers/net/iavf/iavf_hash.c | 2 +-
drivers/net/iavf/iavf_rxtx.c | 2 +-
drivers/net/iavf/iavf_rxtx_vec_common.h | 2 +-
drivers/net/iavf/iavf_rxtx_vec_sse.c | 2 +-
drivers/net/iavf/iavf_vchnl.c | 4 +-
drivers/net/ice/ice_acl_filter.c | 2 +-
drivers/net/ice/ice_dcf.c | 4 +-
drivers/net/ice/ice_dcf.h | 2 +-
drivers/net/ice/ice_dcf_ethdev.c | 2 +-
drivers/net/ice/ice_ethdev.c | 2 +-
drivers/net/ice/ice_ethdev.h | 2 +-
drivers/net/ice/ice_generic_flow.c | 2 +-
drivers/net/ice/ice_hash.c | 2 +-
drivers/net/ice/ice_rxtx.c | 2 +-
drivers/net/ice/ice_switch_filter.c | 2 +-
drivers/net/igc/igc_ethdev.c | 4 +-
drivers/net/igc/igc_filter.h | 2 +-
drivers/net/igc/igc_txrx.c | 2 +-
drivers/net/ionic/ionic_ethdev.c | 4 +-
drivers/net/ionic/ionic_lif.c | 2 +-
drivers/net/ionic/ionic_rxtx.c | 2 +-
drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +-
drivers/net/ipn3ke/ipn3ke_ethdev.h | 4 +-
drivers/net/ipn3ke/ipn3ke_flow.c | 2 +-
drivers/net/ipn3ke/ipn3ke_representor.c | 2 +-
drivers/net/ipn3ke/ipn3ke_tm.c | 2 +-
drivers/net/ixgbe/ixgbe_bypass.c | 2 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 4 +-
drivers/net/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/ixgbe/ixgbe_ipsec.c | 4 +-
drivers/net/ixgbe/ixgbe_pf.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_common.h | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 2 +-
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 2 +-
drivers/net/ixgbe/ixgbe_vf_representor.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 2 +-
drivers/net/kni/rte_eth_kni.c | 4 +-
drivers/net/liquidio/base/lio_23xx_vf.c | 2 +-
drivers/net/liquidio/base/lio_mbox.c | 2 +-
drivers/net/liquidio/lio_ethdev.c | 4 +-
drivers/net/liquidio/lio_rxtx.c | 2 +-
drivers/net/memif/memif_socket.c | 4 +-
drivers/net/memif/rte_eth_memif.c | 4 +-
drivers/net/memif/rte_eth_memif.h | 2 +-
drivers/net/mlx4/mlx4.c | 4 +-
drivers/net/mlx4/mlx4.h | 2 +-
drivers/net/mlx4/mlx4_ethdev.c | 2 +-
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 2 +-
drivers/net/mlx4/mlx4_intr.c | 2 +-
drivers/net/mlx4/mlx4_mp.c | 2 +-
drivers/net/mlx4/mlx4_rxq.c | 2 +-
drivers/net/mlx4/mlx4_rxtx.h | 2 +-
drivers/net/mlx4/mlx4_txq.c | 2 +-
drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +-
drivers/net/mlx5/linux/mlx5_mp_os.c | 2 +-
drivers/net/mlx5/linux/mlx5_os.c | 4 +-
drivers/net/mlx5/linux/mlx5_verbs.c | 2 +-
drivers/net/mlx5/linux/mlx5_vlan_os.c | 2 +-
drivers/net/mlx5/mlx5.c | 4 +-
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_defs.h | 2 +-
drivers/net/mlx5/mlx5_ethdev.c | 2 +-
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
drivers/net/mlx5/mlx5_flow_verbs.c | 2 +-
drivers/net/mlx5/mlx5_mac.c | 2 +-
drivers/net/mlx5/mlx5_rss.c | 2 +-
drivers/net/mlx5/mlx5_rxmode.c | 2 +-
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_stats.c | 2 +-
drivers/net/mlx5/mlx5_trigger.c | 2 +-
drivers/net/mlx5/mlx5_txpp.c | 2 +-
drivers/net/mlx5/mlx5_txq.c | 2 +-
drivers/net/mlx5/mlx5_vlan.c | 2 +-
drivers/net/mlx5/windows/mlx5_ethdev_os.c | 2 +-
drivers/net/mlx5/windows/mlx5_mp_os.c | 2 +-
drivers/net/mlx5/windows/mlx5_os.c | 2 +-
drivers/net/mlx5/windows/mlx5_vlan_os.c | 2 +-
drivers/net/mvneta/mvneta_ethdev.c | 2 +-
drivers/net/mvpp2/mrvl_ethdev.c | 2 +-
drivers/net/netvsc/hn_ethdev.c | 2 +-
drivers/net/netvsc/hn_rndis.c | 2 +-
drivers/net/netvsc/hn_vf.c | 2 +-
drivers/net/nfb/nfb_ethdev.c | 2 +-
drivers/net/nfb/nfb_tx.h | 2 +-
drivers/net/nfp/nfp_net.c | 4 +-
drivers/net/nfp/nfpcore/nfp_cpp.h | 2 +-
drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 2 +-
drivers/net/nfp/nfpcore/nfp_cppcore.c | 2 +-
drivers/net/null/rte_eth_null.c | 4 +-
drivers/net/octeontx/octeontx_ethdev.h | 2 +-
drivers/net/octeontx/octeontx_rxtx.c | 2 +-
drivers/net/octeontx/octeontx_rxtx.h | 2 +-
drivers/net/octeontx2/otx2_ethdev.c | 2 +-
drivers/net/octeontx2/otx2_link.c | 2 +-
drivers/net/octeontx2/otx2_ptp.c | 2 +-
drivers/net/pcap/rte_eth_pcap.c | 4 +-
drivers/net/pfe/pfe_eth.h | 2 +-
drivers/net/pfe/pfe_ethdev.c | 2 +-
drivers/net/qede/qede_ethdev.h | 4 +-
drivers/net/ring/rte_eth_ring.c | 2 +-
drivers/net/sfc/sfc.h | 2 +-
drivers/net/sfc/sfc_dp_rx.h | 2 +-
drivers/net/sfc/sfc_dp_tx.h | 2 +-
drivers/net/sfc/sfc_ethdev.c | 4 +-
drivers/net/sfc/sfc_ev.h | 2 +-
drivers/net/sfc/sfc_flow.c | 2 +-
drivers/net/sfc/sfc_rx.h | 2 +-
drivers/net/sfc/sfc_tx.h | 2 +-
drivers/net/softnic/rte_eth_softnic.c | 4 +-
.../net/softnic/rte_eth_softnic_internals.h | 2 +-
drivers/net/szedata2/rte_eth_szedata2.c | 4 +-
drivers/net/tap/rte_eth_tap.c | 4 +-
drivers/net/tap/rte_eth_tap.h | 2 +-
drivers/net/thunderx/nicvf_ethdev.c | 4 +-
drivers/net/thunderx/nicvf_ethdev.h | 2 +-
drivers/net/thunderx/nicvf_rxtx.c | 2 +-
drivers/net/thunderx/nicvf_rxtx.h | 2 +-
drivers/net/thunderx/nicvf_struct.h | 2 +-
drivers/net/txgbe/txgbe_ethdev.c | 2 +-
drivers/net/txgbe/txgbe_ipsec.c | 2 +-
drivers/net/txgbe/txgbe_pf.c | 2 +-
drivers/net/txgbe/txgbe_rxtx.c | 2 +-
drivers/net/vhost/rte_eth_vhost.c | 4 +-
drivers/net/virtio/virtio_ethdev.c | 4 +-
drivers/net/virtio/virtio_pci.h | 2 +-
drivers/net/virtio/virtio_rxtx.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple.c | 2 +-
.../net/virtio/virtio_rxtx_simple_altivec.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_neon.c | 2 +-
drivers/net/virtio/virtio_rxtx_simple_sse.c | 2 +-
drivers/net/virtio/virtio_user_ethdev.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +-
lib/librte_eal/include/generic/rte_mcslock.h | 1 +
lib/librte_eal/include/meson.build | 2 +-
lib/librte_eal/include/rte_compat.h | 8 +-
lib/librte_eal/x86/include/meson.build | 14 +-
.../{rte_ethdev_driver.h => ethdev_driver.h} | 0
.../{rte_ethdev_pci.h => ethdev_pci.h} | 2 +-
lib/librte_ethdev/ethdev_private.c | 2 +-
.../{rte_ethdev_vdev.h => ethdev_vdev.h} | 2 +-
lib/librte_ethdev/meson.build | 8 +-
lib/librte_ethdev/rte_class_eth.c | 2 +-
lib/librte_ethdev/rte_ethdev.c | 2 +-
lib/librte_ethdev/rte_ethdev.h | 2 +-
lib/librte_ethdev/rte_flow_driver.h | 2 +-
lib/librte_ethdev/rte_mtr_driver.h | 2 +-
lib/librte_ethdev/rte_tm_driver.h | 2 +-
lib/librte_hash/meson.build | 4 +-
lib/librte_ipsec/meson.build | 3 +-
lib/librte_lpm/meson.build | 2 +-
lib/librte_regexdev/meson.build | 2 +-
lib/librte_rib/rte_rib6.h | 1 +
lib/librte_ring/meson.build | 4 +-
lib/librte_stack/meson.build | 4 +-
lib/librte_table/meson.build | 7 +-
lib/meson.build | 3 +
meson.build | 6 +
meson_options.txt | 2 +
275 files changed, 435 insertions(+), 579 deletions(-)
create mode 100755 buildtools/chkincs/gen_c_file_for_header.py
create mode 100644 buildtools/chkincs/main.c
create mode 100644 buildtools/chkincs/meson.build
delete mode 100755 devtools/check-includes.sh
rename lib/librte_ethdev/{rte_ethdev_driver.h => ethdev_driver.h} (100%)
rename lib/librte_ethdev/{rte_ethdev_pci.h => ethdev_pci.h} (99%)
rename lib/librte_ethdev/{rte_ethdev_vdev.h => ethdev_vdev.h} (97%)--
2.27.0
PATCH v6 1/8 eal: add missing include to mcslock
Include 'rte_branch_prediction.h' to get the likely/unlikely macro definitions.
--- lib/librte_eal/include/generic/rte_mcslock.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_eal/include/generic/rte_mcslock.h +1 -0
@@ -22,6 +22,7 @@#include <rte_lcore.h> #include <rte_common.h> #include <rte_pause.h> +#include <rte_branch_prediction.h> /** * The rte_mcslock_t type.
Signature · 1 line
2.27.0
PATCH v6 2/8 eal: fix error attribute use for clang
In reply to Bruce RichardsonClang does not have an "error" attribute for functions, so for marking internal functions we need to check for the error attribute, and provide a fallback if it is not present. For clang, we can use "diagnose_if" attribute, similarly checking for its presence before use.
--- lib/librte_eal/include/rte_compat.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
lib/librte_eal/include/rte_compat.h +7 -1
@@ -19,12 +19,18 @@ __attribute__((section(".text.experimental")))#endif -#ifndef ALLOW_INTERNAL_API +#if !definedALLOW_INTERNAL_API &&__has_attribute (error)/* For GCC */ #define __rte_internal \ __attribute__((error("Symbol is not public ABI"), \ section(".text.internal"))) +#elif !definedALLOW_INTERNAL_API &&__has_attribute (diagnose_if)/* For clang */ + +#define __rte_internal \ +__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ +section(".text.internal"))) +#else #define __rte_internal \
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v6 2/8] eal: fix error attribute use for clang
Quoted 8 lines · Bruce Richardson
Clang does not have an "error" attribute for functions, so for marking internal functions we need to check for the error attribute, and provide a fallback if it is not present. For clang, we can use "
diagnose_if" attribute, similarly checking for its presence before use.Fixes fba5af82adc8 ("eal: add internal ABI tag definition")
Quoted 17 lines
Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_eal/include/rte_compat.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)lib/librte_eal/include/rte_compat.h +1
-1@@ -19,12 +19,18 @@ __attribute__((section(".text.experimental")))#endif -#ifndef ALLOW_INTERNAL_API +#if !definedALLOW_INTERNAL_API &&__has_attribute (error)/* For GCC */
lib/librte_eal/include/rte_compat.h __attribute__((section(".text.experimental"))) · line 33
Quoted 10 lines
lib/librte_eal/include/rte_compat.h +6
-0#define __rte_internal \ __attribute__((error("Symbol is not public ABI"), \ section(".text.internal"))) +#elif !definedALLOW_INTERNAL_API &&__has_attribute (diagnose_if)/* For clang */ + +#define __rte_internal \ +__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ +section(".text.internal"))) +
If the compiler has neither error or diagnose_if support, an internal API can be called without ALLOW_INTERNAL_API.
I prefer a build error complaining on an unknown attribute rather than silence a check.
I.e.
#ifndef ALLOW_INTERNAL_API
#if __has_attribute(diagnose_if) /* For clang */
#define __rte_internal \
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \section(".text.internal")))
#else
#define __rte_internal \
__attribute__((error("Symbol is not public ABI"), \section(".text.internal")))
#endif
#else /* ALLOW_INTERNAL_API */
#define __rte_internal \section(".text.internal")))
#endif
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH v6 2/8] eal: fix error attribute use for clang
Quoted 60 lines · David Marchand
Quoted 8 lines · Bruce Richardson
Clang does not have an "error" attribute for functions, so for marking internal functions we need to check for the error attribute, and provide a fallback if it is not present. For clang, we can use "
diagnose_if" attribute, similarly checking for its presence before use.Fixes fba5af82adc8 ("eal: add internal ABI tag definition")Quoted 17 lines
Signed-off-by Bruce Richardson <[email protected]>--- lib/librte_eal/include/rte_compat.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)lib/librte_eal/include/rte_compat.h +1
-1@@ -19,12 +19,18 @@ __attribute__((section(".text.experimental")))#endif -#ifndef ALLOW_INTERNAL_API +#if !definedALLOW_INTERNAL_API &&__has_attribute (error)/* For GCC */ lib/librte_eal/include/rte_compat.h __attribute__((section(".text.experimental"))) · line 33
Quoted 10 lines
lib/librte_eal/include/rte_compat.h +6
-0#define __rte_internal \ __attribute__((error("Symbol is not public ABI"), \ section(".text.internal"))) +#elif !definedALLOW_INTERNAL_API &&__has_attribute (diagnose_if)/* For clang */ + +#define __rte_internal \ +__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \ +section(".text.internal"))) +If the compiler has neither error or
diagnose_ifsupport, an internal API can be called withoutALLOW_INTERNAL_API.
I prefer a build error complaining on an unknown attribute rather than silence a check.I.e.
#ifndef
ALLOW_INTERNAL_API#if
__has_attribute(diagnose_if)/* For clang */
#define__rte_internal\
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \section(".text.internal")))#else
#define__rte_internal\
__attribute__((error("Symbol is not public ABI"), \section(".text.internal")))
Quoted 9 lines
#endif
#else /*
ALLOW_INTERNAL_API*/#define
__rte_internal\section(".text.internal")))#endif
Would this not mean that if someone was using a compiler that supported neither that they could never include any header file which contained any internal functions? I'd rather err on the side of allowing this, on the basis that the symbol should be already documented as internal and this is only an additional sanity check.
/Bruce
Re: [dpdk-dev] [PATCH v6 2/8] eal: fix error attribute use for clang
Quoted 26 lines · Bruce Richardson
Quoted 26 lines
If the compiler has neither error or
diagnose_ifsupport, an internal API can be called withoutALLOW_INTERNAL_API.
I prefer a build error complaining on an unknown attribute rather than silence a check.I.e.
#ifndef
ALLOW_INTERNAL_API#if
__has_attribute(diagnose_if)/* For clang */
#define__rte_internal\
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \section(".text.internal")))#else
#define__rte_internal\
__attribute__((error("Symbol is not public ABI"), \section(".text.internal")))#endif
#else /*
ALLOW_INTERNAL_API*/#define
__rte_internal\section(".text.internal")))
Quoted 8 lines
Quoted 2 lines
#endif
Would this not mean that if someone was using a compiler that supported neither that they could never include any header file which contained any internal functions? I'd rather err on the side of allowing this, on the basis that the symbol should be already documented as internal and this is only an additional sanity check.
- Still not a fan.
We will never know about those compilers behavior, like how we caught the clang issue and found an alternative.
- I just caught a build error with RHEL7 gcc:
[1/2127] Compiling C object lib/librte_eal.a.p/librte_eal_common_eal_common_config.c.o
FAILED: lib/librte_eal.a.p/librte_eal_common_eal_common_config.c.o ccache cc -Ilib/librte_eal.a.p -Ilib -I../lib -I. -I.. -Iconfig -I../config -Ilib/librte_eal/include -I../lib/librte_eal/include -Ilib/librte_eal/linux/include -I../lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../lib/librte_eal/x86/include -Ilib/librte_eal/common -I../lib/librte_eal/common -Ilib/librte_eal -I../lib/librte_eal -Ilib/librte_kvargs -I../lib/librte_kvargs -Ilib/librte_metrics -I../lib/librte_metrics -Ilib/librte_telemetry -I../lib/librte_telemetry -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC -march=native -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API '-DABI_VERSION="21.1"' -MD -MQ lib/librte_eal.a.p/librte_eal_common_eal_common_config.c.o -MF lib/librte_eal.a.p/librte_eal_common_eal_common_config.c.o.d -o lib/librte_eal.a.p/librte_eal_common_eal_common_config.c.o -c ../lib/librte_eal/common/eal_common_config.c
In file included from ../lib/librte_eal/include/rte_dev.h:24:0,
from ../lib/librte_eal/common/eal_private.h:12,
from ../lib/librte_eal/common/eal_common_config.c:9:
../lib/librte_eal/include/rte_compat.h:22:51: error: missing binary
operator before token "("
#if !defined ALLOW_INTERNAL_API && __has_attribute(error) /* For GCC */
^../lib/librte_eal/include/rte_compat.h:28:53: error: missing binary operator before token "("
#elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /*
For clang */
^
I can see that gcc doc recommends checking for __has_attribute availability. Pasting from google cache, since the gcc.gnu.org doc website seems unavailable.
"""
4.2.6 __has_attribute
The special operator __has_attribute (operand) may be used in ‘#if’ and ‘#elif’ expressions to test whether the attribute referenced by its operand is recognized by GCC. Using the operator in other contexts is not valid. In C code, if compiling for strict conformance to standards before C2x, operand must be a valid identifier. Otherwise, operand may be optionally introduced by the attribute-scope:: prefix. The attribute-scope prefix identifies the “namespace” within which the attribute is recognized. The scope of GCC attributes is ‘gnu’ or ‘__gnu__’. The __has_attribute operator by itself, without any operand or parentheses, acts as a predefined macro so that support for it can be tested in portable code. Thus, the recommended use of the operator is as follows:
#if defined __has_attribute
# if __has_attribute (nonnull)
# define ATTR_NONNULL __attribute__ ((nonnull))
# endif
#endif
The first ‘#if’ test succeeds only when the operator is supported by the version of GCC (or another compiler) being used. Only when that test succeeds is it valid to use __has_attribute as a preprocessor operator. As a result, combining the two tests into a single expression as shown below would only be valid with a compiler that supports the operator but not with others that don’t.
#if defined __has_attribute && __has_attribute (nonnull) /* not portable */
…
#endif
"""
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH v6 2/8] eal: fix error attribute use for clang
Quoted 37 lines · David Marchand
Quoted 26 lines · Bruce Richardson
Quoted 26 lines
If the compiler has neither error or
diagnose_ifsupport, an internal API can be called withoutALLOW_INTERNAL_API.
I prefer a build error complaining on an unknown attribute rather than silence a check.I.e.
#ifndef
ALLOW_INTERNAL_API#if
__has_attribute(diagnose_if)/* For clang */
#define__rte_internal\
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \section(".text.internal")))#else
#define__rte_internal\
__attribute__((error("Symbol is not public ABI"), \section(".text.internal")))#endif
#else /*
ALLOW_INTERNAL_API*/#define
__rte_internal\section(".text.internal")))Quoted 8 lines
Quoted 2 lines
#endif
Would this not mean that if someone was using a compiler that supported neither that they could never include any header file which contained any internal functions? I'd rather err on the side of allowing this, on the basis that the symbol should be already documented as internal and this is only an additional sanity check.
Quoted 4 lines
- Still not a fan.
We will never know about those compilers behavior, like how we caught the clang issue and found an alternative.
So I understand, but I'm still concerned about breaking something that was previously working. It's one thing a DPDK developer catching issues with clang, quite another a user catching it when trying to build their own application.
We probably need some other opinions on this one.
Quoted 70 lines
- I just caught a build error with RHEL7 gcc:
[1/2127] Compiling C object
lib/librte_eal.a.p/librte_eal_common_eal_common_config.c.o
FAILED:lib/librte_eal.a.p/librte_eal_common_eal_common_config.c.occache cc -Ilib/librte_eal.a.p -Ilib -I../lib -I. -I.. -Iconfig(quoted diff) +0
-15-I../config -Ilib/librte_eal/include -I../lib/librte_eal/include -Ilib/librte_eal/linux/include -I../lib/librte_eal/linux/include -Ilib/librte_eal/x86/include -I../lib/librte_eal/x86/include -Ilib/librte_eal/common -I../lib/librte_eal/common -Ilib/librte_eal -I../lib/librte_eal -Ilib/librte_kvargs -I../lib/librte_kvargs -Ilib/librte_metrics -I../lib/librte_metrics -Ilib/librte_telemetry -I../lib/librte_telemetry -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O3 -include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC -march=native -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API '-DABI_VERSION="21.1"' -MD -MQ lib/librte_eal.a.p/librte_eal_common_eal_common_config.c.o -MF
lib/librte_eal.a.p/librte_eal_common_eal_common_config.c.o.d-olib/librte_eal.a.p/librte_eal_common_eal_common_config.c.o-c../lib/librte_eal/common/eal_common_config.c
In file included from../lib/librte_eal/include/rte_dev.h:24:0,from ../lib/librte_eal/common/eal_private.h:12, from ../lib/librte_eal/common/eal_common_config.c:9: ../lib/librte_eal/include/rte_compat.h:22:51: error: missing binary operator before token "(" #if !defined ALLOW_INTERNAL_API && __has_attribute(error) /* For GCC */ ^
../lib/librte_eal/include/rte_compat.h:28:53: error: missing binary operator before token "("
#elif !definedALLOW_INTERNAL_API&&__has_attribute(diagnose_if)/*
For clang */^I can see that gcc doc recommends checking for
__has_attributeavailability. Pasting from google cache, since the gcc.gnu.org doc website seems unavailable."""
4.2.6__has_attributeThe special operator
__has_attribute(operand) may be used in ‘#if’ and ‘#elif’ expressions to test whether the attribute referenced by its operand is recognized by GCC. Using the operator in other contexts is not valid. In C code, if compiling for strict conformance to standards before C2x, operand must be a valid identifier. Otherwise, operand may be optionally introduced by the attribute-scope:: prefix. The attribute-scope prefix identifies the “namespace” within which the attribute is recognized. The scope of GCC attributes is ‘gnu’ or ‘__gnu__’. The__has_attributeoperator by itself, without any operand or parentheses, acts as a predefined macro so that support for it can be tested in portable code. Thus, the recommended use of the operator is as follows:#if defined
__has_attribute
# if__has_attribute(nonnull)
# defineATTR_NONNULL__attribute__((nonnull))
# endif
#endifThe first ‘#if’ test succeeds only when the operator is supported by the version of GCC (or another compiler) being used. Only when that test succeeds is it valid to use
__has_attributeas a preprocessor operator. As a result, combining the two tests into a single expression as shown below would only be valid with a compiler that supports the operator but not with others that don’t.
Quoted 5 lines
#if defined
__has_attribute&&__has_attribute(nonnull) /* not portable */
…
#endif
"""
I really wish other tools would do like meson and document per-feature the version in which it was introduced! Anyway, this is something I'll fix in next version, though again we need to decide in the case of __has_attribute not being supported do we fall to erroring out? Again that runs the risk of users not being able to include a header which has an internal function, so I'd prefer us to ignore errors if the appropriate macros are unsupported.
Again, other opinions probably needed.
/Bruce
Re: [dpdk-dev] [PATCH v6 2/8] eal: fix error attribute use for clang
Quoted 43 lines · Bruce Richardson
Quoted 37 lines · David Marchand
Quoted 26 lines · Bruce Richardson
Quoted 26 lines
If the compiler has neither error or
diagnose_ifsupport, an internal API can be called withoutALLOW_INTERNAL_API.
I prefer a build error complaining on an unknown attribute rather than silence a check.I.e.
#ifndef
ALLOW_INTERNAL_API#if
__has_attribute(diagnose_if)/* For clang */
#define__rte_internal\
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \section(".text.internal")))#else
#define__rte_internal\
__attribute__((error("Symbol is not public ABI"), \section(".text.internal")))#endif
#else /*
ALLOW_INTERNAL_API*/#define
__rte_internal\section(".text.internal")))Quoted 8 lines
Quoted 2 lines
#endif
Would this not mean that if someone was using a compiler that supported neither that they could never include any header file which contained any internal functions? I'd rather err on the side of allowing this, on the basis that the symbol should be already documented as internal and this is only an additional sanity check.
Quoted 4 lines
- Still not a fan.
We will never know about those compilers behavior, like how we caught the clang issue and found an alternative.
Quoted 7 lines
So I understand, but I'm still concerned about breaking something that was previously working. It's one thing a DPDK developer catching issues with clang, quite another a user catching it when trying to build their own application.
We probably need some other opinions on this one.
Adding Tech-board to see if we can get some more thoughts on this before I do another revision of this set.
Re: [dpdk-dev] [dpdk-techboard] [PATCH v6 2/8] eal: fix error attribute use for clang
28/01/2021 16:16, Bruce Richardson:
Quoted 49 lines · Bruce Richardson
Quoted 48 lines · David Marchand
Quoted 37 lines
Quoted 26 lines · Bruce Richardson
Quoted 26 lines
If the compiler has neither error or
diagnose_ifsupport, an internal API can be called withoutALLOW_INTERNAL_API.
I prefer a build error complaining on an unknown attribute rather than silence a check.I.e.
#ifndef
ALLOW_INTERNAL_API#if
__has_attribute(diagnose_if)/* For clang */
#define__rte_internal\
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \section(".text.internal")))#else
#define__rte_internal\
__attribute__((error("Symbol is not public ABI"), \section(".text.internal")))#endif
#else /*
ALLOW_INTERNAL_API*/#define
__rte_internal\section(".text.internal")))Quoted 8 lines
Quoted 2 lines
#endif
Would this not mean that if someone was using a compiler that supported neither that they could never include any header file which contained any internal functions? I'd rather err on the side of allowing this, on the basis that the symbol should be already documented as internal and this is only an additional sanity check.
Quoted 4 lines
- Still not a fan.
We will never know about those compilers behavior, like how we caught the clang issue and found an alternative.So I understand, but I'm still concerned about breaking something that was previously working. It's one thing a DPDK developer catching issues with clang, quite another a user catching it when trying to build their own application.
Quoted 4 lines
Quoted 2 lines
We probably need some other opinions on this one.
Adding Tech-board to see if we can get some more thoughts on this before I do another revision of this set.
What are the alternatives?
Re: [dpdk-dev] [dpdk-techboard] [PATCH v6 2/8] eal: fix error attribute use for clang
Quoted 50 lines · Thomas Monjalon
28/01/2021 16:16, Bruce Richardson:
Quoted 49 lines · Bruce Richardson
Quoted 48 lines · David Marchand
Quoted 37 lines
Quoted 26 lines · Bruce Richardson
Quoted 26 lines
If the compiler has neither error or
diagnose_ifsupport, an internal API can be called withoutALLOW_INTERNAL_API.
I prefer a build error complaining on an unknown attribute rather than silence a check.I.e.
#ifndef
ALLOW_INTERNAL_API#if
__has_attribute(diagnose_if)/* For clang */
#define__rte_internal\
__attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \section(".text.internal")))#else
#define__rte_internal\
__attribute__((error("Symbol is not public ABI"), \section(".text.internal")))#endif
#else /*
ALLOW_INTERNAL_API*/#define
__rte_internal\section(".text.internal")))Quoted 8 lines
Quoted 2 lines
#endif
Would this not mean that if someone was using a compiler that supported neither that they could never include any header file which contained any internal functions? I'd rather err on the side of allowing this, on the basis that the symbol should be already documented as internal and this is only an additional sanity check.
Quoted 4 lines
- Still not a fan.
We will never know about those compilers behavior, like how we caught the clang issue and found an alternative.So I understand, but I'm still concerned about breaking something that was previously working. It's one thing a DPDK developer catching issues with clang, quite another a user catching it when trying to build their own application.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
We probably need some other opinions on this one.
Adding Tech-board to see if we can get some more thoughts on this before I do another revision of this set.
What are the alternatives?
The basic problem is what to do when a compiler is used which does not support the required macros to flag an error for use of an internal-only function. For example, we discovered this because clang does not support the #error macro.
In those cases, as I see it, we really have two choices:
1 ignore flagging the error and silently allow possible use of the internal
function.
2 have the compiler flag an error for an unknown macro
The problem that I have with #2 is that without knowing the macro, the compiler will likely error out any time a user app includes any header with an internal function, even if the function is unused.
On the other hand, the likelihood of impact if we choose #2 and do error out is quite small, since modern clang versions will support the modern macro checks we need, and just about any gcc versions we care about are going to support #error.
For #1, the downside is that we will miss error checks on some older versions of gcc e.g. RHEL 7, and the user may inadvertently use an internal function without knowing it.
David, anything else to add here?
/Bruce
Re: [dpdk-dev] [dpdk-techboard] [PATCH v6 2/8] eal: fix error attribute use for clang
Quoted 14 lines · Bruce Richardson
Quoted 14 lines
Quoted 13 lines
Quoted 11 lines
Quoted 3 lines
We will never know about those compilers behavior, like how we caught the clang issue and found an alternative.
So I understand, but I'm still concerned about breaking something that was previously working. It's one thing a DPDK developer catching issues with clang, quite another a user catching it when trying to build their own application.
We probably need some other opinions on this one.
Adding Tech-board to see if we can get some more thoughts on this before I do another revision of this set.
Quoted 7 lines
Quoted 2 lines
What are the alternatives?
The basic problem is what to do when a compiler is used which does not support the required macros to flag an error for use of an internal-only function. For example, we discovered this because clang does not support the #error macro.
*attribute*
Quoted 16 lines
In those cases, as I see it, we really have two choices:
1 ignore flagging the error and silently allow possible use of the internal
function.
2 have the compiler flag an error for an unknown macroThe problem that I have with #2 is that without knowing the macro, the compiler will likely error out any time a user app includes any header with an internal function, even if the function is unused.
On the other hand, the likelihood of impact if we choose #2 and do error out is quite small, since modern clang versions will support the modern macro checks we need, and just about any gcc versions we care about are going to support #error.
Quoted 5 lines
For #1, the downside is that we will miss error checks on some older versions of gcc e.g. RHEL 7, and the user may inadvertently use an internal function without knowing it.
David, anything else to add here?
Nop, fair summary.
Signature · 1 line
David Marchand
Re: [dpdk-dev] [dpdk-techboard] [PATCH v6 2/8] eal: fix error attribute use for clang
29/01/2021 09:35, David Marchand:
Quoted 19 lines
Quoted 17 lines · Bruce Richardson
Quoted 16 lines
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
We will never know about those compilers behavior, like how we caught the clang issue and found an alternative.
So I understand, but I'm still concerned about breaking something that was previously working. It's one thing a DPDK developer catching issues with clang, quite another a user catching it when trying to build their own application.
Quoted 4 lines
Quoted 2 lines
We probably need some other opinions on this one.
Adding Tech-board to see if we can get some more thoughts on this before I do another revision of this set.
What are the alternatives?
Quoted 22 lines
Quoted 4 lines
The basic problem is what to do when a compiler is used which does not support the required macros to flag an error for use of an internal-only function. For example, we discovered this because clang does not support the #error macro.
*attribute*
Quoted 15 lines
In those cases, as I see it, we really have two choices:
1 ignore flagging the error and silently allow possible use of the internal
function.
2 have the compiler flag an error for an unknown macroThe problem that I have with #2 is that without knowing the macro, the compiler will likely error out any time a user app includes any header with an internal function, even if the function is unused.
On the other hand, the likelihood of impact if we choose #2 and do error out is quite small, since modern clang versions will support the modern macro checks we need, and just about any gcc versions we care about are going to support #error.
If there are very small chances of hitting the issue, it looks acceptable. But I don't really like risking issues with not tested compilers.
Quoted 3 lines
Quoted 3 lines
For #1, the downside is that we will miss error checks on some older versions of gcc e.g. RHEL 7, and the user may inadvertently use an internal function without knowing it.
The function is marked as internal.
If the user misses this info and test only with compilers not supporting the attribute, that's no luck.
What would be the consequence? Having a risk for future compatibility? It looks to be an acceptable risk.
The other consequence it that we won't have reports for this rare incompatibility.
Quoted 3 lines
Quoted 1 line
David, anything else to add here?
Nop, fair summary.
My preference is for #1:
pro: No compilation will be impacted in the field
con: DPDK developers may miss some cases
Any other opinion?
PATCH v6 3/8 rib: fix missing header include
In reply to Bruce RichardsonThe rte_rib6 header was using RTE_MIN macro from rte_common.h but not including the header file.
--- lib/librte_rib/rte_rib6.h | 1 + 1 file changed, 1 insertion(+)
lib/librte_rib/rte_rib6.h +1 -0
@@ -20,6 +20,7 @@#include <rte_memcpy.h> #include <rte_compat.h> +#include <rte_common.h> #ifdef __cplusplusextern "C" {
Signature · 1 line
2.27.0
Re: [dpdk-dev] [PATCH v6 3/8] rib: fix missing header include
Quoted 6 lines · Bruce Richardson
The
rte_rib6header was usingRTE_MINmacro fromrte_common.hbut not including the header file.Fixes f7e861e21c46 ("rib: support IPv6")
Cc: [email protected]
Or was it intentionally skipped?
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH v6 3/8] rib: fix missing header include
Quoted 12 lines · David Marchand
Quoted 6 lines · Bruce Richardson
The
rte_rib6header was usingRTE_MINmacro fromrte_common.hbut not including the header file.Fixes f7e861e21c46 ("rib: support IPv6")Cc: [email protected]
Or was it intentionally skipped?
Nope, just a miss on my part. Apologies.