]> git.droids-corp.org - dpdk.git/commitdiff
devtools: forbid indent with tabs in Meson
authorDavid Marchand <david.marchand@redhat.com>
Fri, 22 Oct 2021 20:55:31 +0000 (22:55 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 2 Nov 2021 18:25:30 +0000 (19:25 +0100)
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: 4ad4b20a7905 ("drivers: change indentation in build files")
Fixes: 2457705e6474 ("crypto/cnxk: add driver skeleton")
Fixes: 634b73104482 ("app/testpmd: build on Windows")
Fixes: 3a6bfc37eaf4 ("net/ice: support QoS config VF bandwidth in DCF")
Fixes: 8ef09fdc506b ("build: add optional NUMA and CPU counts detection")
Fixes: e1369718f553 ("common/octeontx: enable build only on 64-bit Linux")
Fixes: 2b504721bfda ("app/bbdev: enable la12xx")
Fixes: 6cc51b1293ce ("mem: instrument allocator for ASan")
Fixes: c75542ae4200 ("crypto/ipsec_mb: introduce IPsec_mb framework")
Fixes: 918fd2f1466b ("crypto/ipsec_mb: move aesni_mb PMD")
Fixes: 746825e5c0ea ("crypto/ipsec_mb: move aesni_gcm PMD")
Fixes: bc9ef81c42b4 ("crypto/ipsec_mb: move kasumi PMD")
Fixes: 4f1cfda59ad3 ("crypto/ipsec_mb: move snow3g PMD")
Fixes: cde8df1bda9d ("crypto/ipsec_mb: move zuc PMD")
Fixes: f16662885472 ("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>
21 files changed:
app/pdump/meson.build
app/proc-info/meson.build
app/test-acl/meson.build
app/test-bbdev/meson.build
app/test-cmdline/meson.build
app/test-compress-perf/meson.build
app/test-crypto-perf/meson.build
app/test-eventdev/meson.build
app/test-fib/meson.build
app/test-flow-perf/meson.build
app/test-pipeline/meson.build
app/test-regex/meson.build
app/test-sad/meson.build
app/test/meson.build
config/meson.build
devtools/check-meson.py
drivers/compress/octeontx/meson.build
drivers/crypto/cnxk/meson.build
drivers/crypto/ipsec_mb/meson.build
drivers/crypto/qat/meson.build
drivers/net/ice/meson.build

index db1fcadbfe2cb4634970e259fe9ced0f3db0bcb7..fb282bba1fc16e545e750c94d19a4b5e2feef660 100644 (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')
index 82ed05bb0b4e54a0582af8895538a7d21e4950d0..1062e0ef8688235524e7bde7a1d1351db2c21a8a 100644 (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')
index 14d36b33e930e10a72671a20b2de54bf7b0b6551..c0dc4b221ae4bf52f7e3f631e8a5aa6f7934af75 100644 (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')
index a726a5b3fa2a816c3406cfa3d1d60d562839a497..76d4c269995793d4fb8ca991ed10f1680a331228 100644 (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
index 08988212000a694fcf2ada2d8add462260721e6a..6027f6791966087ec14661715494adb32495465a 100644 (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')
index f29c6ee86390d4f1600452bec5d4071209c13757..34dcfe5b8e712aa8054db73933bc50e8eb6d3ffd 100644 (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(
index ef3582a87c861f9da783e056e8c4bec5ddb879d4..7b02b518f0e6d9c203af34ff6d76393fb19c8519 100644 (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(
index 17be36067717298419c20cc9731727cfd4435dcd..ab8769c7559c8125b200e6be1ca56dad660d1297 100644 (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(
index 3360ea02b0c9560fda51460639f963518af00238..eb36772cf389ff29ee0845794ed750168bf6e769 100644 (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')
index a33cad9078e8c8fb2c406131af2e972d7afea6e3..766e4516ad662c1f6e70d7fa34d9e5f9375e139e 100644 (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(
index 7d123e32fb77e030ec5dc830cafbd5dc862d56e4..3add6b637bdb5ec81013140a2011b95b22b7eaaf 100644 (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(
index 02b101980eb550e20ae989d991f5b97854c461cd..e3ba060e55069ebd9a14599099fcafdc4d044f85 100644 (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')
index 3d15727a018179d48fbb951b31ad35ab611d96cd..a50616a9c72f7266361bdf036169c4363a95c579 100644 (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')
index 20f36a18034aecaef0b2fc7a25370fb8ebca61db..3d9470df2340c8d210bed6551120d68325c03d90 100644 (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')
index 59e3d5c57310eab512579aedf08bceeb5f5bf5a4..17b5bec406c696ae9503b270afedb2dbc284a120 100644 (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
 
index 29f7887968143a38ba215e3e73607298dbfca8e6..4b2338828dbf8f56d67cda196f4356eeaebfc25d 100755 (executable)
@@ -8,6 +8,7 @@ A Python script to run some checks on meson.build files in DPDK
 
 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')
index cd8687fde30e307d52f2d48927a653685c846903..3a29c3e60968891ab9db23b15453c904f66116cb 100644 (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')
index 024109f7e92c59461784fe91f10a17dc8fe661c6..23a1cc3aac75564828f903828a04177d02b039eb 100644 (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(
index d7037daea15f3fbca2085f0a05cafb5645e45ab1..b4a81efa8eed4040025d826ea30f393163a31af8 100644 (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']
index b3b2d172580993de4cf4dbc48380880990cc402b..544f481067d7f5aad191425da68a092c350bf7f2 100644 (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'
index 0b86d74a49bca70d07146df05c800b0cbeb70213..d608da7765ac2cb9f884393c3bade241a82de4a9 100644 (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')