From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BBB74A04B5; Fri, 11 Sep 2020 01:30:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7A98F1B9B7; Fri, 11 Sep 2020 01:30:55 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id DC4A11DB8 for ; Fri, 11 Sep 2020 01:30:51 +0200 (CEST) IronPort-SDR: x6Zr3wUYvCzLWgPl9xX5Cq02iXBrhg8DbqCN+4yXsMq7q4ZqqASX1aHMU26LTQE09iLV1W9pIC sLHT90ZvOXoA== X-IronPort-AV: E=McAfee;i="6000,8403,9740"; a="243477708" X-IronPort-AV: E=Sophos;i="5.76,413,1592895600"; d="scan'208";a="243477708" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2020 16:30:50 -0700 IronPort-SDR: ahmE7++yFi/98+gRBaDY5P8JNTgmGKoVvQRCtP16yxYEkzGChvBRKEftFSWtb/VW1Rs7DEza7g MYpzVycGE5bQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,413,1592895600"; d="scan'208";a="300736840" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga003.jf.intel.com with ESMTP; 10 Sep 2020 16:30:49 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 10 Sep 2020 16:30:49 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 10 Sep 2020 16:30:49 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 10 Sep 2020 16:30:49 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.174) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 10 Sep 2020 16:30:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cjCKHfH2zy6ACqAIOC0R/8IH0ijRGmMOyoSY1A2QsunCcdR/jIU+WqVCAkylgpeDYCjZEnh1kW70YCXOF5LwOUZVe4iItCdNXblpHYIwIldlOi8fVfVJT9k0UXSh1DFg0S965GFjKN3Jyg768EVnKejYQt8TtMOyQwABAJAbdCn/j0j4DxpXNazlhe6O4ynRuC6zVpveKaCxoGlL4Dar6Cask0HExT/FoG/8QUASPwn5ABu13k8pkcnkKgCXj76gQigrUHrjdwEO9D7rl9xjey1ZjSOiFilg56k6tEfw7DFYXXRTD0Ig1wxR3MfcESwTdZY5W5hjcpA6XdluWUIQqw== 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-SenderADCheck; bh=QxEhjsG+F9nA8SrZr69vH4japXYaq1FJkHnY9vFH5P8=; b=IvVy/Zzl8OuRI0f4RH9/a61fHot/undI1w8qTuDfDgCHbmB6L7yEYYsNmrmocDRlS51hhioOlJrMEQrCf568PNrkhoDT6c53G9zAv9VK6ZFTjN+SER1ueckZtxhYYdNu6Uo81exhtW8/oOpQwJ6KGS92zv90lBe6KvTYEd8viHrS0OIAW52uXSFdes+/Igqer9el2Eox+b2B/WVRZ8tsOzC58JfIbpnmsqTN2eTl6o9aDDJY7axzs5rEnpUmEs7mKdwyJf74LjhruVhi6jbRkRktl1y+wC18aqtQ7iNoLED070KxSodyCe0rWYFlCfpN6HMWJ/e0nFTzvDesrJnFgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QxEhjsG+F9nA8SrZr69vH4japXYaq1FJkHnY9vFH5P8=; b=PzhFPTmiT++tkzQ7gzwYaQ/ZmlOM0vCKyVP2v13ZjycPf0VFTw4hVc+23UfaPRZBjp67WPlFTBDKY2FhBH9EtH7wfDJQov56KxSaCMYGVLQDW/hCu1pWs1A16APbz+7r502Tqg/UVWNAwrKO61s8vE5klh6g8xdPzbaF/UElIMU= Received: from BY5PR11MB4228.namprd11.prod.outlook.com (2603:10b6:a03:1bd::31) by BYAPR11MB2629.namprd11.prod.outlook.com (2603:10b6:a02:c6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.16; Thu, 10 Sep 2020 23:30:44 +0000 Received: from BY5PR11MB4228.namprd11.prod.outlook.com ([fe80::254b:b278:3f2:915a]) by BY5PR11MB4228.namprd11.prod.outlook.com ([fe80::254b:b278:3f2:915a%7]) with mapi id 15.20.3348.019; Thu, 10 Sep 2020 23:30:44 +0000 From: "Maslekar, Omkar" To: "Richardson, Bruce" CC: "dev@dpdk.org" , "Loftus, Ciara" Thread-Topic: [PATCH] EAL: An addition of cache line demote (CLDEMOTE) in rte_prefetch.h Thread-Index: AQHWhxApVV7xdD1vMkqWTT3SNmI4UqlhEgMAgACAFICAAPJ7QA== Date: Thu, 10 Sep 2020 23:30:43 +0000 Message-ID: References: <1599700614-22809-1-git-send-email-omkar.maslekar@intel.com> <1599700614-22809-2-git-send-email-omkar.maslekar@intel.com> <20200910085519.GB1789@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: <20200910085519.GB1789@bricha3-MOBL.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [68.231.14.32] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4cbf2c6b-12ab-40bf-56ea-08d855e189c1 x-ms-traffictypediagnostic: BYAPR11MB2629: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oWdNPg+kYuv1TpnGivMCCtuTaxJOtTp+KnpbECvCiS2hlNJVgubhvC2G00HzB2oevuxQ6N29mlEEHIX7V8rWWy7+cYFyljqwpkfTqRdzg4HI+MTsPWKr+oc8Hrdl7gv4D3BmYEKgIWlb3qumMiDon0cgO5MLhyTjuWySMLjQBCaA+znD6iAWNa/11G3UVMcHdJEiGT7UXusszUNBdGmINWuJZLw+uQN9tLgHaL5VbKzBZZIFoKs4CKsmvmUepw+isRo/iWpX/N2neEnKn/tkSAcUQlZj8+sXLOQ6tkXns7EGAi1kZITQSY+5EzEXXJF3XmC2TFPIhWnJ2IMYOuzijQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR11MB4228.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(396003)(346002)(376002)(39860400002)(366004)(66446008)(7696005)(52536014)(6862004)(71200400001)(8676002)(55016002)(2906002)(9686003)(54906003)(83380400001)(66476007)(107886003)(316002)(86362001)(186003)(26005)(66946007)(66556008)(5660300002)(8936002)(33656002)(6506007)(64756008)(478600001)(4326008)(76116006)(6636002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: BxYr2+Pqtw9D7yhj+UmomjLHq7qgcL73emPBaWtIQH3maBvM5xh1i340nTKLHLSZmaFIoJoH/aKbKrTG/Rq0QqZwlJfMdM8y1/4VIhOckadYuxKI3Je6Fqdz1vgiVhjUmDRQd8M/V+v0N9SZVGvJt+z1Wp8dayZSqI26P9Y2PWTWzQ/P6EP5vFy3Hh87IEszHbXZBcGMJcl1ny0q3TpEJTSO0GzDwB7LEdr3dM6XsGM0DwOSZ6A380MOpamqZTe+wUOkI0vmuYqJL/bsvuUT67/sX+mfDiCru7n7+lTHnNGuhkU4zfIBG0TBbBXWaWBGEJChIe/vk6I3PR/pwbJUvy31na8hy+Raq8koQq/nwO42SOa+dX8S1eH/MjHi3Uc6maRdqNsIsuJmteA/pwS1rGzWs42Hqmu99VCueqGhjbTn4ogidacIVBBrS8H9taXDmpUVi5MbCPWj8F5tFX72XplVbhTJovKtbpaXlJI98MZsD7TuRPYVPTAjvQwj1jYyaGYxlVe6zAhKe2U70guwHZseRlxrdDyo9LgGekNAnLJL9oqeqnmvMGQYGKDENCSV9u1bqHxl96PiBfFqxVFQIoGroEQsvh4Y54hKBZjZD5nO+vDWUM/2zL8sx0R4PrA5IvqDYBqsfFPUttw9QMD/Jg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR11MB4228.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4cbf2c6b-12ab-40bf-56ea-08d855e189c1 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Sep 2020 23:30:43.8657 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VQBBu7ZjS/uTost+KmVu8+Ii3C57qRluqMP44HfqssGYc+odmEetPrgqMU69wyLIdA/iv5MWWfYXLGvZBTfLMGImd5Wj6MW3I4m9S0VbT84= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2629 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] EAL: An addition of cache line demote (CLDEMOTE) in rte_prefetch.h 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Bruce, >-----Original Message----- >From: Bruce Richardson >Sent: Thursday, September 10, 2020 1:55 AM >To: Maslekar, Omkar >Cc: dev@dpdk.org; Loftus, Ciara >Subject: Re: [PATCH] EAL: An addition of cache line demote (CLDEMOTE) in >rte_prefetch.h > >On Wed, Sep 09, 2020 at 06:16:54PM -0700, Omkar Maslekar wrote: >> rte_cldemote is similar to a prefetch hint - in reverse. >> cldemote(addr) enables software to hint to hardware that line is likely= to be >shared. >> Useful in core-to-core communications where cache-line is likely to be >> shared. ARM and PPC implementation is provided with NOP and can be >> added if any equivalent instructions could be used for implementation >> on those architectures. >> >> Signed-off-by: Omkar Maslekar >> --- > >Hi Omkar, > >please see some review comments inline below. > >Regards, >/Bruce > >> doc/guides/rel_notes/release_20_11.rst | 26 ++++---------------= ------- >> lib/librte_eal/arm/include/rte_prefetch_32.h | 5 +++++ >> lib/librte_eal/arm/include/rte_prefetch_64.h | 5 +++++ >> lib/librte_eal/include/generic/rte_prefetch.h | 7 +++++++ >> lib/librte_eal/ppc/include/rte_prefetch.h | 5 +++++ >> lib/librte_eal/x86/include/rte_prefetch.h | 9 +++++++++ >> 6 files changed, 35 insertions(+), 22 deletions(-) >> >> diff --git a/doc/guides/rel_notes/release_20_11.rst >> b/doc/guides/rel_notes/release_20_11.rst >> index df227a1..c4a4362 100644 >> --- a/doc/guides/rel_notes/release_20_11.rst >> +++ b/doc/guides/rel_notes/release_20_11.rst >> @@ -27,29 +27,11 @@ New Features >> .. This section should contain new features added in this release. >> Sample format: >> >> - * **Add a title in the past tense with a full stop.** >> +Added new instruction CLDEMOTE in rte_prefetch.h. > >You need to prefix this with the library it is in, in this case EAL. Also= , since this >is C code, you are adding a function, not an instruction. [I will fix these release notes]=20 > >> >> - Add a short 1-2 sentence description in the past tense. >> - The description should be enough to allow someone scanning >> - the release notes to understand the new feature. >> - >> - If the feature adds a lot of sub-features you can use a bullet li= st >> - like this: >> - >> - * Added feature foo to do something. >> - * Enhanced feature bar to do something else. >> - >> - Refer to the previous release notes for examples. >> - >> - Suggested order in release notes items: >> - * Core libs (EAL, mempool, ring, mbuf, buses) >> - * Device abstraction libs and PMDs >> - - ethdev (lib, PMDs) >> - - cryptodev (lib, PMDs) >> - - eventdev (lib, PMDs) >> - - etc >> - * Other libs >> - * Apps, Examples, Tools (if significant) > >Don't remove these lines, they are all also part of the same comment as >below where it says "Do not overwrite or remove it" :-) [I will revert original comment and add appropriate]=20 > >> + Added a hardware hint CLDEMOTE which is similar to prefetch in >reverse. >> + CLDEMOTES moves the cache line to the last shared cache, where it >expects >> + sharing to be efficient. >> > >Reading the instruction description in the Intel instruction set referenc= e, it >says about moving the cache line to a more remote cache-line, rather than >guaranteeing that it goes to the last level cache. Therefore, to ensure >compatiblity with the current spec and make it more flexible to meet any >other hardware implementations, I suggest changing the "last shared cache >..." to "more remote cache where sharing may be more efficient". [I will make these changes as per suggestion and make sure it is in sync wi= th software development manual ]=20 > >> This section is a comment. Do not overwrite or remove it. >> Also, make sure to start the actual text at the margin. >> diff --git a/lib/librte_eal/arm/include/rte_prefetch_32.h >> b/lib/librte_eal/arm/include/rte_prefetch_32.h >> index e53420a..ad91edd 100644 >> --- a/lib/librte_eal/arm/include/rte_prefetch_32.h >> +++ b/lib/librte_eal/arm/include/rte_prefetch_32.h >> @@ -33,6 +33,11 @@ static inline void rte_prefetch_non_temporal(const >volatile void *p) >> rte_prefetch0(p); >> } >> >> +static inline void rte_cldemote(const volatile void *p) { >> + RTE_SET_USED(p); >> +} >> + >> #ifdef __cplusplus >> } >> #endif >> diff --git a/lib/librte_eal/arm/include/rte_prefetch_64.h >> b/lib/librte_eal/arm/include/rte_prefetch_64.h >> index fc2b391..35d278a 100644 >> --- a/lib/librte_eal/arm/include/rte_prefetch_64.h >> +++ b/lib/librte_eal/arm/include/rte_prefetch_64.h >> @@ -32,6 +32,11 @@ static inline void rte_prefetch_non_temporal(const >volatile void *p) >> asm volatile ("PRFM PLDL1STRM, [%0]" : : "r" (p)); } >> >> +static inline void rte_cldemote(const volatile void *p) { >> + RTE_SET_USED(p); >> +} >> + >> #ifdef __cplusplus >> } >> #endif >> diff --git a/lib/librte_eal/include/generic/rte_prefetch.h >> b/lib/librte_eal/include/generic/rte_prefetch.h >> index 6e47bdf..89ec69c 100644 >> --- a/lib/librte_eal/include/generic/rte_prefetch.h >> +++ b/lib/librte_eal/include/generic/rte_prefetch.h >> @@ -51,4 +51,11 @@ >> */ >> static inline void rte_prefetch_non_temporal(const volatile void *p); >> >> +/** >> + * Demote a cache line into the last shared cache level. > >Same comment as above. Since this will make it into the official API doxy= gen >documentation, I think a bit fuller of a description would be good also. [I will add more documentation]=20