From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0072.outbound.protection.outlook.com [104.47.42.72]) by dpdk.org (Postfix) with ESMTP id CB7FBFA56 for ; Wed, 18 Jan 2017 02:24:01 +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=SSMB37QgESp0f47vkxHKo98dIPn2ph8HNe3wIhNrSsc=; b=czmXZ4N18xa3eenrLlXviygYEE0VnUp0k09JBp74SB70kdZPpCBKi5OKxpOTdfQNBFJjHEWjzB1J6UTEU0ZcxOLcjsvciMwtTm6QM5+0FwfjPq7RzJvg8BWkBvpKe1sBATrRaU+T02qo6i177TuvwS4nX0oByMjYCaimsW8d3yg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from jerin.caveonetworks.com (111.93.218.67) by BY1PR0701MB1721.namprd07.prod.outlook.com (10.162.111.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Wed, 18 Jan 2017 01:23:56 +0000 From: Jerin Jacob To: CC: , , , , , , Jerin Jacob Date: Wed, 18 Jan 2017 06:51:40 +0530 Message-ID: <1484702502-25451-28-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1484702502-25451-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1484637244-7548-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484702502-25451-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (10.174.56.159) To BY1PR0701MB1721.namprd07.prod.outlook.com (10.162.111.140) X-MS-Office365-Filtering-Correlation-Id: 8dd28fa5-c5b1-4107-f8cc-08d43f40adff X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 3:dp1UsmUCpW0xjVianaf6dyAuALioDqgUPsYDVi4jQswZ+ogzUM7au4dqHAPxcXabz0SwieG46bSr0kyXdl/TJ2+JxFVoTB2S6aktGQQgm+dv1b60UuBxIs13HNBcC7KRdlfoT8QUQuvNlT3arVcVtb4Hq3JisP1PmMMsj7FJgf6Z25i2MLVb+EgmlTM9rrnqJ3WZkTrLe5Jqa0AzvnFwHwfPohWs1tL3awv9nCtr39clcrIyID9FVHGajTu9mxHhsog6DCAh41Xrf1VqEsna7Q== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 25:KwkynwQAbWyEbUJkUPZQT+Tsyd3g+8iBtd1R+l8jgHzZerbLUMHMcAix8h1NGvPV140dPCkju7kXP3owS2cmPBE3KpMCe7r9zGu8uSPyKvAng2TJL175ym1YzW1CVJqazBDD5ISTSAOz1LfNF89tTJqovcjEgfG+gIX0ahTVQH3P+cGbvkzSCRj9PPf93B2A4aYE/HewwgScUG3YlVOl6VsqFx2YMWi++k10fWH2JvV06xMRiwik564ewftvNsNsLIapPmpX+SyPV674h+o5t9zZcWnNKgzFx7YHvMjP0R3TrM5Avu4k1QlBKWWxV7v+rXsU+IiZed3S26loCVNfT66EIcPQAqBi7eqPwq7F91FL726cKnl6a5d29Kgzvct9i584SVHkW3BRaLTrtXKRq4bD0yiyyN7qvjy9Dm06m0GUmRBwCHloR5mhIMz+YjucWyjQIsq8u3pkMR43HWOc+ftUAvBVJLtaCJV1XIzfB/aZKRJeqxJS5cYK6n9Mz9XWCh8uI1ZRF2juJg4Rd6oJ4TI78Nu3BNvFFdbGOPlSaayeCBZhHQXA6hxxPwJhnhJTXx0kbaMb1L19z2gNR7eNLtFfFjXYVW8butCICA3ULd2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2AyW7Ybl5u1YgkBdWBooZOH8BSLNarTIxHd4Y0g7sY= 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)(3002001)(10201501046)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(6072148); SRVR:BY1PR0701MB1721; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 4:TUBuGNXxveornzF2o2JeccZZhiIBH3PftNlKtlMP1oledlXCiIA6rday7wl3HbHo3C13477oiDclhuGQ/1EBXZ2MHk/D1jV0y4Dr+FwPVAOkGUJMVc0edsinKIWOgyaq6i2W/A3ExPNMBGSbrGZREDEHenOQCjdijXJs8fogXNOGCS+5/aYaFOqAoErm4G+3RCUvtblZifnxs/5GxRqUEPeG5C+Wn3gjn6xbDWNIq1v3YhbUemB6R5TliNDSZxgvk1IeP2x8Gn3jid5Nba6Ak9RLmtkHdsu+bsKhSKj6GdaGeQI1DVYHuzvs0gZ8nWYHYtSijRWgFKMRHiLS2dyc8HrDCe1+pxtfuAQR+hp/Zvfi8ToiBGyqCFS98pSF07BF97R/8SEhm3mHN1oz+MrGA/2IaB3H50hG6zALwIAIqqw+KmGzo82v/OkSP+UZxKVpTil01tmMe4VVzDZUeX/Znwj7VWG8ss00C0DRCDnRTmVVOe5xg3AA2zMKRmUjpRzH5GBCkCnO6/9o+xivhq6cwIDM6Qk7TJKStLb4i/HEADeHAGHZvS+IwyxXI7Shxvr85IEZYMR0iQnQtjY4VjlMfVQySEDGUkLkHtnmMyDoRyxGfWxGp/zcSd2UeJuF0sES X-Forefront-PRVS: 01917B1794 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(199003)(189002)(4326007)(6506006)(50986999)(97736004)(47776003)(107886002)(25786008)(189998001)(54906002)(66066001)(92566002)(101416001)(38730400001)(81156014)(81166006)(6486002)(2906002)(42186005)(53936002)(50226002)(8676002)(2351001)(68736007)(305945005)(53416004)(3846002)(50466002)(6666003)(105586002)(33646002)(6116002)(4001430100002)(5660300001)(6512007)(48376002)(69596002)(76176999)(42882006)(5003940100001)(5009440100003)(36756003)(7736002)(110136003)(6916009)(106356001)(2950100002)(7099028)(473944003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1721; H:jerin.caveonetworks.com; 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; BY1PR0701MB1721; 23:9YcXUbNnLViT2CJ5GflOdqp/Ohh+1HYX/s+dYBP?= =?us-ascii?Q?lrnj7q0tlGelFIJQq5XcOMqqPxPcT4XJ6eaduktVmPmAU7mp6pizuIf7jBCq?= =?us-ascii?Q?ElGQEGAENalXmVCgDinvJIoY7zQUn/P5tjd/92gAtXNs8gBUN2u+CRTPfVGS?= =?us-ascii?Q?0xPcoRjQi/YiCGP48IARjy8QwOsclTDLSHNbSHImzolr9y7/U5b/EZ8t1os+?= =?us-ascii?Q?NLEoaPZGzfEADFy1EyF+xrxrpKV3LGh0ee202XZ2phxF4f2P+N/XBxGIEQ9m?= =?us-ascii?Q?FeKY0XTEOTKZ5B3AcCpX6nQs1t6pnGFc4mEpj3qEqhEQmGPUTJOWm2G8vtpK?= =?us-ascii?Q?6M4QA0zl3tY4oBmH0HieEDasPvxqgsPx6BQy75/kaP50RgQJ3hGYodKcTuA2?= =?us-ascii?Q?3hkp8e9twLHbMalygWduyAvNuwK3KAIL7K30LLsa5xz/Gmc8mUaYll2+wx5w?= =?us-ascii?Q?74EQ18bRKq41nMEUQKTxjbwey9odE5TA0FB7c5d1ke13YRkGm2VGVLy9NyhP?= =?us-ascii?Q?DFD2k9koqUNUCHku0w0D1tklESC80OJqqZ5/PlLL0907qbW2LNWeDE4sAqpg?= =?us-ascii?Q?kXAtfpjF/8UYo9PphPUlGse9QBlv4wmG1o9lt1HYDH9Nzax/NWW8o/4zQUbl?= =?us-ascii?Q?1y9qQAg+ud/o6veWn3b6r+vj83X10AipwegypB859tX4CSWJojxZkrCP1453?= =?us-ascii?Q?HjJEAX7AF//RY0HTDjlr7sgMJaJYvFbITGccXVMJrDXPAPP/6adeE+AHRg+C?= =?us-ascii?Q?TDy4o+T50vDC4eG/GneEYPUnSenyq9/KvJdu5qhyyID/gwnqeZNC0kJ7UeJ+?= =?us-ascii?Q?JX+zNYMowNd2W8HTqiIYwUxg0dqL1SREfJhVhn8RRXkcatocu3Vmn93oF5/8?= =?us-ascii?Q?tG4QfkiItR/WtkdXvdw7aTr7g3s2UOAvnyuAjSwln3fMeEvAe9RstpM4qA5o?= =?us-ascii?Q?tQuwr4iVmqFW+bywmdDJBmUOFfpb+/+t/T1RVAizPkJD3h4WeYZiI8NBFvWp?= =?us-ascii?Q?obiQsZ9fD6bWDmLfGCsLMQsI9wTp0w8W0L/ikAHdzrXeITh0hP4Ar6WHr08Q?= =?us-ascii?Q?21K/hOkMa+l9R0Aan4KOXBNBqUGhlpgJnFAfIjJxPBNV/zcao/SfhxZL/0hZ?= =?us-ascii?Q?mckxPzFfVfaXI/008Kmy8WRbSh/VJ3SBj+AEkXKCQ2XWnCswaLrgvO19Hwef?= =?us-ascii?Q?Gc67RJgIf5T75GWrifsRl8meWnXbhjaVxa0/J17errwR8uqZ0TRTsbEBLlD/?= =?us-ascii?Q?LsxteT5o0N2toiKRl2CvXbgCUU82yFYjynIYtoyu1dX2nDiDQuX45YOFSjVx?= =?us-ascii?Q?zMEaUQjFqlc7YXx43javQ5mo=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 6:odd7A06W6mKyhjlnL1CGCAsw4juz8Reai4irxZzW2CirM4hRqh5LK1rOvwWN+tZElWWESZpJr3p15KvfArfJxcs8dsnYvRcqYw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ZmlncJZZeujvDTVHcF3tELU0Jna4D3ERrh3SpiGgyEFl/Om30RmTVeNlYc2M2ipAG53K5jqZmXyRHxL93M8Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2017 01:23:56.8400 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1721 Subject: [dpdk-dev] [PATCH v5 27/29] 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, 18 Jan 2017 01:24:02 -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 | 36 ++++------------------------------ 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/drivers/net/thunderx/base/nicvf_plat.h b/drivers/net/thunderx/base/nicvf_plat.h index 83c1844..3754e1b 100644 --- a/drivers/net/thunderx/base/nicvf_plat.h +++ b/drivers/net/thunderx/base/nicvf_plat.h @@ -69,31 +69,15 @@ #include #define NICVF_MAC_ADDR_SIZE ETHER_ADDR_LEN +#include +#define nicvf_addr_write(addr, val) rte_write64_relaxed((val), (void *)(addr)) +#define nicvf_addr_read(addr) rte_read64_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 +90,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