From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0080.outbound.protection.outlook.com [104.47.33.80]) by dpdk.org (Postfix) with ESMTP id 1CE9DF960 for ; Tue, 27 Dec 2016 10:52:21 +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=a9h6OjjD0XUfbziScr8zoK/GmUPJD0+Yrgur/NP4E9e9U0MfD6ul/gPw+3jeMxh6w9QoK+VbZTeB+s9O0/9f6VowaO/jXQgW2s4RK0TRAV6pUaiTVHRb1t0FvYxnIqEUJ1iig3HheLJpwof/ruKVSTfaaoVRKwh0Dh3uvuhZZvo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (202.83.56.97) by BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11; Tue, 27 Dec 2016 09:52:17 +0000 From: Jerin Jacob To: CC: , , , , , , Jing Chen , Jerin Jacob Date: Tue, 27 Dec 2016 15:19:28 +0530 Message-ID: <1482832175-27199-23-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.83.56.97] X-ClientProxiedBy: PN1PR01CA0001.INDPRD01.PROD.OUTLOOK.COM (10.164.137.8) To BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) X-MS-Office365-Filtering-Correlation-Id: 4fb69cf7-bfd9-43c9-1f06-08d42e3e0cc6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 3:E4VshF9+f2qKUm1iVIABj4zcv4CtKMoKplP0zJd9e3dUtYIPISuBRY17HslQMeQGpToc40kayhskX0mZt7eI5W6UkW8M5voyWjAMGV1TVJeoK/WGOuRhRK41cUs6Dr3omWCrMmcOXt+hc35pISw95eh3KsLEzOop7W0r1TWNfa1LenQ0HlYqsUzcgCXEvyNYzbbBW4tWMbI2EmgFjanJxUWeXLAL/QqlEcLZA0u15aSxqa7/6b+QALZo/+eXK4L4UPkxuo/l8DTx3cxW0s/aWA==; 25:pbmihgGxV+E6oYGyPe53islSxNdrHvgaFpHboyj8A+X3jkTWQXoKau/+RJi7lrsE++l3U5lW19wSt7MeOFOuG+SwiR9X6HzSX/pDc4Sjf6b0EcBdNnbvPuW/AMvc0cD2fYfkFrIdWdloOGra0g/5kEeH9SPGVY4/bj3z5ZAUtOHr2TTuuISXrrybLqwHF65j/vg7rlbBXan2hFCvMjC+0JSRt1P/Tb7N/urrcYDJgHWQBvc01x8IF3T4vfef5pE9AnvkslFe1DGxVHYPyEVRgTIKMdF8DGLDu2aOC1zbjjObriGkZ1p7T4wyvZETZzdg4yxDVqsefWwutsED2zvaS60BoE+lKmuvq1k97gGF0Dgjn9O6tAT+PrWc61Cb/RvHZmNGgybhvOHY6JNcj1e3jsp444B0seeYApPq2Lpu02v9JM2W3Gy1V7B6XyankdaOLFsFlnEfKFeMGGx4XtcHdw== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 31:cKeJMBHZkfabhS1k3+9LXmGNI86P9ePnxhWb3ygVMzAMMytRDd8rFkEhR8h3fcrHNSh2ar+T0nnjDoKwl5hmMPq3SNJSILHiTpop5Zm4KBF5gKxtqFneCXUO1lcVepU3OsLLpHOYE00iTPjYfwf0lu6YzksDqv76NpTPazfrvLKhWV8q0GfKnkWhYkV07P1eE4tzB3bcAXuw7zZDZ5q0hlBFn6m+MlIWdC8tAa+8IU0EQn1gDPZT6y4oudrUtO+YzVM/Z2yPw6PHzhoH6dXrVfXAfLayxe3QwVA1DMvlVD8=; 20:jSqzopz7wOe0XCFXmgYM2JSF7y0Xw72gZpBxgvFrG+MKuKaEjPyd17sDrWPwlsCBfMiLQ50sftoggDnwWTk8EVAtWLWcOSJnQBTht//oZ/2308x5odpdVEU0TSORZ1AMxHoLr5caETw/ni4Q4ZhDItfLMXbv9RDN2InTJtWiGfj7QtoJrGZz2qUWu24HMHTbMPtzpX0TfmYaL4HF/btwr6/09Fysh+akp6Y1vXXfLGxyp1hDmwIjLnubllpPYzB9qQ5oREqEzkA6W09JsZk4wKT5AWzvYRUmcr+gJn2ScBr1KfXokiR0jDj4/0fY5E00QRuUJxvfN3CSclmWNF0QiSxl9TOb2H4AMho7W5KUlljq9NNS6AvOTnK8f8RyUQfUgGDQIsDBBCXMQghDOoUpKTWtdFomztyPWZDVkBFgsUKGM+aBZKRJGCDXjXQSY1+k3QdhlhtW/PyEs46IYi6xXbOXTnp2NNW9H3DaiRcHQ1UT7/nqwPPK78oM3dxfgEJGr473HKk+MS8qQ1bd/AlB250GIItJnkNPugy6fxXYPhf1GyQoJcjI//hyxGRCum71VWR5TTxLoXp++iebo1nXu31BCFahgh1wfFzwUoh6oVk= 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)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123558021)(20161123564025)(20161123562025)(6072148); SRVR:BLUPR0701MB1713; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 4:WlI/+j9hjKnAUk6PE/r82POv5zmI4oFkHNWGeQR+S5PoL9KnRAsDuZ7bJY0cKFlSqqmgCGY8sa5yU7rqyGtjTFL3OBMsfWyymxnwsvBK67r+uVuSZVsU4iFByX3tJgH1ez0/P+7xoFsiipYQVy6oJ7oCeYV0D7MzDnbc0FrrWcUNLUyelE6D/6oIvDWL1w9alq2WeH6G+DmwbMDXTUKw1Q5nl8xhKCuDHpS8YrsACZa+ztCDkcccnx8jzQLAn5U+m1sS7i4/u5C368vmDDWkyRIyc067qEAgmxQ+ET6TFpOtt9AHHffThRUQI2Hr9egs5qytnTBZfe+/b1a1KrRFzEMU82NbY5999ZwcXe0bQxUXppYtMVl20Rk8eAaU2qkxKoFi7AJ5j+SCfItCtIdflOivrZdFJ01zxLkjlVJbF8kjkPoMo+dGF2DoL8aRQdFt9Czjb/WtAqyvmG+VcKcGmvruqiVP7MP3UjmeFDud+kRVF7I37Cjq/x0TImOigb1/CgoT2FZXYkYg7LfYuKkYwJLl/IZK9quSxquBkcBXEbTKukWc8F6vo6KN9sEWh8kXHEWeOhz9NFMVCqUyPG+N7CiRdRj+HpDkExkcmdCF/RoT7VMbh1LGOVvs/dA2YiE/K201CEqA4lJtkuHL1rzpuS0CeMtM+6iBwoNLAwMevhgQMviGgxSF9F0jyUEI5Bf3 X-Forefront-PRVS: 0169092318 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(189002)(199003)(36756003)(68736007)(106356001)(97736004)(50226002)(5660300001)(6916009)(47776003)(42882006)(2950100002)(6666003)(189998001)(25786008)(105586002)(33646002)(107886002)(48376002)(38730400001)(7736002)(92566002)(6486002)(6506006)(6512006)(110136003)(50466002)(305945005)(2351001)(50986999)(76176999)(4001430100002)(3846002)(4326007)(6116002)(5003940100001)(42186005)(81156014)(81166006)(101416001)(8676002)(2906002)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1713; 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; BLUPR0701MB1713; 23:1ONRx5L2Kmn/uHmnV405EfBUUR8LUv9XqXPfao/?= =?us-ascii?Q?UHyHJgAGXtjVttdUFe3M9+T3N2ocyRZ13s/eOR11/ozpVGPJt0hJJXqTIpuB?= =?us-ascii?Q?6rdW1Pe3g25axH98GMk6pmFQ/XOJh8ESCw/hx3sPp5JDD7B2Fg18MjQFwPtx?= =?us-ascii?Q?Db8ezjF2P4diBPkhQ3pA2aerdoEYwEvk3cj8hQoTkB01k5V016R6Pw+AOW+N?= =?us-ascii?Q?n4OlKRHNRtqx3r/+DCdNT+jz1W1IrhIOTp4Wf8nyl+WT5QIaUSAo1drw99nN?= =?us-ascii?Q?58o9S8ttSpRzqLpsrZHgVUiZPqYEKDrsKS5lAHFvgdRkubwwSSR0yLicB8D1?= =?us-ascii?Q?NsV6JGQ8gwEJ1t/9C4tYen+m3MAD9s3YqxjbCLf3aq/uyVwhN0Hg5zCB2U1k?= =?us-ascii?Q?tyMtjwoxqJWnwBgn8iFkCSeqsnFuNdFLrre+++Yuj+2hPG5VVziV9XHywnXz?= =?us-ascii?Q?J5ZpZTuv2wuOhvFwd6F9wrvWJMGSL99w3A/CnC5EOqVHqJTHmi5nwg2o/ee9?= =?us-ascii?Q?wJaQbE1fowTACG4rMw9Bip8wV7aIZTtdA/KZHmL/87fiBNwwNxSktfnUtw5h?= =?us-ascii?Q?g7tiNsKk9SyT9dsE7E0sJnq9+lyi6nIV70Wk0VBlvh7DE6r23xGRw8xfS0OL?= =?us-ascii?Q?afnOUPdnT98GhwQY20gV8pkAofEnrd8s8UMo9o3JgRW1xfup/DFls3BxI0ih?= =?us-ascii?Q?av3NdY/Dv2KVQtktqx+Dmk/0jyYfadb01zjpDdL9S8fXFq4oqDO5Ceg/YzP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Mp906dECrLKWvsZ/lH2bW63kNksDBtKl/oKaBFFlW/MCwuC8UVqp7LhsBsHlFTkB0TY+Ufg==; 24:O4mD+yrTGq05CXzYairShJr1r7J2IqJAV3K5Pava/+LOaAcWnjTvlej/Si0KEpAGPrriD6NjeeDeByY2MBhS4ztGXBoLCe8fM7uHbKmAB3k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 7:HDLMzO0n7WUje68RiImCEjh8/YZtiq+S/M3n8MXU7yIrZa0Ddnrs5b4ko8AGhJTzl1ylx6bEBNyrblqEoMaVTEn2rxcqvnT1q2x1FiAGNraQikHkVF5O3BUdr5gRLqS8TR68TodgyPsGvKkCwdP/H5QvLcJqM8J8G1Y16kOjIcCmmqafuSfkLRiI8AFooj7wKjEedKG4ZUY2CBTq1qmjBBvBdnxNt/YuLoa7RvVZtJCckiUjS0EGeA0qWaSOEb/qtfU23f4NuiFeeNQXwJ9hSpZzHCrtb1t63dJDggqx1fmvIgd69UJR7TR8JIIx0xe0cdausDKCQbNOaYMxPO5K8dyRRL/3YXqidBsl3vUYOwkrPYHd1t43MquMnwcHNnklorRH05D+8EaU1pTvuLXu9NTlUFh6e49Fy4ix2zCRCfZB04wjaPTz5D+5t+CtrL5/6f3+koUjvsHCypEmuNTheQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2016 09:52:17.2825 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Subject: [dpdk-dev] [PATCH v2 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: Tue, 27 Dec 2016 09:52:21 -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