]> git.droids-corp.org - dpdk.git/commitdiff
config: remove explicit undef of unset values
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 16 Dec 2021 11:14:30 +0000 (11:14 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 15 Jun 2022 07:06:19 +0000 (09:06 +0200)
Rather than explicitly clearing any setting of undefined values in our
rte_config.h file, it's better to instead just add a comment that the
value is not set. Using a comment allows the user to set the value using
CFLAGS or similar mechanism without the config file clearing the value
again.

The text used "<VALUE> is not set" is modelled after the kernel approach
of doing the same thing.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
config/rte_config.h
devtools/checkpatches.sh

index 8eb29c15251e55b3e299fbbc864031153b026372..46549cb062e44325448c96b8b7d265d9720a292b 100644 (file)
 
 /* ip_fragmentation defines */
 #define RTE_LIBRTE_IP_FRAG_MAX_FRAG 8
-#undef RTE_LIBRTE_IP_FRAG_TBL_STAT
+// RTE_LIBRTE_IP_FRAG_TBL_STAT is not set
 
 /* rte_power defines */
 #define RTE_MAX_LCORE_FREQS 64
 
 /* rte_sched defines */
-#undef RTE_SCHED_CMAN
+// RTE_SCHED_CMAN is not set
 
 /* rte_graph defines */
 #define RTE_GRAPH_BURST_SIZE 256
 
 /* i40e defines */
 #define RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC 1
-#undef RTE_LIBRTE_I40E_16BYTE_RX_DESC
+// RTE_LIBRTE_I40E_16BYTE_RX_DESC is not set
 #define RTE_LIBRTE_I40E_QUEUE_NUM_PER_PF 64
 #define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF 4
 #define RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM 4
 #define RTE_LIBRTE_QEDE_FW ""
 
 /* DLB2 defines */
-#undef RTE_LIBRTE_PMD_DLB2_QUELL_STATS
+// RTE_LIBRTE_PMD_DLB2_QUELL_STATS is not set
 
 #endif /* _RTE_CONFIG_H_ */
index 34a2e43845f10702721a34860819bc0509d9b571..1edc5810ad107a47970d8191f27c8a74cc0a3313 100755 (executable)
@@ -158,6 +158,14 @@ check_forbidden_additions() { # <patch>
                -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
                "$1" || res=1
 
+       # '// XXX is not set' must be preferred over '#undef XXX'
+       awk -v FOLDERS='config/rte_config.h' \
+               -v EXPRESSIONS='#undef' \
+               -v RET_ON_FAIL=1 \
+               -v MESSAGE='Using "#undef XXX", prefer "// XXX is not set"' \
+               -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+               "$1" || res=1
+
        return $res
 }