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 497904587C; Tue, 27 Aug 2024 23:23:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F423A402AD; Tue, 27 Aug 2024 23:23:08 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id 0ECE940041 for ; Tue, 27 Aug 2024 23:23:08 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id F3BA37BC for ; Tue, 27 Aug 2024 23:23:06 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id E82EB830; Tue, 27 Aug 2024 23:23:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,AWL, T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0 X-Spam-Score: -1.2 Received: from [192.168.1.86] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id BA18B7B9; Tue, 27 Aug 2024 23:23:04 +0200 (CEST) Message-ID: <45f26104-ad6c-4e42-8446-d8b51ac3f2dd@lysator.liu.se> Date: Tue, 27 Aug 2024 23:23:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 0/2] introduce LLC aware functions To: Vipin Varghese , ferruh.yigit@amd.com, dev@dpdk.org References: <20240827151014.201-1-vipin.varghese@amd.com> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: <20240827151014.201-1-vipin.varghese@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP 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 On 2024-08-27 17:10, Vipin Varghese wrote: > As core density continues to increase, chiplet-based > core packing has become a key trend. In AMD SoC EPYC > architectures, core complexes within the same chiplet > share a Last-Level Cache (LLC). By packing logical cores > within the same LLC, we can enhance pipeline processing > stages due to reduced latency and improved data locality. > > To leverage these benefits, DPDK libraries and examples > can utilize localized lcores. This approach ensures more > consistent latencies by minimizing the dispersion of lcores > across different chiplet complexes and enhances packet > processing by ensuring that data for subsequent pipeline > stages is likely to reside within the LLC. > We shouldn't have a separate CPU/cache hierarchy API instead? Could potentially be built on the 'hwloc' library. I much agree cache/core topology may be of interest of the application (or a work scheduler, like a DPDK event device), but it's not limited to LLC. It may well be worthwhile to care about which cores shares L2 cache, for example. Not sure the RTE_LCORE_FOREACH_* approach scales. > < Function: Purpose > > --------------------- > - rte_get_llc_first_lcores: Retrieves all the first lcores in the shared LLC. > - rte_get_llc_lcore: Retrieves all lcores that share the LLC. > - rte_get_llc_n_lcore: Retrieves the first n or skips the first n lcores in the shared LLC. > > < MACRO: Purpose > > ------------------ > RTE_LCORE_FOREACH_LLC_FIRST: iterates through all first lcore from each LLC. > RTE_LCORE_FOREACH_LLC_FIRST_WORKER: iterates through all first worker lcore from each LLC. > RTE_LCORE_FOREACH_LLC_WORKER: iterates lcores from LLC based on hint (lcore id). > RTE_LCORE_FOREACH_LLC_SKIP_FIRST_WORKER: iterates lcores from LLC while skipping first worker. > RTE_LCORE_FOREACH_LLC_FIRST_N_WORKER: iterates through `n` lcores from each LLC. > RTE_LCORE_FOREACH_LLC_SKIP_N_WORKER: skip first `n` lcores, then iterates through reaming lcores in each LLC. > > Vipin Varghese (2): > eal: add llc aware functions > eal/lcore: add llc aware for each macro > > lib/eal/common/eal_common_lcore.c | 279 ++++++++++++++++++++++++++++-- > lib/eal/include/rte_lcore.h | 89 ++++++++++ > 2 files changed, 356 insertions(+), 12 deletions(-) >