From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0077.outbound.protection.outlook.com [104.47.33.77]) by dpdk.org (Postfix) with ESMTP id C841EF618 for ; Tue, 27 Dec 2016 10:52:05 +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=nClJTkrJrI5rZP8hjZ9H6s0OcAV2k82t7AL9fvlqq+c=; b=G+Is4pD9RSYzbINVcFzW9/RMoZPjHgLP/d7SWQ0F3EyCkdrIiOWgEo3FxLIk4hUODxCbNZ2TOEk7slBImthiVFpE8vno1yYvuclPO5lLCynbI1biA+UMbHXNVfCk+OOjM3W4meIX06yx5hiLj9WPzLJFi60nbf8N9zb87jwMQKM= 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:01 +0000 From: Jerin Jacob To: CC: , , , , , , Wenzhuo Lu , Jerin Jacob Date: Tue, 27 Dec 2016 15:19:25 +0530 Message-ID: <1482832175-27199-20-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: c9c4ae38-76d2-444f-182b-08d42e3e039a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 3:HWMEjLeFmPL07ZS1NiWLoyFZ6wHme+vEp/xMJGg7SVpF4/v/6S9PysteXfPtLlryfBzhQuP8OG2XHc/Re7cJvxUgzAr49pJQMTAo/9zebk0tsE9iqVC2XMxLjF7h+v2Mh05LCv418m46E/ZM9g2ftwqC6lDuezwDYYY7Bmb/cn69ptea9686C0rNEQpbPtfp4zPQPBqJ38rAmsHMZTHJQ/jt25r2KPIzbEGe/JwhQkAr0XrArk3nAlkr5IsF4GMQNS/WCTzjtQd5E5WnzuYyZg==; 25:00e/MxbdtcAvonzwP3DsT3pYlgCyjTx0RYoNg27kL58MTpGnJ/DcJbiBtq5AIbddVUakz0hVWWs+G1fluMgielIecPkNGR63vMCrt2ehTRe7dovh8/WpAPxavs/+0FTSkiRNhUHs5JuHqBL2o4G08xaVfn+PU08U5LVSMir2f903c6KK7pvnYyh6EntB7Ycuw37U1EUv6G8xe8GsD+3p2iGAazmR4vsK4gX5O0oSUJ0yp6n4cH3xLZyEwnU3bRuE8Px8+9XxR8/sakH4T1/4iKkZGUjMuv2ySxYrh1Zz6x0QGMZxH9Ce+/jVNeZY5CH2iiFGhjEZAb65G47XRnjnei8Zb4lcG2scYaQExv9JNckdllcgBP2jgU8MZx+BMWzm5YR3BD05D8xQvtwivPqgphngejxzsclt/t72njS1eY3nTDhgJPQ31jGrReWMy50g+55RCjW3eGZ5zUlSd2rWlA== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 31:fqq2vEa5/mb5Zclu/Fl15T9Mz1sNi6Fx3bT8QplK+gDFjp+cLL7nuWbolhO/jJ6CKijIwK6Yc4aXhPA7/27S8/pNCoS6mQHcTQFs1MiwStVaSUeTYlfGVq0nMKKkxOz87ESoilwFzte39NdaXba3Ge3q0os475kAtsY3t5+Zl6lZkFHvopRykcu+uLJclYLmGvoj52n46Lwrl9BqQFxQcgBJkxYF4Vxb0Gbhb6p//L63EE2yTkg8dQIoqT8j0liQ9kGP5hfSoT3/JVp2kwrkGA==; 20:ruuyARYqCgoIeElAzA3h8DtE5asDXPp/mc1Z1RUKX0qbzso4FMtg/5K2G/HkPniIjNR9qeF2MC94gKs+bTel3vyq3qSKjHyw2txMtW9MYksSCgBe/4VactgGR0XQBgA1DElOXjEITuGepHZ3eC7/+hJf1u51PZU1nGC+O+H3oU1vmiDtsWagR92tTD8UYe4MGAQmzxzZxup+r40t0aSzRtKdaDJoV6SOflJFWnDPSwGAE/HOxHSlZj/i0Yu+L4ezbKpgGxAmX/jWsrH0PiPZvo8M6QJ/SE9Hka24DHlY6TucdT5bFMb83jcTsSAscU0h8NS1yClvhu0V+oL48rS6rxnMiPcgCP89ilQQd4ZQdUoYDt/zBBAgDp1MIn68h5t+O7qLl4Kj2j/mCegB3iNQS6B9GLtN8UDBpFWQNFXNn+zQ+DGFfh+UolvXsHQbMhi/hSfPjHPnuOXi1fY3fCWl74yTOcuwZQvard9c9X3paZxvfVw22JwVlOv8Z4fZJ41d3wznJlp6AZJcGyaJ8zy6gMGVQJ3//mWgJ05mnQlcyJ3l46y5dBF3qATa5tAqWWUh2+FiDyESJ2WricakeB9Qq4tNORPhdqP3IE/0pbZTuMM= 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:XFkpkugwIdqtrg8sdwaD6/c0Dvm52pVodL/xl7PRDWFyq0VG7cvknwgYtSqzzFVwDeuJhRaY+OJjluVjSNBBoNFkKpiI5RJLwJ1lH1jjx2Fs/uSJ9co5FNEnDjgsRxbMN12pok4wVz9JZ0NuQrZa5frxk5QKGcVf+paVwWF5LbyNVvOo9b7gPWXyoFVKPaLkwfd6O8mZA4NZMX3nuLjT7TQwyWIAFZV1V3k+OR3fqh+vVqfRykkTbUnJih1FoeP7c1z+9aQ1Rpo6xCRJLb82DYIhWDxxUwahkK+H7I0KT5wlPW2WiprSLVsXtNeBEkXM1D9ZFTKVzx78lCr4gtJItsbqzB4r46QdNI3ZCkULOog5dM3QXL2YsNSHXgijdvdsySwWWztHabdxiMjxmob+Af9hpg/6bmc37GWgdeGjwO72c1vk0BXtBbn5szWZbURb0ct5icA8x4fZNExsm4HGbhlFvec3Sg/6fO7UyuVOQXGOhWAyopuXtU+IZIKATwteXCzffRLXJ0QnXGdZci2jgvn8LYuz8b7gN07yR0P0d4LNxVGLTvU3bYBB0O3UOAT5XuYjRc0v8O1QxcpaxP8/eD11EZkYpvspOcRmPGv6XWSxj/G3JzA0WrjkK+qGKtdsdnjtMiz3MBp3cCb8NQ7VhV/pcfJmsJcoMQRaQqmNohMM1x3wTbMrqAJg1xhn/xft 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:ccUuSzjZrqQnAMSbLxTC9t+e8wGWUXGZX8lyPSw?= =?us-ascii?Q?P6meYOFJOLda2abQ9WCbKAcXU53cJEASzOm9VuDPkDYKN5+h4AV6o7aPKnsX?= =?us-ascii?Q?D0Fo9VaggFTAUAP6y8ahEuIRgGoYLW65IpZIxiTgOJJmagDbqa8Wh9/M0uWf?= =?us-ascii?Q?JEd4Z5vyCGU8+FthIZbCnot0W/tzY2mhCH2AGdYELBTtwl2/JaRTvuVHwvtE?= =?us-ascii?Q?XNw+NTyf8g2tF7y6imA9Rb2k072r/QIZixxrZXAa+OQ5cYIGwUSfnAIiTMiA?= =?us-ascii?Q?ECFk8gZ+3/F0ReNR7Ac9vrwgKHCnySvXsIO7rprxH3GXWH3bvBTGchji05ss?= =?us-ascii?Q?wFvYe+MaajXOA0d4b49sYrlicny5BJY3ffe69E3U902JTNeyuoN6MFecmwNW?= =?us-ascii?Q?VI055DXuroFHBs/1GwUqI4GDRGgPPIX8LMF1XfZ63ZjW2HukQRh+9F5WO43e?= =?us-ascii?Q?3TLtdAOVwMbFR0kA8a0BkbWZllgTjl1K4AGaPGxrQH8PxZlzpDce/8pCbdom?= =?us-ascii?Q?Mnx8w2/T+PdyQBHR2m5LtMUqLW5YYWUrvpv+0yf5/VxvWGa/HUDXaZzpqxK+?= =?us-ascii?Q?SoQmr4Cd/7V7NXP4UbwJsl0VnaW/bWe6a0ikCEfXrCUV8cRHJIGg4q+61tX2?= =?us-ascii?Q?Ze74t0/JvKzD3XKrEANq/Hp0Ab349Tv+qxPxzyRNLBXOhsKdcKda2kanYmpM?= =?us-ascii?Q?V0sg5O6UCxoJuHrCz3JQLvcR42ZS7kqNFkvLUyjrsmtWc3eYMhUusFLpY/s3?= =?us-ascii?Q?z1zb/DA68DJM9VlTwLLMo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PpAfuTYXUDbp2GZuhopMBBXDbY/JmSwEmRCcOwf/4HU/5Cy7Q==; 24:9TjXlH6M2b9hOKbN4YljYhoYt8r52n0GJbZkjayFvErJttQjQ+3W7TRctACiiXdwOsXFdMbb+6dNIYrt10sJwumvief0g1tCcIy1wTXEPm0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 7:7b/CQzQKhnDNUENVDG4aTKGeQ16pVNKnoVlYpmDDLU8g9XVX3b0yCTvkGMbGU+UYIIfuzMEY9i8ghWQJWv3B8afHuVV09M33iuty7/aFGaKt7eJX3FJBsz/Xupz4abbhNuTizZqCbE/WvU7VTrmBVu7SqLdITLc/YG+Xkbh2ldZqwPdhezXJib+NZ+9V15Fn8sXjCy0t5wJneCvuz55NL6AmVYCAPh+W8lrubCKgUUotfGj9EDD4jWVJc/X/HKVgY8GBwAE46R95RhQ3dFMsV0xqD6bf0bKkMUPCYlPLwbtK5kPZDsi7N1rjsm7R4UrKBvzwYf9CLGz2q5/jcfOEAbgcI/VsbYWa8UX0GB63nrFVZijDdCQQ5nbVoKlV7sOIBcSx8X9s30EY7/vmyMDx5LzCLFQ0AAb9Pdudo608Hbaa9uk7RPlgk1zUJJ4aRHhtGF26vqlhYaZeyDJQIsbwGA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2016 09:52:01.4351 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Subject: [dpdk-dev] [PATCH v2 19/29] net/e1000: 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:06 -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: Wenzhuo Lu Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob --- drivers/net/e1000/base/e1000_osdep.h | 18 ++++++++++-------- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_rxtx.c | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/e1000/base/e1000_osdep.h b/drivers/net/e1000/base/e1000_osdep.h index 47a1948..b886804 100644 --- a/drivers/net/e1000/base/e1000_osdep.h +++ b/drivers/net/e1000/base/e1000_osdep.h @@ -44,6 +44,7 @@ #include #include #include +#include #include "../e1000_logs.h" @@ -94,17 +95,18 @@ typedef int bool; #define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, E1000_STATUS) -#define E1000_PCI_REG(reg) (*((volatile uint32_t *)(reg))) +#define E1000_PCI_REG(reg) rte_read32(reg) -#define E1000_PCI_REG16(reg) (*((volatile uint16_t *)(reg))) +#define E1000_PCI_REG16(reg) rte_read16(reg) -#define E1000_PCI_REG_WRITE(reg, value) do { \ - E1000_PCI_REG((reg)) = (rte_cpu_to_le_32(value)); \ -} while (0) +#define E1000_PCI_REG_WRITE(reg, value) \ + rte_write32((rte_cpu_to_le_32(value)), reg) -#define E1000_PCI_REG_WRITE16(reg, value) do { \ - E1000_PCI_REG16((reg)) = (rte_cpu_to_le_16(value)); \ -} while (0) +#define E1000_PCI_REG_WRITE_RELAXED(reg, value) \ + rte_write32_relaxed((rte_cpu_to_le_32(value)), reg) + +#define E1000_PCI_REG_WRITE16(reg, value) \ + rte_write16((rte_cpu_to_le_16(value)), reg) #define E1000_PCI_REG_ADDR(hw, reg) \ ((volatile uint32_t *)((char *)(hw)->hw_addr + (reg))) diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index 41f51c0..6ec38d4 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -610,7 +610,7 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, PMD_TX_LOG(DEBUG, "port_id=%u queue_id=%u tx_tail=%u nb_tx=%u", (unsigned) txq->port_id, (unsigned) txq->queue_id, (unsigned) tx_id, (unsigned) nb_tx); - E1000_PCI_REG_WRITE(txq->tdt_reg_addr, tx_id); + E1000_PCI_REG_WRITE_RELAXED(txq->tdt_reg_addr, tx_id); txq->tx_tail = tx_id; return nb_tx; diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index dbd37ac..61edbfb 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -605,7 +605,7 @@ eth_igb_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, /* * Set the Transmit Descriptor Tail (TDT). */ - E1000_PCI_REG_WRITE(txq->tdt_reg_addr, tx_id); + E1000_PCI_REG_WRITE_RELAXED(txq->tdt_reg_addr, tx_id); PMD_TX_LOG(DEBUG, "port_id=%u queue_id=%u tx_tail=%u nb_tx=%u", (unsigned) txq->port_id, (unsigned) txq->queue_id, (unsigned) tx_id, (unsigned) nb_tx); -- 2.5.5