From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0058.outbound.protection.outlook.com [157.56.110.58]) by dpdk.org (Postfix) with ESMTP id 209FB379B for ; Wed, 1 Jun 2016 08:00:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=iDnJo8XdfZHKhMoGa+99cWqI9vo4cxhgFS7Sr19r1Mw=; b=EesJMATxAzVLzwXQRPRGH03607KpnV2Vk2P2Pa2J70zakB/2f+4yoRvKG5bx0+j6rTsm7mQ+fOQ/fEUIIOUXoYi3O6JjhvhlOw6KwfoLqXab3fOD+EZwIhcJ2JkqlxFSNmOsInkx5TpHdLy5zT/WNzq7I1HFsMf4hyw3hoGYJGk= Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (171.48.17.148) by BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) with Microsoft SMTP Server (TLS) id 15.1.506.9; Wed, 1 Jun 2016 06:00:54 +0000 Date: Wed, 1 Jun 2016 11:30:36 +0530 From: Jerin Jacob To: Jianbo Liu CC: Olivier MATZ , Message-ID: <20160601060028.GA3823@localhost.localdomain> References: <1464663966-8122-1-git-send-email-jianbo.liu@linaro.org> <574DE5D6.2040001@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [171.48.17.148] X-ClientProxiedBy: MA1PR01CA0028.INDPRD01.PROD.OUTLOOK.COM (10.164.117.35) To BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) X-MS-Office365-Filtering-Correlation-Id: cb4fd2ea-27de-4da3-bf1b-08d389e218ca X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 2:MJa5VhE9IySbzFYi3aokapVYxiMPvUy8HUvfQkf6dIQyUg4tERaqjAZXKcgOPQh76lOTyYgASdNMrWxCRlfibB+s+9kv+4Z+SQ/peoRYc05OY+3KTz0VClFVc0y1UTPg+84g5dCGAxyXJKyDFIrKSDeCVkEXWyPIPJ0e+eA7M8/sqJ+8oA7R61lPNvk9ixFR; 3:p2/2YpsxbbMpMMVhnr2Sf8vM/lKPswOdn7+PWn24u9D6CoBICBJ3IorEe98gHy+G0B5gxcBs8O0/nAFwCmENwstelJHe6Uh/ceZRKRVJFyLEEPezbNSoeVF4ZxcHlcAV; 25:HUnBBP0AZrThnqTlX1WhjqxKNwtuwcaEps/uIV93/O86d2iVyuJfO5lwxVA+wjyYIleJSWVgg3nErgUo+2aHbl74WdhSGN23K7xpbkGsLhZwipc8vnxlAv5LnUasefBo2nnWgD9jMVvle9Qc58Ry90sHqWi/qtpn0hIzhWKusISfTBRRJusixE4mxPTYz0hw8O55oH4eg8GmhiJp6DipAuIHPFISzlAsoIh+331XuA8mIryxaltYNFq3B5Zchux6FeyMI4NRdJ2ypdGcGfKkWT7YWxeHBGcclRLbigA0/qjBEDRSg+93lsWbcpFkoot/IHQVid4WGailxrsXT/RsmcTWPB3iRGjwsLHV8KN6EOIbdKC2dinKQbLMhH/YjYKd2NeblDbOBv7/UwigrPDAmwSBvnKVCryPZdzdNxmqYH4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 20:jgLkHfpDb7RpYaRcvG8AIaVPyAiXB/Pj5LERoNULoFc84KBepucHNegHfjYEwnsa8rw8zpwjDPRsy33vjPuZ0//GhB5wh5KlOo5imhQlrnJLNxdWBhwZh/CRTU5j1cIFWrXTT5KFxied5ScVGPvUuo5esbiGiEckU7X2twk2tX76lQeaEsP3YmKO7h9kwzF+1SSa79dAVPeWJtwg2Q6HeRrhDeuavZ+/vxsc/bsy+1PhSpG5Q9UlIIaxexdj+bdZWXA7PrBDt4owmavsyoJem9C8Yri7U+bVy8ivylD+e3PsKbV6frf5/HqzDOOH2fVWAEDt4M6MecP+EKdIkgTnjVIa6VtE7z+z3AK8E70jUTcGKb2mvWaa9Oy+yB5Wq6D/F6Rk2J4viLq5w5NCdUOVclnRWbPOrH1FRfcaTsA8MSGOs0OxmADTJlusJkqus0JPyqz938OUoJixLHjey5fAU7vZiF7o8Seb5ux7NK4nzf0FAcEE1KUvlsdivXH+1iCSAJ35DC3oYTqyV/XywKYW/4uRZ4eLGRKetbw5E+VzgWBCCFfQTEF2Qc7yBfj1zo1pKzrDzIqmyIva7VyMKZhw3CCIUHv1/HUR8RE65c6eUMI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BLUPR0701MB1713; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 4:8D+5heHCJJQLczRqVxode/SbWzdaSYxsODwDdNb4TwYY8kA67L2AAoazqbgfeVcL+2jzzqnLFPL5dU9I2iqBhHdPBAtFjfPSUY6SOzV3izCOG24LpqEpJcPX1TYso0ehMbbDJc+EaUTp907l7BxfQG5O2xFaFpq+m1JmfSx9+TejyOPgnuVWtHnSnpAbOK5n5xhgPjyGq+cihQYMfRWkGUad9fSRy+9PcaqZX6MtAsnkPpxFkwOOwH9QUPBC8I71brvThFHMKscginRmLhuI+n6dpKdoDs1BoHr+zdZP/XdoRqPe6sJIbFdtPSlJC7hcBSoDKEFtvSemncT2XI9WF+NezYekuCN0LfANoWdrupoynUAe9UVuMYBiwM8/GNfY X-Forefront-PRVS: 096029FF66 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(24454002)(377454003)(4001350100001)(586003)(3846002)(6116002)(42186005)(110136002)(46406003)(33656002)(2950100001)(1076002)(5004730100002)(23726003)(92566002)(50986999)(76176999)(54356999)(4326007)(77096005)(83506001)(47776003)(19580395003)(19580405001)(2906002)(81166006)(61506002)(9686002)(50466002)(97756001)(8676002)(189998001)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1713; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1713; 23:uFwdVjzQEMKrjC+g8k6NKKEVHSdiVx2BabgkTwE?= =?us-ascii?Q?dNYjtYch+J3wDY/en25d/rmGovMMPKu5GVPezegruib5wOUTEaElD32KFRn8?= =?us-ascii?Q?8yxBCsDuS7PK2SS+N/olfF10Tw7RTmiUs1x74UbcdNyh65KVxghRh3Ar5X7d?= =?us-ascii?Q?XAuFL9xrBBlQxovhk5ziOtQXLk6NBC0H1mDYu02Z9a0ZRSjruOSkp28UkjIc?= =?us-ascii?Q?bL91oujWZvCh5HJcJ2olV3JKcI+VYNGAN9FkfZY9ujcuQkbL2/24uYbfEYWc?= =?us-ascii?Q?+ifKwwIbS8yIXeviBJZqTBgdAnc91t14x/CqArvrv01jQXoYFwtfvzconwHY?= =?us-ascii?Q?tjnOSWbAItFkINMAg+k5DkLvV5n+8WOxrBOdCI5azjSkeblKUJOieEQ/gaKC?= =?us-ascii?Q?NackdNUUHfGaYguQbuwGY9S2whfGIZBEVGJ2JUCHMemVuUJ9ZumjDvNxFmDD?= =?us-ascii?Q?SFCLtkxTAfrivtENrjA5MaL7CTk5HU3y766Fvn5056S7mkcjAv1aBtZJ4J5n?= =?us-ascii?Q?h1i0fRNg61Xt6l5rQWWFVdRTdAKlhp3m0hJBgWjgwrbLqmo7T0fCqHENFCuJ?= =?us-ascii?Q?b3v0xs45fJd2JcBKxk/qhgxt7xeY/+lEphzfS85//pcVD8ujwPA3yuXbnGoC?= =?us-ascii?Q?DF+WobvQJEqIr6DRxCN0oeJFimfghPL4U88z7qqsnJLuxllXnYiJuzmFNgV5?= =?us-ascii?Q?xhco7K5rPBuvmlvoBjTEnG/B4qr2OJGC7M/0A3HYpzvrqxEMNk/sdn89wTQ9?= =?us-ascii?Q?CA1m+xjA0YLIYQfh51fcLrY3bxSDdqu9olYfjrG78o4VBz3EbQm48ucgpMPT?= =?us-ascii?Q?Pnt5poOAhgtUFV0HNd+1nKI8SosIVTMjn/mrVl4k8wOIc/OPHRWDLQ+pZBuT?= =?us-ascii?Q?Llk2PqkL71bwRxG9WGYfLBm/tmX1FE7XuCblRy3Ic4eMRl9RKC4Xcl7q+hHJ?= =?us-ascii?Q?/cM4ZcHu89CBha9pj8kkJ2I7wayC5xjCOkpD8yN4R6Q=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 5:9XvH2S9QMwUNjUy8o1DorOUls40zKfVaF062/4MTouDLKpVlgNPPSfXi+GNaWQ6OFuElVZLD4sW7WUBwQriEgtIfX9JkTkHnlrPIdmq9KV2PyOD4IKR0UF8QQlZSA/IDqZ4qbJniS3PieE5uVKIDrw==; 24:DhKuqFp7VvuvRcelhKFgdUVYaWSz+UuE+sTjRhuXT0VeMKpbKenPyOGqB6Ye70bDmP2BLcNbq+nhQT1P7+rgUvxmllPEtW004X6KgJcVpug=; 7:B+mu37uDDlNbMDtPHIPEOmeqPM/H1hWUb/B79WgY7yTScQUktsOMe/ieG7hs83RuUhhE6F+T+eV34CX6HF2ZGPmhP1MSsCRyayniKC7LKOMms1/gfvjLGNS5X2bTb9bcU7NI4m+DUikdut+Y0JLn9oWIeh6iAMIovhOVOXmRPsmhYKstVQwXCNu74ucEU31a SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2016 06:00:54.2644 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Subject: Re: [dpdk-dev] [PATCH] mbuf: extend rte_mbuf_prefetch_part* to support more prefetching methods X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2016 06:00:58 -0000 On Wed, Jun 01, 2016 at 11:29:47AM +0800, Jianbo Liu wrote: > On 1 June 2016 at 03:28, Olivier MATZ wrote: > > Hi Jianbo, > > > > On 05/31/2016 05:06 AM, Jianbo Liu wrote: > >> Change the inline function to macro with parameters > >> > >> Signed-off-by: Jianbo Liu > >> > >> [...] > >> --- a/lib/librte_mbuf/rte_mbuf.h > >> +++ b/lib/librte_mbuf/rte_mbuf.h > >> @@ -849,14 +849,15 @@ struct rte_mbuf { > >> * in the receive path. If the cache line of the architecture is higher than > >> * 64B, the second part will also be prefetched. > >> * > >> + * @param method > >> + * The prefetch method: prefetch0, prefetch1, prefetch2 or > >> + * prefetch_non_temporal. > >> + * > >> * @param m > >> * The pointer to the mbuf. > >> */ > >> -static inline void > >> -rte_mbuf_prefetch_part1(struct rte_mbuf *m) > >> -{ > >> - rte_prefetch0(&m->cacheline0); > >> -} > >> +#define RTE_MBUF_PREFETCH_PART1(method, m) \ > >> + rte_##method(&(m)->cacheline0) > > > > I'm not very fan of this macro, because it allows to > > really do everything): > > > > RTE_MBUF_PREFETCH_PART1(pktmbuf_free, m) > > > > would expand as: > > > > rte_pktmbuf_free(m) > > > > > > I'd prefer to have a switch case like this, almost similar > > to what Keith proposed in the initial discussion for my > > patch: > > > > enum rte_mbuf_prefetch_type { > > PREFETCH0, > > PREFETCH1, > > ... > > }; > > > > static inline void > > rte_mbuf_prefetch_part1(enum rte_mbuf_prefetch_type type, > > struct rte_mbuf *m) > > { > > switch (type) { > > case PREFETCH0: > > rte_prefetch0(&m->cacheline0); > > break; > > case PREFETCH1: > > rte_prefetch1(&m->cacheline0); > > break; > > ... > > } > > > How about adding these to forbid the illegal use of this macro? > enum rte_mbuf_prefetch_type { > ENUM_prefetch0, > ENUM_prefetch1, > ... > }; > > #define RTE_MBUF_PREFETCH_PART1(type, m) \ > if (ENUM_##type == ENUM_prefretch0) \ > rte_prefetch0(&(m)->cacheline0); \ > else if (ENUM_##type == ENUM_prefetch1) \ > rte_prefetch1(&(m)->cacheline0); \ > .... > > > > > Some questions: could you give some details about the use > > of non-temporal prefetch in ixgbe_vec_neon? What are the > > pros and cons, and would it be useful in other drivers? > > Currently all drivers are doing prefetch0 when they prefetch > > the mbuf structure. Some drivers use prefetch1 for data. > > > It's for performance consideration, and only on armv8a platform. Strictly it is not armv8 specific, IA also implemented this API with _MM_HINT_NTA hint. Do we really need non-temporal/transient version of prefetch for ixgbe? If so, for x86 also it makes sense to keep it? Right? The primary use case for transient version would be use with pipe line line mode where the same cpu wont consume the packet. /** * Prefetch a cache line into all cache levels (non-temporal/transient * version) * * The non-temporal prefetch is intended as a prefetch hint that * processor will * use the prefetched data only once or short period, unlike the * rte_prefetch0() function which imply that prefetched data to use * repeatedly. * * @param p * Address to prefetch */ static inline void rte_prefetch_non_temporal(const volatile void *p); > > > > > By the way, I did not try to apply the patch, but it looks > > it's on top of dpdk-next-net/rel_16_07, right? > > > Yes