From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0079.outbound.protection.outlook.com [104.47.32.79]) by dpdk.org (Postfix) with ESMTP id 74E8F2934 for ; Thu, 15 Dec 2016 06:45:45 +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=SAzgKLYZGq35HDGq8GCSt0y0Eh75gjn86D7o6ZQDXCk=; b=DaCm9UMOzKrCsTgd/4VsIYrQm3UYSuYHE8aclw0vObqxOUEFERMABRQY3Mfp5WHaabHh33Q50URCORJGNFi1DjT/pgG5IraAK9XVKfFyN8jHEHCsiYKQOUcp2mClSqB9MXqxibBq1qnacuDHE8ATgBaw2MjKu6OvsVti/gVp0mk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from santosh-Latitude-E5530-non-vPro (12.0.243.26) by BY1PR0701MB1721.namprd07.prod.outlook.com (10.162.111.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Thu, 15 Dec 2016 05:45:42 +0000 Date: Wed, 14 Dec 2016 21:45:34 -0800 From: Santosh Shukla To: Yuanhan Liu CC: Jerin Jacob , , , , , , , Huawei Xie Message-ID: <20161215054533.GA10211@santosh-Latitude-E5530-non-vPro> References: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> <1481680558-4003-27-git-send-email-jerin.jacob@caviumnetworks.com> <20161214030223.GH18991@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20161214030223.GH18991@yliu-dev.sh.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [12.0.243.26] X-ClientProxiedBy: MWHPR20CA0019.namprd20.prod.outlook.com (10.171.151.157) To BY1PR0701MB1721.namprd07.prod.outlook.com (10.162.111.140) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 2:BYYPjRNhejKWeF0SOslG+vEPlghftSUqHp6lZ/cTkAQtZQJpyNylZ9mUcDAHahvuJ3tSW009WLDSKzbwT2kbGjfEVG//ysOFrn5ss25VnybStSRSz0XgqE8+wfdDbiYb/dkLqwS1MLQXN5znJGAD8D8X89qudwSIq/ZKukMxnd8=; 3:LSNNUni5uQfih3w6jgv97sQfOFZ5oNPPJQkr4/Lzm4zwy4xT5PVUGrEyJ4crSiHZPBjJ4DgjmxUmoY+MhnqH9hDezvCcgv2+7bqLYAlpjituArOidOxaDYon64hrjH2OT26K31d3dUEmzyMdgUBpA2mgb10bYoYl4XGd8GDbhN4= X-MS-Office365-Filtering-Correlation-Id: 83bfb9b0-1dc2-4690-dbfe-08d424ad9c3f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 25:vFZY8wD//MUQ/Jnm+/Qr/m+09mu7deIb/tplKJvpN9NaXb8pRk+GdM5xfDQsP4bkFs/I1Czv7H6a8sX2PkxVeRkojsW370TkR6lOkcFEgR+SQ4d45N6xpnmIX7PMyPo40h1NlAf2YZYLrJjvmdEP5E8BHD3Wa18iOnbKdiBuZ8V5tlLjYxGQrE09L9l3sqB5FkhNEuW82GqWqSf/ggn7P/G4zH01cv4IQzXet6ScHSl6Cfb+imVk72ok97kKmasz0DYoc+qOZG1j0Xtza7kG1fC3Qa2UqJsNKR0lPHsEkKPnpJlbKcvnSqXKjcumiSUNMLUT+gn7Bb0nJK48iqDq2Ew51ZHXgRsZPaKzNvq+ajqWENYrV1W9t4F/3R3CWY8AlXG9MV6gYeEpVdsAJn8siaTVDCxHGb29Aaq1nBDEIoCnvMd7BMY8NJqu3l+Qt8Yx3wSnKMW8jU0AVmVf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HaoQPe0E54/5tF1un40VnxkP5SYDf3twwQs94cZXL3q8ji/PIvq61LhM1Y6KSFwUsU5N+WmKCN/xSDB3RQeMcyFB211znEEd0hw79cjyHu8e3O6ZZ/l+ztzB8bKUV2k9YWUHdUgVH745Xf359qHq4SmshsF6S/k8JU81bHIybDXs18IsoGZ16CbSOmtum/pjqkEB8xJPsVA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(6072148); SRVR:BY1PR0701MB1721; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 4:RuRTO2dCWbwivrlNzYhsQOt6sWZPuogJRJRx5cLD1EoLXjgtZkFVDUV2VwlDdYZ4n5yakAKe3Jhdrba7KoZLiU36XSK/1cxP6OjvyrDVCBwUkZbC86SUOs3Z1BP8QtRhPiq6luSF+yen0AAS9RrTJIvZ8sryacEc8XKqi9mVtmR6EyiYeWZALUSf2xsPLtjr3gf42MfQSqBxXccho/rO+nqidLC9gHlAhTVSw/uGhzBYwUlVEnuIxvoQETZVwNDICjjPTYDLUNUKifODU1Mc7oAHEpuMTqW6QLuaeYa0gN0kgV2vLCYZ/Ln+JqoB6KqXqVoFUtwhUR9oNZ7aen+dBEo8ypGaTfvaD4xezYd2XqCJz3m/TKLEYPi8x0HT9fYyjYjp/2h7/KxHvFz1VY44dFZpplgcKMRbRGJ4OI4MOWSwr5njBarFk4noBJmnbbCLStZW5LGtQ/WLZQlbfHqVB6yU0v51sgshVqWou+DO4UUy724tJQRvdrxDktL5xG6fsAJXIJNHRABclIpu62nRCxsmS9061NMbvxb6xQMBEBnr8TOOcTE+dhJhAnN4BKmasqteP9eOjuhiiCHTrLeNeg== X-Forefront-PRVS: 0157DEB61B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39840400002)(39410400002)(189002)(199003)(43544003)(24454002)(6916009)(42882006)(2950100002)(54356999)(50986999)(68736007)(76176999)(97756001)(110136003)(101416001)(46406003)(3846002)(50466002)(6116002)(105586002)(106356001)(2906002)(92566002)(9686002)(7736002)(8676002)(81156014)(81166006)(305945005)(33656002)(33716001)(42186005)(23726003)(1076002)(4326007)(6666003)(6496003)(66066001)(4001350100001)(38730400001)(25786008)(97736004)(5660300001)(229853002)(189998001)(83506001)(47776003)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1721; H:santosh-Latitude-E5530-non-vPro; 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; BY1PR0701MB1721; 23:WX2098cahKuYV5ImCytM6/N3whjdnFVayrGkCjV?= =?us-ascii?Q?srmJ1rVtp45p3bv/scTvFot3hLWm4jtPS/U/oyAlXni5xzyaD4j/3hTD5WuY?= =?us-ascii?Q?bry94XZem3cS+fzyh/qCSc3+HY0HCsNVwtkweg8FswWba41y+dQPaHXrT6yp?= =?us-ascii?Q?tj9EGCsZOvxmVbIVnjtxuNEYHw36Mku6lW2LjcP7A4PJOqWMO0DI+g06QBdy?= =?us-ascii?Q?ThaPqhljm/MXjkPwDVmspqcYgOtT9Ab9AW5en9TuGfIIcjJSuvBEUcvRDbRd?= =?us-ascii?Q?MtAHUHDKtaAgS6Vp4J/7gZsfudABkvLXDVIDipsrQLapWbHGyntEYLTrD7TA?= =?us-ascii?Q?IWz0PWtpbRyxpFVXWeUKo9xcBsk4CuvWyb/QGWa8T5kb/bk5prZzZVljkiy2?= =?us-ascii?Q?rvSN8yn71Cg7m15KkBw1HbYOZMrqvXY2V2yJc8dG/96qtpTXQOp0JvyCZBH5?= =?us-ascii?Q?E4q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ostics: 1; BY1PR0701MB1721; 6:LMiLNQr5R33z6dAYBW/w/1V7BO7TnvSzHFn320S7JJ8JaE+1uCkFLW2rKxG4cK9Dt0/ISJ+QoBYXP9e6NhjX3w048ZdJ0wmCUvQ5M3DRl1YWC+w5dpgagN5sz+jgToiXp/jdSmr1tT3WBnLkTFPoASZZTqQscKj2kU9MLIxe/Q0vwGqI6c/gMXDfo5P79/RRk9Lsnve7782XaVU2O7wvGEXjq7u+b9wwJ5jzyHMBK3lMZiFCqvXvlh1Iq+dLbcv5nz2loO6sYqQkRclXlFvjHRT/jYFFkmFDSPzWJghT8BdSlgBiqr5uLE916uaO4d1h; 5:8ynPBDUiWJHx0pNZDfqbWB6oQbHhiAx8FX1NmgeUBAYISxGHg/jtigD5sG4lRWWZiaukoJkxO7mBCE+SGwu7VBDRCDVLer6/NEZfcXdYSjwTRf4FxGdwiat6FbIPhHuw41lofBWeld6jj5eA0S3LKQ==; 24:NQqrjS2QxJ37V5JgXdcbxnDjeTJ89SfxQJa6EdJXupdrSw3Y5gqpEoJgzc1soFPQ/WUk1hn+noKMV50sYywqraNP91GIhtMo7+zKVnb+FWk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 7:RwNyIJBamYMUcpVNq4PlWql69NxhteTiBnO40jD64bpKBbOPpz87b8fvqJ52+56Nrf4nqm38k7rd5nAf18DjkuYsz1rvbFm0mlhiXQ1jqVjIRNhExHmPZ6TTaLDwIfEw38MdSglSQSYuobB36xLBp1wcnctoz6WGW23D/5XXLcDOnq892ML0iglzcay/G4cmsVfubDjISvcCoZ9k2K434EwgSNxM2B1JKym0gefX2bI+495fVmUTdJfUhu1KgUcLv9fzf9AgaKXjoHjX0xhDB1AMHMD2AWDlD+caBXWIxJmLL4ODwENoa8OCYY2ns6l32eso+XsqRt70cGHe5hDAZ2Tev6SEjfma0M+drY1LQ4I= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2016 05:45:42.2534 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1721 Subject: Re: [dpdk-dev] [PATCH 26/28] net/virtio: 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, 15 Dec 2016 05:45:46 -0000 On Wed, Dec 14, 2016 at 11:02:23AM +0800, Yuanhan Liu wrote: > On Wed, Dec 14, 2016 at 07:25:56AM +0530, Jerin Jacob wrote: > > * Following macros are derived from linux/pci_regs.h, however, > > * we can't simply include that header here, as there is no such > > @@ -320,37 +322,37 @@ static const struct virtio_pci_ops legacy_ops = { > > static inline uint8_t > > io_read8(uint8_t *addr) > > { > > - return *(volatile uint8_t *)addr; > > + return rte_readb(addr); > > } > > Oh, one more comments: why not replacing io_read8 with rte_readb(), > and do similar for others? Then we don't have to define those wrappers. > > I think you can also do something similar for other patches? Make sense for the virtio-pci case where API name io_read/write as good as rte_read/write. However, IMO for other drivers for example ADF_CSR_RD/WR improves code readability compared to plain rte_read/write. Also IMO replacing code incident like below static inline void writel(unsigned int val, volatile void __iomem *addr) { - *(volatile unsigned int *)addr = val; + rte_writel(val, addr); } with direct rte_read/write more appropriate. does above said make sense to you? If so then I will take care for all such driver in V2. --Santosh. > --yliu > > > > static inline void > > io_write8(uint8_t val, uint8_t *addr) > > { > > - *(volatile uint8_t *)addr = val; > > + rte_writeb(val, addr); > > } > > > > static inline uint16_t > > io_read16(uint16_t *addr) > > { > > - return *(volatile uint16_t *)addr; > > + return rte_readw(addr); > > } > > > > static inline void > > io_write16(uint16_t val, uint16_t *addr) > > { > > - *(volatile uint16_t *)addr = val; > > + rte_writew(val, addr); > > } > > > > static inline uint32_t > > io_read32(uint32_t *addr) > > { > > - return *(volatile uint32_t *)addr; > > + return rte_readl(addr); > > } > > > > static inline void > > io_write32(uint32_t val, uint32_t *addr) > > { > > - *(volatile uint32_t *)addr = val; > > + rte_writel(val, addr); > > } > > > > static inline void > > -- > > 2.5.5