From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0073.outbound.protection.outlook.com [104.47.33.73]) by dpdk.org (Postfix) with ESMTP id 446BDF95E for ; Tue, 27 Dec 2016 10:52:26 +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=xacL2X3sGap134nQAIRr8z5BJNM6POFkodeHJvzbzVk=; b=Kvj5aLuTeaK3SNtSHad55+INtBoRlarBMV46H0UEGR6IGfM9A3bcM0l6ivD6EH/WCU7lfG4/GIdOMxcdci5CT9rntdFi833S66JoGnXw7A2pabm65rTe2fo1P89VrXpUm70I0yCibfyOI8sMQMUSSYDG9UJDynijUdm8Q/m3D1s= 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:21 +0000 From: Jerin Jacob To: CC: , , , , , , Helin Zhang , Jingjing Wu , Satha Rao , Jerin Jacob Date: Tue, 27 Dec 2016 15:19:29 +0530 Message-ID: <1482832175-27199-24-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: bd7e0524-ae35-4a1f-95fc-08d42e3e0fce X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 3:7pkNdvRNsoMWTQkeV2bl6hMqddhlVheg7KhEIbLckbBGBdeGxgtuHkDA6XByUjvNSCZ7zjuKbNt9xexirdIgMrpvY6dPHdD9qPGBSP9BxwR/mw6c1uzX/YU7RvS3SUhCfZsZnmuzlUEhmSjfre5DDNHLtyZ/Wls1ZvURcP4j2IhrRjguzj5yT9pClh8mbgJKL11VCxjLbq5kkb67LJ6hQlQ5lyFyHpCGnsf3idORjS65EkX8O4I+fF0HStVj7g20Nl77Us/BOBo4b/SJT7pZ0g==; 25:7HZuFpOlXJi+jGEl1rgmHMdgB24v9FPqPzjqNFYt/6W4AiuC8W3KkrZwUrN/CN9hilmTl9Px8CLrCE7jJM9W8PU4syy7EdazkrDO90h2OegPjblf554ypAPm0iAbc4oZ9bwaZRAH1DffnHpOVTOGs/c6jU8rN4JXzPgNIyfQGKd6tohrVJtPPOqbtYWgTF0mQ6uL7jBdnZzfBUQMPVnuTloYNAgPfwLr1MdblJhxC5AIU9l1SCZkY5FlYjE3mJQVJUG3HkRcgaT0yrY+gtU2T7WV1uwQszX8MrCbqkPqJIm47rUlKI6/YMdxeVmCsixZmlkxKDnAvuybmDep+81PQ7WsW7y61Bhw9RNru984RSe4Ur1jm2TIXhDV4892bHGsmTL7Cpd27NKN0izLgmiJ0p+sLr85+DvJc9mUgUuvVefsJq0gVNptVez0+8pHCQXECiVYGikxq6rPFZlcuZTAmw== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 31:k8KbuD4nH9mOVHICNZ8TV5lHksIrj/JC66/hjFP4VPCHXBJrfc0fNUqHapIO5TW1X3umB9SBCNqwad5fC6d3NkC+Yjjaf+1VDCHkay7kLIJI6jqR2kVgnosZMqhb6IxuZV0Jg3E22mhHSGwZFBHtYf/nX2D4JmGJt5IjLUnyvzUIRrn5EiJOvlPSKc1ilVI/D/eCa5BLaDWDMMMCHFH0gLJrFj9ZBoF27kfCv3roJWGM7tyP/JUlyeDvqU7rgPE/; 20:KloFmvRD/e8WKNi7PHACIUs8d7HyMHNWwe8Wr5cs1/pXiIRQk4uOLSc5YyTZ20sn4W+i/6FPpDY39c9d7reQxJUCOBqiFzusa990vJPfkWtJHOEdpuT7XAvDA2QhUudftcKdXhmVWPMPGP6A3NblwsQ61xQYtMKLpxWfC7CaA1SU9JsONvrZbJyRC5g8F64AkCMKTQIQUwziFQHUmJfp72uKlKo/nxXGp7fe+63T37saSNRYeoQENLbiiO9bL+WKuaZQPdQPLcWDgCDc8lhCNRypC1G987ay63VovPGUEv7ZASIt3eTAb5010bgf7xnZKFXIjPo6VssVV4bBIbUE0KBGhFhg/uXizZtDc+iZ3ZFCdkBuk03XtWh3Lj4di9/jMN1hlWPUEQ7jCHXmhmqCjdwac5Wkobt3iMYaIwKI3EM31kLIXa5BkdtktI1cx+/0ObHvho9c4EajUefBhb4+OQSMLygLz+088IChoGv+bTKisBlVAisowcW1dvokDOPoGDOFVUYA/sx2ksjFdFdHmRpGquy+om7Wpod8fTsA+eGOSE5eQgA9rHAwYPClsDxvEdXHE+Uoid1AqyijcD2CayMPKyaHeN4DWL4CiIS9nkg= 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:1UTVGCPnDu7JXnON/7iSXOg6lMwkllquCVkqY+kAAL480YMl/IO2wcgXF3cvFt9vOYSI4aODHZlmHa31dZ3g5U2HEgwxONLUL6DHMmIo+5dmA0VE+tk0HxBx9IX2w08zGZovyttaqVaKexpERbLG9I4D/ENz09hT5txglo7rfshI9/nAzfoLzggPjvQTJEHbwuzWVIEqFLxXbMBI0PrifFWz8WGV/80IyRuJkwAbXckKP0n6vrwKZcaw+7X0SrGhjTpE7qQA4N8K+q0e7perpeE36P94gliBczgc2QN5ItQqhqOfoxcPDPuxcMxbADT8zfYYKZDSl+m+Xe4R5kgM5Y8e7a1XwA19kyf/mTKntEXgcGBsvH2zDsJzPx9LpcTC5c5D7uODn7vGPT8c8N8WHBeYs8l/41CU/afVseKOAWJ8orz4g9Et/U8RvltDCoVBaP0OBGEugkGjPcpw7UqkSY+7X8XRcSD4fzXOckCLGy8IdJYJQwxp0dssvh7IrmN0dvDG27LmDtmbmhMM6RqrTTdCtTD4XJrmsmLx98wo74SKqcOG+TSmz8MUfZ8Q967zeae+/o6RQJ769dT3YqWva0qy+QYcHjrOzqK8Kee0budlAhTicQzVkav7p5MWkERxnpu/lEkTe44LPW3JhYeXa6s2gocAMi6FMooxiUFpMr31HxJ31n5of8hsB3vSz92d 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)(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:Bs38lXZhocterYF/PKv/HZ0EBoOSDTPI6dNUKD9?= =?us-ascii?Q?zgL2djiv0q8a3BcSdzgixK8J4vTYJJRhWw3OcCo6i7FPOeJiJ+9M7RAIASRD?= =?us-ascii?Q?M5IRf9XosyWMImeGhR7XeiIOlbTffsFqd+Rihokckofr3ORuGSEVTdtojmZ/?= =?us-ascii?Q?3puv8R/jsDfQvgMHByXzd1UCmOic17qtaTZAu2eZ/wqtH704jNuh20V4EDuD?= =?us-ascii?Q?dt5lHxV0+QNGOQfvPmicD7EVYuXCQa0CuzpBqLTWfyK5V5uvFnjNUunhPMHQ?= =?us-ascii?Q?A8Y7oX/D+klKPS+nU3kc4FRCJ4iMSVhXg/9ApCk5dQHwBzUqR5zr3qeVrM0k?= =?us-ascii?Q?nit/0GYELAO2ze6VeoJT7lVxYbljNKsKR7rS0edyPER3zoMLR5ODnALTYjn4?= =?us-ascii?Q?33dJmiOl/d4TyvN/D93edEQBUD+4EpGxyNKvSq8NXYAr2TOYb78P4C+tBGUr?= =?us-ascii?Q?NdSG/yufhCSwx8+2j3SqZD9hoQEgspR3bq3uyx4SENwgEdQUx4xxQjHuXwKH?= =?us-ascii?Q?9lcmvgs3TPGelKH7NaNhnIBWHewELsx2Ho+1tUqTlJrO/LjCdAtqTk9pRo3g?= =?us-ascii?Q?w+ANFB4tfz+bG+nlIjYIxkXMFvl41RBFanycCZypehUT/c+/wKjcoaB0iTED?= =?us-ascii?Q?IL6GkS1yP4eF7EdguRhXzoehfQUQBEvsOglAHtSEshuV7oR4qw3JexdSFhCW?= =?us-ascii?Q?npt6R8kJWG/T/mVpanBcisps2mGTh+S4oUue1wQvZfqraWjBjydttRWwzOOP?= =?us-ascii?Q?8vVTMblMwQBi6JDyyA939u9saSdS9burmtA2T+e49cfMIEveSLeI8GmAeOD/?= =?us-ascii?Q?sx0M6uo8vybyTPEAXr9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nACxbTaQHHttML6+dStAPrAw6w0lpXSb0NOoEw+ai6dmV9mbyo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 7:mzOGsoKQWT1R8wgf1Umi/EBzQqs5TlYUgGarqMNO9vwh7j7GGnDPBSw6kDhUvRaVZUw6+Pasa24g0Ecv71WsQ9G1zG1L7aTsShwSjaQKvKLcsohMVRnxYKd8QGBZKzLdQtAPi9CdKfmFN6Gn09PRLDTLvUIM0pSka2XuBjWDAHsWrtP9iR0+0y2APEJOIaRK00UiWED8KQiKSUHdDOW2FiwJp3DPh6t0sYoaYI9lyjzGEu0js+8IfiuxYUQbFwZ1oWqeNLHyU/fzGaZGeLY3jQMliSKLMlrO32KlarH3j87OWG6srmODNDb/DW3nVlzw27QuXyVBmdQGWmzqsEebetUx/rFK3rUiVIsckQTAgtvHwXF5Om8XrAtCxDPFjxPwL9gzLtkGkqyTVjxr62ORkU8Ou5YoXfcJmCd3i07dUqF7IjcO/o+PMn+ZNqe6P+vZCwbfo1zt6D8fpQ1KsuqqOA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2016 09:52:21.8327 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Subject: [dpdk-dev] [PATCH v2 23/29] 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: Tue, 27 Dec 2016 09:52:26 -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: Helin Zhang CC: Jingjing Wu Signed-off-by: Santosh Shukla Signed-off-by: Satha Rao Signed-off-by: Jerin Jacob --- drivers/net/i40e/base/i40e_osdep.h | 10 +++++++--- drivers/net/i40e/i40e_rxtx.c | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h index 38e7ba5..c57ecde 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,18 @@ do { \ * I40E_PRTQF_FD_MSK */ -#define I40E_PCI_REG(reg) (*((volatile uint32_t *)(reg))) +#define I40E_PCI_REG(reg) rte_read32(reg) #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_write32((rte_cpu_to_le_32(value)), reg) +#define I40E_PCI_REG_WRITE_RELAXED(reg, value) \ + rte_write32_relaxed((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) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 7ae7d9f..5c41a90 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -1228,7 +1228,7 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) (unsigned) txq->port_id, (unsigned) txq->queue_id, (unsigned) tx_id, (unsigned) nb_tx); - I40E_PCI_REG_WRITE(txq->qtx_tail, tx_id); + I40E_PCI_REG_WRITE_RELAXED(txq->qtx_tail, tx_id); txq->tx_tail = tx_id; return nb_tx; @@ -1380,7 +1380,7 @@ tx_xmit_pkts(struct i40e_tx_queue *txq, /* Update the tx tail register */ rte_wmb(); - I40E_PCI_REG_WRITE(txq->qtx_tail, txq->tx_tail); + I40E_PCI_REG_WRITE_RELAXED(txq->qtx_tail, txq->tx_tail); return nb_pkts; } -- 2.5.5