From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0066.outbound.protection.outlook.com [104.47.41.66]) by dpdk.org (Postfix) with ESMTP id 0974F58EF for ; Wed, 14 Dec 2016 02:59:04 +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=aJSR1un1R4GC16Jh94vkQOt9mDgyJO7QYQmZbi9FMA0=; b=NfhXLL0PrWRb6UeDOR6dBgJDpriHPsOmKVCrnfG92MM4iOz6k5saatJXrjm/jAMH88+rrQVTNBVdJvdVDm8iC9/iuueyovAsjwMk+6xAMurmvFfiTr3PvVytVnuknP/9X3eEv79/sOr0UKGBrUBDCI5s48rsiEnTkdhz8L+ZcUo= 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:58:59 +0000 From: Jerin Jacob To: CC: , , , , , Santosh Shukla , Satha Rao , Jerin Jacob , Helin Zhang , Jingjing Wu Date: Wed, 14 Dec 2016 07:25:52 +0530 Message-ID: <1481680558-4003-23-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: fec7c55d-52b2-421d-d1b7-08d423c4c7a9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:RFamfg/5aJoKDxfYVZPKdlfGDAL/57L0l/G4MOlYOIv1MvU4Ogeu/P/r/3XGboR6IBuUgfAJmcUNBGKS7tH6Tt8AX1bqZyUScpGcb6Ihr1ecNOO5GR4ZN/cH+JWarC1ybcevtH1M3z8eEaBT6LBvJocJMkdKPdTFtb9JoWLoLF8sLyFufFM4Q3HvoJDuMskQ+JcSJWtG13LGV+KI0ytN8mu3f3Ef9TXvGu8GjK2NCkMAk7Apf1BsJTA+oqYS/02Odd0NIAyTqraqKzg8caC2ng== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 25:neJ6vP1qVwcJhTtUwl1ZV24TydAsV3r9wLuziDzy5AHJn/LmRgxIh5pUZ0MGKlR9prFrwysiQfDCdiMdGz7GyysxaZoDTm9LUUvtnAGmuJwt2CnKgPLoLUlDZXkkgV+RYrp3nMM7jLs3bJEX+zVyP4YKtEhZ9NSloofF07x2/twXqORcxaHsyrYRXVh4uqYrjzwYHUbTjnsAAxw+tGcEIN18OdNMEk5tK8PbD0fZghndkF1eUZp/9SjN0VpMJKbRsHst03Z4+0cEmSKIj3Skuh3V8+CKe5YxfxmX3ZkRN4Ov7lfD0llGp+p7Pw/dCV4Cs092/ibUIFwKx2BHk7Jl7lhfZphg7GpCb19cvDLSamY+xkiR/0qW6vp61he3TwalimynoxQQhC35vvEx/XLmVns/pUT9/koeWQw01lIkjvDTvzTg7YXZ5D+ctCmq/XWJ1cMn7DOVgH/GlYIkEynuRbY5bSrShTlfcZ55MHkXR/8jMvAiHvQuYmOfOVWyTkyL4kpY/An4H/AHIQTnlZSHGOQEj2rArRxhXkj08qwYO9nKeNXbDbE2UtlYKOlkzXPSuPLuoDicqJJiJJ5K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+ruB2nTTqdTDUmDjzAoKRsSlBkYc9E4jX13jlJgFfXiqYJip2kFERGUHKyiKbDcdS6l01w/IWLNPc= 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)(20161123560025)(20161123562025)(20161123564025)(6072148); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:G0Ia83dA75JyxcGx43LbcykAPjL+F7g6NBx9bocCQ/WFqg6uI4/pHdBbMtHlhCOMlSTK+t8ju12IpJe3//0SiRKt6/RtVZEzIYsIwfaDCAuH3ziuNxUNYw4H/heehIiCe6z/+hvXzY2EbXhyvG9u26CUB29Tldu/NgQz+UoOuNOAMKK+L4hcsWFhYOH5BdtJ2ntf5NpkQiiVV7TjCCwdqgnr6AmKsK/9Ed+OcXGJZ3PDW+lQBuU1vHlIr3Hoi+AYYlmgpnNDACF4ejBAPIoAJ8wyoEKzys/jm1H/k2IbALc5hePe4xiwGC7eslCdAowU94ETQNb6A0VqrW5Rc4epz3bO7bj53WT41jxyiNUnGwH+43B0qrrawznRDW92mqaukX8hyRh5sneN5oZa+H3IUmu5cowf5f7snosws5Y4i1CYeTwLdq0ur1VcdkkFS/cE31VO+ejg76iw4pMAnSe7Ln1IwvvkYpgbTVF1eCp6q7+EQubSopnP2bSQ5lcNmqk0eOiL2bJqBWYzmxOlK3D+bbJ5w4v39T5OBSPrqe4BJxNwyZdNfNab5LrywxSFlMfcboPeXkqqlP2kudAx46mIcCuc70peKlLT//amAY/3KOcKeUVz5nj25quH8FfEX+ykBXVhjesrMXSKVMdALQ8K2g== 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)(81166006)(38730400001)(105586002)(8676002)(106356001)(5660300001)(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:2IlDyY6lrFSEQ+ITWdWUmfcHgt655/3HMYIOjXY?= =?us-ascii?Q?YJUoVG0oJUhC+4jwftWNrZIQ3EY8B2YKPf9FDru83VlQv1doZlleg9A9uyWc?= =?us-ascii?Q?2EQG7hZ0ptAPk6DHCMh6IGiiCubdHbP5s5+hxNoIsZS6RGiZ0yzjSK1ciP/4?= =?us-ascii?Q?JhYCVH7mP5dGcVwT9HaRvKf/qMeL2c35/4E4BODkQjYl+wqmEg6bzAtfOQlJ?= =?us-ascii?Q?mETOXb+9J/IMmZ25a6XuA8PZVe8Hp4IAm+m8sDbVq40uUg39DMjIRxLmFkRS?= =?us-ascii?Q?zk3N0z9UOZh5aQzasj0daW/Q+U4GrflhfkEG6V9q8FpBdXO6txhzUC8eMiuW?= =?us-ascii?Q?Adf+C/TO4QKuiNn2IgOjX8G3UDoGjOEa7MbW0HO/8oyqShh2R0MbvWwCJ9yQ?= =?us-ascii?Q?xEMAHR3dTKnJINCDoBDAaPg/M/yiOOO6ffvIDm5tHy74AXfBHP1gtVMI5+7K?= =?us-ascii?Q?qgeWxs6i+xfdE1ElpdjUfOk0OsNMUlvh1OFuu8qGUD7Hxq/uaFR3zYhh1Bmz?= =?us-ascii?Q?FDrqIW91gFSlb5R8RUS43q6NvGHb1/GFUoJPSi8SYt8R+0YcmtOJsO+dIrDM?= =?us-ascii?Q?SKmuySf4ICJEfb57gvk1PONpuiBnlyaC/v9iicXg4CAF2pkSs3IlmMCk40JC?= =?us-ascii?Q?0wLygJfchopnf+ZuVt9PtXINNJqt4KH5UStQBSy3uPUpG90LskTeke/NS1Uw?= =?us-ascii?Q?xYJVuZBXBGvctXWWGk9zIm7bSDp6AFLgi3gvNe6aLOmnIcZDrGko8MBEgcx5?= =?us-ascii?Q?GaR84MqQaRhLQ1rSSUGtSKqtGWGgQes1+oreVojOu1d8VNuDqACibkqcFVmd?= =?us-ascii?Q?4NV0ubw5lFvihwI6Uau0EmPHldyhoRVixGwhoJoIvzYj31cclGAciNKVn0Wr?= =?us-ascii?Q?a5pVTFJRCQlqtb4nuo24e/P7W0H7PaSRvLMbGBrY6vNxQADHUOhUE0zQl4sg?= =?us-ascii?Q?TOLX2P++OMUpa8pu0dLJnXDmiUCLTkdK99sJMqZjBaCuQkGy6UUzHzes9hWO?= =?us-ascii?Q?1ZcApJGu6z6zZpwX5VeMwBw9Mf8UrzNVuNLCS6EroIT/zV4yJhwdPLOIWv5w?= =?us-ascii?Q?5KPEIzN+Ev6lFsU6KsRO956RcqArNRy9bE1HSDEN5uMImOlWoZZkbHXcxGQy?= =?us-ascii?Q?Dotn4qKdKuQh/AjhUvCjNiviSSc2xUJU3?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 6:h34YKwuhPf2PWyILNnHp86+kixtd58qK0svkL9864fQr958HasrQSSv746QEqTMNc+wOzSDBb0OLRq6cKNxHay5K/SUBmR3txaRT2btLINR1ilCZ4JQYmXscLD6dfioZ0zm3nlVRXobr1NnFjLkriPW1ivlBFeUC70NSJi2NdsL3jgL/nViH4P+GXp8Q+RW6aEeF0E0dgzT4fXcQH65WerlN4p0La4HKw14UYImLVMeIu/TgRhO9cv0VkLmGjI8o7q9q1t2oJvM8fTmLcGzC4/r4umznujl0QWuExA3sr1+NFLULuwXEfGaA8TCt32Q48L93xafUeYRw3b9tSQLPxInYqi76IkYraCbQjZtTcrQgKQVb3+WNIqWu5D10fLZNsduk100zCTi2LXBjF6goiKtnP1M7+tjh/F8zfpCUSK8=; 5:slxAROdwc1PgduYPLxSyxlKtR10f7YtJ3OiW8Z6JjlWoyaR7nAuaUcsVMr1Ac8cCKtTPXLE2W810IDpV6EmpC0uVqDw4B65aiVJq8Rzl8jlRRVxXRIxoOCuoJJ0Md0YawauwW3y9g2q8wB7TNUWVLw==; 24:EQU3zeCugtnXdBlkjoU7niO2L+heNcexpTTCdCgJ6Nn65mPJWSb4o3pRf6ZYRrwlVeqnGVsLgLkZEhKUxvS47ZwFK68sOL9gEsMnRj3MF38= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:+DGWwY3Vw+lpm0bULwYpyuj9HntZ1WFTO9GWxRfwGbFzYlgaVZu9Xe70AxTB0ktI30apvznsjbo8XbXObx//p4oEGBA0h7bij+VihlDN0rqhbwR0lLHlQngylisjptz8E45p/XbUny77W7NX3uvjG6sALdPhRPSc/C+gEZRg8zro0UeuG5go0ktt9gy39l03sHapjEY0OVw+e7eI1NJyd9T5L5VNkDY6tFa3/Xb5baMvtNf5MagTA2A8ZQSVZyQvUZLBupnjvB7rrQiKUxvAshh6VVByZu7LQ5bU7uwM4Wxw/ysozH1Kl/EkuKcShhP9cQ5ittPGkX0+ki4Jkrsw3QnRV52CpgspBhEX3JgVb4FcXBmN/0hYt2ktVhmfpZ9K0/5bhS4zuc1B7gY09QiLGvu10Lam5rzosKfuw9P+Zi7TCuQYGgYMJArC+1MbBE8WY2loS/UE8Qx4Nf0V5E91Pw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2016 01:58:59.9710 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 22/28] net/i40e: 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:05 -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: Satha Rao Signed-off-by: Jerin Jacob CC: Helin Zhang CC: Jingjing Wu --- drivers/net/i40e/base/i40e_osdep.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h index 38e7ba5..8d5045a 100644 --- a/drivers/net/i40e/base/i40e_osdep.h +++ b/drivers/net/i40e/base/i40e_osdep.h @@ -44,6 +44,7 @@ #include #include #include +#include #include "../i40e_logs.h" @@ -153,15 +154,22 @@ do { \ * I40E_PRTQF_FD_MSK */ -#define I40E_PCI_REG(reg) (*((volatile uint32_t *)(reg))) +#define I40E_PCI_REG(reg) ({ \ + uint32_t __val; \ + __val = rte_readl(reg); \ + __val; \ +}) + #define I40E_PCI_REG_ADDR(a, reg) \ ((volatile uint32_t *)((char *)(a)->hw_addr + (reg))) static inline uint32_t i40e_read_addr(volatile void *addr) { return rte_le_to_cpu_32(I40E_PCI_REG(addr)); } -#define I40E_PCI_REG_WRITE(reg, value) \ - do { I40E_PCI_REG((reg)) = rte_cpu_to_le_32(value); } while (0) + +#define I40E_PCI_REG_WRITE(reg, value) ({ \ + rte_writel(rte_cpu_to_le_32(value), reg); \ +}) #define I40E_WRITE_FLUSH(a) I40E_READ_REG(a, I40E_GLGEN_STAT) #define I40EVF_WRITE_FLUSH(a) I40E_READ_REG(a, I40E_VFGEN_RSTAT) -- 2.5.5