[v5,1/2] build: add meson options of atomic_mbuf_ref_counts

Message ID 20211013205417.84119-2-tchaikov@gmail.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v5,1/2] build: add meson options of atomic_mbuf_ref_counts |

Checks

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

Commit Message

Kefu Chai Oct. 13, 2021, 8:54 p.m. UTC
  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>
---
 config/meson.build  | 4 +++-
 config/rte_config.h | 1 -
 meson_options.txt   | 2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)
  

Comments

Bruce Richardson Oct. 14, 2021, 8:20 a.m. UTC | #1
On Thu, Oct 14, 2021 at 04:54:18AM +0800, Kefu Chai wrote:
> 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>
> ---

For this, I think it's a setting that needs to be a global one for DPDK, so
I'm ok with adding it as a meson option.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Thomas Monjalon Oct. 25, 2021, 3:55 p.m. UTC | #2
14/10/2021 10:20, Bruce Richardson:
> On Thu, Oct 14, 2021 at 04:54:18AM +0800, Kefu Chai wrote:
> > 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>
> > ---
> 
> For this, I think it's a setting that needs to be a global one for DPDK, so
> I'm ok with adding it as a meson option.
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Changed the option name to "mbuf_refcnt_atomic" to match the flag.
Applied, thanks.
  

Patch

diff --git a/config/meson.build b/config/meson.build
index 4cdf589e20..c90c7a0bfe 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('atomic_mbuf_ref_counts')
+  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 590903c07d..208d916a1f 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..222ad6d9d9 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('atomic_mbuf_ref_counts', 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: