From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0084.outbound.protection.outlook.com [104.47.41.84]) by dpdk.org (Postfix) with ESMTP id CD445FA33 for ; Wed, 14 Dec 2016 02:59:18 +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=+7a9eDkXBz3D9v5nr0GvgK56a7ABaOnnMCZ52fwS4eo=; b=d8aL5+7En+XQr9bCC7h/RYYjX36MoFsjYbSxnuC8z0Z4c4OERVMzhGjcRTiQrYNejOvtsBfz7+9eblGgVlXi6C0d2rvijnj4p2JdAEy1ZkKuaVM8X1GnZiQaLoKprEaodSeSu25uo5yPQYUIDCShLFXugYaZXKOjJ6krdUGbeAY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (122.166.91.229) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Wed, 14 Dec 2016 01:59:14 +0000 From: Jerin Jacob To: CC: , , , , , Santosh Shukla , Jerin Jacob , Harish Patil , Rasesh Mody Date: Wed, 14 Dec 2016 07:25:55 +0530 Message-ID: <1481680558-4003-26-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.166.91.229] X-ClientProxiedBy: MAXPR01CA0006.INDPRD01.PROD.OUTLOOK.COM (10.164.147.13) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-Office365-Filtering-Correlation-Id: 878015f9-427f-464e-b6f0-08d423c4d018 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:V44VJuT2Xl/T5ZXhAsT14XY6GOWyRtulCL2o4iCUxAEN30KoouucenFnWi7NW+l2roAoF0V2/l+WuyPZpp3X6uBS+gTTzcT6WIozQiAqOqlOPNMmGjEgvbJ1aIYXzonZ6BCyV7grbV8/sx9w25o3NnbH4qPRaDT2YlNLjQQ/cxkPhmVWinLYdNUBL9w5flTIS9w4cOQVDxobLqMaq8iveLx+Z+By/iTnaCmOb7IqnDFlaNNUxUVEHMnwUIrT+9wzL7zXxEzbUwAnQqH1b9BibA==; 25:uhiLG5sbcOlex0F+hE+5LEecQYWOsAgWHDLm88/mSBZlB6odQNPk8Xoly5teCvzOxzU/dfjOEh4Dh4VSP3jj9pqHzqBFa346TtOJcvxlqSaBiQJNplpwIfkK4lzWHBkdgQe4L74G5VHtc+/ZQKgIWBlvsWzccu0w8L6v4OLRi89VegmGBIpmMNEnaeOF1vFmXGsXCw0E+H8kR3w1op+h2FLl5j0SbxEtp+gNLKw8YU96xxP6LpACXfJM/amuLZuKdDE0osV9fhcsps8vYtpTF7L81IJkkrkuZez7RrlzpFe9FOg4tLhNKEO5cnAou2kElj5H2wDj2Wb1gAXPx5h05RKItxmrd1NWespQi8OHFYs3oJdVFj5Zqz4oJvQj9QweKjm5Cesj8jVWdU19kDzZP/DZS4+lI5d60EbmkxtMg2k6XDgea8C+lb0HEi2Ju+mkb+Qct9f8TBWzsA6kco6GnA== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:bp+O6mmF332Fos2OrXlCPjzKtDT7gJT/9zNqiJUMrU5z3lxNllLeFnFdKqaLXWZd6Kk9l1eQ3RKym4Z82hcndoSAFAaO+3ndSI7p776NEEpxMqWIsCzMu0rZZG9cPIKaK1nukHbROTRqnuRoGYQxC/rjf41ws2FeLRYTox3NS0kCPE2yF04LqtcQuijii3IYKFFs3sARAp2RF8OJ8VpyqROMuuqefJe6uW1DLQTAbdmI2CBIa/J/EwrkzB13D54uG0UuXvAzVOMb2MZrGGbL6g==; 20:2BAReveaJ6CvADaUfBOMs+zsjuUrscIsiCXN6LeMMe89hggK2E5/h4FNd+qALKA+suWp22THgT6gsjpsKQP7xoYV2SX0sZefnwbDU40D8wnHrIBaBBZFH1ujzInq3z3qxN29qiGxRJoJ7++mch/knodjoflNmfH2u321eIgDoIoIPrzgX1u+NOcP/jEqXqP5nf/bJ6znzimCfc3PwWuozkOv/4YWdJer/c8G/EQ7EBFMyHeWIx/2FAM85KdGJ7XjAioBFqMHPhxMnwHCGzZlrKuidNjnaYF5y5pJ1HslooyuED9oPoePU7Gno7bar18NI/I6oLBNDXKrr9M49RvUxFVMJWSEenI9QRuhtqvqWS+O2wa4TgZnHN80iLuZE3BlFuf+1+IT4hWEHKI9ianOVibYZzgYVyxyvPmOSShMeEJ7hemq3LsLVsWP6Q6oYhYLE5vsn1J/th5QmTHtdZI45VB6enAo4Umg5fNjMqAVCqjqIVncvyD8E5aL6QR5fhFoekfPgxOt3wHXu3FyoPzVTbKyzglJkC1AgNU8/56kgKuBj3/f7Tx0mKQ6BI1H8Bcbxnd3oX6ULBGBcbQZrRiFhEm/rmFXkLaQ/lyAXP7c6MQ= 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)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(6072148); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:x8bKeHdZ4i/xLAgrG4ObZob7OiovAay57grCFeAoX/mUiT9axU3LBEgJTg4zHh41xLKcs3R4dxkxFRWhh02Wcj5QmDmL3uFMddGbXznRvYZ9vqklsapeE+9UeSxeYzRA08MZm7eBw7S12f9H+mWoCTm/XEvcwYTHSpag/OXtg5fXpamhxhdCO4SPAw+DsPBfd7ctGqOqrYk4WAP4IIkS1l8K9NZx07k/9hu0jlhyENL2IvFexbowXno2Jt3OuqnpUGg/AcfgpPofL5RPRWoApw8Z7zYydjlnxJa61Q3wfHIclv7YCrdVs5I/P/r+szM4krKCAU+Ms5fyH+xHX1pwTZhP7VSsXaBvMK/nWkIBZNvX5x5CE9OgEKJxLDUFawsVGIYak5640by482HyXPm4lAKuPLfRrg1NvTK1XwiJuiUUWDd0LVfHL45NIO5Q+3+HmjcOzdzx/Zb4AM1wNJlvjWCJd1qfC7gW9LQiYQciM6atLsPFXHm+l3aLeXU3szrr7TPOpbyD1ziHYYDUXOPgqTi4LiUJgkdVf5PiM0VCTaNYlC1EQCuZN7Sq3elK7kixynBejzPbfma25BMfyGCqrmfyZWz+NRK3xwhToYim4fM= X-Forefront-PRVS: 01565FED4C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(39840400002)(39410400002)(189002)(199003)(6116002)(6512006)(6506006)(6486002)(3846002)(66066001)(68736007)(47776003)(92566002)(5003940100001)(50986999)(76176999)(81156014)(50226002)(2906002)(110136003)(33646002)(6916009)(101416001)(42882006)(2950100002)(6666003)(4326007)(4001430100002)(81166006)(38730400001)(105586002)(8676002)(106356001)(5660300001)(107886002)(305945005)(48376002)(97736004)(50466002)(36756003)(2351001)(42186005)(7736002)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; 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; BN3PR0701MB1719; 23:1ldKS3P7/M8Bmg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W+ZTsPuO7Q/wyy9ykXyl4yiuDsD6Np0EiahdkwHL0eZbeotA4HiQWsMQ7wGaLnhhTQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:pbTZKJ/yRh1ZTgxmmSTCIxTHqCdgefInHSFWX5O2FWBNHS51o0hmTdbSKsdT44v9NCHgei/idC6amm2QNHwlEzuWVTvYv6ih46C4M3QvNXIq1r0gLGVMzNRF5uDoyChryXX1SZI0HCkiSIsbw2C3fQp5fgQssg91XLzmzEqWOKt8EArhVG59sZmvbaA46E6gGW341VMrHWxOcgCwRvy6HxejoH1oDcV9OV8SYpR8pgU3bGBz+Zdw0jaTF/yh1AKK5t+VrKnxladaW+jRYeJnaD8PXTDWXqi8HxavicY1oRFxUlkzmx+SksTYC6ZwCqHVP4Ul7TjgvGE/OPQQ1fKB+O3ia0MjCxw0Sj9kJmbdgepam497qN3ySA+zAPT/sXw7ZagH65HWZiJGcg/yfKttvoS9Eh3hVroHNfjanNE14NUlb8yFrBaj5JRQ6c9gbfDUg1MBOX9J8BI+xAa/1jtcew== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2016 01:59:14.4027 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 25/28] net/qede: 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, 14 Dec 2016 01:59:19 -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. Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob CC: Harish Patil CC: Rasesh Mody --- drivers/net/qede/base/bcm_osal.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h index 0b446f2..925660e 100644 --- a/drivers/net/qede/base/bcm_osal.h +++ b/drivers/net/qede/base/bcm_osal.h @@ -18,6 +18,7 @@ #include #include #include +#include /* Forward declaration */ struct ecore_dev; @@ -113,18 +114,23 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *, dma_addr_t *, /* HW reads/writes */ -#define DIRECT_REG_RD(_dev, _reg_addr) \ - (*((volatile u32 *) (_reg_addr))) +#define DIRECT_REG_RD(_dev, _reg_addr) ({ \ + uint32_t __val; \ + __val = rte_readl((_reg_addr)); \ + __val; \ +}) #define REG_RD(_p_hwfn, _reg_offset) \ DIRECT_REG_RD(_p_hwfn, \ ((u8 *)(uintptr_t)(_p_hwfn->regview) + (_reg_offset))) -#define DIRECT_REG_WR16(_reg_addr, _val) \ - (*((volatile u16 *)(_reg_addr)) = _val) +#define DIRECT_REG_WR16(_reg_addr, _val) ({ \ + rte_writew((_val), (_reg_addr)); \ +}) -#define DIRECT_REG_WR(_dev, _reg_addr, _val) \ - (*((volatile u32 *)(_reg_addr)) = _val) +#define DIRECT_REG_WR(_dev, _reg_addr, _val) ({ \ + rte_writel((_val), (_reg_addr)); \ +}) #define REG_WR(_p_hwfn, _reg_offset, _val) \ DIRECT_REG_WR(NULL, \ -- 2.5.5