From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0089.outbound.protection.outlook.com [104.47.42.89]) by dpdk.org (Postfix) with ESMTP id 54489F937 for ; Thu, 12 Jan 2017 10:20:06 +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=sEN9cC0QpQamZU1HAvl2g7ZX56XwH/o5WP1E8fgr01M=; b=fxhZF9iBgEcScva3bJptJJPLR62uDigLYPKKwT/84Z2mWrn3VJGjFAWzrykO1F8y/N/zp1+4osxV0EPPN2PFgdb36TfybZYIYCDx4dqLhfrobDePPlTBrRcfL4XFa4bKNeb6xOPSqDzhj5iwC5nvpjbHmMB+Pm8sxZ5wMzaaWtc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Thu, 12 Jan 2017 09:20:00 +0000 From: Jerin Jacob To: CC: , , , , , , Jan Medala , Jakub Palider , Jerin Jacob Date: Thu, 12 Jan 2017 14:47:17 +0530 Message-ID: <1484212646-10338-21-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BY2PR06CA0007.namprd06.prod.outlook.com (10.166.106.145) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-Office365-Filtering-Correlation-Id: 35fc5bfc-d56b-465b-f815-08d43acc31af X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:M62mGCrWEECu/WNFLucEBimWXp2ZesQ597FEVKf7sNHFfKkVurhk6jGRUcReKv1ViF6TTO1m9oAyHFDPCLhhbWPaTITaT0p6ImveW84z1H5shtGjGRtSJkKSdS/tk+SmRcdRotiDh8gJWaU17Z3kRcEzHTBVnKXDm+ZdYzkZGPnFzx23LGj4+ufbLvHRUYq9DVo4cBHbNTxisPBLj8EbjSb2W/4Iy7+DJlGq82LaF6yozIfoPCBpXSIlIiGVF5tI5ZOBwAU36uyzdgFhD9RLGw==; 25:BZ3HBIxG8xO7UlqIjXdQ9WefAjOasbYaQuAhZp3qu1k7uIxAvcrllU6FIoC3ZoE94WcpDD5TVMHNydrEzP1Fx4XAfzffJ4gSdBEp/eBY8gKYbVEXwHZ1T6+BX/jHwrn9lPzSYPpvFO99bseoPPoQqOpJbsDKwfSE4DqgGqdf9nTmJinDnacctO7fP2dYNITZqGI4a6FW3byITQTci/S2gxVli/m1LyekYcqhI7nAYkitJU5YAkl93j433B7dqj4Q7w39gmSP9XeayOE1Y+WpPXzvOhoqWTS437yxr8TrFn+lVujNEaJWWrEnbHEos9IHbtYWFatIz4CzoHzhHG3kU67qd12UC4dLGGQEAgaEGgiI7fcrThfRuM3VMsDjieNbLmTH24P57x92JPuR+P8Mp+LuCZUFYUbSwoEGWKuMyESga1vfLl5urilwbj+d5G+E6aLwm/chA7C7ID2CStxTwA== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:6N1r6jEkKzWKBuMCU3niEGFFrtd5JRJ5UJ62H3DgGIsi0TNzSwh+GSM7UDoRlEBGodR9bliW3/rUHG+i6UZ4e4ZOHHtVLVcI2mO9mhDGH5V8zV2iBxH5p1hS3UCySjPptfGlYRUVn9atociunQI9JMZnR7o3e559mtkDJGyZxJn5b+uCjNn/3JSVJQ39CNTstJLz89iL+AKufxapgS99iOdRXD1NIbn5k6zLHuIZFGh5PUrTwmZKFm97aSNvtMlcIT0rWobfLTQqqgsN31LYqw==; 20:fjpihO2e75xNYw2RFcRrODVUesehcjmmW7eSFzCP/r8PJrwSEBehkWEyBWDgOz2VgZX6asqnFLeBsg5KmxGPLcGdjv2GyqM5bcTN/AlLWvzKS1e8SCWOaCP6XC2hrq0iUX/KJuqRaL34b7HjNQzwLvINL9pLU4YKoA21xuS7u7YW2xSdOEkwiqDR2BjThjp9Wj3L74D8ER6r+StjT43UK2tF7yt7TuTqdmyeelPD/cuCu2biVwueUyigavGtNgCwyfRm2iV/aw3kTE5aMenfXpiH+pUJB3mu+hudIYg2Bb3p7rbeoUyCTTrVVBYXt9FwhT7NQQVYSNSsxKyL0sA/bEhOws8c1dlccsyagfzi2J+8zjKO5ZfNFwa2rGSozrxZXUQmxVwsXvfYLXIlJwUF3iHcSAl4CmvSWLFu6PRUw6xKi49PRBd0Q58J4+nYetOG2PC7IO45Q4o149gKAavpdogAW+g5gVk0hr9PDn7YUdsOa1gvtpuPatomIEojo3Lr3PoP+ax3wOcY5vuiiG/t++7tCp7pQgnns1/tITy/onuUiUawU+6HUPrvGQ8+C174WsRCLQNAqBuxXz1CxJmLvhYUngYkMP8APQes/QKYTtA= 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)(20161123562025)(20161123560025)(20161123564025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:JcFEbezwfMcOZES9AnmySHXJk16YVzVlPxpshdO0PZUuHLWrVpylWfaEq2xS8QyOPzIFSkESWL9+hqOYm1XhqTLQYM3I9lTLaXAwVD5yjgy2TU3SiwUOrZgDIU0uxvGamtnGUdPgafAg7G6zwcT/WSSomYdm8Hdqqs3xqSn+OYROLRFhG46meCkgdUYYxQ4NUA3wUaduOzhRXBTOhbkGzVtoguoff3yZA21aROD6AUbliaHLP95ecXBDmCfRMBdmHT7MvyO286RZqL5gvvFn1bm9HwNssCwz1ZcgX7njU0GzC6rmFIzqqyJt84riw/a99kwmFaZbmGnVpd7grMZzqcvNid8uldVhSMoPcsvaG/tiIr45xzTWpUFZ9JilxOzTAZnYXHGG9PQLT94KYoU+MYVX0Y0ISlLhm1h17V2VS2nU+Xip+S6v435A/j5zwOiw7PAqPpOqAH28b4oZVsGVxdVqIfYPnuNJQHbNN0v0P9tRQv4a5Yw5mRYeO3xU17ILp6CU6iBx/Ks02UGaZJY6zuLS2zVGT0dUWLX/sMQZxq7Dbowo/j2QysdTjC+irqjV0XAgYAKSZfi1QMNMAqBkJT+8rH57a2MJaX7UvDdiaX8= X-Forefront-PRVS: 018577E36E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(189002)(51234002)(199003)(2950100002)(53416004)(76506005)(92566002)(105586002)(69596002)(2351001)(42186005)(68736007)(106356001)(42882006)(6916009)(305945005)(2906002)(7736002)(50466002)(48376002)(36756003)(5660300001)(110136003)(4326007)(97736004)(107886002)(189998001)(50226002)(6666003)(6506006)(38730400001)(101416001)(54906002)(33646002)(5009440100003)(4001430100002)(6486002)(66066001)(5003940100001)(6116002)(3846002)(47776003)(25786008)(81166006)(6512007)(81156014)(76176999)(50986999)(8676002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.caveonetworks.com; 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?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2euI5iUnxJakKJ1wTqeL752vjQRmxNNPrTdCON0Szps2ZlUyi+8i37ltFAqbchmc949iKQ8pZA+0vU8LKFo9NUalMPPvRZAov/+k0kXfsboI2+gKhROCj1+JOZKzrktv5kXZCRWpd+KWXlZY1A==; 24:bBJSGL6F6dZ6zRj9CTZ/OPW4PWdKuev0FntRb4ot1LncR1hn7S+chDq0bYAHHX7iGg5K1aam4BoVl64lLK/W31r5mGL0e6MJKnqQYN57rAs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:iPcDMHdwdTjrQwYU6i2Zlg1g+dUSxUBu4cfJauZ8Wc8+QNRbnIRexiYDw/Hjo9SN+hU0Z3S9MyQkbh9ZdRdq7dPq+vpodzUK4BQN7VWFinOg4rGKLgHCcvHpXCekIYhd8r7t7fwgMnPUPIvq+K+IE/eVi6KlTJ4JYKiutn0EFBNzhzNEUBjT3r1SsdI8fUhiVcFPMwOdlsDZEK074tMITqaB2LGVS4kJsRYvJd6nc6JkfHnAnZ2jSjVVkis7eG0GhiuUgjTUgHEPCuWSVsjp/myCuONG/U0G1sZbZdRKnlxxVwLdGoHgUWBSdu2b2MlTCHm+D0EhLqXaaY48+x5OZBuCTaqWTBLtyPabYrkT4inpFNZxlfg5WEcOk9VaPaadMXRlnAy9cD51oPkGhOl2wScEaSyezkf1RjwuSOxarqWosiBdeK9NriLFeUBCxvPAm0WUOrB15O+hHORn7hn0tA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2017 09:20:00.6037 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH v3 20/29] net/ena: 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: Thu, 12 Jan 2017 09:20:07 -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: Jan Medala CC: Jakub Palider Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob Acked-by: Jan Medala --- drivers/net/ena/base/ena_eth_com.h | 2 +- drivers/net/ena/base/ena_plat_dpdk.h | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/ena/base/ena_eth_com.h b/drivers/net/ena/base/ena_eth_com.h index 71a880c..ee62685 100644 --- a/drivers/net/ena/base/ena_eth_com.h +++ b/drivers/net/ena/base/ena_eth_com.h @@ -118,7 +118,7 @@ static inline int ena_com_write_sq_doorbell(struct ena_com_io_sq *io_sq) ena_trc_dbg("write submission queue doorbell for queue: %d tail: %d\n", io_sq->qid, tail); - ENA_REG_WRITE32(tail, io_sq->db_addr); + ENA_REG_WRITE32_RELAXED(tail, io_sq->db_addr); return 0; } diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index 87c3bf1..09d540a 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h +++ b/drivers/net/ena/base/ena_plat_dpdk.h @@ -48,6 +48,7 @@ #include #include #include +#include #include @@ -226,15 +227,21 @@ typedef uint64_t dma_addr_t; static inline void writel(u32 value, volatile void *addr) { - *(volatile u32 *)addr = value; + rte_write32(value, addr); +} + +static inline void writel_relaxed(u32 value, volatile void *addr) +{ + rte_write32_relaxed(value, addr); } static inline u32 readl(const volatile void *addr) { - return *(const volatile u32 *)addr; + return rte_read32(addr); } #define ENA_REG_WRITE32(value, reg) writel((value), (reg)) +#define ENA_REG_WRITE32_RELAXED(value, reg) writel_relaxed((value), (reg)) #define ENA_REG_READ32(reg) readl((reg)) #define ATOMIC32_INC(i32_ptr) rte_atomic32_inc(i32_ptr) -- 2.5.5