From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0052.outbound.protection.outlook.com [104.47.40.52]) by dpdk.org (Postfix) with ESMTP id 1B396106A for ; Tue, 17 Jan 2017 15:13:35 +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=lUZZ4aqj7WsX7DatRQH5vtkk5ofURCRcW5tIk5CNTcA=; b=jVZIt/KqjzZRvSES5O9iwy3A4TuMvomGotWAFkwZKjyhiX2WxpMgkyQIrM7q7oG9NXrFqcTWU9PxIhln/VmUaIc/lPErlcVrCcyuzpYKgyzRHcMGsSTQXeqBTBYKe9cdIVMZkNia83rhaMwNhxBB/t4OKve7smZE3jb5qlaOVb0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (122.167.185.94) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Tue, 17 Jan 2017 14:13:29 +0000 Date: Tue, 17 Jan 2017 19:43:13 +0530 From: Jerin Jacob To: Jan =?utf-8?Q?M=C4=99dala?= CC: Santosh Shukla , , "Ananyev, Konstantin" , Thomas Monjalon , Bruce Richardson , , , Jakub Palider Message-ID: <20170117141312.GA7844@localhost.localdomain> References: <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484637244-7548-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484637244-7548-21-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [122.167.185.94] X-ClientProxiedBy: PN1PR01CA0013.INDPRD01.PROD.OUTLOOK.COM (10.164.137.20) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-Office365-Filtering-Correlation-Id: ebac6c73-b471-4569-07d5-08d43ee30594 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 3:k5W1TZTNj1ME9FAu4BrtJetY3v5/CI9z/3ouIQ4vqQsimC610vYNUQS36PnZAMa0St/M06VY8PuGa+No8XqSwvPD3bnBmw0PBgN8577H69pGZuWLPWQ43VSU+9e242+d0b5wckOZQSdUb7yDEehhN2vrHDCdvTIqcRxC2mcre1hcSjI3EfYOW4EGDAQwRh5hH19P8PiZrZjfkg1fBgjVTvK+wLI8mpT7HP3rAAlr26nV4XM0N3Ra/UfXYdP0hqQCrnPpgfZUQZMDR2PTu+OwEA==; 25:nYbDjjdFaZ4hYoAZ5zZXpuKY27I6+peB1d7wSxPRKi8qpWKnjNFQFAoHus0bD+N1YW+g//z2amIFdCdFIapCam8XV+0aSNiBkq/dmAM3CXxnhtrqlkOrd6ZLuGRtsRogKq0eB54YRUO2gkSiTC40PfpyvZ1dyjEzJ493wqBB1WwqEsudS0bkVdhoZPBiBrwyg+D7WFVfxFLzAkhM4lxjlWNYEm3f9eLmnES8o5TANup4Db0tIdU+FGhOzvvpOhTNvGGEzcxHoOK6CzaY0n4CKw+2lv3n0dIt9pde8mdZaQHL8Tz36a0XpqA2XGO+Ohg+agMYyB53NMR0IfraoKaTf6icHjRMOWizDKlzIpm+sLACUKK0VZe0QZ57gmyzzfWuFxUTn2s5fPytKdWFs0XjEU99Jk0AdaGC7FsE9+4/Xcv2UI6elh4yEcOApX0siUQh6+XPACBgyQeCefJt0M7T4w== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 31:MFZGJPm0I+fMTHf8kgc+Zt144uiBR770v+gMvh/71L8kJRubgvdkr02si3FMfJnyO5Ck0Y8g2U/78scP5o46FGE8RNbPHOtV75DTufAfJNvdqN/nh7XijoV2qAI/OVgLbS9AGnEiA/BR8ENZyZg6jQiFsZCc7l6q/w01xZYo+SwyW/iJMdeGI+w4QWthLOU2D2oCN9sv+23UI24CyDPnVgsrghQnNVO9nHrzVulUTT9UC/G560esJkRO0JYmz+6u3qIVdUR7S56+BGHix4rz2g==; 20:uF9+K/iUC0CDX/CNPpIZuLhgmNaGPXhXCSaxHdVc+PwtDYK2CCVJxt3d6J3CL2iljtLP+Nc2x936TmUYVE2lT3MnGkBCpqelUhmKnyasqIniNtLTpXU+kKdTe9WrTDoF6G52Z0B53gGIECrinlqFAn12OwM4o9Bjdl+Yx4CByIiuSTsG3hF8qWfw2BJmiS7eGfl3gsp5sox3fk3gvDvGBT5xXY8rLdYd2qEKS5y4Wx/XBTqrNvREFwrQ2gmGf8eFdAUpfUL1W9BIxNnjxBYV9b4kVn7B0SJ3EXZZ8HE+sIJCL2gliAy+kixn/vfAMCDg5SZ36igUaLE7GzQB7pTe0lZDGxSUb0dbB6uTDBUB8hDfJ+9F5WaB+5ejtiu/2aIP5uLQ8Kj+YAJHaydRUXT+l6ZnS9aMeeGc2JwvAPKAkQ0yu8NrzCitYVcdcP6oXAGka3ZXgHDYk92hhegjEFoBkLgNATuPuW6gkfFd5pM1Uqm24XQIXIjBS2Ivy6K7hKy39s8fwU2FkPG2q1xejpYkF7Mp7VNPPduJ3JfIUTrZqYnMMEr+SxtH2gBzwJju1dgZt9j1lde3s1elnLNWIO/4LxWt1gzCbB7fq816+JboVW8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123558021)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 4:hl2l9PyTC4FTncNDmD4CH9jexpSAWHVjM33rbppTdJLBFQ2Clk/zvZqOPvQLAg4wDASeQMk6OD5zCKhb7+PgeSkBhwTSBKzeyoti83UTZ3b9QaJWiarjmdIrfVWwnF9ReFDkp4IRdUsCo4cnZkoYIARHlPMPwn6De66poEDXLcExrqrqf7G28nIlha0I8ZByWmxs8db7/EbyQctiOQzdT2tJJFA7MDxgou+/iMxjtpJuFGcQk7vZ5BZYso2jTQ4Ipv4moWXNa4CiHCrKtmniH8A96EIs3sbci37T71EtB2AkZMtyaAmYflt1cexMjrjMwDd6DGTSWCKvq25KjGNY2D5yTdqG3GG5BVB5A2bnk6w9lIKUR9pgJAb2qhjGiEugRxARdax3GEQCS6C+1UauT4xgSDWhdzkLs7zuCoRkMPNqiTC/PW5SICckNTJ0p/hAYj+fXdA1obj//ZD7rPvBUIva2vDHXztfumHbHFHdS+Iojrc5dkxVN9V48eLIBHpbhYv6oId0XI1MjDz1R9nz4Mauz1LMLhZmj7INEdfdTC0EUUACf1RCUNDtdor4udzzjLMksTXIlI5FuZkGXcU8NGTu2C+sGgwaRjc/FmbBgUE= X-Forefront-PRVS: 01901B3451 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(43544003)(189002)(24454002)(199003)(2906002)(50466002)(92566002)(229853002)(93886004)(68736007)(1076002)(42186005)(54906002)(6116002)(3846002)(4326007)(54356999)(30001)(23676002)(76176999)(55016002)(38730400001)(50986999)(83506001)(33656002)(101416001)(61506002)(6666003)(8676002)(105586002)(25786008)(97736004)(47776003)(305945005)(81156014)(4001350100001)(5660300001)(7736002)(2950100002)(9686003)(2870700001)(106356001)(110136003)(66066001)(6506006)(81166006)(42882006)(189998001)(6916009)(7099028)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:localhost.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: =?utf-8?B?MTtDWTFQUjA3MDFNQjE3MjU7MjM6RzRmc3NsbXd1ZDJTNGs1bTRkSDI1amtZ?= =?utf-8?B?UEJYeXhtZjZyMmd4TTdoVThTZFIwbnBha2xPT2xHdnU3QlVVNHRhQk5jK2pm?= =?utf-8?B?UG5DZ0RYZVk3Mnc5UmtTU0J3WXloRjJsakdQVHJWdEJLK2hGU3pYdHgraWpt?= =?utf-8?B?SHVSN0w5UWg1Vi9mZFZTdlU1YVRhUmsrVnVDSVVocEEzUzlUYVl2NWVQanVG?= =?utf-8?B?R3pickFsbHRKdFBrRFZoN3RXM1JuNTNpUW5wM0ZTUEdLZWIzaCtHbjhSWFNK?= =?utf-8?B?dmV0VzBWRTdXNHJPbFQzLzVQakZJcTVlRkhkUVVCWUpNNnJZOXEvaDlINXQ0?= =?utf-8?B?RUtpeVA0RFVpcSs1RVNpRjQ3UHNsUThDbmpvMHdhTmJPMjc2b0tnRUsvZU1G?= =?utf-8?B?cUdnY3VXODFyeEJHL0JIS3k2SWhlOXM5MUJCNWdMNmRsZEZiK2dpKzJ1b1ZY?= =?utf-8?B?cTVPbzY0NlErRGtnRzdrNXRhWGJ5dFdPY29UcE5TWUhYT1I5dExrUDM2dGwr?= =?utf-8?B?NU1YMTRqc0drdlBKNVFvTmlIOUtQckhDSkFOZFJBaE4rcC9Cd0JuL0VjV0FO?= =?utf-8?B?SEFQc1lYMlJyS3hDWTZNeU5lbzlxbWVTdlcvaStSZjFiV0RqSERya3VkdXVO?= =?utf-8?B?eVRlWm1FOVYrUUtOSHpBTlFrR0dMclp4clowUjltOWNEOU5KL1BFVGkvV081?= =?utf-8?B?K0xzNHNDdHU5bnlCQ3ptMVlwTHBBbEh5VW1TK21ia29kMWFaSWQ5Wk9zMkwz?= =?utf-8?B?SkRRUEt3K0FtajN6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DMWVSMDEyd3EzUmNzaEVGclZiREJMcEl1K0dBMkMyRVlQN1FDWUlWY01M?= =?utf-8?B?RURxSFdkUC9xZGhJWXVhamcvU3ZyVmtXUU9HcG1mZ242TXdFL0pidXpRbm9Q?= =?utf-8?Q?PSmrjb2wHK0ySYe?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 6:APzUcmUMZlQ7FmmuuRjXD4n/HCu9fKR0AUQb94eoLthytUcEG1IlsBfn449CJELNsXElg3R30SEEJ5RZ0oI7vox8ixdryNS4K7ibSVuN2Becmm1fbNLjgom0g8X5EC08EIN7NIqLLlalP57sqvNxAixXfREGHuve7S+Jax3wYUJchajr28cyvUzuK4bcEG1Y4PGaqDacrtXKufiN4Z8TiirsebHh2wrLhTw4PLmkPmxETYPsmR7URVwo16qk68Wu7xl2Lld9ybDl18Hu3JurXgajI5Snnyjf9UVitgsW10wLpZ26aygpzWooKcbQ4+hVikGug0HltFROPfM4gsund+8x9dR3pjbE7bpffMUCmdaWEYoTYf9/XoAh+kHC0ySVyji+1rPRySxRT/dX0C/TrbQTpkRrvd/2vwidp4DUmJM=; 5:MJK5qDyic3993fRCpLocReO6+/u5DtwgQ/pNXwqH/YO2TGbBKQzm4IQoum/qIJuhfyRTz2atDTiigDq327uModGi4v1khYxut7WFQZQBSC73aO3I1FzVL+syC+wFcloo2wsOrO/hJFU75EJAywEAXg==; 24:eoKPejH1mXUN0gp+xKVq4BLsNm6r1JRQFg4Wy8sUNPjKTfjwCaSNgxQsfxJfIVr5TjGgBerUEr1Fz94+PGPonPWjzl1gzPkEBcR9imIYusI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 7:sLfUMj5PfkFOWaUrZ/Edn4n/NrY/0VFbItTFA2FlilEd8twZ5sqBSOfitspvZzJd1iLpTxuX04HVI08jQlcqGvvSU5JcSWCuMKrIFwvwbof8KGJGHj8e0ckjLxzQVFltf99peAD1rENEJ1XuL3+KMrhODFzyqMtuR15yP6g2y6OtSXxU0LJ+0RxiDkz9gjtp9jNKKXymiEbLZGETilpmu4DpQZB1DYWGmde/qQo9g57rm3KjzFyxTXS9o60iSh/1lzL72hEYygVtEoQhaJaTsUjgRwC4uAfQFvHLjWBhJ7oRj0ux9yxHhhfYX8KPniqCT1+G3EGJdWCu7FUC4jmEWPaZNqXFBtELgG0mPRn5kaK51T2qs1OZcmc1u4CiB7kz9vLWFTGDOJ1+sBeRXM88p1BsAoBMyT7Bm/rnkejJc+THpsw96FV3hcQsNb27p79ss0jBecA+7e1dzO8A7x35AA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 14:13:29.5603 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: Re: [dpdk-dev] [PATCH v4 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: Tue, 17 Jan 2017 14:13:36 -0000 On Tue, Jan 17, 2017 at 01:51:38PM +0100, Jan Mędala wrote: > Jerin, Santosh, Hello Jan, > > As you are introducing improved I/O access API, I would like to ask to > change ENA platform code to: > > * #define ENA_REG_WRITE32(value, reg) rte_write32_relaxed((value), (reg))* > * #define ENA_REG_READ32(reg) rte_read32_relaxed((reg))* > > There is no more need to have read/write functions within platform code ( > *readl()*, *writel()*, *writel_relaxed()*), as we can directly map our API > macro to DPDK platform implementation. > Also I would prefer to keep API within *drivers/net/ena/base/ena_eth_com.h* I have tried to make change as per your requirement. looks like, read32/write has been called from following files. drivers/net/ena/base/ena_eth_com.c drivers/net/ena/base/ena_com.c So, Is make sense to keep it in drivers/net/ena/base/ena_eth_com.h or in drivers/net/ena/base/ena_com.h ? Following diff is an working build-able version. If you are not happy with the change then can you send a patch so that in can include in v5 or if you want me to change the let me know(What is the change required wrt the following change) ➜ [dpdk-master] $ git diff diff --git a/drivers/net/ena/base/ena_com.h b/drivers/net/ena/base/ena_com.h index e534592..f34e416 100644 --- a/drivers/net/ena/base/ena_com.h +++ b/drivers/net/ena/base/ena_com.h @@ -42,9 +42,13 @@ #if defined(__linux__) && !defined(__KERNEL__) #include #include +#include #define __iomem #endif +#define ENA_REG_WRITE32(value, reg) rte_write32_relaxed((value), (reg)) +#define ENA_REG_READ32(reg) rte_read32_relaxed((reg)) + #define ENA_MAX_NUM_IO_QUEUES 128U /* We need to queues for each IO (on for Tx and one for Rx) */ #define ENA_TOTAL_NUM_QUEUES (2 * (ENA_MAX_NUM_IO_QUEUES)) diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index 87c3bf1..ee81648 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h +++ b/drivers/net/ena/base/ena_plat_dpdk.h @@ -224,19 +224,6 @@ typedef uint64_t dma_addr_t; #define ENA_MEM_ALLOC(dmadev, size) rte_zmalloc(NULL, size, 1) #define ENA_MEM_FREE(dmadev, ptr) ({ENA_TOUCH(dmadev); rte_free(ptr); }) -static inline void writel(u32 value, volatile void *addr) -{ - *(volatile u32 *)addr = value; -} - -static inline u32 readl(const volatile void *addr) -{ - return *(const volatile u32 *)addr; -} - -#define ENA_REG_WRITE32(value, reg) writel((value), (reg)) -#define ENA_REG_READ32(reg) readl((reg)) - #define ATOMIC32_INC(i32_ptr) rte_atomic32_inc(i32_ptr) #define ATOMIC32_DEC(i32_ptr) rte_atomic32_dec(i32_ptr) #define ATOMIC32_SET(i32_ptr, val) rte_atomic32_set(i32_ptr, v > and map define ENA_REG_WRITE32 to relaxed version (when barrier is needed > we call it explicitly in driver code, there is no need to have > ENA_REG_WRITE32_RELAXED). That will help us to manage code together between > the different platforms. > > Should I do the change for ENA or do you want to keep the current flow and > take care of it? > > ​Best regards > Jan