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 0B7ADA0545 for ; Mon, 10 Oct 2022 09:52:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0248F41144; Mon, 10 Oct 2022 09:52:21 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2132.outbound.protection.outlook.com [40.107.244.132]) by mails.dpdk.org (Postfix) with ESMTP id 7ABB140041; Mon, 10 Oct 2022 09:52:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dm5i2jB9TBnBn9TkGniTScx7l1NxQ/2ZVku+XdOe7pudIT3pj9FLaJLRv9MK6hx+FbPOP5bf74aZ9/UBd86ctXcyhQivWsizC6Fx4eumekp2C2CIDmQx0mCYaeWbiFrcmKMr9YY0xykD3P/SzoPxqWX1wcHgBWBmHoz0rqoqaFfeXY1fzAXnfIhaoDHhZwAXjK6TxJgl7V4QUvy6F5jeRSWacPbi/8evOYm1YF7gnGpwKV5OxsuuvIOrUNDozvR6w4QDC3hqPxHz1JNXzL46z88znzik4WF8ha316XKWs6CqLXHJYG3AUK/Cj9QcA2K75A8dnLnlMp61SuQTH4aH5g== 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=hx4vpP9Tt4raQgBkaraCImL1KRwbZmDa8LuSow11kjI=; b=NWeucHVc7AqQkX0ODnbiQLL/3I5Eicvxk4Mk9BXs6XQGwrdjbf4eOJr7udIOGZJgaehlnjk0KvrpMK3vNFG82SDamzqlCfWCinlCzc8b4ul/YPe5BvkEtGmOYNM+7Qg7lgWX9o/piptuSRPz2ivXWE2kbySY+NGeFvwe0cY5/eZnsPtNGkSOznF53EWLFlzDnoSijcEp1dAuoEGm3OSw/byguhXLEwY9lFLgVOVcuU5czSeN+2ohP/FMZXJZywXNodlIJ2CgOUsY2aLrUEmRtzyOT3DORjY3zHjESvZtpYZI5gOh+cB7BTL11hIeaLad8/eYgF+BSkxTqhwGeg/9TQ== 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=hx4vpP9Tt4raQgBkaraCImL1KRwbZmDa8LuSow11kjI=; b=Z3hQW0RKovudp2heQn9SRM3uQUJrOpl0uw+kej/2YCt3l5ZssKZM40Y8TfZbK+Kh7XxkrgFFCY1+wVOosrURRlNQiCgOH8d6yfvGfuRBFF9hLrlFadwilLZIBCCeLIIRQydpGzFEebFuq/py0oZFmPYVQ7h803iyhrTJYrPhzQE= 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 MN2PR13MB3760.namprd13.prod.outlook.com (2603:10b6:208:19f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.14; Mon, 10 Oct 2022 07:52:16 +0000 Received: from DM6PR13MB4431.namprd13.prod.outlook.com ([fe80::f565:49f5:8d21:e93]) by DM6PR13MB4431.namprd13.prod.outlook.com ([fe80::f565:49f5:8d21:e93%4]) with mapi id 15.20.5723.010; Mon, 10 Oct 2022 07:52:16 +0000 Date: Mon, 10 Oct 2022 09:52:06 +0200 From: Niklas =?iso-8859-1?Q?S=F6derlund?= To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Peng Zhang , stable@dpdk.org Subject: Re: [PATCH v2] buildtools: ensure the NUMA nodes are counted correct Message-ID: References: <1659426855-11014-1-git-send-email-chaoyong.he@corigine.com> <20220922080642.315800-1-niklas.soderlund@corigine.com> Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220922080642.315800-1-niklas.soderlund@corigine.com> X-ClientProxiedBy: MM0P280CA0113.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:9::19) To DM6PR13MB4431.namprd13.prod.outlook.com (2603:10b6:5:1bb::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR13MB4431:EE_|MN2PR13MB3760:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b2708f6-9eb5-4dda-93d8-08daaa9459c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EaW8w1FYCp32Kn0QUN0Tlb3vYWu0E8wV+25VZ7Q+TCaIhp6BpdZC6EdgpO69b/bgcuTjjPllPNPcth8nHxoJdfGprIiS0G1jkv7l3Zq401Ft8I5EicrOGMe9eVLw/KtrDQNMKC4MG3x7Q3Yf3yB13UIytvZ811WySd3n4coXNkQdMmWslG5dZ3V5UsH9oQIFeS+CFyrs+UJL3pc3RzU17qzlhxt9/suayVYNfOCUXivRuxvnITCcln6i3GwGEza9otrlMJwu4X2lDPAiZoIkO3aVWCQIaDubxHCATAHGEVZYNJY29dQth9Bdo2IpwuzXz6/UCqW41N7ObUcToaCRj0XSeaYybgXa0wEzWDfvqvzFPCpidLkxs5sj3GhW0+0AxnIzGXNjQ2lK33lYK5NShNaq+1HauOwINFWikeIthREbIs4SBR7MNkiHxZW7Vuk/2lut1IbN5Q1UQJ7SvChlPPZUJFwJeahY2t1bT5yp4G7YuuvqsQn1TPAb9+oUkjf0fn2k7nqD9gylUKjZetohBFJSnuW/fBnBClJZu+XgOI6dA6c3mD5V2oQOLIjWGlQVTvQXN3VMBm5xyIoeXMZtrkVrgHiPFiNQ8B8dUC7wogR9bnxpSHgRJyfKK8IIFpzpsL4fQZT01oCiMT7zSUGBT/MpPOvNsbBPpfW2dx0Wxd8qPTefERF0TnkiZS5XEXmFemwfcqzYMVZxjOiWNdq/cWDANFI+LV0RVBP1qDGpVWYtuI0fBeukEtvomBMNUhXc 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)(396003)(136003)(39840400004)(376002)(366004)(451199015)(53546011)(86362001)(4326008)(38350700002)(38100700002)(66476007)(6916009)(316002)(66556008)(450100002)(66946007)(8676002)(6506007)(6666004)(83380400001)(6512007)(26005)(9686003)(6486002)(52116002)(478600001)(186003)(5660300002)(54906003)(2906002)(66574015)(8936002)(41300700001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?mD2972rBEslSIV1Zq6VT2sTKyaw70kCkIV0ordK3VtAe+kTfWV5PO5g8Q7?= =?iso-8859-1?Q?0xI5YTsGkqYZUXhvj8MlmGDJMfHqcLqUYAqLgdKWzapwgj1/18dOnYBRvW?= =?iso-8859-1?Q?iwQ3wHkybUfThteHLM9mCnfTAKVluRcoaalFFBYXSg/g7/8dPZ7A+sW72+?= =?iso-8859-1?Q?GYjRNT2CGXWnkuGNGCk8HKlXIX0k4Uf5pUlxZHP/I5SgcPzq2plvvT8M83?= =?iso-8859-1?Q?HK8L1cv9vcdnlijprQVED+66XPbIAyUduqNezl8Z75wcNekgjxuZBn7uuP?= =?iso-8859-1?Q?ewzMMcW+who72QLDiN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ina?= =?iso-8859-1?Q?4MIDCtowbAABOWKkrYc5o80wjNiKQuQ88WAoKLG7RdSfAh6rqbzzUBSFB2?= =?iso-8859-1?Q?LG+UkdhhNFJfRMRmhv89dIrpYZsxd2G4p4TbRK8aHR1vdS9Dn8sfhMFrb/?= =?iso-8859-1?Q?WjGBZpiLAe024aSZb5BwxaaeIt+v62wiUQLMCW9ESh+ZQjVPR06lqhcqcf?= =?iso-8859-1?Q?cmZxNiDuubOiy97n4LSqXYNRhnetmQg29M/PpNrIjdDn8UVM/ImKQ0MGNN?= =?iso-8859-1?Q?By4ToxA0GuCBwZDe1n1bzyaNwY6yJEFFulw4F5qT0BO+A6Y5dc9WUPlEb3?= =?iso-8859-1?Q?YaoFEWbiAPRXfE/7/GYkmIRrT6XozBPHe5xonmjfdaz34wj//GVUQR1v0d?= =?iso-8859-1?Q?SVCD3Tnav9yOLdhpkD5dQB0CI0EjBgSN3RJUUxelHlU31kSY9x2tBDIeFN?= =?iso-8859-1?Q?Ltf+6HOT/v7X0Vxh4aZpfwYC2zw+Q3Qz4QKJlBSzCFND03mM4ahgcXZg?= =?iso-8859-1?Q?=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b2708f6-9eb5-4dda-93d8-08daaa9459c6 X-MS-Exchange-CrossTenant-AuthSource: DM6PR13MB4431.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 07:52:16.5351 (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: Bl2l6BlASyGNcL2AyOrWdmnqdfLJprmr9h/bY5JpTQCz3rsZbLj6YNicsn3e7bO24f91J6owdXIewIly4mXTx9ocbFKJK9nj0CeG+LRxArE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3760 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, Genteel ping on this. On 2022-09-22 10:06:42 +0200, Niklas Söderlund wrote: > 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 > -- Kind Regards, Niklas Söderlund