From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0045.outbound.protection.outlook.com [104.47.34.45]) by dpdk.org (Postfix) with ESMTP id AB33EF976 for ; Wed, 18 Jan 2017 02:23:40 +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=ZSpZtkahu8zhSyMo/rnaYRNaWPYsA5o00q4urA9Z+TfoDIFIaMLbQiVlYvBPAZEYSPGKZz621rwZBGbCHN1O3IaPxGjH2etj4DBT+pR8z5gJEhVvAksQjec303ctwFPquG9Fd5KmNgfOSmVciOAa8V5O09IGfW3XwPCUfz2p5TY= 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:35 +0000 From: Jerin Jacob To: CC: , , , , , , Jing Chen , Jerin Jacob Date: Wed, 18 Jan 2017 06:51:35 +0530 Message-ID: <1484702502-25451-23-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: 2ed55edd-14f8-4d53-7bb5-08d43f40a16a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 3:TjObjatxshsYgSZ428lgOfCnsyii8rYHt7LAFjl0vZ8M509ZfFCLy7SLCUL1C5qb/tgic3UYvcC4liWXAxk4n6uCGAMP6Au4zVbYckvBbZPR6MctqRTCu377nZjX/zQFGFUqhNqX9jor0hINg7PgWHOBLAbuVMAi/decJZRm3sh+nQjL2TGNR31Ap7jkgvHC50NZM9goTr3WBjLTkON99snP5exMMZbuSdHqBsFSoN8oUooEcGkIzPmfha9zne2eP9MtqyOY2tbYFne0IH6I4Q==; 25:IAYQrGz9YHz7wUNy+cZpq6ZkjJTIfaaaX4j4ZCpW7bd4S/XOmtiWrPcgLtEYT/hjA+h+zU2zRmAzgbKr9I/VDMz5V7l6KLSMcJsrH3zBkkNe8WSBVUczL0XKFHrLpuRln+ENGCgmWG5ngBcbUwOJ8/Eq2kyqqXR23kDUDdQKWDIxmSorApL8Y5P8NE+y44cI6v71XNYweB6HoZeS0DRTVJKrqGW2ezNs3+VGSirUm3HdESlG4az/7cMlQAZqU+r2ghVnBWluXs3QIwXqJWFKbdB0KU1mPLXVLI1rfb/ocUMnczILxHs02ExP92Ns/XV78Y+MshY6pfY7iYLQZPcnN6ZfjFRMptXptf4Y4J7YYaRVE6Jju72FGIyPGGEBIcrGILqMZf/y5wx+F9tG8yahEVedr06PtNM/ive3jW6QwBybBmPQxMw2XoY3uIlEupt4hYo89LtHaoJySZLSO6LaOQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 31:QkT3cwTfLGsfJW66XcZNWzB1NofZQ3Q0RrbwvvELam3hPLfR8r7L8gyPubsT1DfgJ7kZbpUxKsP5xB7xWuy3IjQ+jGvDluDUOP09rtpfYXbcvLINs+y4hSTK4aPQdRo4KDPdGX7Zo2c6Uh1YSVs0vzCxvEfYVm7FM4ZQQwSThRc2VTbX/9icTURhaVtuhOTk4s+qYrbiSvBEJj/7z7YuR90bmr+tJAaUdIrs7dH6FjiiV7sID4JnVDvDvSBDuawMvRH25w058EIkbhtduG1WcA==; 20:ATI2vjWwpYUz2bAGepbcZhfoc9zQ5sgIdqXq+Syu4aNUwsC9T0klCAxl2MqsqapU910t57KnuVbtafZNOzx3etscsY9NwiJXw0avV3j28FRvBqXNW60CLSL9fCu37KyW5ehuVJfkyv8H7l6vGMbeGEtiptVJgv6PsU2GDlf4gP2YU2SRZHMG+pr0MKckEyIzVEzbNRoeq8BPnZr0MH0IwtLw5NTaeBCgk/xEHtEv25zFLlmeig/bvBtDdS2tF1WOwi6htxRgFb1qs5vhklyj+EzERMBruDN++AFU+kRbWonwHcQwF/n0sKJ4otYTczkJZlhLHjnJoHH7tnfAW5Y6U+5AbBeNhthLWnBN0RAZU/S5bpPupv9KaJNDZ2Mgt5o70AtS47em2rYXJQQ7H5HV2fuzYiBleN9Y5B7+jvip9iiu2Ykzh5V/FaJbUeO67MPqVewR4ECQ9skPTTHoLAAY2xFkKSgyWtvcPSwLs1rLItqNnum5SI2ZlpIxoSGFXIbBhz7aWe9plb5QuU58S2fz5SW1rQc/Kkl7DgOxKjHWqN2bxFuHr0y2bF5Bt4G/Mc4LHzffdfX8PprY8UFS+gkM4ex6iL6MU/dCcek14JS1www= 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)(3002001)(10201501046)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(6072148); SRVR:BY1PR0701MB1721; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 4:bHWzCC/D2r8qC/jEZ5O5NyODcYqKCWJNYkIJvTU4IH6t+PR8IYN3brVoc0s/DdGBBQZwx30oPXEbqGb/Il6Sloiv2TaIfaoV1hG3qp5DDhE5V4NnMZTNek+XUBIsbZBJbgXmNdE/BTg1YMXeuXxGlizjBG8G27H2ZSlG7PSf4VyLJJ+jaYXuu0HnD/OarRZmLReWRUkvjq9/VY2O3mu7L/kO6BUlI+ZfPeUDY/XmqR3Qlcb5wJtpQTwozs0gt8aEMi10ICuW1YIj5MvBfzoMYVoXmA85Uo7R0AOs0VjDczHzFpp65AC31LAY9f4euxfCRk/pxGtdAtYrkynwGXbcLnOjseGqtqqEAG9J9CpEh/l/Cme1yo2XKUsGocu/3012Y8IDNLvQ3uhKyYC1Ce483yFQb16SI7HqYNR/yVum/0Gx2UQFQe2VNFRGv46O9L2lje5AjYGISqx4HvmGiG/PfAzt9jturHp4MXHNjEwX1Q8z8DurtVMgmOFPMZkEUS8ycwxMBoapV/b6OcXieyZIMRqnm4eL9io/wV0ROdRjEEgZ/cfM4gDg6uevs+xwVA/CK9tDBJnyw+0tgtFwlLq7YoUlag5S4WseiZhM4M/NUo/YX6ecGo6KUVwktJhlGWk6CNkQE180NFDuOv8d2rTe1w== 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)(105586002)(33646002)(6116002)(4001430100002)(5660300001)(6512007)(48376002)(69596002)(76176999)(42882006)(5003940100001)(5009440100003)(36756003)(7736002)(110136003)(6916009)(106356001)(2950100002)(7099028); 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:F7m7rXHvpiQkhH1ymCd7DqBnAigODXITaUnDuGv?= =?us-ascii?Q?TQgU0IcXEJU15VhxCs8HtS1StfUBuVJDU8E5XydNyrdKQzWteItHrENAn1BH?= =?us-ascii?Q?VE5tCp6yK2qDa5FtP7BZ2sBKX2aZ0HSWqDP3pLWWHTae7/7wlB26IwFGJhP8?= =?us-ascii?Q?mWx7X1g3Gffplphnbdgaiq+BbA3QdSiwq56edFwbOwnwsZYHy+mcNXP2JZqG?= =?us-ascii?Q?7NotFKtyd7Uk7IVtA0hi3FacltZUipxD4giRD+pf52dNpq7mZ0nualRXVB4/?= =?us-ascii?Q?t4aGnST5TXURGiW7LunGbNUp5pPRnFAKwvIaCP+hdWEs6y8ylfwQun6LoLZ5?= =?us-ascii?Q?2pxVLp77nFsK6tAtTXE/5GUfe4SOLCOFm7udLTyQr0Wyz7c8WB4plTkIS/mZ?= =?us-ascii?Q?wUYJJajNihx1TSydUmkoRNn0VbCNfRX4LuDrJQeUUbb/Gy6vCIAzURlcaO5G?= =?us-ascii?Q?X7gCHB1gQTfvxNmHF9/7qZP1rt10wEEtPsSTmHEE1CSX8qbzGNtmmHU1JZGC?= =?us-ascii?Q?El9VF4iRDZh4DMvtZWsIekcMKS01Otb5xh15X4IaRatJ5VMsnudm7rJdnjt2?= =?us-ascii?Q?C3AqmcNni2xKddkS+aGc6dEs7U4hpO26lNppm9+2PUNTdWUu/sovSvpYoHTe?= =?us-ascii?Q?Z/SmqaY1WaVp81f1Q/fHmHsZo+QyaP/4ocG7Rt7p/anqZITs3pMtczuegONh?= =?us-ascii?Q?9AfuuHZjwI+pJwom2GDT1FBbbADWDxC+oqwJA2xiWe+FCN4ezuCSn8zy9Iz2?= =?us-ascii?Q?wbEolyD0c2CHCPl0cADG04fuGEOd0IKXZ+TAcgjNDJ/OcUYb7agc+INBUG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qrpsc7r1F3ZY6eihK6BjgYGKcj/AfFeI6hgLIykxM9sNlzHatk22i+gfSA4NQngc6zrMAUd74bpqeP2Jrt59nIcL/Kre3jizTE/jybP73fNrVA7wBXigeg8Mx3eDTQ/TLODIuesqBCF2n+9OtraU=; 24:/gXRtQP6ZwzwsNIfj2BNurVPi1j0tzqfQyZD0rihtb4VNqi9dqMGpm92oZcTn1N8z1FzyZ0xAeCRJlenpSjKZDPEYaWiB88uS0UzdapGoCE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 7:FNqQ6sZLFKVYnt8pUDrE+PUHtY79+2OABMIrtwmBspXHLHLomwUoJoart7FQp7My4ElB+6ZGKORfrzvNjxqejHSNp4m3HibMzn/nDBKQNODExGrFeFN43d5BoO5KR1rYqi8+7tUsUmFF5Qt3U0DdbUNuEBHdL3PCoK/vQPeW63gcT8RpgluUphs8b9VDkTGfPw2hxebx8ZgOWyljKjnLGm5Y1nT2lgYUp4zVtQFgAvuCAdXkcJt8MJNZBl4gcrB3h/PGrTXWC7e3LfbyG01eD17MnW6scLoMz5LZqq1o2+wxRdyT5SeiztwwC+wzKgmsQqWYcrnt8YBcCQiVGMYRjsR+l8hKHrE9ZuKKV/bKX29jiFtAlrAeqRX+C+qN6LW0jD7d0o6A+Y593/d8OpldrZQsYn1gJ2pferuYLHKBmDAB8IWXS9bdkNCqIB1UEWTCAIAzoLOnFZ+cBhC1S8g9fQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2017 01:23:35.4594 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1721 Subject: [dpdk-dev] [PATCH v5 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: Wed, 18 Jan 2017 01:23:41 -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