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 12C13A0543; Tue, 2 Aug 2022 09:54:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFDDD40141; Tue, 2 Aug 2022 09:54:36 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2119.outbound.protection.outlook.com [40.107.92.119]) by mails.dpdk.org (Postfix) with ESMTP id E4290400D7; Tue, 2 Aug 2022 09:54:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uxw0GkyCyZ50pGDGp17JYmCUstdqbMeayJ3B9Qcjwy+veVquFtyhipD73JCB12ggXEbC3Dz0Q3OnF0lWw2yI6cY7DcY4z8XnVW3nS4ZlGDxKwsANSodM4ybYJ14jgpQtefXf2PyF88ygekbimXd3lShDW/fdRLHbjVQLCOwpk8C+0R+A3IW4WrZ550fXB/Kt2FrP0RTDgqP6hnPfhhtqd59Ch7Njd3hn3hLYQ59sXPcAizO+pVOROFFJyH5Y0fpAgnPDrcTinGFi1CbrvOM8zEZIb/mtcAJh8t/t20jDdte3LDiihZIa2sgOfWDKa72S7Q//9UEy1hC/F3Q06kmklw== 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=zpUGDsQBQ1UuZkWIXNklCs+wJYf2rQLaVUSJnt5ufkk=; b=GDT3txfTCQkXjxgwCzLqWa+pIQXPIhJq92JAXVJiavxYTjAzQZi5rAf+TuPQyN5FdPTaOew4VcdogtWvA2sCmNUMh2bYAHaPCWDiUl6g7bBlJ4ZOElwMPevUuOdUeAgJp+vXcMcELK0RtmtBHFnsWO6InLlUBMi56Dy3M8qD9s26OcHr92K0N59JXOpW2xT/OtP1mMpfCohL+G/TPrWdzrLp8JGdDz+vwIJait58EpUQ8y+b63/DiN0cLooOoDpNNo5KqcaKUNj1an5hifzUGDAexlUt98M2zA9L6Eb+7/tpLiDkvUyP3BdeVeJoW9e7jnshD69QAuUgELOHFvd06A== 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=zpUGDsQBQ1UuZkWIXNklCs+wJYf2rQLaVUSJnt5ufkk=; b=GrQ6JwoBICIsUK88zkudaJ8cj+2Yt3T4aosJwre7LeolUYR4HrafchgU+Orzxq+cKHU7qzAuV7SG/d5U6FRMw/0TiBw3nDaaEKd7UjKf/GQXbamHUEU/s1ZijwnDesHHJWibZbQoKfcL5RDAWQs6lLzG9XNRi+B5AbPwGq56NyQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by DM6PR13MB4377.namprd13.prod.outlook.com (2603:10b6:5:1f7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.13; Tue, 2 Aug 2022 07:54:31 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::102f:f8b7:b4c6:feff]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::102f:f8b7:b4c6:feff%5]) with mapi id 15.20.5504.012; Tue, 2 Aug 2022 07:54:31 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Peng Zhang , stable@dpdk.org, Chaoyong He Subject: [PATCH v1] buildtools: ensure the NUMA nodes are counted correct Date: Tue, 2 Aug 2022 15:54:15 +0800 Message-Id: <1659426855-11014-1-git-send-email-chaoyong.he@corigine.com> X-Mailer: git-send-email 1.8.3.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR04CA0018.apcprd04.prod.outlook.com (2603:1096:4:197::9) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8b2275fe-eeb7-44c9-f2b8-08da745c3b8c X-MS-TrafficTypeDiagnostic: DM6PR13MB4377:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CdDD5wVDX/AkhE63QR6H3apWjD2TvaTnl3SjonocgNlxOaXKjDI37i7LkF5nZ2GUB/564GSnR+a9s1GMbVkdtPnV2rvvnToSnwP0QbciOGlYCsZ/sIVbSzR7ZQsI8kY7aGrhXE6gMln1LCYCUc8UAt6bqym+TOHxB5CTpmYzuYlX/Do/hEWF5bWxDAZeAzvEoPflbOhYcpjHsoKDlntFa6vGintw0AnQYM6wdAvNFZUxl29barmBRk+uXelTQ/3IRnEEGid9QW6MbWUGK26RGzOh8VDCcyPT3Q+ObbX+x5SdHhmmQcZy/Sb+OvysMfxXhgvLHILqmkCI9g2Ajp+sKq8nzRRFF2tFto2aRvlxDT3PhttMneeW72sAgZxrCMwrab579h8cLsPwOCYzvimjwhUUsHzgYB+sAVzH/xAAugLxXx+eBsRdpxAy0P5VY2z+JVr5ubAFQfaDvjU+ofAtE1TgOb3v+nBU5efp0GUPPRiPtqmexVZoOz5azbJ6U/n/hzHic3oCpCb4Ipg2hWKDsucsHRdQy2uDkLh76H+mZMdQ4R/Y2rByhS4cHaa7Y0Elj7shpyDYUmnDfs+69WQcWlIRpt+xWE9YJYnAotoddjwm2A+sTw2+7OsefJhUKXRKvy/jnQ4YsZqzCGBPnuPSgaZMXyNk78itmoJXnj3jvrY/SIoPoGfNmUOdUferqLDF8O1RzK0rzq0+Zty7BAsx8iDvBxXjRL2/Q0QIQ0XcVGQWr3k1TvlcHgFUpj1Quy1Yp25VeAHqG5M4gR6koWbbvTRlmBOM0ipEqq2jVqqrU2Q= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(366004)(136003)(346002)(396003)(39840400004)(376002)(44832011)(83380400001)(450100002)(107886003)(66574015)(2616005)(186003)(66946007)(4326008)(8936002)(36756003)(2906002)(8676002)(5660300002)(66556008)(66476007)(6916009)(54906003)(478600001)(52116002)(6506007)(41300700001)(6512007)(6666004)(26005)(38350700002)(38100700002)(86362001)(6486002)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TjFjVmNuaTVZclg1UWNZUy92ODEwWXlkTGREcG5ITkFLT2x2UnZZSzVQUFNE?= =?utf-8?B?WG5OWUYwMUpBM2FKVGdwdGNFMmtHdG9XK0lNWi9ZaVAraForY0VUS2cySkFI?= =?utf-8?B?R2d5eUF3Z3BSS0xaVUxSZklwQkQzL2xadnRPSUNnazJldUZROS9ENXdXczJn?= =?utf-8?B?bkhWMS81V1JxMHk2bVBvaXZTeGhhT1c1SVpSbWc1NHI5eFBtY3pwS2Z4Rzkz?= =?utf-8?B?RlpFQTNBd1Z3dGpFM3VrM3BJMGFHaFBXMnRYVG0rTHBvNmFReVBDb0hFMllB?= =?utf-8?B?azF1N3lpQnJxemY2dGt2RVM3L2RJYTJ4WWc1VlhYTWxzQ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TnlzaGlTcXVZMDJkK0pxdVRWQTVYQ2hiOWdGcWNzUFpuRW5jRmZQZDNlTS9E?= =?utf-8?B?S1E9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b2275fe-eeb7-44c9-f2b8-08da745c3b8c X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2022 07:54:31.3908 (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: l2dAA6suDOTjA+daaSZYA9vBE2cwUAzUsabFpCIQlhx6zJQAJfl3pM/sH1UwpuqI+sNf0z0WKDkpMdn45tNgEHitZv8k3xi8Oz3u/LRg8pY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB4377 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 Sorting a list of strings with the format "node[0-9]+" in order to find the largest integer by looking at the last item after the sort breaks. But if there are more then 10 items as a string sort will sort "node10" before "node2", it will get the error NUMA nodes. Solve this by sorting the list based on the integer part of the string. 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 1b7787787f..2f243886cd 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.27.0