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 0081A458C8; Mon, 2 Sep 2024 03:21:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E50C40269; Mon, 2 Sep 2024 03:21:07 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2074.outbound.protection.outlook.com [40.107.93.74]) by mails.dpdk.org (Postfix) with ESMTP id 4C857400D7 for ; Mon, 2 Sep 2024 03:21:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xYSt60IBHIlyJvUQwEnVrSKboqndgMdbPIUXMdaDgeSI6h4+/5SNf+4HInE8XTI0HqUtybkV7N8UvxUFoocE2OmQGZIW9UiQX2Ir7dqfVo/fLH8xZZ2nBXogQ0spbmZmfOo8zJxWfM5irdg/5jzxASItA0G2xAqaNgkFNbCwKU2dV09oPIvFpiimpXsO6la7ka2CM11o7NiRjIr2Unb5Sc/D/jb4UX2QG3fB3O4OWSY8nvHEwJ131YcHrAbgw23O1hTlbsqeUI/IM7INCZ/FfHbNEdlytAjtTK8zcLmJG8ncWnreDHyLIthy/zAIfWoK849oPVHb6ODH4yE1vCAxVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=KbVFKmfU9nldX/hxX+9Ovm5SBliXrcJMW/jrwU6u3mg=; b=TmW0bdSzgxZ/8BUiJqGtCxQOfo8OKaw0W3BiXNeKa1hSooKMqxX7zu5OuOiLd2FPQ0C26qO4EbF01dviBIr/RUlwmPtYrjFrZL2K4OnNYwBirP1mLnzzLYCH18f7M385AtEslDl8TrOZU17hfsSytbBhENlWFElO5bILA08aWIZcAM9TZ5tLzVuwGatByvr8t/cRKQqN9Qap/I0FDOERGZNAq9rVWREsTn6PA6SXzTLAelkdWwlUP2QYYhmZ6l8nM+/AKpnXqK6vdXzjaV6gTOZM9e66KtrkH9YWbtIF02ZpOy8SXsDAEtIJGweEInzmCbduJ3gyBRv2omCnkRkECQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KbVFKmfU9nldX/hxX+9Ovm5SBliXrcJMW/jrwU6u3mg=; b=2OttMjCoopAIXwJQaFOvTdVLYORF0tG2GKamp6NUKzD7xCZ2FPTNgow0Gxelzgfm3gLxtVVHZCCHD5+Ae2SH5fssCScd5ink4ye3i2INqctr8pfyo6YDn881b71ehlEEJFU+uOe5IMyPEEPY4KGUZxNRzeBHAmRqa5nl+4LU+2c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB8596.namprd12.prod.outlook.com (2603:10b6:510:1b7::6) by SJ2PR12MB8805.namprd12.prod.outlook.com (2603:10b6:a03:4d0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.23; Mon, 2 Sep 2024 01:21:01 +0000 Received: from PH7PR12MB8596.namprd12.prod.outlook.com ([fe80::a011:943d:7291:8069]) by PH7PR12MB8596.namprd12.prod.outlook.com ([fe80::a011:943d:7291:8069%5]) with mapi id 15.20.7918.024; Mon, 2 Sep 2024 01:21:00 +0000 Content-Type: multipart/alternative; boundary="------------5M45ysHbc9q9CunZNEeK41FM" Message-ID: Date: Mon, 2 Sep 2024 06:50:53 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 1/2] eal: add llc aware functions Content-Language: en-US To: Wathsala Wathawana Vithanage , "ferruh.yigit@amd.com" , "dev@dpdk.org" Cc: nd References: <20240827151014.201-1-vipin.varghese@amd.com> <20240827151014.201-2-vipin.varghese@amd.com> From: "Varghese, Vipin" In-Reply-To: X-ClientProxiedBy: PN3PR01CA0187.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:be::10) To PH7PR12MB8596.namprd12.prod.outlook.com (2603:10b6:510:1b7::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB8596:EE_|SJ2PR12MB8805:EE_ X-MS-Office365-Filtering-Correlation-Id: 98114ff1-e1a4-4b87-997d-08dccaed8152 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?am5RT0wvc1FYR2FsMDJMUXF4V1Z6b1FMZzByNVhKcGNKZzV4RGNTcnpzTGZL?= =?utf-8?B?eVZlWTBEOE4za2ozQWZPVllzMGNnL1d2Y2lkVyt0dkhrTzZHTzZGQTlzM01H?= =?utf-8?B?WTFSQkFjaVJTWmw1bnR5TlBxb0ZmMElLNGFVR3haZnpwNXdEZE1aWlk4NUdI?= =?utf-8?B?VzU0R2dESVV6ZDc1OXZreWFCYXdCZTE2Rm9oZ2dlQXNueFQ4TVNPSjRvMzBp?= =?utf-8?B?RkpwQnhJQ2dzbm13S083U2FzdlNsSVgwNjR5Uy82bDZzaFRXRnZ0b3ovZDJp?= =?utf-8?B?MDk2a2tTL3JzV0dMRXB3UW9YSVBrSHEyZG0rc25CcFFSVXFYZ3BYRlBTSmdI?= =?utf-8?B?NE1mU25oVnRYSWRTVm14OHJxK2pGdFJRcHZVQW5qWVZpaEE1MElmTHMycE5L?= =?utf-8?B?dVROd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utf-8?B?OGpEenlsQm5yUHNEbFlFM3dsM1poS1phZHJKcmhDL3NvOVIzS1YrRGFRWmcr?= =?utf-8?B?QlhZVU9PZjlIQ1pZeEhqM3ozQmxUY3Nha0hESHM0VU9jK21kWXZwQXFud0VS?= =?utf-8?B?VFducjJpZHpaUmRBaGxOZG5MNm0zQUZ1YjdmYUw5Z0ErRjErMmNZbm5tNktO?= =?utf-8?B?MHUxZ3UzK2t3a0FQK0RINXhlSU8zTkZabTA4OUV1aVFjUzh6R25hbmcyQkJs?= =?utf-8?B?VWNxQ2tFSUkrVFdYajBkTFZ1aFFkQnF4WXdBSml0aWt1R2xGcVBnejVrYlU4?= =?utf-8?B?aWNZd3RZVHdOdkl6akprdVJCR3FGYjhDSFp6TVBteHN1VjFsbFdwYlFiQkFm?= =?utf-8?B?a0pZL3FETXZ4enQwNnpPeHZZVjZjMnZkUURaSDBEVUZpaGRFRkdZc1dIb0Qx?= =?utf-8?Q?AgV/5sNpIDMNuzb8k4=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR12MB8596.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RFBHVXlpN05nV3ViS0VGTE9QV0hvdWcvVkd5RXgvdERzVE5NN0JQdWx5LzRp?= =?utf-8?B?SVJOeFd6Z28zQ2xsdjhIelp3eGwzd2wxc3V5bk53V283V3RkL1oxTXZPRHZk?= =?utf-8?B?NzZmcWdaWVVXOVNUTXdoRjRPcFFvdEp4MXdiREQwdHVlSHhJV2M3eTBHK1JU?= =?utf-8?B?TmpWaUc4alZkZjhCRzFiWnloTkJtYVNWbG5vYUtTMUhQWlpSekk1SUttcWxG?= =?utf-8?B?U3lHbDEybmhIdXE3VnRMQ3hSRG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1THF0?= =?utf-8?B?em9mdmMwMUVUQm1EbVgzR2c2T25qeTBwUXU4Rm84TTZpdU9hOXNSUnVwT0tZ?= =?utf-8?Q?nr9Q5NDDwhnn8+ZHbpih0u7QK?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98114ff1-e1a4-4b87-997d-08dccaed8152 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB8596.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2024 01:21:00.8767 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: K6KC2pJBSfP1D4p7shgR/UjxrLJudkknqBGllM7dz+znVb+uj/p1eSd54Xr+zVXRKSPEN4CXqQ04fEX8mjRbmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8805 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 --------------5M45ysHbc9q9CunZNEeK41FM Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit >> -unsigned int rte_get_next_lcore(unsigned int i, int skip_main, int wrap) >> +#define LCORE_GET_LLC \ >> + "ls -d /sys/bus/cpu/devices/cpu%u/cache/index[0-9] | sort -r >> | grep -m1 index[0-9] | awk -F '[x]' '{print $2}' " >> > This won't work for some SOCs. Thank you for your response. please find our response and queries below > How to ensure the index you got is for an LLC? we referred to How CPU topology info is exported via sysfs — The Linux Kernel documentation and linux/Documentation/ABI/stable/sysfs-devices-system-cpu at master · torvalds/linux (github.com) and Get Cache Info in Linux on ARMv8 64-bit Platform (zhiyisun.github.io) . Based on my current understanding on bare metal 64Bit Linux OS (which is supported by most Distros), the cache topology are populated into sysfs. > Some SOCs may only show upper-level caches here, therefore cannot be use blindly without knowing the SOC. Can you please help us understand 1. if there are specific SoC which do not populate the information at all? If yes are they in DTS? 2. If there are specific SoC which does not export to hypervisor like Qemu or Xen? We can work together to make it compatible. > Also, unacceptable to execute a shell script, consider implementing in C. As the intention of the RFC is to share possible API and Macro, we welcome suggestions on the implementation as agreed with Stepehen. > > --wathsala > > --------------5M45ysHbc9q9CunZNEeK41FM Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit <Snipped>

      
-unsigned int rte_get_next_lcore(unsigned int i, int skip_main, int wrap)
+#define LCORE_GET_LLC   \
+             "ls -d /sys/bus/cpu/devices/cpu%u/cache/index[0-9] | sort  -r
| grep -m1 index[0-9] | awk -F '[x]' '{print $2}' "

This won't work for some SOCs.

Thank you for your response. please find our response and queries below

How to ensure the index you got is for an LLC?

we referred to How CPU topology info is exported via sysfs — The Linux Kernel documentation and linux/Documentation/ABI/stable/sysfs-devices-system-cpu at master · torvalds/linux (github.com) and

Get Cache Info in Linux on ARMv8 64-bit Platform (zhiyisun.github.io). Based on my current understanding on bare metal 64Bit Linux OS (which is supported by most Distros), the cache topology are populated into sysfs.

 Some SOCs may only show upper-level caches here, therefore cannot be use blindly without knowing the SOC.
Can you please help us understand

1. if there are specific SoC which do not populate the information at all? If yes are they in DTS?

2. If there are specific SoC which does not export to hypervisor like Qemu or Xen?


We can work together to make it compatible.

Also, unacceptable to execute a shell script, consider implementing in C.
As the intention of the RFC is to share possible API and Macro, we welcome suggestions on the implementation as agreed with Stepehen.

--wathsala


--------------5M45ysHbc9q9CunZNEeK41FM--