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 <tchaikov@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This commit is contained in:
Kefu Chai 2021-10-14 04:54:18 +08:00 committed by Thomas Monjalon
parent 59e5e8abab
commit 93b2a8501c
3 changed files with 5 additions and 2 deletions

View File

@ -299,7 +299,9 @@ if dpdk_conf.get('RTE_ARCH_64')
else # for 32-bit we need smaller reserved memory areas else # for 32-bit we need smaller reserved memory areas
dpdk_conf.set('RTE_MAX_MEM_MB', 2048) dpdk_conf.set('RTE_MAX_MEM_MB', 2048)
endif endif
if get_option('mbuf_refcnt_atomic')
dpdk_conf.set('RTE_MBUF_REFCNT_ATOMIC', true)
endif
compile_time_cpuflags = [] compile_time_cpuflags = []
subdir(arch_subdir) subdir(arch_subdir)

View File

@ -50,7 +50,6 @@
/* mbuf defines */ /* mbuf defines */
#define RTE_MBUF_DEFAULT_MEMPOOL_OPS "ring_mp_mc" #define RTE_MBUF_DEFAULT_MEMPOOL_OPS "ring_mp_mc"
#define RTE_MBUF_REFCNT_ATOMIC 1
#define RTE_PKTMBUF_HEADROOM 128 #define RTE_PKTMBUF_HEADROOM 128
/* ether defines */ /* ether defines */

View File

@ -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.') '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: 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.') '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: 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.') '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: option('enable_trace_fp', type: 'boolean', value: false, description: