From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0074.outbound.protection.outlook.com [104.47.42.74]) by dpdk.org (Postfix) with ESMTP id 367BD3B5 for ; Fri, 28 Apr 2017 14:25:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=f9DrsNBW81FTFR6IV/sGFrYn9u/YN7UqdnP80zyXEFA=; b=W/j9bYmvs3o8ZeXzSF0Nd5UVuoL2OPXxV6hNRXQcS6bD2aYy1b0+ssrJMW+xw4uJ+LjTsCSHJeYAvxeSYkDCmA/TNoUhnj6fH93jQcJC8pt1Xw/8Mlmbg2FfWgc0u4QM+tiMAc2NoM/fgbIDM89mIhEevHD9WvALhSuF3DHZfQI= Authentication-Results: linux.vnet.ibm.com; dkim=none (message not signed) header.d=none;linux.vnet.ibm.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from [10.0.0.75] (31.172.191.173) by BN6PR07MB3507.namprd07.prod.outlook.com (10.161.153.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Fri, 28 Apr 2017 12:25:23 +0000 To: Thomas Monjalon References: <1874376.tUCind7prS@xps> Cc: dev@dpdk.org, Gowrishankar From: Andriy Berestovskyy Message-ID: Date: Fri, 28 Apr 2017 14:25:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1874376.tUCind7prS@xps> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: HE1PR1001CA0009.EURPRD10.PROD.OUTLOOK.COM (10.171.99.19) To BN6PR07MB3507.namprd07.prod.outlook.com (10.161.153.35) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 86b44113-10c3-4c4e-3300-08d48e31a504 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BN6PR07MB3507; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3507; 3:uRUapkzCfTaX7NB/HpySfkdAkO1XXGVVPMX6zoRpsF2AxKQ7ckUf4hZjYRksOaoC0X8QU7+eBgYYyiiY9wxpMgrWEkzkKLvAzSLbXVaxbEJd8KpTTSt7MvNf3MpWkpc2N9iNsMvjo5L93YInEQsM1duH7NXVTObNPDVzuUtBhaJp/pYvDXeedHJlfmnAQji71E1fbQcXKjyRKGrQObYMk1ycP1UrUIj9UvScKSxpBWPB852zdyHKHkJ3X1Xmavqsee8URIgGbWXiyyFyACtTyYJ8SPQptB5qfUDNvqV0GRFxv75eyM+slqs84uo0fdtE6IcJm27DFMNxDA5D1gg7Jg==; 25:Xt7twXWQfkV4IPn6we31nKMMgi/M7c8YgBZtPbn0qMeuTj1y8beWJNo8Emu+68yFYplFEsrrg4xbBgQfJ4GdEtY2ITxVKMpI5/N2ke7Ps95iHnWJjMoMlRH1Fj76s1DNeTYKWjyiZ/oZjL2wfPmssyPkxd4ZMdEeeZO11c8ol3gR4LvGbKhFyErO6aZ0bghYG9CWy5FtcMZB9jX+SI4JqGOQby/OmNG7DwqMfmoII17c5CcJeLXQvEWQ9Mr/ynhaHlxg1lHo0QOyti5tUbFfWTQu7hjMeG3TP4Neyw4A02/GG9AysYZGPtd+gjPr6nbUUrZ+sWIoAsMhsnQGIvfaETFlEuaMiYnR9iSamBspciR9DuupuWjdU0N7FbBBx3ngH0keDRRn1jrwJJj/6GbcCXrb74jtBMqnoLxqjjGXuUT74gFXEqsXUwx44MukZp0kGEzuTyHMHjs58SVtBFyiBw== X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3507; 31:NwPCoFPM66ntnnN0gQf34qqDomwQQ0eRc4DvNT6Drzo3VWty4XNE4PIxyrtnknOSRjiG1jGg//+bLkUq++z1FrymNZTTx4TYCBqd+zZP3HhSpcmRcgodVWrr3W+2MpO96cHNu2Jn88lTrgqeD/VKMJhXKh15PVlkDp++wQutUJM4Zh9QVV7T9xqp92HlnZvnWTxc5h+dJCZiUpoGKNE1rIcGwoxHpHeTYFUj6u9YL/ifVEXFfzZuk4wUVv/UTlFZc3LaAWF/DnsHS9OaHipaAV/IeZa+7J2R2zqXLcJKMIc=; 20:E5cllEv/99ZtLG0Z2VGd+9n2uH08Q24iVCRm0PHaManba+UDGbgcXmUWbcY6soYB8Z1YH+Lis//XCxXj9PQMg70XoJXTFft+ADEFIjgr9+9epipXZ3iywCkeJaxfleabBuPm17sMbn1XeLqb5C/jEVNC1PIrfRC79DTW8KSKuV5MdMksqsuxOkyCFSVzNaZYfNPGZI/QRsd5ac9q/rTl7ZwsBk0ZybGC1M9nYbw7VJaj1nO0MUbEcPehM5JpepTnKA5h6w929SzaiHBbAW48sGFVRX7NeYbZxjvnwXDyAESqEBIJq37AxmkR0XyxtqAU0uthNT10+3aqYZcAJU6yE/HLOMOO2AL/dFlUruu/4GRT5CTSXcbqWfPUJ+U6aVtrZQ2ourHehUGcvvC66lvXhYkAzlVBrIg8qkOGYpfRDXc6+jlrYYUpUHoTJVHJXHH6EufaZdH3iDqYFXtYPYgnh7TXSUEnM5h7APvQlT1/ubaydFFhKQujbLDKCRLYNpHjBGRXPZM/aUSPuuvz2P6P+he8Fd/7+P+lTOy1i3+pKELk7ErFSizF9sKcj9jMD6Gce5SEBjBfGMevDAU75y/EcFS61zuAyNEfazgvtwkrjq4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(104084551191319); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(93006095)(3002001)(6041248)(201703131423075)(201703011903075)(201702281528075)(201703061421075)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148); SRVR:BN6PR07MB3507; BCL:0; PCL:0; RULEID:; SRVR:BN6PR07MB3507; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3507; 4:eiwyoHsQnO/Ol21TMpAXfE7bw0jXzDxFz3J0MGwYDWRmMwZkR4PW/cMNo1kTmVfpwIwXlZqP5zwKc1sVA82nMJPflaTsirwtmfQeRoQPf+pMz0tc5MVGgFWu3qImxJQponZ4lorN0zGQiwACSImqD4NGTXI6SVG7vzgMZdzNl/xWoFb6ZV8iPhnhsXfQy8+MhSR8FMWWyyVR0crYo+ASJEXOQCxz2iKiQl4aCbxnN0rLV6KqsNWj6S43Dk96cJs1Urm2XcXNJGx91+R5d4jwI6baLKeiVYWUyzFX8BjJv+UTZiluHZQmeBvBneUfAwOIIpy6utxMvnh/UKSoxgL36N3XYGAlG9CBkdUYGZkSdKGTRCY6qeYKSriSSzz3mrilVVdrZhFEJaR9B+lNRaxJ6i7tY7pHNYoB4sTsgaugf3oJW0iPqirYzlFEO5VDSVo077eT5OvLHFq9delvzDGxFQq9C12JPk5d/ZUzUNf39o/1h/Sj7k/boXw7HwVD+FKKM2fBQCaHxxcPxpoi6xcjmKTHV12a7U6/iEA+e51TTqU9u0GjDC0r1WlBgEmmOIMh9D7qQ0cf/h1tbE2OIjQ6ZLHoJaoZ3lD5ENDQiibpAUPBsOMjoTOrVDB02bxmCmuojfgNQksci+GPkKT1XvB4EbKbWKxmWkTNk6z2CVeq5QMrJOId29FcRe241KLHfORwRlw4ZWm8pThywxkpccmyrYxhqlcFlSc2ZZ1orlo94HR56rqcKQgY7mYIL5aOMO0yI8uDpnEIKcWWcJRfK+nGhQ== X-Forefront-PRVS: 029174C036 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(39840400002)(39860400002)(39400400002)(39450400003)(39410400002)(39850400002)(24454002)(38730400002)(42882006)(50466002)(6916009)(110136004)(2950100002)(3846002)(6666003)(230700001)(31686004)(42186005)(36756003)(4001350100001)(6116002)(6246003)(5660300001)(53936002)(7736002)(189998001)(53546009)(83506001)(76176999)(90366009)(77096006)(6486002)(47776003)(66066001)(65956001)(4326008)(54356999)(33646002)(50986999)(305945005)(65826007)(25786009)(2906002)(31696002)(8676002)(81166006)(229853002)(23746002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3507; H:[10.0.0.75]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BN6PR07MB3507; 23:Eu9rxFE4MXzIZk96EEXw/4yYmcDS/HESiHwuD?= =?Windows-1252?Q?iNGw8IRz0FiFObosZyiGL/XtFrcMNHcPIaqRbkjAuqQIr2Tdcd+N4BKK?= =?Windows-1252?Q?+ly2JuU1JrVH5QSrAfbV82edTQ2Ek3iq8Ty/A+p6A2lyM+rGf5UJrLpZ?= =?Windows-1252?Q?MSeRMtVOCx7CgTT/vYYVg5G/gLEV1RWtrs5Bhj0R4C5iniGeoLDkICju?= =?Windows-1252?Q?f2M0VQfIEVS7ggjBgpdGXwF6UQ95t6VEX3P6HhflMfstuHhuRU0rB88U?= =?Windows-1252?Q?vpIEDVwX0FQiEPzfnq1uhlcVjsSlHvehXHU3WxEIvnjqW0ysYnvbTb1O?= =?Windows-1252?Q?noEmAC+8w+a6Yt7n6EPZdwkyUrNr4g2JY59kfWf6/Ug8Di/c3MVheAk/?= =?Windows-1252?Q?7dDDDBEc3UBBzCn6hpeZIaq7gAMfbfMR3HG2LILZwi66af1EOHGO9ztE?= =?Windows-1252?Q?rRT5spOcZWlMpK3aK9guQ7wIoL1ksO82tELSyUZO9/HViumKIOlM2i0j?= =?Windows-1252?Q?0I7CgJAYBo79QtaDVgGpesWqoRsbS+naFCDqO5RU/WT5Hhl+aEat74/z?= =?Windows-1252?Q?egAAnGk8TY+wvVHi7cI6+vu93IZCq4sQ7jaqHahKdI/j65p8vKQ1gRxh?= =?Windows-1252?Q?cjZjSQ3qEXoR4pldy4n5+cOZH7JJl78qsZmMbLu6jFLRL2MoK8ojvjjN?= =?Windows-1252?Q?OQtxx8FKHUJtZ8yR4HY5dUDhQksZ+SlMwSKu6iIhrlY4Ds+YH5AVgXTi?= =?Windows-1252?Q?owSO0lb6c16SyfBXODG+aDtgHudyqdUXNuQChLCxItl8ZLA+lWkDNDQS?= =?Windows-1252?Q?J6YHThqdkDPSRI9xe6OKwK7IjqmOfNzlsFZNQ0r9jn3dLaEki6+ZDzCs?= =?Windows-1252?Q?kA0WrzUv2hxH8rxoO2bAHspiB8hLy0o/seDFsWomOxnmnKKHYBvq9gnB?= =?Windows-1252?Q?oUeNumsd9mjxGQ+Iaxr/IcNt+6n1CBwkNRQwDOHlB/Bo3obuVkz/8sK1?= =?Windows-1252?Q?XfzhC1G57K/ae8wK72PXe+dBgjzA01NvH1SlX3/WxPrOgnJqnxYnw7kR?= =?Windows-1252?Q?ge6458bIA1S76ZJidV2F1kKkCfgY1IcP2uaKZoZjIKFiew2SBxNBVno6?= =?Windows-1252?Q?tzo6MbBrFiPeNymbzIY3qJRhfU8BxyNlDJwgD+9hU/EMhpzVJb5VyNKK?= =?Windows-1252?Q?d/6reyJyc0Wwchv/2xuXVDOuUFa6xNTeMEdYBDCGNejkLqRJXRR6TzmD?= =?Windows-1252?Q?yTmf86OBksq4mUR60Z4Y06IWuljij6rRqBvNmhjdZ6OlU29S1zSs1BXj?= =?Windows-1252?Q?S0F6FKs32zX4cJkuJS2FfRebUMEAITGUmdDex0zPtBPSKFit6+TCnneA?= =?Windows-1252?Q?kRppFbQaKnm?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3507; 6:/FN1OG7Du3ZMnW2lhxX6PJG23jWfqZG+x5pzC10u7xiGwxmManBxyyo4bHhwiqhqUVSuuYOrwaN+WzkS1sZrKikP5L5HyMrKv21MQSLCp7eF0HE5yoxSJUVL3NxAxIc1H6tcNgkxiJkOAwXZGzXAGFrdAUdMVHQbLnKKtfD4sk2cNSwWu2zaGItnAuiQ0GQuFNPQV+wRRvCfgzjyAtesvoR5S2YYqKWFjjdprdBYyRdvm5j8d6TQmQlGST5jjIHi7p4dPhhBJ0Jf0U548oPIVY0vC51uolSYFsbsiYRJj1q59Uy1gOVl7xtveMjwIjrLBEJOi00oRoP6CdAbSXr437d6WvK+rr9KxWQMSKpbVMvUmXSsHBhj7bT0jWHjF3dlQ1JmqBiOoxPcWf74fqAg2Ow8XzrLl8P1fw7ov2/mPWis/zVNrkSerynN7FGzFIw23gfjLU5BYdYaBoTVDQLR/+vsC+LRAJh5XEB7LIeWdVdGVKjNYZikezh+moKa2YoVVW/B2YivPsXLjXypYzTw1w==; 5:SZxt4WfWq/JgjPv3gPSHbAToEd/kwFQ4AHxvuttrTC1J1NGgKc5otuxZ+iqqjGXmACPZ7lkZLDLKCmjP8zYQOqTVB/3iY+WVGBwVTBtycp3YY8ZME1ljVpwyKPhbMBDNs9EKHcC6qJf8a7kqelUfBg==; 24:YvwT6OZ1zfbnwHOTl9rmYAJ1N2r/gSnIX+D25EGTvKJvoHsJjDlzyl7ymVAmlZfxYtyBB7zYG42JFnVNRAYG2xMye1ukIVjtCBqKbKvf6WA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3507; 7:HvcLsZKDIb0TS9+COnfSInVPdQqm/q4Y1IHeDphpMlfr4EYQEonCbGnPjSk2rOATRA7gkrtk/DmBoYw481pMHdQWUPLvAitDkl3NzV/LGn3fOq5J14OLn63xKN34OKCAjLloe6bvwr+83NN6rk8O8knsUgv28r2XDmouyfU7gygJP1BeW74+/XY0GmbnVC0ICAMEjbavQy3F54WCpRvh81c/0JaOo1i4sSVsXYvDO/UL+P6XCfltt5NYv9+Gw22QMAA/MGbbmX4UiP4/rg1CZrG0asLfFLhrfevxRpl8Mm8mmDcSWSe3BWByvGI4ol+Wd8sK7IZP7y0s8mAONa4jxw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2017 12:25:23.0994 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3507 Subject: Re: [dpdk-dev] [PATCH] usertools: fix cpu_layout script for multithreads of more than 2 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: , X-List-Received-Date: Fri, 28 Apr 2017 12:25:27 -0000 Works fine on ThunderX and does not brake Intel either. Reviewed-by: Andriy Berestovskyy Tested-by: Andriy Berestovskyy Andriy On 28.04.2017 13:58, Thomas Monjalon wrote: > Andriy, please would you like to review this patch? > > 28/04/2017 12:34, Gowrishankar: >> From: Gowrishankar Muthukrishnan >> >> Current usertools/cpu_layout.py is broken to handle multithreads of count more >> than 2 as in IBM powerpc P8 servers. Below patch addressed this issue. Also, >> added minor exception catch on failing to open unavailable sys file in case of >> multithread=off configuration in server. >> >> Patch has been verified not to break existing topology configurations >> and also not changing anything in current output. >> >> Signed-off-by: Gowrishankar Muthukrishnan >> --- >> usertools/cpu_layout.py | 12 ++++++++++-- >> 1 file changed, 10 insertions(+), 2 deletions(-) >> >> diff --git a/usertools/cpu_layout.py b/usertools/cpu_layout.py >> index 5735891..99152a2 100755 >> --- a/usertools/cpu_layout.py >> +++ b/usertools/cpu_layout.py >> @@ -46,6 +46,8 @@ >> for cpu in xrange(max_cpus + 1): >> try: >> fd = open("{}/cpu{}/topology/core_id".format(base_path, cpu)) >> + except IOError: >> + continue >> except: >> break >> core = int(fd.read()) >> @@ -70,7 +72,10 @@ >> print("") >> >> max_processor_len = len(str(len(cores) * len(sockets) * 2 - 1)) >> -max_core_map_len = max_processor_len * 2 + len('[, ]') + len('Socket ') >> +max_thread_count = len(core_map.values()[0]) >> +max_core_map_len = (max_processor_len * max_thread_count) \ >> + + len(", ") * (max_thread_count - 1) \ >> + + len('[]') + len('Socket ') >> max_core_id_len = len(str(max(cores))) >> >> output = " ".ljust(max_core_id_len + len('Core ')) >> @@ -87,5 +92,8 @@ >> for c in cores: >> output = "Core %s" % str(c).ljust(max_core_id_len) >> for s in sockets: >> - output += " " + str(core_map[(s, c)]).ljust(max_core_map_len) >> + if core_map.has_key((s,c)): >> + output += " " + str(core_map[(s, c)]).ljust(max_core_map_len) >> + else: >> + output += " " * (max_core_map_len + 1) >> print(output) >> > > >