devtools: forbid indent with tabs in Meson

The rule for indentation in Meson in DPDK is 4 spaces.

Any tab should be flagged as an issue, let's extend the check and fix
existing offenders.

Fixes: 4ad4b20a79 ("drivers: change indentation in build files")
Fixes: 2457705e64 ("crypto/cnxk: add driver skeleton")
Fixes: 634b731044 ("app/testpmd: build on Windows")
Fixes: 3a6bfc37ea ("net/ice: support QoS config VF bandwidth in DCF")
Fixes: 8ef09fdc50 ("build: add optional NUMA and CPU counts detection")
Fixes: e1369718f5 ("common/octeontx: enable build only on 64-bit Linux")
Fixes: 2b504721bf ("app/bbdev: enable la12xx")
Fixes: 6cc51b1293 ("mem: instrument allocator for ASan")
Fixes: c75542ae42 ("crypto/ipsec_mb: introduce IPsec_mb framework")
Fixes: 918fd2f146 ("crypto/ipsec_mb: move aesni_mb PMD")
Fixes: 746825e5c0 ("crypto/ipsec_mb: move aesni_gcm PMD")
Fixes: bc9ef81c42 ("crypto/ipsec_mb: move kasumi PMD")
Fixes: 4f1cfda59a ("crypto/ipsec_mb: move snow3g PMD")
Fixes: cde8df1bda ("crypto/ipsec_mb: move zuc PMD")
Fixes: f166628854 ("crypto/ipsec_mb: add chacha_poly PMD")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
David Marchand 2021-10-22 22:55:31 +02:00
parent 2cdca6ed63
commit f88b0b8922
21 changed files with 111 additions and 106 deletions

View File

@ -2,9 +2,9 @@
# Copyright(c) 2018 Intel Corporation
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files('main.c')

View File

@ -2,9 +2,9 @@
# Copyright(c) 2018 Intel Corporation
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files('main.c')

View File

@ -2,9 +2,9 @@
# Copyright(c) 2019 Intel Corporation
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files('main.c')

View File

