From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0053.outbound.protection.outlook.com [104.47.33.53]) by dpdk.org (Postfix) with ESMTP id A9A76F63E for ; Tue, 27 Dec 2016 10:51:27 +0100 (CET) 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=AWJD6tt5V9QcMaxxB5JxhgxutWnOhFqIkK7vbKvxrFg=; b=ez6xXgqmh0DPkU54O2avPQEd0tTcPvZJBvhwpA5J+uc3/2YzyK8tRnXejlrwxGAI581yKlzeUfEZIFXik1daZyY8tAFWU3RxhMWc/OrYtdoxM0WcAP9z8u5mKG2FquSI5H0/Z1zG5t+Kj4eMlb1zeMhZ02d58EWZhczVtvCdAHY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (202.83.56.97) by BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11; Tue, 27 Dec 2016 09:51:21 +0000 From: Jerin Jacob To: CC: , , , , , , Jerin Jacob Date: Tue, 27 Dec 2016 15:19:17 +0530 Message-ID: <1482832175-27199-12-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.83.56.97] X-ClientProxiedBy: PN1PR01CA0001.INDPRD01.PROD.OUTLOOK.COM (10.164.137.8) To BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) X-MS-Office365-Filtering-Correlation-Id: a3b0347f-877f-4b21-dc48-08d42e3deb87 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 3:rDDiYWpI6jxLlNfIPFG4jyyIWgGMl3TQh1NS4KM44JY5d+MppLFUooXjwq/uVyj5W/O+tWeFCfYQSCThFs8U95eQyWxlibE+kFOuGPykpTa0gRVqFWMnGUqzTR7IdA43o7bZcDI5Kz3Y7VZ6wWJI3ugF1nJYTrW6becTEkXYv0vxgnYwFYgdICpV/kj+BVEU2AR0dpUtPdzBuzcgg2NYk1F/ICej9PV25Wp6W29/sX30KaeI1PIdjo15MubEjv0ia006G07yyqyN+3tS2BPZRg==; 25:BwzfUvyZw2o1Xy6kWXn2QzGCpOtcJP508WrZm8qlZoxVSN0HY0lRUyvw3LcQ3sx1QnQOHiMJUTjZDGq9vZwM0LadsB5RSaT+3GkUPCtIEFLWy1moGCBr8wAtX0W7vrFCEvqryVw/DvkJXaMgwy4CcSJ88Yjq1oGIuu3duTXNjDXsFAk3lu+UjEMef5PTJ1n/lfvhpurvoupV1x7YipCCaSFTpcWaiV9eEuMu0cz/SK/jTk6vczX85srgI2aVXsD57LKOfeGXqxHsTnletw7kovKDksbQe+jDDQXBQqPAbE7OQA2CfFRBS0V26fWRt2Nk7g/G2wjjZWCMtnlf6tisA4kUMevIpHMSJ2XZjbWz53riIhJ53f7bwgjPVDgscfYckAtVs0Uu6K1bsYvh1aKemla7CT/FMhNS3oh/BagSNRDWs1QPkhuFOEXjq78c+9orTqENSeIEZhCFNHdOtUChmA== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 31:0O4mPqHqO457VR32j8PXioem39UhagDu9oBrmmSHzIL6eLTo16FZzXGKfoAoxolseTPAe666oLsmb8y6b0zaQa8ffrKbm42OSQMgADjs2sy08z8AEbfxs9FL5U6KhLMvGNwhkxbM1ViAGCQ4jmnCzE9HJvtPNJjMyqsAXh2ODqN2gweYcl8tTWBPZKvp6DlW7lE91AnXbZAkjBK8uMMwKN/VFuCZgMT6YTyA6Ep7SNSqLOnUi5c9N5uQIPo03O0C; 20:ueMvGiuZ3wf5X4CTH/LFIQe/s7hblWY6tliUINuaJ8bcO7GY+64P6OoQUXOQsLhL9Cb2Q4KVX1oADGpjhOEw9/cF3IjzCa6PUE8gE5wlYB88Dg6TnBdOcmOOpGrPdB5JERIIIpMbk5Dpyfqe4BfADrR3nkwy7GNvlKA9t76C2K8Samkx3I4At0HA+NwJ+0CTfpi/UugveEqrKtOn7YrtG8uUIEf65neTPZTipxlBzuPOEpFicsB/jitHgVJItdkXw2XiHLydFNABaj/qX1Zs8wWo0gGTiEA8diHjzB3IPPXXeS2CoXX5yLFGBQ4KGjDcws4D2RbiVrKwmfrss72W5/zhPMRhVfTRHaOm7epuGkCf03lsHVucisvSyhliUyOKu4RrvqERv9pgMQQN1HMrSLmU+yvAzJ5qjNKE/H4r4HFiw8EnlCdS8Q++HivuHsjEdnkDEk5lVhAxZO6YjTQO3aVNKv824eIFY+m+VW+JuuUlQAx+R5UKzozkuJRbS700uMi0stwqHj4+tOiL6cUgdrf6chMNKmjEvMaiGvKjq1eVPV0pbdkjY9vQ0YHjWi99D4I0zxUPGvLRRHQ+5O8wTpAqX7/AjRXeDBCB1bziXAI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123558021)(20161123564025)(20161123562025)(6072148); SRVR:BLUPR0701MB1713; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 4:y/2RvTnKLpQKW+ltvlo5GpIuA6lmgJLEIFzmH/1gp3kIRR3Tz0Oj5duolj+Io4Q0+cVBrHuqw0BUvToguYbIYNPsvDSB15+MUYyaGFfzgM1gPMoLaR1/3mw/gVv3/kWvfN9NNCCn4jaOHk1fDCJm8kfjNrcILKc+/pyKM9XsbT6qBf3dZWc5TGdUfrpSFl4JAwU31y42M5/TmoBdE/DLQsy8k67VXpphzFXCVRva+c5qNSJz57PreZnt8PQI9PCYn/DdsWGUCE//7QV0/gynPqdLDH6waskG/oxvUcqQDDJdFiOTgE4Jpr2Yv10uroMgQBGHH1U/06baudANjKSnBSWDdcYcBYtaCYyumzIau6nItJlk/LSkW5B0bQ3uBZXy+dv45wu48s+E17u0KIAyFrtx7mPMvNwCqd6c+V/XYNwC6hevwaRvQrhKx9vsEZhXHy1afEKkmsiQVaZVcEKJZl3SFjt3dn2gUEqubdzkEPv2UxkkHRZMVb4Wj/ABBXpQ0bN60tkIKrDaJAOAqTHNI2521JXqJEHhLithwAPDfp4dvmdbtChTCA7kict87/GOgvTsvRdGlr2QLmTGXhqdst5xjU8Vh51EkOpShU4vZfU= X-Forefront-PRVS: 0169092318 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(199003)(189002)(4001430100002)(3846002)(4326007)(6116002)(50986999)(76176999)(5003940100001)(6506006)(6512006)(6486002)(92566002)(2351001)(50466002)(110136003)(305945005)(8676002)(66066001)(2906002)(101416001)(81156014)(81166006)(42186005)(50226002)(68736007)(106356001)(36756003)(97736004)(33646002)(107886002)(48376002)(105586002)(38730400001)(7736002)(6916009)(5660300001)(42882006)(47776003)(25786008)(189998001)(2950100002)(6666003)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1713; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1713; 23:SgJyrnFJgZBguX3Kug+bt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nSa7f76f8nLw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 7:6oqrFfl+VZ+0h2rclC1SIz3ycSEDCV97IzixkBeZR1BDLJbAzWbIhzEIMzM+hNMV6aNxnESgsUQ/2FTGJjTn00VP8bHUSLMhloMue9ggUfeXC13KSntokVUAJc2blWTWSxYrtp3eeAmQJ7LDFTPFuA4YTZuPmiilZ6fNXlex2vpBdWZTekRa/D8Ly5HpKG8ehKUZohizi6nxOQNZbr08mD2JGCgoVMzslmYTgCCLIj9Yt8AamsbVmRxSRwpXqYqNyrY8+Rjthpmty+tErAcghSqtpwsGRul1g4AeA0yG4tJhfJiMcPORml/H6oqtFmEV59zFk73uePoFOSRfCbvDlKHycoiR62ZNLCoIVXX7PK9YGTSUeEwM1YnDSFVq7DIVoUMwRb2Rd35BRv2guY36/HHflM4z3mGrI69/R/R5C+bC/tTjFggGMHVjTldOP+6uJM8Y0KZMrKqyhIpPTo3ueg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2016 09:51:21.9611 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Subject: [dpdk-dev] [PATCH v2 11/29] eal: generic implementation for I/O device read/write access 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: Tue, 27 Dec 2016 09:51:28 -0000 This patch implements the generic version of rte_read[b/w/l/q]_[relaxed] and rte_write[b/w/l/q]_[relaxed] using rte_io_wmb() and rte_io_rmb() Signed-off-by: Jerin Jacob --- lib/librte_eal/common/include/generic/rte_io.h | 54 ++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/lib/librte_eal/common/include/generic/rte_io.h b/lib/librte_eal/common/include/generic/rte_io.h index edfebf8..342bfec 100644 --- a/lib/librte_eal/common/include/generic/rte_io.h +++ b/lib/librte_eal/common/include/generic/rte_io.h @@ -34,6 +34,8 @@ #ifndef _RTE_IO_H_ #define _RTE_IO_H_ +#include + /** * @file * I/O device memory operations @@ -260,4 +262,56 @@ rte_write64(uint64_t value, volatile void *addr); #endif /* __DOXYGEN__ */ +#ifndef RTE_OVERRIDE_IO_H + +#define rte_read8_relaxed(addr) \ + ({ uint8_t __v = *(const volatile uint8_t *)addr; __v; }) + +#define rte_read16_relaxed(addr) \ + ({ uint16_t __v = *(const volatile uint16_t *)addr; __v; }) + +#define rte_read32_relaxed(addr) \ + ({ uint32_t __v = *(const volatile uint32_t *)addr; __v; }) + +#define rte_read64_relaxed(addr) \ + ({ uint64_t __v = *(const volatile uint64_t *)addr; __v; }) + +#define rte_write8_relaxed(value, addr) \ + ({ *(volatile uint8_t *)addr = value; }) + +#define rte_write16_relaxed(value, addr) \ + ({ *(volatile uint16_t *)addr = value; }) + +#define rte_write32_relaxed(value, addr) \ + ({ *(volatile uint32_t *)addr = value; }) + +#define rte_write64_relaxed(value, addr) \ + ({ *(volatile uint64_t *)addr = value; }) + +#define rte_read8(addr) \ + ({ uint8_t __v = *(const volatile uint8_t *)addr; rte_io_rmb(); __v; }) + +#define rte_read16(addr) \ + ({uint16_t __v = *(const volatile uint16_t *)addr; rte_io_rmb(); __v; }) + +#define rte_read32(addr) \ + ({uint32_t __v = *(const volatile uint32_t *)addr; rte_io_rmb(); __v; }) + +#define rte_read64(addr) \ + ({uint64_t __v = *(const volatile uint64_t *)addr; rte_io_rmb(); __v; }) + +#define rte_write8(value, addr) \ + ({ rte_io_wmb(); *(volatile uint8_t *)addr = value; }) + +#define rte_write16(value, addr) \ + ({ rte_io_wmb(); *(volatile uint16_t *)addr = value; }) + +#define rte_write32(value, addr) \ + ({ rte_io_wmb(); *(volatile uint32_t *)addr = value; }) + +#define rte_write64(value, addr) \ + ({ rte_io_wmb(); *(volatile uint64_t *)addr = value; }) + +#endif /* RTE_OVERRIDE_IO_H */ + #endif /* _RTE_IO_H_ */ -- 2.5.5