From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0074.outbound.protection.outlook.com [104.47.42.74]) by dpdk.org (Postfix) with ESMTP id 998F6F98A for ; Thu, 12 Jan 2017 10:20:49 +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=dFKTJfe2czlOxij541+KrWcIYfldS89ms3lGoD83ZlRiigyYjhD9w1GXdwMIPfdilxsbSMV5AnrH7ARzBKZoi5wxHYPQZ7OqBOl6iIhHmtmpmf07++XtOrwAhVXuWVNBMChkd3frUl4P7b4t8prX0cDlOpnqtJxU7AB227qAqwU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Thu, 12 Jan 2017 09:20:44 +0000 From: Jerin Jacob To: CC: , , , , , , Jerin Jacob Date: Thu, 12 Jan 2017 14:47:24 +0530 Message-ID: <1484212646-10338-28-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-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: BY2PR06CA0007.namprd06.prod.outlook.com (10.166.106.145) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-Office365-Filtering-Correlation-Id: c50e3093-fa45-4930-299a-08d43acc4b9f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:IQCvBqCcQo8h7N1CFWDpQDHN6dOxPFb5utaw0n4TN2yb6LTTnTqZlxsxhT+bBTq7BTzK6dVSTcWSd2YJ126391JXjLBgG2kawhitTcDCKMOKBDAIg/Q1T7f8Sa89cFMEKXxqb2x/nQfMrrag0E8c+xdIiomFjqcW8eA1PA95ineio4Xrkl/bl+qEUkYqZM87gX1vyNs8rmJkN6PRe+VDi0DHBb/UuNZc5enp6+qYuqngq3S/A/BG22Xla1Qm9rADGTS2F1BY5a3OGsbXu1cs5A==; 25:b4HuUc/KHIfw7aN9Jf8s3hyigVXO9BWsZBMvKaMHD/Yy8NcIRgRn9JKCv/tOkdKje9gDkHEYMxWnHO6BKcQbcwBiDcDFJcWZPy33BSmd+HV/GqQm6hpyzZW67eYsmx3bseqwnLlFA8rs0Ngq2MPQ26pGv5rSSUdisAld+B+IlgI88wzMeQrNYV8P27vUIt6J8+FL0VNcdepyNIvB7ehLm9OWlzmvH/3EilDucai9TxtFo3OAAmUKpVLBlKSBDRGdUpNyuWuT1Mb+XXtlZ/L6y+o17h1oLT38Ab214DEelMR4WB06ySPa5Zq030spOzqNpvY8rY7ZZ0NETGE2N1hq5h1TKLxku7W287E+p1x3cAg/GrUf6gEby1YrG+D/CdtlHSIiDXOKdZzB4AJbs8ft4mr57ZXVaVEvHUlL5KMhj9Ya4GnXqP5bcG8vsz8O943OtOFNlun/Ih3TIPBESvfv0A== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:4y8y0NR2l2snG/MchY4Nffnc2q3zxbFx63zhQ0XNhfaP69DIUsuR18Glhj1VCd7k/qJemCaamxoZ4ykSYGTgPU6KlDVdLolOHU+Oe/MWAAxZx42pW3CyQf3gkeFn13hnwpxi8zBTkPBr/EoYZd6NRPDjlm9hU4puXyGbwcxWDMXra3Csafks5taz3fbMRQUHwYW2Qu4VwJjiJ1ULL0BQC0p8x23AqWRhLvIZ8xtwNWTAelglysyhEqycPKnlPS6VYlUlPnMdgTGSFMRu5vwVNA==; 20:jjpu8B/ChGEFj3OBOr7JPlUoDP8xjW2uM3enRS0KcJlgDBEuCYaFOVBtoZ9UrMmrO1t/km88aHlMkTjaFkA2/moF3eWl+B7t/8ulG98R6d/+VcRDn/y+OJrpC3220wEqXbEYLyp4bQX4oX0fIdvom7nednkaR7upmonHCMI+DjvOtCfYv05eoW6w0s2+81BRsE8GBtBESoXNHEmHWQG11T5E4U6BdK/wzp3vzZAJvEgF7I6kHDgqXbVhRkbKqtjLKjoY+lVHBgLbP/bCzmYIk+Gc04LB0H2XnTFucc91pcgZbyWkRci0fzPkx3wWRc1oI5YS8NJx9haX5k5mWEaw4l7O9fpeFzYC8+S04K74fs0Kb4HnsrUcgf/GUW6xoepaWDCpv6vZ3aCSr50EL/GHEmg7eEswWO4qf4BHtPvfbMhk1mCTiqT8oZo5SBi1Vt2QFIHg1VHPMwMsb/1pTp9TJqI3eizX4MjR5dUxZ6pqHsKFLmG8W3SIz8WkGiVPd4CGism2Ba1ijHzbzltnVuLv1uOZysDDNwZ8clvsvfH/t8dGMGmU3+jPJpVdFW62dygK3qdZLCEVBcyFZAytvLsmA5eCjk0E5GrLrwiIGezVtzM= 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)(20161123562025)(20161123560025)(20161123564025)(20161123555025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:eVBhpVQn8G9+MLMToOIiY4Khgzujk2l0oxpU3ZzzD4Nh5Im6Pg7zNnz1ByyPRCSNidZa5aDlbjiqMSFja5OBVVjYWrwKsFuWIaYYKmiHtRqRkmzYMnmgjf82yLM+h+7ukEXjs27gWITRQnzJGeYqqUZABvuvnHNSRA/6DrKEU8Agc997ZepFL19h2JiwgPcwcVtAwO+Fqtrceg8iWmvoOf53Mfv1abTdfS/uB5znWkl6cUaNzAkC4v3Z5XII1MXRp5/Cep3VahjDEK8jCuGGoXCEFT0fobyLRjTm48jiZ0SupvvNMk1zU96i4GtrzTsq/fFUFSG+UqKAWGfaV0G9osUWMnPddA2qB3WddCX2xhFMz240ArQGbfQens9V9KpE5haoRnYw2zPIu/c1N9Iw2bRscCjRVMl6CDUG0hkof8LetCbgO3sATONSRRrE/h2V+3cX8smzzmUSQ4JotrWkriV9plQbVAAxuglED5ZuOanGIhUuKqBI0cjelii/j/fFvI1OgiJ7mUV7fj90id9ax2tiaLYgdkeAB+sKLPuhruPFeDpotc/dMH0IG+QS9hwjBi+K0L2ckgBAc0iBjBtVZNANDjt1Tv7S2y5h36DyCzU= X-Forefront-PRVS: 018577E36E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(189002)(199003)(2950100002)(53416004)(76506005)(92566002)(105586002)(69596002)(2351001)(42186005)(68736007)(106356001)(42882006)(6916009)(305945005)(2906002)(7736002)(50466002)(48376002)(36756003)(5660300001)(110136003)(4326007)(97736004)(107886002)(189998001)(50226002)(6666003)(6506006)(38730400001)(101416001)(54906002)(33646002)(5009440100003)(4001430100002)(6486002)(66066001)(5003940100001)(6116002)(3846002)(47776003)(25786008)(81166006)(6512007)(81156014)(76176999)(50986999)(8676002)(7099028)(473944003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.caveonetworks.com; 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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2pGL9oo/sV0b4f4w0rfGqVOxiGs8ugOW7zhLWjoDtD72g30xpYz2V/O8yMT/tVvagTSTaTU7n3Ac0rukjPnbSjvZY+8XihX5m56gyROTvW5dRigjpTe/GZhMgbhSFKd+sXOr18sFLueQ==; 24:tSwVoCVyvg1Od6lWNqiX0rxebFnEH9RD/b0E8DhHmwjqI3WmwzK6hmAjeEd56a1wrdQMypKyZMS4xbYz0gOh54/A46oj3y+5cQHa6MmMiwM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:Yqcoekpck/3Y9XbSHDRCkOaEURAmRCWLFoF2P4y+qlycbe9Kmr/H3dha0XrBjMjTqVAtMLB/dBa69S+l54irf2DAI1xO86WwiSxREI21oVvu5Q+riq8j0pQ0LNM1fC5oxn40JxSfufad42ngiJn+usll5rL6jnrBZnfSuA+d60L02TpRVQcPg8zRnc852K3SduC9Ud1U18k1AS2BUL3q17L5oqlRaKtD97BBcpfe3GPn7irPNQHQZoNKOmNA40y7gMk+HgDQQggxQoYMkzWHXiKQyliVO8gXr2HPv6sW5aKF6gu08U0I79GT1uEcWXJoOiD3sLAUB/MjG+SM8FOe322W9qYLTD1owQZx6o2tMf/OTmRl1w/VrAysIKGfutoRIAq4FEf/kp39z9lMGeKAy/InW/VWiQbwTQYIP3FlCS3tCkdIgoyXRmsYk1y98awjeHb52BSjbHn6tTCNAh9NiQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2017 09:20:44.8020 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH v3 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: Thu, 12 Jan 2017 09:20:50 -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