@ -2,9 +2,9 @@
# Copyright(c) 2018 Intel Corporation
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files(
@ -24,5 +24,5 @@ if dpdk_conf.has('RTE_BASEBAND_ACC100')
deps += ['baseband_acc100']
endif
if dpdk_conf.has('RTE_LIBRTE_PMD_BBDEV_LA12XX')
deps += ['baseband_la12xx']
deps += ['baseband_la12xx']
endif

View File

@ -2,9 +2,9 @@
# Copyright(c) 2019 Intel Corporation
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files('commands.c', 'cmdline_test.c')

View File

@ -2,9 +2,9 @@
# Copyright(c) 2018 Intel Corporation
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files(

View File

@ -2,9 +2,9 @@
# Copyright(c) 2018 Intel Corporation
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files(

View File

@ -2,9 +2,9 @@
# Copyright(c) 2017 Cavium, Inc
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files(

View File

@ -2,9 +2,9 @@
# Copyright(c) 2019 Intel Corporation
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files('main.c')

View File

@ -2,9 +2,9 @@
# Copyright(c) 2020 Mellanox Technologies, Ltd
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files(

View File

@ -2,9 +2,9 @@
# Copyright(c) 2019 Intel Corporation
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files(

View File

@ -2,9 +2,9 @@
# Copyright 2020 Mellanox Technologies, Ltd
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files('main.c')

View File

@ -2,9 +2,9 @@
# Copyright(c) 2019 Intel Corporation
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
sources = files('main.c')

View File

@ -2,9 +2,9 @@
# Copyright(c) 2017 Intel Corporation
if is_windows
build = false
reason = 'not supported on Windows'
subdir_done()
build = false
reason = 'not supported on Windows'
subdir_done()
endif
if not get_option('tests')

View File

@ -324,47 +324,47 @@ endif
max_lcores = get_option('max_lcores')
if max_lcores == 'detect'
# discovery makes sense only for non-cross builds
if meson.is_cross_build()
error('Discovery of max_lcores is not supported for cross-compilation.')
endif
# overwrite the default value with discovered values
max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
min_lcores = 2
# DPDK must be built for at least 2 cores
if max_lcores < min_lcores
message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
max_lcores = min_lcores
else
message('Found @0@ cores'.format(max_lcores))
endif
dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
# discovery makes sense only for non-cross builds
if meson.is_cross_build()
error('Discovery of max_lcores is not supported for cross-compilation.')
endif
# overwrite the default value with discovered values
max_lcores = run_command(get_cpu_count_cmd).stdout().to_int()
min_lcores = 2
# DPDK must be built for at least 2 cores
if max_lcores < min_lcores
message('Found less than @0@ cores, building for @0@ cores'.format(min_lcores))
max_lcores = min_lcores
else
message('Found @0@ cores'.format(max_lcores))
endif
dpdk_conf.set('RTE_MAX_LCORE', max_lcores)
elif max_lcores != 'default'
# overwrite the default value from arch_subdir with user input
dpdk_conf.set('RTE_MAX_LCORE', max_lcores.to_int())
# overwrite the default value from arch_subdir with user input
dpdk_conf.set('RTE_MAX_LCORE', max_lcores.to_int())
endif
max_numa_nodes = get_option('max_numa_nodes')
if max_numa_nodes == 'detect'
# discovery makes sense only for non-cross builds
if meson.is_cross_build()
error('Discovery of max_numa_nodes not supported for cross-compilation.')
endif
# overwrite the default value with discovered values
max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
message('Found @0@ numa nodes'.format(max_numa_nodes))
dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
# discovery makes sense only for non-cross builds
if meson.is_cross_build()
error('Discovery of max_numa_nodes not supported for cross-compilation.')
endif
# overwrite the default value with discovered values
max_numa_nodes = run_command(get_numa_count_cmd).stdout().to_int()
message('Found @0@ numa nodes'.format(max_numa_nodes))
dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes)
elif max_numa_nodes != 'default'
# overwrite the default value from arch_subdir with user input
dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes.to_int())
# overwrite the default value from arch_subdir with user input
dpdk_conf.set('RTE_MAX_NUMA_NODES', max_numa_nodes.to_int())
endif
# check that CPU and NUMA counts are set
if not dpdk_conf.has('RTE_MAX_LCORE')
error('Number of CPU cores not specified.')
error('Number of CPU cores not specified.')
endif
if not dpdk_conf.has('RTE_MAX_NUMA_NODES')
error('Number of NUMA nodes not specified.')
error('Number of NUMA nodes not specified.')
endif
# set the install path for the drivers
@ -429,7 +429,7 @@ if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address
endif
if is_linux and arch_subdir == 'x86' and dpdk_conf.get('RTE_ARCH_64')
dpdk_conf.set10('RTE_MALLOC_ASAN', true)
dpdk_conf.set10('RTE_MALLOC_ASAN', true)
endif
endif

View File

@ -8,6 +8,7 @@
import sys
import os
import re
from os.path import relpath, join
from argparse import ArgumentParser
@ -50,6 +51,8 @@ def check_indentation(filename, contents):
code, comments = split_code_comments(line)
if not code.strip():
continue
if re.match('^ *\t', code):
print(f'Error parsing {filename}:{lineno}, got some tabulation')
if code.endswith('files('):
if infiles:
raise(f'Error parsing {filename}:{lineno}, got "files(" when already parsing files list')

View File

@ -2,9 +2,9 @@
# Copyright(c) 2018 Cavium, Inc
if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
build = false
reason = 'only supported on 64-bit Linux'
subdir_done()
build = false
reason = 'only supported on 64-bit Linux'
subdir_done()
endif
sources = files('otx_zip.c', 'otx_zip_pmd.c')

View File

@ -3,9 +3,9 @@
#
if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
build = false
reason = 'only supported on 64-bit Linux'
subdir_done()
build = false
reason = 'only supported on 64-bit Linux'
subdir_done()
endif
sources = files(

View File

@ -4,30 +4,30 @@
IMB_required_ver = '1.0.0'
lib = cc.find_library('IPSec_MB', required: false)
if not lib.found()
build = false
reason = 'missing dependency, "libIPSec_MB"'
build = false
reason = 'missing dependency, "libIPSec_MB"'
else
ext_deps += lib
ext_deps += lib
# version comes with quotes, so we split based on " and take the middle
imb_ver = cc.get_define('IMB_VERSION_STR',
prefix : '#include<intel-ipsec-mb.h>').split('"')[1]
if (imb_ver == '') or (imb_ver.version_compare('<' + IMB_required_ver))
reason = 'IPSec_MB version >= @0@ is required, found version @1@'.format(
IMB_required_ver, imb_ver)
build = false
endif
# version comes with quotes, so we split based on " and take the middle
imb_ver = cc.get_define('IMB_VERSION_STR',
prefix : '#include<intel-ipsec-mb.h>').split('"')[1]
if (imb_ver == '') or (imb_ver.version_compare('<' + IMB_required_ver))
reason = 'IPSec_MB version >= @0@ is required, found version @1@'.format(
IMB_required_ver, imb_ver)
build = false
endif
endif
sources = files('ipsec_mb_private.c',
'ipsec_mb_ops.c',
'pmd_aesni_mb.c',
'pmd_aesni_gcm.c',
'pmd_chacha_poly.c',
'pmd_kasumi.c',
'pmd_snow3g.c',
'pmd_zuc.c'
)
sources = files(
'ipsec_mb_private.c',
'ipsec_mb_ops.c',
'pmd_aesni_mb.c',
'pmd_aesni_gcm.c',
'pmd_chacha_poly.c',
'pmd_kasumi.c',
'pmd_snow3g.c',
'pmd_zuc.c',
)
deps += ['bus_vdev', 'net', 'security']

View File

@ -19,7 +19,7 @@ if dep.found()
'qat_sym_hw_dp.c',
'qat_sym_pmd.c',
'qat_sym_session.c',
)
)
qat_ext_deps += dep
qat_cflags += '-DBUILD_QAT_SYM'
qat_cflags += '-DBUILD_QAT_ASYM'

View File

@ -67,10 +67,12 @@ if arch_subdir == 'x86'
endif
endif
sources += files('ice_dcf.c',
'ice_dcf_vf_representor.c',
'ice_dcf_ethdev.c',
'ice_dcf_parent.c',
'ice_dcf_sched.c')
sources += files(
'ice_dcf.c',
'ice_dcf_vf_representor.c',
'ice_dcf_ethdev.c',
'ice_dcf_parent.c',
'ice_dcf_sched.c',
)
headers = files('rte_pmd_ice.h')