From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0073.outbound.protection.outlook.com [104.47.42.73]) by dpdk.org (Postfix) with ESMTP id E97DB106A for ; Thu, 11 May 2017 12:11:16 +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=fCgy9nSqQppBL/HpqnyY4hcT4JJ0tySADacc2gmjNkg=; b=MhQyi5qET8DIQuv9610Nzq4yvlMSZX86cz6SYAlQ1Jm+imPeeQU+iKMvyHJ7YeYjlo7VnrtI8lPaeJjifAJkmhtiGxvI8QkWxkKrCStfe2jSybNmE6USmG6+XSdtBfDib7oPavhK9w66HJ5TsfyiiHwwvwVX4ZqDXjzeYQLEYzs= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.domain.name (111.93.218.67) by BLUPR0701MB1716.namprd07.prod.outlook.com (10.163.85.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Thu, 11 May 2017 10:11:11 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas@monjalon.net, jianbo.liu@linaro.org, viktorin@rehivetech.com, Jerin Jacob Date: Thu, 11 May 2017 15:40:41 +0530 Message-Id: <20170511101046.26456-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0070.INDPRD01.PROD.OUTLOOK.COM (10.164.136.170) To BLUPR0701MB1716.namprd07.prod.outlook.com (10.163.85.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a5d92c97-dac4-4ccb-49b9-08d498560dcd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1716; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1716; 3:uezN3bz3n3mGrQ+eHhaWFvMKGbiY6HyiO4T+rTa1FBhNpjtn/h67Qp9RCQShfSZSasKjMGAEcfbGddbeIyY50oFy28qru804pelC1BKiJkqNZNUgJcp/920dj6jDBWaLdhNrOZoAQfC4+83NCr7uz8bjNpbWY7CkOQY6hRwKgq7lpz8BE9k+TSDfVEtIzDfY8Q6JdSInzRu7ks5A0kQXsTO6aap2Q0RNkeo+RaCQLiyO6oG1+9hy43aIbNd30iPOjhBev8xq/tENscsYqpR8dl0PUBY5rpqgQ+l3CPV17e2io0evRk4UGmqUM2qd/EBZ4xCjdE10KmhLBt4HxgB6nQ==; 25:UGztjjFHukkkGbkhotdOb3uRbPppNOWDoZPixefxeIVYdS90zZWoKaoqzw4JLkxF2SHTv4NqO/ozxQ6Bwx7UsBcbrT4hEUeAlxQYkbXEW5wvZBwsBHmxVLiM4d0z8w+2uXP+OBp5aWLDq2Mfs1JcIwRkbjW75BK8BLQPtQYwwx8l4RboRgRETCBUKw0QHACSut/VsP9WkpKtxHUooYXAVs+2FHHYW1xHrAfyfPZSNfmK0JEpGKg6KmUKanjq+jBHxjO7vE/UonMX7IYsLgandzJ4yoeNIMDY64rt7wrWgydsgocgiyZvNrP4PxEnMiUChdHRSMaWzktzBxFntUlBJcs2QMCfhukem4nP57p5bwzoEpWW2a0EOtdpJ+qvdfA6vKxtZDo73qfBu7K/eN8YHmN45oW5y093cbdbnYoeGZ1MFso3SKU9RJy1SC258JYF5x8qJc0ALJzbu5ROi8IixmscJXPhjwa2t6K2jyM9++0= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1716; 31:QtyqsIYjHsee0qLxGR2lbw3+hPb9GAqXwlFCqKweW4WQZa6iiAjKYRw901XSgq13Qln/g/eUaFO0BzM6n8YEISb9N8YqZMFAZT9hgKIaoNtY/6Pr1mOtAyEAPDaZtXGZtRGePI9RyaY4OTRfC+y1MTyR8UfTCM8dlXHpTpxtP4PEmQ90CTRx3FBpaNg02ek3Oxuth4zObhe4bW2FbvBzQIN7Hlvj3Tc9rrwkEiHk0Xw=; 20:Xq8OJyXXq8Bg7vV83qe3GWDP0oiaKYFb0Qf2SnJ4GlP0nfGE2jNK7J8U7aHduKfUwL4ri+J7Qjji2Heg95UZtP+PIluUj3UGpXP9QSUem92vjEXxJwr8KBaqQr3GKgYkKFlR+B6mH2gY3BPkEByWpq/zaBiQqTdzDrxK+zHuPBGRQPG2MkktZmsSifthuvsbX8iNby3ncnVwrtVmATnI6NvRiuSZW3ixGqjnrwpl7F3vewmZbCOFWpGre+9MNm/WYuqJ0E0UKrwolmJDEwNtG0u1IAz5pNb+MI0UhZZkq0Bx4J6QAK9cIjvlPvcclFm5h9M3MGITqN5OyglDSaRRNtqbGrQRqO4JDTHCKSTn49pubPZurxJebVa919hjaQD21QnkHd3aS5YA9Mw9yGs9AiGvZkit2qGb3S1vclUrzboRyC02m/svFgd1/1oaf1LXXTp+TfndU+TqKUu1GuCl14zUZRLEdYAq0WjsLDyV6J45BasP6+2hoNHeXSdyUtNj3GoYR06WXQCLZ39d/60iYL+ihaNvjwoP29K1viC03aw5ergV19OfBTFriuklSfyLIlgqrgCtHSUfM3qw/+FOCi8u4q64WRIZOO6kQb+A/Ek= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(10201501046)(6041248)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148); SRVR:BLUPR0701MB1716; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1716; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1716; 4:8xaJeg8pDsKMgd1JU756VIVDlLqCWYQe1KJssSVw2nXHBSN1xXv8e9NsN5apxochPiCjL1K01L5eJf+l4Euow//5h2F+PsN9qnPz/DJsDLOFubkANJ2MTnot9TjVQWEsyCLu5GO8nTQbnAnSZTnpN6LDiGZM8moUX4Vhv92Sg2fVCuFfCNQkh1QqTmYk2cPrTWVi/RDpJhVfFlInxAosXHmxPhhe1f2brpqFYHTLyOUWlvdSQRc3PLePRslyKuHYmLYOxJou504Em+m7NGS8EcCvxwvnkOa9rOIFMcbEkTrbJ4WtlbDjW2pctuhO6iVvXnCh69/7l9JIx/k514C6n3Jnw69VZnmAbq/6IpP510F6WACVOAlbmqhA4cyeGvPsDJdRtrQLo4/LcDJa5V5Xk2q/rd8ekXPc4azNKNr7XuNC2maHtdHr1lzJwk3Nh4wxYBMeBmjGP1sPvCWCGCr6hxRPcDTHaJdFFCGCscp2Wf/0ePSiVWKW37SoEqdBDUPTYaqpV9I0qLa4etsR8ojzvgwYh/m/RABqS4XjlTEIAXDZMQ2VTInABq+Cm3P+gNw9Gm4Qzs3RyO5QvsCUQUbPVc2p9534N/u3DTfB02AoY6vks08gcQivIoIHKDB33Sfc1yQbYy+89in/cIKgv7Y0rJv5uQMAjl4+++YuN+WCdknbl/eIRiSbs/QbabH5vBi3mCUyJtYxtqUJcckCu870/a7kuKx5q5WP8oW7kMg4NeqylKvdWcnUfQ+WcoGwGkYD2RkNfJ7alDiwtohlm1tVug== X-Forefront-PRVS: 0304E36CA3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39840400002)(39450400003)(39850400002)(39400400002)(39410400002)(5009440100003)(2361001)(3846002)(110136004)(2351001)(478600001)(107886003)(38730400002)(189998001)(25786009)(4326008)(72206003)(6512007)(36756003)(53936002)(305945005)(7736002)(2906002)(1076002)(8676002)(50226002)(50466002)(6116002)(48376002)(5003940100001)(50986999)(66066001)(6486002)(47776003)(33646002)(6666003)(42882006)(53416004)(81166006)(5660300001)(6506006)(42186005)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1716; H:jerin.domain.name; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1716; 23:fr9egcwQhuySU/y5A40jToU2XZFieTt3oCMPA+u?= =?us-ascii?Q?3fnK2ZT2LsuUsGksjY3ZlRZsYsVOrZ6cfmvlpBQdFAecmEx+86X3i7ljUYUZ?= =?us-ascii?Q?m+Y6FHK198j1xs8ei1vmj6jxTATI9OXn+pSJXBIOtyvzNaf2PFXD4+5XGE9F?= =?us-ascii?Q?QZsCeUcxHFR3PZVSQrS6uYuOffgdaQiESJPvl1K23xKu4dM2VOTGI3U7mm8l?= =?us-ascii?Q?CcsVVOACPpbHyc0iOoRWxoPLaZov1AaxglaGFp7hFm4ZwEc2TJ6n5csRs7yR?= =?us-ascii?Q?hPdXS6Vj8UbRCC+w8G1bBw3QjUuB0MIqyqSQAH6JxIu/rGTBYt17hJm2ez6r?= =?us-ascii?Q?9Mbgb550VzzEWMmlYMIUeuywi3qFrOBNDvcpUgwtoooGLY5v9GudTkxLXdsn?= =?us-ascii?Q?hHDrT0QlSpL50SPAqqbZ9Zn3lUUNasXE+1/TKQKhObKjaMnlr68uYzp2wqgw?= =?us-ascii?Q?n+u/TQn2SV1Mr2gLTsfshns0+oJCiFXqJZc64GTu1XVwE5PmvV5cP+gJd3kh?= =?us-ascii?Q?FQ1cr1oeoieo2zajv1I9LSzSh7Ck4UQ5RQbeX8E467S7Go+frNmKDnadz78L?= =?us-ascii?Q?lBksBy/sQUQ7CW+Piy9N1uuGabK9P+Wp/g1YuZn8b4IS//TZpQegvupWZPnT?= =?us-ascii?Q?gDx2YUCxLsi/Pkl7Lv8ymTBTnTD6zxjEXbhg7tq/hL/jodlHiaEX2xbNnHbT?= =?us-ascii?Q?/jpMV4wxW0ouqneiCU03B8ts8ESyUhGZAOa+V7v7ky1y0QLzpwHo/Rsz7ipn?= =?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; 5:ntJ/8IH0/F3wVTfd0XInuXqx1nQojLCZAAW3rzfM4OnQm+obHBG6IJIzuBkvp6QHP3HW9ujGNx6ERTKZn5cl8oKg8L4gIz85BSq+15ps/aK/wTiaKGuZUFYy6BeJpWdQmdJGCDVbZDQjTBuE/5vTwA==; 24:rJcovXYbKPyCp5Gz06SaDEyOWNa1gqYAQjrukodjS5txdeqj7MX8f8RRoJjBBbk5Lt6Y46GHD1aCn9vEKKYKEUq5az6OPPke+3efzJtAbLE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1716; 7:Aw8qjhgcRj2Gb6vjoUi9UcEYL/hTuPRs8GL6qgQYmeXgW+Uqv+CajxyO1R/F4t/TbcjitioUtq7VUaTbfUz+byVNyg2377wRDpkdq/x5OLgdQ1OeeU7pa2kzQKywA/W2EcU7xreXoFNGg6v4WjpwaXIycU0EZrAMXpBu2ZUYGq1gl655tyaqwe3mMvIOOfQaFSAotZxgBK5iAOdvuPlX63Y+IfbrEit1+1xKXfjqt8+pFTrt8YgkY9XLBiKOmVX1wE8MnMYCvg/ev9Wc+VogB5X/9csIe7UkONEqlZOH9pX+jcKNy8bMeG/zjxBPFZYF9oqQ6oyd4AXQChk4UYRQCA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2017 10:11:11.1311 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1716 Subject: [dpdk-dev] [PATCH 1/6] eal: change rte pause as architecture specific function 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: Thu, 11 May 2017 10:11:17 -0000 Each architecture may have different instructions for optimized and power consumption aware rte_pause() implementation. Signed-off-by: Jerin Jacob --- doc/api/doxy-api-index.md | 3 +- lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/include/generic/rte_pause.h | 52 +++++++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 lib/librte_eal/common/include/generic/rte_pause.h diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index f5f1f199f..a6f3fedd4 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -77,7 +77,8 @@ There are many libraries, so their headers may be grouped by topics: [SIMD] (@ref rte_vect.h), [byte order] (@ref rte_byteorder.h), [CPU flags] (@ref rte_cpuflags.h), - [I/O access] (@ref rte_io.h) + [I/O access] (@ref rte_io.h), + [cpu pause] (@ref rte_pause.h) - **CPU multicore**: [interrupts] (@ref rte_interrupts.h), diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile index a5bd1089a..fb1e2aab6 100644 --- a/lib/librte_eal/common/Makefile +++ b/lib/librte_eal/common/Makefile @@ -44,7 +44,7 @@ INC += rte_malloc.h rte_keepalive.h rte_time.h GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h rte_prefetch.h GENERIC_INC += rte_spinlock.h rte_memcpy.h rte_cpuflags.h rte_rwlock.h -GENERIC_INC += rte_vect.h rte_io.h +GENERIC_INC += rte_vect.h rte_io.h rte_pause.h # defined in mk/arch/$(RTE_ARCH)/rte.vars.mk ARCH_DIR ?= $(RTE_ARCH) diff --git a/lib/librte_eal/common/include/generic/rte_pause.h b/lib/librte_eal/common/include/generic/rte_pause.h new file mode 100644 index 000000000..9625e580c --- /dev/null +++ b/lib/librte_eal/common/include/generic/rte_pause.h @@ -0,0 +1,52 @@ +/*- + * BSD LICENSE + * + * Copyright(c) 2017 Cavium. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RTE_PAUSE_H_ +#define _RTE_PAUSE_H_ + +/** + * @file + * + * CPU pause operation. + * + */ + +/** + * Pause CPU execution for a short while + * + * This call is intended for tight loops which poll a shared resource or wait + * for an event. A short pause within the loop may reduce the power consumption. + */ +static inline void rte_pause(void); + +#endif /* _RTE_PAUSE_H_ */ -- 2.12.2