From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0040.outbound.protection.outlook.com [104.47.41.40]) by dpdk.org (Postfix) with ESMTP id AB5F3FA5D for ; Wed, 14 Dec 2016 02:59:34 +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=pY9N8p0qSemQSDFi3+pKPprk056i5xO+okXFg1j3N7A=; b=bZn6DEUY31aprjLsy1bC9Prp/vC6ghz7raTJ7imQIFsgGgEI41UzYQdUQSU6zEUn8aEhPo4GZ8mibRvwnnVwx6jwmwvmxWq6HA13aC9UcP4+W7wRRuCBSEOK5rd1fd+5IV3LRbzAYByC+I/QeXfQ1S7dOSlIrwJonB+Ty1M43mg= 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:59:29 +0000 From: Jerin Jacob To: CC: , , , , , Jerin Jacob Date: Wed, 14 Dec 2016 07:25:58 +0530 Message-ID: <1481680558-4003-29-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: e7e45ca9-5c7a-4a0f-39de-08d423c4d89c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:cy+D2IYxIqG6Zp80tnki4nHZAQ1epI9BUFv+BohXUTI6b8AiLDok8EsE4hqhV/FRasy/yI8z8nnTYzdoySneOcSfjWQ8ChqXTxUlldlu1qCSUCZBEEB08AO4zBC8xB10NRuCCbLMCPLf3R5QgCCjgX02O/aKYRp0AOzj2PN9shBLXZBtaTJ9ETnxUkQ+B2OTNjrpDbxQCnszb7kcNPhCTy7t+Wiy6Qyq3eCWFX/CUrwCV/NIMogFf+Bl9z37ACVbc1byoZhi18iT/twGbYAfuA==; 25:xTC0ZWGMzP6lzuZmUPp+gmh+SmIMxS/effX7aqttW+bmlgpssmQ1253hDB9sDXM68vY3HcRfyhpeTmXeDw4+8escV2MjWWbJj1+wfzjeamGPggnvYveGIK0EKWC8vY67jhMRReqInUbAqqIHJ4QOHbRGVC8Z+kpj/fHluByO5UbD+XNtGKtd9yNT8iXX3oyWE3JLkLf4hYMoCIA0K9urZTaixX+OPsY73zlNLPfjwMv0k9xq/VrvbtdG6JrKc/bVWkXd33d7J8AannMJz8dKx5Wxq5oHMbCYRCDYFYrtGVE0Lz22kaylMANW3bXSgOYGkQeUEwLxUa1bG5rlzrIYrWRSGPKfzIvqRPt0fn01bkTR3WzEs3004qHZ9Us0jvtw0JAgMmvZ3Zu2BcxujrE2p3Lx5XtVXl7xwjBFYODt1hcM43wt4K/3+vgfESOEX4xBxYLfMbm08aCi0HibsD6vuA== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:lP/XI0BFQncK+JpdJmvaAg+FtPSxWJ2+J6iSTKJ6op3ECpuKre/SegE0gKe8lOp+/vWGP0AuUNwprD49iOWRvyYSvmzjaV+0X8VupTvEulEUCpewFeU1ldoXIiw20qJ+2bMQZca4JQuR0d0/zVvEN+Svds2ELelH1HvJQGQv6UR0HNxxtz8Hl9qSC/O5gXbJkoPMzaPJYT04WAO5x/cf8n0/ycWuxqfyrOEAPKOYHJ+OdYOH4OIs5A5hN1eMhqE4; 20:GEYdw+Ar3AyGo88FfZLRhtLxldDAuFSS3WqlbAXxz5kqT1R3M2CrkTQZWmJutfmxzFBCoI7M87xuk/o2FZ96OFgyKt8CzWlFJP90WkLvaJiVSk4J5p//EcRXVrfqlUmjQxsdWPc3v1yH/CraSMS7zbfsxkWvxrOIadeDzGEQq4taqg6/nA2drjy9HlcscFbOx3KWayZBq+ClTjub94oYypk1Th0th5RjN2f6j0S4CJF7b7dgVv4Ea1zwwO18kLBdS+TuRntBy546MJwaSpyU33JJZY3ca4sYhG1spYvXdlOkgB/eXBavfBsArzgbjQc8I/h/PJMqZ9erULKzajLM4bi500oMgKM9qhQQlZWgapTIHSS6UEQyNf/8XKj+DFjuLv3dh1EqoFfBmeM+cLH0pVb3dSOCnQMlycCfqnv7w9QGIbrtZHw3Iw5vrgy/I0VcP8Qu6Zy3D9dw8UIw6ZK74Pf2KWLKazMGeyt1vR6Ses+JVfExS0a3ZWlPcmH/aiXFsCjFplAfM51x0FpCZyoL3xh1BJz2033n8LhqVDvkBNmT5Ca1eIhmXeUQwKWkkfSYdlDCx8vzsNpjaS9u6bYsPwWUWIy3C/j61/0zc8pCjzo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); 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:BCqUDQKaSmWQcumnSxOcEjYWSe4UW6ao5zbfgHw+wgHAa7qjZ1Cnp8rz4ddt41MvpV1NMSvEVjt81QL5SXVB9m7Pq+8mo45nekJpioBqR9LEyOVTpCgpErugp7nLyNsfLIV0X7lnGfIKoTbQ+IqOP4f5gdP1Lj4sUM5FGoe7jzVJ6O5PmkKZhi2E13eATG3wC5cWe23UW67JPuIS5azcUi1yN4WVlJ4qPUT53e84pkCjcWBS4pkdOE3jMXBUNWCggt8dOnoVkMZBB34MSlsKnEqqv/9ej1Pl51NbLcivt1GeaT1QA0RamS8au4vmtrS/vZXc+vYRyKftFRzgH5bQlEOUn2GjUQSjfy/mFB77uiSzjt/aeltf+DxScvk//XWNpteH+1c2XzrikOKmI7gyWpSUereXG9yqY313kdP/Gxcok8d5R1q3d9YhQ3N4giPKBRtQgmMjirnq9mON9IXpzWP79nToVZSYMmkYj5buy6lef1dj9OxcQXzaWXDwz9nnB4eBwkPCjT6KEl2IPY8LmsdwqAuiqmq9CUoZhR1pWRnEK4Elr/8UxmHOR7ZPbEjFZ1bn4/GU0jKL3eaRnhb1w/MX3WLfA3mT8j/TGznIkKg= 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)(473944003); 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:fE/NHsYEKmXtzYIK+OhD+ov6KnlxT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bpykRcgpwoSXCB2BBndwsmZiAHDhEpoJ4jcxKUYF2TUHrNegbavkU3QF5gmfl2B4oVBAcbBMC51/CjY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:cCw8H/+RYyGfsbqQFQ5U5wBGj/Whrad0nUiV64KfjmGh8A8WiYQIB+VgczLcXB/ue5EvpIjZ3MVrDeFe4HLPDCI42xswjeB566bC8/LZN8mdkPCAB4WbMSPMuwj4iRr7j6tgHP4OVE6KHSByC/SitymotVkzBYTE8X/b7zqx/QkfK6lDuv7N4kbORfqpqtgjcBB4VBVu+/oPKDrmLWxfGkSGeqCiI9SfT14arfmYcgzE2WfIQTeD2j6zbIxfh/upxRCFOCdrNVoSwDBNI90qkoxCQ1IJe4zF8Wv/0xY5CMmAd6b+L0hS/f9er+e7pJAgBZqoxhOdAhsVEgl9jSCa/4zLzt7eQwcwLReKYPG1LrT5wJg6tsG9Ic0vMjsXUtdhHIQPn0sBqHE4diTWn33FjWp5r8hZruk67ZThzFAIwZniCehgQOtHOmcdIguyaFhvCIdiR8ig9NHqo2BunZIijw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2016 01:59:29.5331 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 28/28] net/thunderx: use eal I/O device memory read/write API 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:59:35 -0000 Replace the raw I/O device memory read/write access with eal abstraction for I/O device memory read/write access to fix portability issues across different architectures. Signed-off-by: Jerin Jacob --- drivers/net/thunderx/base/nicvf_plat.h | 45 ++++++++++------------------------ 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/drivers/net/thunderx/base/nicvf_plat.h b/drivers/net/thunderx/base/nicvf_plat.h index 83c1844..25eeb7e 100644 --- a/drivers/net/thunderx/base/nicvf_plat.h +++ b/drivers/net/thunderx/base/nicvf_plat.h @@ -69,31 +69,24 @@ #include #define NICVF_MAC_ADDR_SIZE ETHER_ADDR_LEN +#include +static inline void __attribute__((always_inline)) +nicvf_addr_write(uintptr_t addr, uint64_t val) +{ + rte_writeq_relaxed(val, (void *)addr); +} + +static inline uint64_t __attribute__((always_inline)) +nicvf_addr_read(uintptr_t addr) +{ + return rte_readq_relaxed((void *)addr); +} + /* ARM64 specific functions */ #if defined(RTE_ARCH_ARM64) #define nicvf_prefetch_store_keep(_ptr) ({\ asm volatile("prfm pstl1keep, %a0\n" : : "p" (_ptr)); }) -static inline void __attribute__((always_inline)) -nicvf_addr_write(uintptr_t addr, uint64_t val) -{ - asm volatile( - "str %x[val], [%x[addr]]" - : - : [val] "r" (val), [addr] "r" (addr)); -} - -static inline uint64_t __attribute__((always_inline)) -nicvf_addr_read(uintptr_t addr) -{ - uint64_t val; - - asm volatile( - "ldr %x[val], [%x[addr]]" - : [val] "=r" (val) - : [addr] "r" (addr)); - return val; -} #define NICVF_LOAD_PAIR(reg1, reg2, addr) ({ \ asm volatile( \ @@ -106,18 +99,6 @@ nicvf_addr_read(uintptr_t addr) #define nicvf_prefetch_store_keep(_ptr) do {} while (0) -static inline void __attribute__((always_inline)) -nicvf_addr_write(uintptr_t addr, uint64_t val) -{ - *(volatile uint64_t *)addr = val; -} - -static inline uint64_t __attribute__((always_inline)) -nicvf_addr_read(uintptr_t addr) -{ - return *(volatile uint64_t *)addr; -} - #define NICVF_LOAD_PAIR(reg1, reg2, addr) \ do { \ reg1 = nicvf_addr_read((uintptr_t)addr); \ -- 2.5.5