DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] build: add meson option of "max_memseg_lists" and "mbuf_refcnt_atomic"
@ 2021-09-02 14:48 Kefu Chai
  2021-09-02 15:02 ` Bruce Richardson
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Kefu Chai @ 2021-09-02 14:48 UTC (permalink / raw)
  To: dev; +Cc: Kefu Chai, Bruce Richardson

RTE_MAX_MEMSEG_LISTS = 128 is not enough for some use cases, so add an
option so user can override it.
RTE_MBUF_REFCNT_ATOMIC = 0 is enough 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  | 5 ++++-
 config/rte_config.h | 2 --
 meson_options.txt   | 5 +++++
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 3b5966ec2f..72dd461198 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -301,7 +301,10 @@ 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
-
+dpdk_conf.set('RTE_MAX_MEMSEG_LISTS', get_option('max_memseg_lists'))
+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 590903c07d..0a659f5e1a 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -29,7 +29,6 @@
 
 /* EAL defines */
 #define RTE_MAX_HEAPS 32
-#define RTE_MAX_MEMSEG_LISTS 128
 #define RTE_MAX_MEMSEG_PER_LIST 8192
 #define RTE_MAX_MEM_MB_PER_LIST 32768
 #define RTE_MAX_MEMSEG_PER_TYPE 32768
@@ -50,7 +49,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 0e92734c49..c0e8958797 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -38,6 +38,11 @@ option('max_lcores', type: 'integer', value: 128, description:
        'maximum number of cores/threads supported by EAL')
 option('max_numa_nodes', type: 'integer', value: 32, description:
        'maximum number of NUMA nodes supported by EAL')
+option('max_memseg_lists', type: 'integer', value: 128, description:
+       'maximum number of dynamic arrays holding memsegs')
+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.33.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-10-25 15:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 14:48 [dpdk-dev] [PATCH] build: add meson option of "max_memseg_lists" and "mbuf_refcnt_atomic" Kefu Chai
2021-09-02 15:02 ` Bruce Richardson
2021-09-02 15:05 ` [dpdk-dev] [PATCH v2] " Kefu Chai
2021-09-02 15:11 ` [dpdk-dev] [PATCH v3] build: add meson options of max_memseg_lists and atomic_mbuf_ref_counts Kefu Chai
2021-09-08 16:51   ` [dpdk-dev] [PATCH v4] " Kefu Chai
2021-09-20  7:51     ` kefu chai
2021-09-20  8:08       ` Bruce Richardson
2021-09-27 15:03         ` kefu chai
2021-10-13 15:38           ` Thomas Monjalon
2021-10-13 20:54 ` [dpdk-dev] [PATCH v5 0/2] build: add meson option of "max_memseg_lists" and "mbuf_refcnt_atomic" Kefu Chai
2021-10-13 20:54 ` [dpdk-dev] [PATCH v5 1/2] build: add meson options of atomic_mbuf_ref_counts Kefu Chai
2021-10-14  8:20   ` Bruce Richardson
2021-10-25 15:55     ` Thomas Monjalon
2021-10-13 20:54 ` [dpdk-dev] [PATCH v5 2/2] build: add meson options of max_memseg_lists Kefu Chai
2021-10-14  8:25   ` Bruce Richardson
2021-10-14  8:29     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).