From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 817DFA0543; Thu, 22 Sep 2022 10:09:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 744D740156; Thu, 22 Sep 2022 10:09:02 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2115.outbound.protection.outlook.com [40.107.102.115]) by mails.dpdk.org (Postfix) with ESMTP id F165F400D7; Thu, 22 Sep 2022 10:09:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GPhqTUd1LwGV/hkT4q2pJxB+8xZxT0RuvRCCdN41RJvjiZ6HktJNCb6uXmzBGQUXxFoCAZKtxO5xu+Ait2tPK0LFLeoLtcrlbWNCFQU2jtiFStKvSrBJfUnbKxsxEGZIYDXpRcnxpotcEqBb6sXXehUqlPIozKJu5wX6L8lBc/9FcYc6mBoSeZuB4MxCYiaZNp4bF4tDKcgip2YaTM2YM5oNZOztMCvb5Q8KM/uG6iAX8crhUNOS+66jUsVAbfkigzxONhGqhEnxhpRyXp1Q2RtX1dIYgQh5010KByPB9KKIOXI7b+07R/Eu1oOYhCLoLbJyFzU3KC1rzoJK56Zb3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XlYpErlhF+lRAt9B9GFAYMGLOBcYJVn+ZWS3BG18wrM=; b=Grrhu99kvTVwYNP++RuTpt/tjhlk4DsKJZAxTn35kQVpT/xde2gY4sx+VtfDYuXo1ms4LpT2L4Dvjcy4oFDK1EiuMNbXr+T3sT80a7NPeB3gASW9USkxlFOexhkvKRZgEbty34RwKj8l3A/L/Eyi92OzE56DoDP4nLEgNmQNFWOnRruugZ5QBJ89iLX7tpGH3cBbKM6Z46ULzhop2fuapvnpvqRv3PFAmkIaiHx70AZgm1HsvhUR/iq4fKEjAiLBl7zdnCnShnkzmDyofGpf5W9bp2P3uQxwgBGZMrmmNhLkSVc1IPO0eexLMrwBOP9DGBcuQBS94CtO2ezk9RW1+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XlYpErlhF+lRAt9B9GFAYMGLOBcYJVn+ZWS3BG18wrM=; b=RqLLWpU61LyjlRfxFL8XH3mzyq3YQTnfivq1xWpYe7md3xiK9DWyVZ2e5T+NzCES/FL/NcQPSz78kzBrvVtsYK65KgSmCv7BagDUZMzsqLANuv3FzoAyZ8QQoGu6wvU+Kf4a+E3Uu92y5pzjK6GQ5yjd+k15yHNAltIkP+m7EmE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from DM6PR13MB4431.namprd13.prod.outlook.com (2603:10b6:5:1bb::21) by DS7PR13MB4590.namprd13.prod.outlook.com (2603:10b6:5:297::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.7; Thu, 22 Sep 2022 08:08:58 +0000 Received: from DM6PR13MB4431.namprd13.prod.outlook.com ([fe80::e198:fd7c:5eb4:89c1]) by DM6PR13MB4431.namprd13.prod.outlook.com ([fe80::e198:fd7c:5eb4:89c1%5]) with mapi id 15.20.5654.014; Thu, 22 Sep 2022 08:08:58 +0000 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Peng Zhang , stable@dpdk.org, =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH v2] buildtools: ensure the NUMA nodes are counted correct Date: Thu, 22 Sep 2022 10:06:42 +0200 Message-Id: <20220922080642.315800-1-niklas.soderlund@corigine.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <1659426855-11014-1-git-send-email-chaoyong.he@corigine.com> References: <1659426855-11014-1-git-send-email-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM6P191CA0014.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::27) To DM6PR13MB4431.namprd13.prod.outlook.com (2603:10b6:5:1bb::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR13MB4431:EE_|DS7PR13MB4590:EE_ X-MS-Office365-Filtering-Correlation-Id: 46da68b1-4510-4c89-f27f-08da9c71b385 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OBg73Zz4PLyUqofLgmtMV1WYRysRFSXWLVm1mFlppUV9qX0Mt1IWDPaKKOSfx9pWtgE5BhauZEdLdLxtZCw3sqVTl2A7dQIrNCM8A6Iu56hb6sfR+8dXdde6r6Lq8ZyCHn1vUMTyR2I286Kw1NJoFjwOK5epFwi18GwdsLIgBABi6ems9/P0t8N0gI4iDC0fRVtip8H+sXvw1jjXzthYkPKkB13+ogXyuQLh+3AfDDkSijeUaSTF41ZT1mkSXkH/7OFHFVmgBL5tXgSVCB8GAL8hVED0l6dsXJ9cA79csQpTSx4lFV89JI2rG+iTtrcu15uwnA4o2dKFxfnJeVhWZdncd4hfJZiEXh4T1EGtXV5IzaGx0cdv88ucPapZCjZq0G3zDvfn2L0gwO1pJFyy1RPoNQmriR9c75mO2TW8Bwm3o2Zd36LFFL8RqLbL1xGPOWXIUBYFmJ8y0XYCnnEGpuxbZUBkY480ByUHjzPoteMsNdQD4pB2v8hw/tQuSdx6XnDXmcvefTGLqAt3O/SCmlJI0H9JEc2BiiIzv9bRcYgL/9wmuCYgSXbmAjo64u6B1oN61PAgo95rRTX8x5Z7OJ1LQw0LlA9IvlpWEW2L4lyLd2bWLJBEposH6mwovsWcc0BvdkaZn3/Zsz7TEs5qPl0zjZXxt7gdYLBQxYQNBLPFoUduL86xg562GjAPqERkezd2osnn135DgZe/iAkgxs1srTrob/OjVJUfTs/beYGqRMJNbozhdI/m1fUmuFIKeyq3k3IjKIuojkyWXmPGyQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR13MB4431.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(366004)(39840400004)(376002)(136003)(396003)(451199015)(36756003)(26005)(6506007)(52116002)(6512007)(41300700001)(86362001)(316002)(54906003)(6916009)(4326008)(107886003)(6666004)(6486002)(66946007)(8676002)(66476007)(450100002)(478600001)(66556008)(83380400001)(66574015)(8936002)(2616005)(1076003)(2906002)(186003)(5660300002)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dEovOE1kYWRET1U1bWd1NE5MaXdoZXg0NzJ6NHozeWR4RmNqSXNSenp1R0gr?= =?utf-8?B?WWdGaFUycUpGRVdxOVpYQlZJSVc2ei9MekZ0TmlFSGZxWkVwMytxWnBnN2Vt?= =?utf-8?B?c244L0ZxdmhVQm42anA1Vm0vZWpvNVpKYk9xWm5RSkJZWnNKa2tPQ3dueldz?= =?utf-8?B?NzFxcThVVHdqdm92b1FTT2VBaDl2NzZrWjlpa3FQbUdlZ25LUFo0R3dVdzR6?= =?utf-8?B?SEMreEgxNWFwUV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l4cy9xTkM2dHJGcGJ4NEJaM2FWQmk5SGhlY2tQdE0wajlFUTY4SkVMeXhh?= =?utf-8?B?bXY5bTB0MnBKTU5BMVIrRjJGWXBjMHcwdC9oSlBkV0VneUdBek9lUFpHVUg1?= =?utf-8?B?VXc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46da68b1-4510-4c89-f27f-08da9c71b385 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB4431.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2022 08:08:58.5202 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gGH4PttmrSlQwuoorhha3zWww7oOc9PDiq9uM3mst9+i+0N39E9eBFJm3ojkxIRejSXRKlNebPTsFOc2cNywG+ABxMWGfmisG41n+I4LoRc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR13MB4590 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 From: Peng Zhang The method to fetch, sort and read the last entry of a list to figure out the total number of NUMA nodes in the system fails with 10 or more nodes. The reason being the usage of string compare while sorting, hence node 'node10' will be sorted before 'node2'. Solve this by sorting the list based on integer comparison of the numerical part of the node name. Before this change on a system with 16 NUMA nodes, EAL: Detected CPU lcores: 128 EAL: Detected NUMA nodes: 10 EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem EAL: Detected static linkage of DPDK EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode 'VA' EAL: VFIO support initialized With this change on the same system, EAL: Detected CPU lcores: 128 EAL: Detected NUMA nodes: 16 EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem EAL: Detected static linkage of DPDK EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode 'VA' EAL: VFIO support initialized Fixes: 8ef09fdc506b ("build: add optional NUMA and CPU counts detection") Cc: stable@dpdk.org Signed-off-by: Peng Zhang Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- buildtools/get-numa-count.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildtools/get-numa-count.py b/buildtools/get-numa-count.py index 1b7787787f71..2f243886cd21 100644 --- a/buildtools/get-numa-count.py +++ b/buildtools/get-numa-count.py @@ -6,11 +6,12 @@ import glob import os import subprocess +import re if os.name == 'posix': if os.path.isdir('/sys/devices/system/node'): numa_nodes = glob.glob('/sys/devices/system/node/node*') - numa_nodes.sort() + numa_nodes.sort(key=lambda l: int(re.findall('\d+', l)[0])) print(int(os.path.basename(numa_nodes[-1])[4:]) + 1) else: subprocess.run(['sysctl', '-n', 'vm.ndomains'], check=False) -- 2.37.3