From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0049.outbound.protection.outlook.com [104.47.36.49]) by dpdk.org (Postfix) with ESMTP id 4ECEB7CCE for ; Mon, 5 Jun 2017 10:59:18 +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=XEjcps6NrtdG7bGQLy5MtrQ3dBGK/rdf6hVAglE2A40=; b=Jvwc1g5GV00bQbABM7PE3Bo2pJTto0qRVn5+dHXUXVow2Pa9Z/nV1urtMPycuhUqCgf7uFPIFBppmMlP3qprGEwOU3092zmDlC8mlyGOazdMwOu2GpY+nhy/kjoUQxaDuQ/B0TJO4s8ZD+GYmCwFbH+PHTQXkeyJgufJoK15DHs= 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 (171.76.74.1) by CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Mon, 5 Jun 2017 08:59:15 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, Jerin Jacob Date: Mon, 5 Jun 2017 14:28:38 +0530 Message-Id: <20170605085843.16696-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170511101046.26456-1-jerin.jacob@caviumnetworks.com> References: <20170511101046.26456-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.76.74.1] X-ClientProxiedBy: BMXPR01CA0026.INDPRD01.PROD.OUTLOOK.COM (10.174.214.12) To CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0701MB1726: X-MS-Office365-Filtering-Correlation-Id: 9c832f42-74aa-4d40-0a69-08d4abf12570 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 3:RLVvAn3golsVS+xx/7jjM2hGkB6mH/8g5R0kY+l6tSkkBd18RG3mtNKOmkY6f33F8Q0rcta0yD8C69PplgRZYenww/z5RvGgGRXPjdmTdGxlO7dPvpksslODsP4QJJLX2EXX3aTKC2CnG2NTEUgT1Gmi8kfSgehK+gDi328rz6Ry/fFnnPy9aKEHWW0l5yFS9y+S0CVErQIRzTLjZ9VLfUAXt7jtW3Y7rNx4BMWiRzKeNVPY/NxJklJ0Q9evlKQZ0SH+e7d4zz36xg7GkIBVwOE0HJUwaXXtVzwRAy+B4VAnUHXlhX75VfbxACIgCLIt5q7u9bMMgcU/L6hHTZrEhQ==; 25:R8nb+op65+7MZL6MJd9oIiVz0/qpk7jbwUZtbqUVVFrSmv4AY8Rx1H2j67ZY1tULBcw/X5sLUcqOTKCHJAMjnCDaEU2Pvzbeqiy5gbL0A3FYBjLDqrqnkh1rUTVmB1CfC8HhARq0qv7BUjg1UNZlU0+9kvRJbn0vnjSOKIKQnooUqXPMcuyPUcVGNNXIEADTGHMQTF1IEg6M9kYjcK9LQ2DCR0s+5CVy3u+PebtrpmscVKU4kN5bQjvEKJaY5qsCUlkDE/gVL+IaOA/IAAJghJGXiRsgG+61la7QL1kbNjyHGGIw9zp8vpcJdEwY4dful+veFchntIiHCVD3BF4CANqH/edIg/snwmL7Paj+ZSEMuEsqcjFEVWNum2nYsQ+iJsyYi22eMmZNVI39SyWIY8O8XdgcajGt+pO0XMq1Hb+Gc7RlYUA8liAlKlD/nN4W32kygU2sGqAMe8wMUYmbAmIbXCn5EhPs7BaiiYoWTiY= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 31:24vngbO2na5zlGp4bUegZMPDYMmx7FiEQXSgo4BGCMM/ZBsKu2T1fNsnqjz0umVV+OD3GuSkNMAimXCULIoW9+QS67M1tTBclEy1rw5L9C6H0LdjD7hSt3Y2yVb+7Hoay7ygvQpviZeSups5tA+HvuLq2DogpqWvHr3FAh6MG1Cc2F7rRKNttRDja4jPOXb/ckuvfh04k7b6HeMZ4xkZoag+gk8ll6bzlNjRAwrmvjg=; 20:5ADkFHWGDd2FPFLaoosEjyYUuDzqn/SKCit2CUwX5i17/cRY+fhoAfvDBKOEP3HtT2RNsfTLnlC3FkVdZ1bLlgMO68M3Wa52fbjNg3sEsKkJpXNNgpRIJ9ib+eIdH+bzF6PAPMuxUis9nV0ox8ilb3+I1ELZ3Q8yuiZkjaE+vOlJtfzzp/fpb1s4Y8UUmLtF5jSWE23nFhyRi0NpHoO/B5XN2/QW/t9YvNVm4e1H+zUkY0TDjkYxVTEJ9Wr7+FWZjTqf+/rMZts9Rp21KPUst00DFyjUEWo86v9bXjy8xYc/Dlxl80oRIBu1YUIpubp7JHdt335XHvYrDfF26u7SfpgELPxXsQQnvNHN1Mi7u0f9Y+XQjFQgKTDSyEO0yQR/2h6Abi8e00h9ITFClqubz52sWnxfuNlBa0ZlGr5RQuB9lN0p2JV8Y5eZz9kHolNPdC0F99pa27dWUVVg41Iv2n3AGNaHb7GnuGAubippf/zeta+2caaL1TYIX8KTVIK/bZjnjvvDmbQpjf6oiq2v2OBLQYINISBw+189onvhgy1/qn/Aj49ssJmVlp6dkZpjEkXFP1/kgncsfx1Qi4ckw9eDeEjCwHjUyELTHXHMtrQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123562025)(20161123560025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0701MB1726; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1726; 4:CGkyyBjFicdSadDi7YS0SaF7PNPe14FxnNvenT+U?= =?us-ascii?Q?CYIQdHj8GymujgfGFY6sI3o9NauW+h0Wd2fMNaCrDPQ31SEQZgz9VGR9wRvv?= =?us-ascii?Q?e1Jqb6SaypK6rEAHTK4l/vOmsvM8RcxZ0rHojWGFx4Qm9Ymw9/ZYaGDDjijb?= =?us-ascii?Q?Ig7h1CtaaaMZ03eakvXt5e9f84uLx9ee1AYaxRwmv/kXUE4BT9g/Ghe2hTkQ?= =?us-ascii?Q?uh+q0jZMFeRw+TvXjV5bH3gSqYe2Apa99e/XfQ/LprE8TL3ALSC0C7WydE7P?= =?us-ascii?Q?8PWttIzbnIw2ABmkGhA8mmo7+ZJjrynroo9wRWv9dpuo12VOECf4zqIDoQnd?= =?us-ascii?Q?Sf4oEXvwe0u5kKFzVDxUokiiSJn1uy773ignl7sbhghR9vJ39cbqu+uL8FsX?= =?us-ascii?Q?cLcLtXkjzrzok3TyGHp7gQx4ozCgPcVRpMleTNCqxXqaTgA7TNrSNqBV38m8?= =?us-ascii?Q?8IqOCTDZVcZKjYkRcJ6zMX9PS905BtAx3k04HV1rblBKptqDAiI2LGgGVHTE?= =?us-ascii?Q?qgJaBs61MlYDFR/S2XVvhdPcgq7tmiRGk1rj33E16oDKOJOTAGsEBHFg8fug?= =?us-ascii?Q?J+NYf+XrvI8+oRtqdXQ+YpXFgaoe1XBrmwdzJSQyizAAo78kOepILX+7qAoj?= =?us-ascii?Q?RmLmuMUwyminJ8HWUCJXalMgxjE0cLB24xMYeWfB5E2fEJBnssXGxWRC2L6x?= =?us-ascii?Q?/T8lEzk7UNLJy8xIsizQespBaMdgjJLcGME/cUmrlWt3fznG5SIcNUwuI3u5?= =?us-ascii?Q?/Ln1UfSZeFA/F77pnkR+wT/IdMCdwxClTcCP7n+IXKWl0T1O4VXde0g+QJUT?= =?us-ascii?Q?0LZ9QP45qjli1lX+729PSA9a3tV3pKqzxqdct+pAGqKN6gSoOrBH6W6fbz4m?= =?us-ascii?Q?RfiiYeZZ/bQoioxPAZ1DHLBbki4lWMIVmBr7VphSRYNsKaLKWB3t6oy0T1B8?= =?us-ascii?Q?hgykA+ybzhL0h+8ckksSBeYgu46G4Fp4z+AGZhHIdHQYYQ6GUMKA+bGoNiJt?= =?us-ascii?Q?IBgzhQIZ4esmm9cIAEjzH0wdSc+GMPNonkkd+mi2K5q142HvQSf0cl6YpPbv?= =?us-ascii?Q?hAsrL9M9UPCUVzT/kWV3sMCCoYdAmekQrJK4vdXaIpZRXZcONz4s2Zlos6xm?= =?us-ascii?Q?GkIwfhP6laM=3D?= X-Forefront-PRVS: 0329B15C8A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39400400002)(39840400002)(39450400003)(47776003)(189998001)(66066001)(50986999)(76176999)(2361001)(2351001)(36756003)(6116002)(3846002)(1076002)(33646002)(5003940100001)(5660300001)(53416004)(7736002)(305945005)(42186005)(50226002)(81166006)(8676002)(6666003)(72206003)(2950100002)(42882006)(6916009)(478600001)(6512007)(25786009)(110136004)(38730400002)(107886003)(53936002)(2906002)(6506006)(4326008)(6486002)(48376002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1726; H:jerin.domain.name; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1726; 23:1PzR2E4N2l5K5bfLOE9T2JirarhpoH1lEYflqaN?=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6EiwFUc+HgZddT0214DD7dw5B+kpNA4plhsBotG2LTA9esQYLI7kmbs+0VNqRjVEqN8pPF2tE+8LUikTIkKEzYLrYDhPoF7CHswU7y3sYYXiADPA7AoGfjq/lsqXsfQygjditvrDhK9aSba1+pIOqVmCOCwYmILoZMZUHwpLk72Qn0Fbi/X1LKPbLAo4ulZCyHPD5gyDYDi7t8dcHc7te+IIDJg7DZfNB/pQE75QTu6xG2MVE8jSxgN2IP3DDSuMbUARsFfLbfxLYt+AxxKMLDI8StLbdiQx2V87wuEF7kKS9c0K/+MNXhSisPUGwLdvGfr/YQrenEx6s2M8wnFn; 24:CFeoW3INl1h4Hmb3k6TTueFtCla4O55w1WCSBsp2BE4z112tFi3tcnC3Y2vb8SJbyXvdKTNfTHyliGp6Q8OIbKmQ4UpLLtYG/BlvAkeOwEM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 7:yELKa1QhoEt4VLL89PuY5r1hTnwdZFwFO9a444ZLm4ggApZM1tskHRELM8oBDxlRYlxpYzb+R0EsTo4HSPhxX4k9WWu+pQLlfSn16nr0DgTpGPpecKroC26IQPANiO2EYM/v/BAvpG/4QWo9lEEQ6sOT+oon/0xEmym7mTvsjs36xOzOPVFMMTykGNbpQrbJ2bObYHa6qiCQ9g6VhkYJqCfJzSY6iXmwjFCVSaY0+lklBZ/i8eEgviyLjL6Djt+XkgJAG7VI3i1fpnXfQkGLc5aTln6HQQveFjY7OBXH4Rp4dRPnVV9+n5YUhPL2eL47jJL2817xT0Dt8g3CxE5HnA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2017 08:59:15.1524 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1726 Subject: [dpdk-dev] [PATCH v2 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: Mon, 05 Jun 2017 08:59:18 -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.13.0