From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22B71A04B1; Wed, 26 Aug 2020 06:48:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ED4522986; Wed, 26 Aug 2020 06:48:01 +0200 (CEST) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by dpdk.org (Postfix) with ESMTP id 2438A2AB for ; Wed, 26 Aug 2020 06:48:01 +0200 (CEST) Received: by mail-io1-f66.google.com with SMTP id s2so836207ioo.2 for ; Tue, 25 Aug 2020 21:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=57OwthwkW1XJgCqLUiHamDjELQdVGImvJ/2D5hOMpig=; b=eNPBHLtje1sUJTIAaPRFlnBkeVPjPGL28SC21+CT05Ys0Rf//pDhY+Pw7gO7eBoYzm Az9Q2R+uS0Gw8m/52lukU7FWJjCTBh+LFLzi7Bco/X2QCctN+SqzX4dUq502QkiBrg8t 2x+7XRqL9EOR4lTWQq+KkzyaQt7C/nH4ASzGyqSMXpxecYiHZaPr0UJjE5mJsmCZkMRf xTUTYPBvrnqPo90uR+739XE8flZYimoRsDdmWKUL8kdJkxJoGlse41hIanX+nMdkEGHt t8FUdgC0FEnccfpum5HejQ9awVg4mNfRqZOdssT5XDmtoxD0KLjAesd4SFrDjFwaSTpc jGTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=57OwthwkW1XJgCqLUiHamDjELQdVGImvJ/2D5hOMpig=; b=lOzZEU2mZ3/7xJxM16iZ07aveKXCz9u2q/CE3/U53PCo+WWXttAGoOWfaAAKvX/sku PsI2RfsP3jAwFN0QFC1s/2/7/nNU46cInpAms7zpZlW/uKu0BbWpeLVST8VkvUhVJFOz tGPpbfCMBNo/l08IMGjX7oqw4oEluPi1IQG2c6DcVt6Waf5CK/NQnnFczmNPX1D6WyW6 Zs4fZW+btkPRNyxTjUqT7dD8y4DS1/x6YRmXF19FiQ1yOQBhWBhur3CLcacUBNe+gFJ+ YhXaURH2JFd3Me5V7g06yaSSscZ8xMbNi5Wva7TWvWU1D7CvGY0aJC2hGeIzSDL8dFs8 xYUQ== X-Gm-Message-State: AOAM533558vnCM8KAqLc0Z4tL19Hy9lfXTfsW6wdaiqrr552qs/yV7GZ W0g21dUWi0muc6K9qR8uyZnIfC0RwmpD28egbAs= X-Google-Smtp-Source: ABdhPJyqaBnVo1dtUL0QihhbEcnf1iVr7x1GypIZYJquTgR1Uh8MlGfKnH+af9+tPdLcDWlt57IXMtbKbeYveqPpD0w= X-Received: by 2002:a05:6638:1643:: with SMTP id a3mr13765883jat.104.1598417280328; Tue, 25 Aug 2020 21:48:00 -0700 (PDT) MIME-Version: 1.0 References: <20200825211317.8358-1-dharmik.thakkar@arm.com> <20200825211317.8358-2-dharmik.thakkar@arm.com> In-Reply-To: <20200825211317.8358-2-dharmik.thakkar@arm.com> From: Jerin Jacob Date: Wed, 26 Aug 2020 10:17:44 +0530 Message-ID: To: Dharmik Thakkar Cc: Thomas Monjalon , dpdk-dev , nd Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 2/2] build: find max lcore programmatically X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On Wed, Aug 26, 2020 at 2:44 AM Dharmik Thakkar wrote: > > For Arm, RTE_MAX_LCORE is hard-coded into the config. It leads to incorrect > RTE_MAX_LCORE when machines have same Implemener and part number > but different number of CPUs. > For x86, RTE_MAX_LCORE is always set to 128 (using the value > set in meson_options.txt) > > Use python script to find max lcore when using native build to > correctly set RTE_MAX_LCORE. We may need to build on the native arm64 machine and use it on another arm64 machine(Just like x86). So I think, at least for default config(which will be used by distribution) to support max lcores as fixed. I am not sure this patch changes those aspects or not? Please check. > > Signed-off-by: Dharmik Thakkar > Reviewed-by: Ruifeng Wang > --- > config/get_max_lcores.py | 13 +++++++++++++ > config/meson.build | 13 ++++++++++++- > 2 files changed, 25 insertions(+), 1 deletion(-) > create mode 100755 config/get_max_lcores.py > > diff --git a/config/get_max_lcores.py b/config/get_max_lcores.py > new file mode 100755 > index 000000000000..ebf1c7efdadd > --- /dev/null > +++ b/config/get_max_lcores.py > @@ -0,0 +1,13 @@ > +#!/usr/bin/python3 > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2020 Arm Limited > + > +import os > + > +max_lcores = [] > + > +nCPU = os.cpu_count() > + > +max_lcores.append(str(nCPU & 0xFFF)) # Number of CPUs > + > +print(' '.join(max_lcores)) > diff --git a/config/meson.build b/config/meson.build > index 6996e5cbeaa5..80c05bc15d2f 100644 > --- a/config/meson.build > +++ b/config/meson.build > @@ -237,11 +237,22 @@ else # for 32-bit we need smaller reserved memory areas > dpdk_conf.set('RTE_MAX_MEM_MB', 2048) > endif > > - > compile_time_cpuflags = [] > subdir(arch_subdir) > dpdk_conf.set('RTE_COMPILE_TIME_CPUFLAGS', ','.join(compile_time_cpuflags)) > > +# set max lcores > +if machine != 'default' and not meson.is_cross_build() > + # The script returns max lcores > + params = files('get_max_lcores.py') > + cmd_out = run_command(params) > + if cmd_out.returncode() == 0 > + cmd_lcore = cmd_out.stdout().to_lower().strip().split(' ') > + endif > + max_lcore = cmd_lcore[0].to_int() > + dpdk_conf.set('RTE_MAX_LCORE', max_lcore) > +endif > + > # set the install path for the drivers > dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path) > > -- > 2.17.1 >