From patchwork Thu Sep 2 14:48:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefu Chai X-Patchwork-Id: 97865 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B424EA0C53; Fri, 3 Sep 2021 08:32:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67DB740E01; Fri, 3 Sep 2021 08:32:51 +0200 (CEST) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by mails.dpdk.org (Postfix) with ESMTP id BCA924003C for ; Thu, 2 Sep 2021 16:48:21 +0200 (CEST) Received: by mail-pg1-f173.google.com with SMTP id s11so2195785pgr.11 for ; Thu, 02 Sep 2021 07:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3R98VBTS7FEIbpSOQijlU1CN3tEmPxwjnl2jCe11pyo=; b=CQLNM+mH8ehaxoUBb5tFxq2AEnL0lcQNooYKgAncFMUejc2FGcys/gfmjvNDmCcovH c87f6QbshmW5RjBiWImRV27Vk4kzu49tdkdG/yRan5if/m4gLg/N9AhdUlHkQfDColK/ KJH/OUCiGumrNc7+iyhBHToU17NReuF6w4r5IC2X1563tn5akv3lwfotxxCu2bcjTwqk 74h+Kx3v0eSl150xn/A9Ab/08fKBcK5l9jloLrpoHJt7bWU9iFSrj2cY9t+jPcvX3XfA aE5G77CJTTvyvZPLgLMcoR0XBw0lv/cvCwbHhKNNbxO5+jYYYv7AkYwnQmAJbgdCux8z V71A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3R98VBTS7FEIbpSOQijlU1CN3tEmPxwjnl2jCe11pyo=; b=qPHj67luE0CrXyy/zjKP4PUXGnjzu5xqipS1CfI8KMCjVTyzzC/6zxCx4YeD33bl9G Au6M09cLhTYwH9yZbONI6ZxZ6kjPNCF0+T4mUdTm1VqBH39CERwGhNJaxgzATBQ6b7No jLkF/its2hxT1Rq4V+d2dJnN+ZJOwSjlpw0lOdf4eagkVfSm/+IzmGYQrVjm883p3Ute JKMH5GxA3C8DuKt4il5zXM1426yXaxsn0ARIxPwVVU6wKjF6FglMEGQAM13dN1pV7rjI /vV9/Xs7xJ7OM+W7DJATc+aU4TvIVE0EhqUGF2kj/kqPB08wKsDCPoRGLziQWocld9lA 8F/g== X-Gm-Message-State: AOAM532YAx3vZU/1KmtsEw5qMD91LXgqMXtB8zMYjeUtmelj5v93TlV2 O5fq6vbNTEFfxgn+qkdUPqzC4nmfaUCbXA== X-Google-Smtp-Source: ABdhPJzhsU+ElgVztV9gDHQnvln6WAoLSDCvGhQbxYLbnSQbeI90SXCaMI+ohcXpJHXwP9qf4V672Q== X-Received: by 2002:a65:6283:: with SMTP id f3mr3569183pgv.369.1630594100614; Thu, 02 Sep 2021 07:48:20 -0700 (PDT) Received: from localhost.localdomain (74.120.174.58.16clouds.com. [74.120.174.58]) by smtp.gmail.com with ESMTPSA id o10sm2882182pgp.68.2021.09.02.07.48.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 07:48:20 -0700 (PDT) From: Kefu Chai To: dev@dpdk.org Cc: Kefu Chai , Bruce Richardson Date: Thu, 2 Sep 2021 22:48:05 +0800 Message-Id: <20210902144805.105098-1-tchaikov@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 03 Sep 2021 08:32:48 +0200 Subject: [dpdk-dev] [PATCH] build: add meson option of "max_memseg_lists" and "mbuf_refcnt_atomic" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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: From patchwork Wed Oct 13 20:54:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefu Chai X-Patchwork-Id: 101516 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E673FA0C55; Wed, 13 Oct 2021 22:55:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28F124113E; Wed, 13 Oct 2021 22:55:19 +0200 (CEST) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mails.dpdk.org (Postfix) with ESMTP id 69DD34113A for ; Wed, 13 Oct 2021 22:55:18 +0200 (CEST) Received: by mail-pj1-f42.google.com with SMTP id lk8-20020a17090b33c800b001a0a284fcc2so5362619pjb.2 for ; Wed, 13 Oct 2021 13:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PDIcHa11/do0TPnWVRTkk+7omKLjgs5lLHL8ZFk/acI=; b=e0ygJnF2sYh78vv6OeUAhdFfLTTtLa1Z0Eoh/GXmSiKhyzqfDypuhQpL983pHCrCHz a1OM/MUNtxePXMOxZCEpcrfg8uh2c0rRqV/80+Hv8drq18eAYPV8omqMEhTWZLga+U6E Y6UUZ8m5i8sGr2y0ITTEBCIo03YWcBf8DLV5uvHwhQ1pjG0/EG3/2azRcGpWnq1DHA+P EoDnPFqHWJtLqP8ub36vxoaKlbZ7UWSCtWNGq9kWecMwcRnj4A8ZkOsuvamnj6oRjUIP FnS147zTwFMvJkZ86fPBbBMWFQifRp43Xj5dsA+Sg9SI4hxFiFsoxVMVxuUECSCFWW4j rfew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PDIcHa11/do0TPnWVRTkk+7omKLjgs5lLHL8ZFk/acI=; b=nQM0ODR2mIh+OgbeXyKkxcBPpp8IDGEve0bRiXE4olfv6mjJ767zlP3f9lQ6++Scrt V7q1hutWNJ544jxveDL+vk0kjl0tRQjtwXlOpwtpcUaZotbDXCcy2EqTHOlmcGBZ8jrG JbHiuE+3WlpRoPxhEC6vCZfwzocwzad8z1Vp+vPDfmLLISsw/rjnyjNtHeTc357w4xXR SOamUItrxDjrEcmJEjP5fBuPR5mpmPRNQ0Fx6N2SndCbwaqdGDyWcrZRKw29v23vscTs Fx0zSYQjkIAKI11T2F9Ow6He1la3WFoelTVxsABr1ByKum/nX7wJq3wa+UBQmi0AL3zi yt2g== X-Gm-Message-State: AOAM531uWl32BLhRmK1hkDFl6hBpaW9QFNodsjL+M46hc1aELuJ23NsX YwnL27n7Kp2wE/23eZtAhyaLyYQtXJ7q3Q== X-Google-Smtp-Source: ABdhPJxyvICxMREUhHGLCmeV6DxxGm+hoNWjxu7zjNoxBD8XeFLxXqYbVoGPZZu5jWhZR+NhwePG/g== X-Received: by 2002:a17:902:e8c9:b0:13d:dae7:1d5b with SMTP id v9-20020a170902e8c900b0013ddae71d5bmr1330482plg.39.1634158517417; Wed, 13 Oct 2021 13:55:17 -0700 (PDT) Received: from localhost.localdomain (74.120.174.58.16clouds.com. [74.120.174.58]) by smtp.gmail.com with ESMTPSA id 130sm354712pfz.77.2021.10.13.13.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 13:55:17 -0700 (PDT) From: Kefu Chai To: dev@dpdk.org Cc: Kefu Chai , Bruce Richardson , Thomas Monjalon , Avi Kivity , anatoly.burakov@intel.com Date: Thu, 14 Oct 2021 04:54:19 +0800 Message-Id: <20211013205417.84119-3-tchaikov@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210902144805.105098-1-tchaikov@gmail.com> References: <20210902144805.105098-1-tchaikov@gmail.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 2/2] build: add meson options of max_memseg_lists X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" RTE_MAX_MEMSEG_LISTS = 128 is not enough for many-core machines, in our case, we need to increase it to 8192. so add an option so user can override it. Signed-off-by: Kefu Chai --- config/meson.build | 1 + config/rte_config.h | 1 - meson_options.txt | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/meson.build b/config/meson.build index c90c7a0bfe..8d03dc6471 100644 --- a/config/meson.build +++ b/config/meson.build @@ -299,6 +299,7 @@ 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('atomic_mbuf_ref_counts') dpdk_conf.set('RTE_MBUF_REFCNT_ATOMIC', true) endif diff --git a/config/rte_config.h b/config/rte_config.h index 208d916a1f..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 diff --git a/meson_options.txt b/meson_options.txt index 222ad6d9d9..9127f8556f 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('max_memseg_lists', type: 'integer', value: 128, description: + 'maximum number of dynamic arrays holding memsegs') option('atomic_mbuf_ref_counts', type: 'boolean', value: true, description: 'atomically access the mbuf refcnt') option('platform', type: 'string', value: 'native', description: