From patchwork Wed Oct 13 20:54:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefu Chai X-Patchwork-Id: 101515 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 EFF49A0C55; Wed, 13 Oct 2021 22:55:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23ADB41123; Wed, 13 Oct 2021 22:55:17 +0200 (CEST) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mails.dpdk.org (Postfix) with ESMTP id D83DF41123 for ; Wed, 13 Oct 2021 22:55:15 +0200 (CEST) Received: by mail-pg1-f175.google.com with SMTP id e7so3501137pgk.2 for ; Wed, 13 Oct 2021 13:55:15 -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=F1JDFHjU3MNQb+Yd2DRkHEHawiV01q/Ua8sLKB0SK9c=; b=I1Ush4cyXuBEcyKS4mRY3xUXxKLiNjwv+7aEAjOaqK8egn0tM2IrCREWqh8zL3QTAv oON/ZbbqLfqucEUUcTgvH0rHbsHpTpkV+Zf7uyfqR5N/c/u/3fYdkalgM9tVEwLSO5DX itPSsMLdhBnJEB3kIFQgJHxz/vcX0TQpjlrvYGOCTJ+PG+ERyitNdQ05Rca2HQCpr7I0 hZ+oDfXvJnV5B+EFRxbd38fFvBFNQJBXJDm4mNfnu8jDOgo9/cUbUefBzgWzdOwlQAZ8 aM7XTwt6WyFa+cOWZkgT0srF9pgKz74v5p3mtQRlgMkZwHWQGUwuXE/Rh+/Y0lJC5E6E JpAQ== 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=F1JDFHjU3MNQb+Yd2DRkHEHawiV01q/Ua8sLKB0SK9c=; b=X+xelhtiDejq/OeZpsKu44xuQ6ASsAf+yJppUf3c6ygQ7Sv5jyiGZNuN3YWzz3kiJN f9zFPAnPNygasHR1NjCApjXAh5IX9f7nqs1NhNe/sDL3/0xfVGJMiCDCyvXDTq6W9cGM ahFACKE6XG/SU/vAUDwwPs52N1iej+zW9mAFMEowWtxacdhEUIW0H/8q+JeQqCWF772f n6hM7qnGnRPcT/uLHIACuIQPxbVwzepHzcWwqyJns2RZpK52/wfBP9pk+PNxXeEqW8Ki 5NzNQBdOolQkBXUbe6OcFXRnzx/yXEX6DnRHTjvg4U5xFuIMBnB0Tc1bXFIIW6wqMh+A Xnuw== X-Gm-Message-State: AOAM5337JIGcQCWrXAKfN6KSc+R53yE+NPG14l1KI/Y9UxWVm+Nk6fPs xw/uSJtRUZyB9fTcQIXSvRXPtwf8kR5KwQ== X-Google-Smtp-Source: ABdhPJwCAddci5X5+VPmSL04Wkxz1r4MtRIIbzFWVJ5FziZbWbr4/0ON9/h65TP/ZkDKtLCatHYhxA== X-Received: by 2002:a63:131f:: with SMTP id i31mr1126760pgl.207.1634158514880; Wed, 13 Oct 2021 13:55:14 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 13:55:14 -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:18 +0800 Message-Id: <20211013205417.84119-2-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 1/2] build: add meson options of atomic_mbuf_ref_counts 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_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..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: