From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0043.outbound.protection.outlook.com [104.47.42.43]) by dpdk.org (Postfix) with ESMTP id A84F2F926 for ; Thu, 12 Jan 2017 10:20:19 +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=ijpMLn+OFuw4k2KaHcpSXmxX0mQLBGcaUyOUjV7dhxw=; b=nQa6iD7AhsLCV6PCK84hNa+7DbEbmr0HzQpNuLZCqpvXEMt30F8OE1atcPISJLFBfitutboSjEvMRR+NRCKhVQD3vRu+yVBlMrK6lYhqSMd55FQdce8O+b8c6NdVvtrI9hFXDHT0M9earoSlwyY8UFW1fPZMK9VgK4uUe9KszHE= 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:13 +0000 From: Jerin Jacob To: CC: , , , , , , Jing Chen , Jerin Jacob Date: Thu, 12 Jan 2017 14:47:19 +0530 Message-ID: <1484212646-10338-23-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: bc096930-5af9-4516-00da-08d43acc38ff X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:RZhzI21H1cNm8e/++kKKBXy96hRNkdcIUa77BEfaxrOTxXIoGxldod37sy904j8ZascMAcmoLx25Zlta4FeQuvHg5/HKj3YuKK2ydnt3nyXXPwAfYfR9mO7dFubVfw4RQ70dbn4NoGvsrDPZZnTOISo0psOYOESlHMiMGy3HzZpbbPU23c5ZtAPpba0D/XXZN266rEj0+y8BYAepH7HVnWiUPS10oyE5UCPSfdwsrMYcQqPHaIj9mhNnSAzvGZTqim9Lxk750G8H7cwUH888nw==; 25:d6v+lQjWJ9mzGbStjigbFuVD+cd04y8Gf6B8U8Mq1iz8D2a/247PTH/SW4snIC73N9RTCSwZCcsY2xfbopbt7x7RRFupAXBKrP4SYJ3W3iGUzCLP6asKEjOZNlYxPW1K/3WpUop5hR5fKeNkngyCOqCKDWLLzLFSdrvQo0XMnM43aFkTyccNVaISkHXbqHgsr2jj3HR1Fd5iAqr+Tk4ggFnSlHmPz2VmTt44ZrB3lLm1T537TXIICSxSaZkWjFbr9HWZhE4xK/xtWgqSna/sTouVu8EGW3/B7BmoeJBEljaFb4XEQ15g71z2s3PqGG+eu3W5j1aYMPua+Use+3Fbwg3KfsOQ15zWkI84WaNTameLgzn58X++rhWGCZXIo0jbRGty2Om7A9py+Dp0FqBGmeNEfB8f/QbmqJrUXl8bXe2CrxQcgX0575eEl4ImAW2MgWahJxouoHzFlNydI3cnbw== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:B2/bbkWrFwImEnltUwkryb27YXBMYgTmjjZUd/zq5i2jpv9QTvEnEoo32BsMnRvyQsSc+hY6btKAfiJcRDUd32A7T4boDv4wVOl+vmrokW5A0zJ8QuHKMBEcKD23J5jSo9OvfI7B1EbKA5FUDOodbkD2cjTW3DXFRI6UH8AMXiJ057+nHxfeYWVw5gpmgKTu2FFE6ckEz6U9Iic9YFvMM7fcOZ+90oM70DYS/B7+bbJ/1jYUiXfzzPg4pEHD8nH8; 20:59pOnDkR0lCwXdS4Z+dnHaYSDWGFOY26A5X87cyQEQrjP4XPcgJmePzHWxyH4ORQ0MHXlpCLaDZTDjGz3bu6fdKIQnW1AQIhJUaJvvcjE+mz19CqoqoInwKkxzAY5omB4PDMPQpBx6gRPJ/Q8x+Un0TOzlMcL8q2Eh0J21eIVSPGqQBagUrj5Q+6uyjPcRneMlN8tjaF7yq2tHVVD62yXWosSXaYxx/9t+MGw98wWigwQKhUSznMK75bjQU2aOJjpJ0O9kJMkzZL6qtt2xsjDRPN7BO0GxkbR1Bn44vcTWLSk4xae+1G8QURQO+KGGQ7s/NZr6IC+thYn0naUer1W+chli969qSR5zOFRdCkybVZ2XNX1urKqC4vjq8VoMD4z7jbu0F65jSFT0rae11E1a45/6BSnhsfHSbVdp6QP1LrcywIDua5atJhD2YEZWC39Mtu/HIj8uOG+SOcFjbc+YfL5p2bUEwuVza08MbC6lt4Ck/Rp/cVjlp+3AwPs3FC665TPPbexe313Yn2ZfsiET5hKPOCxqWAZR+p5r1O9vMZsU5sfXQArEKBjsaiDqyihtTXV7p6QzYe6TxERZFymRsTfe2GzX0Wg3V5jq9vlkg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:B3r01jDcx49oO5vMaOnvhx2/WJ9944erRxlN3johDql7rEcU8f15zEtRb33OgILACyxILvkDz/HBE6VjIVJgrNhNmJvFxXc5MZel0nq0P5UPEb82qHH1Ag1UMCTc7LH8vg44h6CdT7nJova7gNRF7L1zkNrQL+GhG/Iyl+g+SWdOXacEeMjUZqAd+L646VdSDHjiU+YZ/9SFbWtju6d7hMV6irRb4Xfyr79o5dgiWvkb/CREAGFRtf+wu88OAlZ7pRM9Wx2ZJt2wmLfzCVTrUWgpp4OBFqvh+t5RG5XHpbW0fhFAQ4Ptbql0Dw03p1wD+8YifYyf6UmtTecOpfIr69cLU40pUp1Xd9rVg/uzUMhQBh3inOwWJ4gxrheDQSYGOJF6wLRbci+C4zdPshy0pShi0PRUlGN/b+TWNs6c79mBq93kqGOBu3Lje+FLABXEzd8S6fMKLjSURlPKIJc5oMHBCbkiqqor/gmwi7xeTcIrWVaAWfzhhJji2o9mq9KgVSQ536aM79+/eRIyPlp3yrnifAU8G0IwmL47eeNS+q2VsZ7SLlUCP6g3jR+K9Hs6pFpFjyJ65sPXhKQOESy81foZzLSPOizrdwn88wIYMHPktaPg5j6hiMfGove2KKDciDCzoF4ieNuEs/wkJ/Xyng== 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)(6506006)(38730400001)(101416001)(54906002)(33646002)(5009440100003)(4001430100002)(6486002)(66066001)(5003940100001)(6116002)(3846002)(47776003)(25786008)(81166006)(6512007)(81156014)(76176999)(50986999)(8676002)(7099028); 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?Q?1; BLUPR0701MB1714; 23:Xrrh8RJVDMiC+6vFir8n+t7+jPlWWiCZotRgUYO?= =?us-ascii?Q?WZxvVS6Vb7u/6OLmW9hj5yHO9pKrXh/2N0vkrXwrV7FakDOVC14An55MTHAl?= =?us-ascii?Q?iCtr2euxOc2kDbbv+VU8KsBkHBZftk9APduLDUG56bKOBbyfmUIdeLXa7lKK?= =?us-ascii?Q?sOMTjFaw9mul2EivfzEgml0jqrtoPe3ITzwnu2xediEqclMuENjATgwnr4VO?= =?us-ascii?Q?WDgmsDJefIZzQSxtuWXRzzqvq7inN0qomdyeGQ39oat0GSB0nFDswtBwq0Dg?= =?us-ascii?Q?7vH8vzBewQ/gBj5QsakRYqVCHjhLdireAm9Deh8qtUkCCClxrFTF0RZYphTz?= =?us-ascii?Q?gmJs5eaJvwatWHyPRD9uV/v27SWR5/HF0PLdrEuYMUktp5T96UYK6R2vWlga?= =?us-ascii?Q?BpjACps6lC7zGXJklrPS+QPWQUWPry7JXA+DzwGkq9SxDvOHgTbwjcCK54by?= =?us-ascii?Q?BVcM4PzZ7GyaJDuwY9qytb49JVR4ZGwsfjlbRsr/IMw/zB/PXyw2mNu5Btrh?= =?us-ascii?Q?vDk3QlqsLKiClSPhAqe9btYfG+V1jJnbORtDJD/SSPbe3RVs9igkg+SN7yqc?= =?us-ascii?Q?EckPxKc31/oCTVS9d/fNdWPoKJDQUqbovvLdXrKvzNviTPJUeA+haUY93Cvx?= =?us-ascii?Q?kQ20NAc45EFBraCMgiaIwfqDPxSMOn9YibEmymQZa5043HxmKF7HPGldQ66V?= =?us-ascii?Q?sBTzAlk3DDmU8vCVgFWasWfKwtlww13Sfcoo2ShkLOgWmbTcyg8GVT+UFHNC?= =?us-ascii?Q?MRU9wiNtfovukG0gkAsvtaqFIG7PmfoK0+aDndSjdS7rcSHKnmJ4nNMJndTS?= =?us-ascii?Q?Vcy5UZk8JAg//k1yyhQcgxbVadk+ub7QTsF4iOgeO5Vb+Hez6nPNPlm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0ERjP07GIamouXaouKxb4KHgboNNbsD1Fwu/gRv0Daj842/qzgWho3kCGo/sVKAOpiLYLYfWiyNNDw8+kjusNh2zWg==; 24:62Rwc6Fe2zo7kDa1X4ud8F51P0+zYxYEJ/BPPdis22K6qQJk8BnKlI+hlHwJtO42CNFgZkgZ26R5Ic8FPNhkK9Ltp6rOLgwX25Y0cycLBzw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:ymDfEZhINU6m2fcRW/vfKctYpxLHbAwldVqvBIQ1H4gv0nEisCp6GbTI48DbS6OoNGG1RXsLYnYOSDEkLCTwpxUWfzDZ9f9GL7iQ7HPonNHuP1C/5uzGm4AfTDQ5wf6HIW+6S6br4I9Y/GmUl/Pf2aMmEqUoNG0fDFpN/AYLSEoifqTHWiPc4QOg57h231TPi8mEH/CYfvBGAGxlGmRs6HnVqfU0kZ3INWyAFylZCbVuEMzOv59r16pzRTWJUjCRIfwpENUckO0bJMtVHoWJIdVsYwibCXO3Qnz46IN8ePMQ80Z9HoxMqWYg7YiravCFkyyZemVfk+sPKTUA6VTXXgHW6SooUbxt7pc1BVPVtbWncftJPuHxyRNbkQPObNCTNbVeuPZBjzwUYIZB8UETFghGuLH3xiQ66TVK6k/mD/1hPv3GU+1JZ4J/QXU8VEx6H2F8a8AWu8bLt5Fok0D3Tg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2017 09:20:13.2000 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH v3 22/29] net/fm10k: 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:20 -0000 From: Santosh Shukla 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. CC: Jing Chen Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob --- drivers/net/fm10k/base/fm10k_osdep.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/fm10k/base/fm10k_osdep.h b/drivers/net/fm10k/base/fm10k_osdep.h index a21daa2..f07b678 100644 --- a/drivers/net/fm10k/base/fm10k_osdep.h +++ b/drivers/net/fm10k/base/fm10k_osdep.h @@ -39,6 +39,8 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include + #include "../fm10k_logs.h" /* TODO: this does not look like it should be used... */ @@ -88,17 +90,16 @@ typedef int bool; #endif /* offsets are WORD offsets, not BYTE offsets */ -#define FM10K_WRITE_REG(hw, reg, val) \ - ((((volatile uint32_t *)(hw)->hw_addr)[(reg)]) = ((uint32_t)(val))) -#define FM10K_READ_REG(hw, reg) \ - (((volatile uint32_t *)(hw)->hw_addr)[(reg)]) +#define FM10K_WRITE_REG(hw, reg, val) \ + rte_write32((val), ((hw)->hw_addr + (reg))) + +#define FM10K_READ_REG(hw, reg) rte_read32(((hw)->hw_addr + (reg))) + #define FM10K_WRITE_FLUSH(a) FM10K_READ_REG(a, FM10K_CTRL) -#define FM10K_PCI_REG(reg) (*((volatile uint32_t *)(reg))) +#define FM10K_PCI_REG(reg) rte_read32(reg) -#define FM10K_PCI_REG_WRITE(reg, value) do { \ - FM10K_PCI_REG((reg)) = (value); \ -} while (0) +#define FM10K_PCI_REG_WRITE(reg, value) rte_write32((value), (reg)) /* not implemented */ #define FM10K_READ_PCI_WORD(hw, reg) 0 -- 2.5.5