build: make headroom and max memzones configurable

Message ID 20221012124021.52265-1-markus.theil@tu-ilmenau.de (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series build: make headroom and max memzones configurable |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed

Commit Message

Markus Theil Oct. 12, 2022, 12:40 p.m. UTC
  We often set headroom and memzones to a different value
in our builds. This should also be useful in other projects.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 config/meson.build  | 2 ++
 config/rte_config.h | 2 --
 meson_options.txt   | 4 ++++
 3 files changed, 6 insertions(+), 2 deletions(-)
  

Patch

diff --git a/config/meson.build b/config/meson.build
index 610e1f9ea7..8708b45c5c 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -299,6 +299,8 @@  endforeach
 dpdk_conf.set('RTE_MAX_ETHPORTS', get_option('max_ethports'))
 dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet'))
 dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
+dpdk_conf.set('RTE_PKTMBUF_HEADROOM', get_option('pktmbuf_headroom'))
+dpdk_conf.set('RTE_MAX_MEMZONE', get_option('max_memzones'))
 # values which have defaults which may be overridden
 dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64)
 dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64)
diff --git a/config/rte_config.h b/config/rte_config.h
index b2377a04e5..235bbd860a 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -34,7 +34,6 @@ 
 #define RTE_MAX_MEM_MB_PER_LIST 32768
 #define RTE_MAX_MEMSEG_PER_TYPE 32768
 #define RTE_MAX_MEM_MB_PER_TYPE 65536
-#define RTE_MAX_MEMZONE 2560
 #define RTE_MAX_TAILQ 32
 #define RTE_LOG_DP_LEVEL RTE_LOG_INFO
 #define RTE_BACKTRACE 1
@@ -50,7 +49,6 @@ 
 
 /* mbuf defines */
 #define RTE_MBUF_DEFAULT_MEMPOOL_OPS "ring_mp_mc"
-#define RTE_PKTMBUF_HEADROOM 128
 
 /* ether defines */
 #define RTE_MAX_QUEUES_PER_PORT 1024
diff --git a/meson_options.txt b/meson_options.txt
index 541cb3c7b4..0574dd0fff 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -50,3 +50,7 @@  option('tests', type: 'boolean', value: false, description:
        'build unit tests')
 option('use_hpet', type: 'boolean', value: false, description:
        'use HPET timer in EAL')
+option('pktmbuf_headroom', type: 'integer', value: 128, description:
+       'Set mbuf headroom to a custom value')
+option('max_memzones', type: 'integer', value: 2560, description:
+       'Set maximum allowed number of memzones')