From 68fc7c39ee42ae8d787709ddf0106edc3b02db5c Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Thu, 16 Dec 2021 11:14:30 +0000 Subject: [PATCH] config: remove explicit undef of unset values MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 " is not set" is modelled after the kernel approach of doing the same thing. Signed-off-by: Bruce Richardson Acked-by: Morten Brørup Acked-by: Tyler Retzlaff Signed-off-by: David Marchand --- config/rte_config.h | 8 ++++---- devtools/checkpatches.sh | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/config/rte_config.h b/config/rte_config.h index 8eb29c1525..46549cb062 100644 --- a/config/rte_config.h +++ b/config/rte_config.h @@ -83,13 +83,13 @@ /* 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 @@ -120,7 +120,7 @@ /* 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 @@ -133,6 +133,6 @@ #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_ */ diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 34a2e43845..1edc5810ad 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -158,6 +158,14 @@ check_forbidden_additions() { # -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 } -- 2.39.5