From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0064.outbound.protection.outlook.com [104.47.41.64]) by dpdk.org (Postfix) with ESMTP id 436A4475D for ; Wed, 14 Dec 2016 02:58:46 +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=AIHMR4xIhMLWIMt0EBK2bUeg9JAz8X7raLVvOT6d4po=; b=eNPQl/ZaW+PsuKwJQAaXKi3bxUOxLbDtvBtPZM5B0Z0gvW/ArdWUtZDfG/4oruJbPtgScUsVH6R/Wn/wUo+o4bNejyX/5eORhWqJt5ErZzu1fJNa67xH6tVc7gmzzEWlLqAic5eMh+ErWNqZxGDjzcvjtHwnoTXB+5mbJgtKmrs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (122.166.91.229) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Wed, 14 Dec 2016 01:58:03 +0000 From: Jerin Jacob To: CC: , , , , , Jerin Jacob Date: Wed, 14 Dec 2016 07:25:41 +0530 Message-ID: <1481680558-4003-12-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.166.91.229] X-ClientProxiedBy: MAXPR01CA0006.INDPRD01.PROD.OUTLOOK.COM (10.164.147.13) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-Office365-Filtering-Correlation-Id: 5b3dc2b5-7320-46f3-ce88-08d423c4a56d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:+R2BJCKsk2shsGoIUV9sNzHUNmgdnpmh7sAQI8WccXJ/TMcjvUO2opaIov+kRJ53798hq+0iKA74+9xzpyMPQ7PcWe49VcKfYwL3ANkRrn4n0nGv4oWner3gp/LRtMAHA9pltx7s0fXwvSL+zAelkj7g+tpONY1OpET4rvuqvQ2xKkCdFbKVaiXZ+Zu5xkRwL+6DtUFH9y+6zEYCth4m9gd0/uiz0bZ4IC179BxKilIIz/GvFUcA5talMSu74W1sLbiukdgMpCUwIgvchMvrSw==; 25:4upk0Rw96oSMnvQcQYA1PEeG8JCUugHsyU/8/oeikjKCkhhJAWqXlY5bjpjxFu0if3yBgitVSx5QNtyppyQ+gNGQqTuYRQllcjXNdbFCmATkl7wbu5EDg13ssi843Zws3kzl8Fr2YGk5tYP3a+xWKwnH2jOgmJ71t0nnSlt/yfGCgr+KYWMJstAMkfqFlJLrrybn2iQCUNxiq8uOPzUyqdrYFqmWf2RLXy0Ha7kdZFMIRaSWE4hZgda4oG1sodzaxJGNrWuk3N3Auh16uJWi8ISjSMydrPcxyElYYKA1YQiIMrJ108wfyM+DXeGjH0TMtjZZ6BRxbEOyIMAXtD9JHKM1w79yluynEdXYZXJ5nZsWRU/7AZkX/PLBJwx5SZTaJiM21WRC2Tsa9jx/UZBIW5bOeqzhNtw8KXiscSPR+j1XH84a7Z5OAZpPyFHPxr1QaIgy2F4rKn8ONhJalmuObg== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:fOI2zT6/bUyxchcfgcDNtnaXodNc4IoQjgh7k6D0JGeAVfF+zRJKS7upU2P0oZwv7Wt5PwFZTdgjfG91yN+Hdu/CPmYszShu3g0LTE+VSjRfvLXzGQw0jcvwFPVJL/7LMAt4Hztw4uDn8DtsNUh8cQClPLwxMXSoCl8OY2OjwjV9qVMxCXe6Z98cqU4H4hcG4jVNojLpPKseChTwh+p1FNCDepWkUQXA8Ov7hn97dR/dx6YKKvQZ8e/yfrQvydKEqySC/GXX8qekKrNCOx231A==; 20:rfkcIqGUd6NVvJsOfQJiiNr/ZWPa44MpHLplx36UWxIxeaETfINY1PqAGp/apmjZT7vd/87X1fmBGby3KAhdG5rvheTiWm9XRlZr+s50Uiy3gKpApO7xZz/jOmGJuDgJqko0kSuz81/rFBiuvwYP7oWFsjtfeEiVGcZGWwQxAsG/XpY2/JjJEqHgv0uld6+51fd/auzBjIJw95rts5F74wOSHy5vjKrkdN49tIlhltA+xQ1ekIr8sFdbs33Q8z2PcJLp01W0FNYxJLCwMJ6Q4xUxiCObUk174dzPi6xjp0A3/n2caLWzTIlIrnXsi8F6DezhZ5UzFRyULlDlfARJQlrB63UCClj/tLQToHcVymYthl/Kb7j+Rk4xIZVRgV3jBDuDHOvcAnk74Vcrl7RAWuRyxmt6wDmocj9hXtlzZPaDxRZV1jhjz958AF3JJ8aUIkE2mxZdorGvgm5igSeiJPsThnDo2Ildo3lyj/WH38CT8OGhJPDS8zcuoI7EVo+STOydqSsJKYpUxeAE6VSsOYqHsPpfHFbx5/BdUlnj0JvJS1RXq5JLIbpAdoTlADRCTfrKRfQvSEMdIWUawVQnWUojzNd+NBAi+WcXtEHNB/M= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(6072148); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:rhTdrp4m5nRdYhYGs0k2M+73U9MGEwxSf7zgMObQHbJ6QtGakigTJv5kfnqhkTn5TY6tHmGbvIpCl9DH6ZM0vcRcwraevYCYC16vRfHwvktMAvgQpe4wd+c8GrSOU8X9fCK3o5XMZamDEvP+cv01otegrydShyTDVJu6wzKIBgCJKqwXfoAQTk8a/iFzsqP754NjOFOODe2Z+QUMyTjqbeEdKcHBK0QR8fRJQvCRfPP6T/TyK4Du8qeo54RpAHa3p3dWpAE0IaMIV9k8lf2Saw+WSm+EVI8llLAO05MYQKNhLmO30Fdykk/Zbthaeama28H8SPyKC3m3F25CA/K0rMmOuvh5ig16N+DJbmZwDQgzVwk+TCSvGAzvZN0rqIX1I/BedMcfC1Q4utvAsBZwTbhPVNn1HtqNLaevgcphPIygk5gei5QsTTiBtHwQQt2qqxhrzLmXaNxQX8fGdP+wUupfM/kZ0yae61nriFtFA5bNsiUZ5NvR4Ig8bbirUOV6ZQWbIPyv6xWnKIwOnXSV9lecbhJC4u0kkdrzQSJJoaihAP60SYRBjApPgpBEXA6S X-Forefront-PRVS: 01565FED4C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(39840400002)(39410400002)(189002)(199003)(6116002)(6512006)(6506006)(6486002)(3846002)(66066001)(68736007)(47776003)(92566002)(5003940100001)(50986999)(76176999)(81156014)(50226002)(2906002)(110136003)(33646002)(6916009)(101416001)(42882006)(2950100002)(6666003)(4326007)(4001430100002)(81166006)(38730400001)(105586002)(8676002)(106356001)(5660300001)(107886002)(305945005)(48376002)(97736004)(50466002)(36756003)(2351001)(42186005)(7736002)(189998001)(41533002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; BN3PR0701MB1719; 23:NNA4tFuys31r8i5jgkG6ieANs87yPozWD8/IQCW?= =?us-ascii?Q?mU8xSbwXuESp3w+o6WDXuDG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YqP27SqkVlMHYCq1cpUQd+1KQUSPwxCrkVbYqJaFY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:c4sQyKi7MmOgsM1P/v922elfcPS59mUOmv0/gXTuZapOKeaOwiI8DM0ntnr1+BIBtgCPfTjV5J5RQCN9+7G89JougQLfMR6V+pDoWbm5BGNldoWHuKH58F35UtptduxLWzizlyuc0ZKKTFJkbunVDyR+Bg0ZzH/9faNUdn4jN8nJeFi6Cm2sDRMYiGyiV2hZSU3s8CRpgRZMjpAWE8dvr3VbXIXsmk++/X8xw9HzVMDVIsBpZ+ZY01vEp3EjnW33uLbPkP5MEtlnWa9e3xetU7WRkq6wJn34E15oV726ykJzniAo24CGnYazauY/86dW8700Ca0NKV4aexhmZefRJj9/CTrwbzG5UEfVCwdSF17ilCgsiD/YS7RhhTMKPjW62eHCBQ30i0n4zfP68rnUbiR4ArL6vfsiqRj4mcJCgvS/afRZEWm5lO4KrlydseiDUQyleKKJFcdStBBSdOtopQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2016 01:58:03.6190 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 11/28] 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: Wed, 14 Dec 2016 01:58:46 -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 d7ffbcd..f34c131 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_writeq(uint64_t value, volatile void *addr); #endif /* __DOXYGEN__ */ +#ifndef RTE_OVERRIDE_IO_H + +#define rte_readb_relaxed(addr) \ + ({ uint8_t __v = *(const volatile uint8_t *)addr; __v; }) + +#define rte_readw_relaxed(addr) \ + ({ uint16_t __v = *(const volatile uint16_t *)addr; __v; }) + +#define rte_readl_relaxed(addr) \ + ({ uint32_t __v = *(const volatile uint32_t *)addr; __v; }) + +#define rte_readq_relaxed(addr) \ + ({ uint64_t __v = *(const volatile uint64_t *)addr; __v; }) + +#define rte_writeb_relaxed(value, addr) \ + ({ *(volatile uint8_t *)addr = value; }) + +#define rte_writew_relaxed(value, addr) \ + ({ *(volatile uint16_t *)addr = value; }) + +#define rte_writel_relaxed(value, addr) \ + ({ *(volatile uint32_t *)addr = value; }) + +#define rte_writeq_relaxed(value, addr) \ + ({ *(volatile uint64_t *)addr = value; }) + +#define rte_readb(addr) \ + ({ uint8_t __v = *(const volatile uint8_t *)addr; rte_io_rmb(); __v; }) + +#define rte_readw(addr) \ + ({uint16_t __v = *(const volatile uint16_t *)addr; rte_io_rmb(); __v; }) + +#define rte_readl(addr) \ + ({uint32_t __v = *(const volatile uint32_t *)addr; rte_io_rmb(); __v; }) + +#define rte_readq(addr) \ + ({uint64_t __v = *(const volatile uint64_t *)addr; rte_io_rmb(); __v; }) + +#define rte_writeb(value, addr) \ + ({ rte_io_wmb(); *(volatile uint8_t *)addr = value; }) + +#define rte_writew(value, addr) \ + ({ rte_io_wmb(); *(volatile uint16_t *)addr = value; }) + +#define rte_writel(value, addr) \ + ({ rte_io_wmb(); *(volatile uint32_t *)addr = value; }) + +#define rte_writeq(value, addr) \ + ({ rte_io_wmb(); *(volatile uint64_t *)addr = value; }) + +#endif /* RTE_OVERRIDE_IO_H */ + #endif /* _RTE_IO_H_ */ -- 2.5.5