From 93b2a8501cb358aea67865fa49a333067a2bf2d1 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 14 Oct 2021 04:54:18 +0800 Subject: [PATCH] config: add option for atomic mbuf reference counting RTE_MBUF_REFCNT_ATOMIC = 0 is not necessary for applications like Seastar, where it's safe to assume that the mbuf refcnt is only updated by a single core only. Signed-off-by: Kefu Chai Acked-by: Bruce Richardson --- config/meson.build | 4 +++- config/rte_config.h | 1 - meson_options.txt | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/meson.build b/config/meson.build index 4cdf589e20..4b29e59356 100644 --- a/config/meson.build +++ b/config/meson.build @@ -299,7 +299,9 @@ if dpdk_conf.get('RTE_ARCH_64') else # for 32-bit we need smaller reserved memory areas dpdk_conf.set('RTE_MAX_MEM_MB', 2048) endif - +if get_option('mbuf_refcnt_atomic') + dpdk_conf.set('RTE_MBUF_REFCNT_ATOMIC', true) +endif compile_time_cpuflags = [] subdir(arch_subdir) diff --git a/config/rte_config.h b/config/rte_config.h index e0ead8b251..1a66b42fcc 100644 --- a/config/rte_config.h +++ b/config/rte_config.h @@ -50,7 +50,6 @@ /* mbuf defines */ #define RTE_MBUF_DEFAULT_MEMPOOL_OPS "ring_mp_mc" -#define RTE_MBUF_REFCNT_ATOMIC 1 #define RTE_PKTMBUF_HEADROOM 128 /* ether defines */ diff --git a/meson_options.txt b/meson_options.txt index 9beedabe4c..7c220ad68d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -38,6 +38,8 @@ option('max_lcores', type: 'string', value: 'default', description: 'Set maximum number of cores/threads supported by EAL; "default" is different per-arch, "detect" detects the number of cores on the build machine.') option('max_numa_nodes', type: 'string', value: 'default', description: 'Set the highest NUMA node supported by EAL; "default" is different per-arch, "detect" detects the highest NUMA node on the build machine.') +option('mbuf_refcnt_atomic', type: 'boolean', value: true, description: + 'Atomically access the mbuf refcnt.') option('platform', type: 'string', value: 'native', description: 'Platform to build, either "native", "generic" or a SoC. Please refer to the Linux build guide for more information.') option('enable_trace_fp', type: 'boolean', value: false, description: -- 2.20.1