From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0041.outbound.protection.outlook.com [104.47.34.41]) by dpdk.org (Postfix) with ESMTP id EB781F6D2 for ; Fri, 13 Jan 2017 09:17:31 +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=IeRWcm1zZUhUlYCgQwG19zbzvoNM57AKzp03xTLRe3I=; b=hKVqjS46cnUxlTsiFiIM/73deC7ok67eg0p26FqPWdpqWZFfeuq3EEAx/zu4XuS+3kPuFQLG9ULqwwdtpJ1+6QQtUO2JRuS1RrBAVEmJopeWw11mx4xkb3fhBy/ogL01rPMCEhCErir4ajnAk+jY1bM6R+KYmBYlOOMb5s1G1Cg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (171.61.97.114) by CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Fri, 13 Jan 2017 08:17:24 +0000 Date: Fri, 13 Jan 2017 13:47:05 +0530 From: Jerin Jacob To: Ferruh Yigit CC: , , , , , , , John Griffin , Fiona Trahe , Deepak Kumar Jain Message-ID: <20170113081641.GA17635@localhost.localdomain> References: <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-16-git-send-email-jerin.jacob@caviumnetworks.com> <6bb9980b-f546-38d5-044a-63507510f6a5@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <6bb9980b-f546-38d5-044a-63507510f6a5@intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [171.61.97.114] X-ClientProxiedBy: MA1PR01CA0116.INDPRD01.PROD.OUTLOOK.COM (10.174.56.160) To CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) X-MS-Office365-Filtering-Correlation-Id: c9bd33f1-a2f2-4a61-b7f2-08d43b8c9dcf X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 3:wEzRG0E5FPYs0VqxG7PLhCYto1IPPwe+ruQjEswVYZsbc90KhfvYNXRKADcItOlzGW0iGsGbKtfpWwmKl2yWUCy8HdaJk+WOL3NNJ1OJsUzZuQGnlMb8MFN0KvjQa4UatJWIgzRQjmS0JEMCf4aKyzykNWyjPVXKeQHeZQHnTCFHgo61NR+13JKKTr5rRUoKQ3WVEraMZABnDXp2zDq7kQif5SBg+2b13Z37iyp1rBj6JH43GX7BC4nTrJI+ipXw7c/4QPlrDAPN2WPyUJoGeg==; 25:luXkHh9mMbMYr56rcGPA2IYzPOzAuC2XiJrNom0DZ5B9Z+uQyvKFRfXwRVN67O6P1Nq12cgoqj6qXg+Vm5XglcvygkDVC90PNS8hxwkJv762M6LROPSvU0ccay9YpQtfSHHUPzf3Zb8TFW1r9qapcZf1i5icG8iN1v+b7uEPupKRqcbb4DAZaoDW8tj9IFIzFq7r3iuL/EuayLyxZXDNnjgvmwPEozNeeSBrajVdU9iPyjyDEi+Q3fW+5JzF12A6lYIqYK7O7NUzUNzkkKhFFWy1yVVghua6JT4okrD0YuLxCiWCHAW4VaB4L3bzUSNGCLlW4KyB4ZWyEYLmhL4mpwERM+8yQNDkD/V4NanAty1qh4KMuy866CSKvnZQpDmv4h5kaxE1fdwRz16/hZ3pOUa5Dz3nS5KuHyWwGMJslRiqEr+aTCWzlMKISAd8UL1YWoKHxu2bWgr0B8+O/DC6pw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 31:58kk4L6VOWM193+xCsRm7XZIJqdSAJGP4C6axezJ1hXOHbn/r1f8jF/Hb/raSz1W4ZhLJEEogdVYg9H/vMnQmB5Rgg9zHcHVShGVwAq9yJG1cfa7d2PgBupzBNcdy4gQH/9+8bRLOpcXHFg8NQ6k07ikVCK3mv7imM63Iqvs8BIjjXWg9k3/yRWFGCnBf3leXWYYlVohh47leTXMvQFNcSsMxB2SnUmzQ56dkqduSlDz/HTE91r8c+xqzP+PLr/0; 20:ds0XJ6D5Li/8cQzgdHHDTX1dpFUvciG9GJ05HHVcQcIunLr3osP9OE6G/RCv2yanSiLMfUn4ntyeUiaJdepn235BZIDjirlWJmX21kw/Gb+VEka699WjgMtA55pkipyq2suiM5+KPudSGpYxECf7Hzs32Jhs/uNEuDlpSLEYo37di6UGwqxYjcqJvP/FSQH4E/rDIlehRlHT6zg/6Q/gK9fh/SNCefsTeB0qxMgxSOOE16rAGaG0YBQMStdeJXFiVDNNlbQd1cGefHqXvjlfHRxh8W/pQ9vHLH2bZVmiQWg3Xn6ZZoI1cr5oc8o3RMu6poLu7ffWe1S3LOZ5DdxsuYoO/wBCTT8eFixMsvw/1ym8b96YokVId+asZ3VP37p3zUXWob22yTOE/zSm3r4xW83VG/xg+qfbPSdCwJ5uQnIcka25WUHtmz4wdewp/aEPIrknyR78SFIJ8iUTNd8p1GCVcJG8xcbTTO0ajcvMTLohkUo28Bs+yqSGY7let3i3YsxL4G+vcxpNQdK37LUImirnYj3M8tXEYXvpaz4CM+Zxi1sj3XgjsiaSyLRjuqv2xSqDB2CvbKf0bWWyw5gkJ6/9d3TrB7BEdCTApde4FGU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:CY1PR0701MB1726; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 4:AtzwkrPBfn1SXyaUb1xwZzetOiIOS7QQvF1uJYn6tVzc627gLti4HPlx3FEI3vGvbvo4MUl/upahctnGRKaBr2R8ZZUDKLJAJfn2V973PNN3AwgjVoDQKc91jrvij1bDpu4XMNy6bV9h4JlXnbDk310ZqReNcPa8oWd3T3s4esPTXHn+aWYpgyMUywbATS9SJo15fzlM7WBKRFotsSZeG7wUyvwt3aWoDtdo+yvMaKTLG2/cHfowXd52p/YWcDbOHJsUiqQsOzSL5yMyKKJdi76SRs2l2ZcjvTPU7bxPI7WAo+xpCZYUWSvtLgJEVVmm8UbHSzMp+I5AYJTwgR1pDkohkV9XQ+VGNYaVPO0kbJ0ovH8MaOivzT+S3rfuQWFmyKWPRMZgpdUhkdbt0RuPTwJVaLtLqzaA91QjDRrNkURiLWsc7u1/AoRqqOGzz5iisgz1i/n45wYtbup4CKyaJMFb4oym9pXKoiBuUsF3yBuw2UOCm/ed0efQDR+G9Vbj4ve/01eX+P7jajrXe6g9T8GIeXBD/3OT9TNKwttFgowJQDVnx9BsQCTuKCqLrkdZ2+WoV+3u04espdAb26r785oqb1/KaF6uYknXuZWpUlF71YGZ8+F8lf9QYTr0Bl5d X-Forefront-PRVS: 018632C080 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(24454002)(189002)(199003)(76104003)(377454003)(42882006)(6666003)(6916009)(81166006)(2950100002)(189998001)(93886004)(4326007)(92566002)(7416002)(7736002)(9686003)(8676002)(5660300001)(305945005)(81156014)(50986999)(110136003)(97736004)(54356999)(66066001)(76176999)(54906002)(4001350100001)(25786008)(33656002)(97756001)(105586002)(2906002)(47776003)(61506002)(42186005)(50466002)(55016002)(3846002)(23726003)(68736007)(101416001)(229853002)(106356001)(6116002)(1076002)(46406003)(38730400001)(6506006)(83506001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1726; 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: =?us-ascii?Q?1; CY1PR0701MB1726; 23:KqIG3cQC4Fvezg1K9KQ19XtJwpt34NnE3uIZVRz?= =?us-ascii?Q?GeOdnzCaBBkOPOCL61+ouAJPVb/XoSUct370Ria51yPo97bMj4jn1PmWCJK+?= =?us-ascii?Q?C9o7fMpBl7RNazYdpeEJkiB8WAYFjpHm4N4YzEJQWQkMISFNwadrUuEnJf3L?= =?us-ascii?Q?Jkzh7pER0Ikvwu71MFVM9rwcDWvhzzSvtOkN4cW3MQDfcoPkKAE1XTcRIutu?= =?us-ascii?Q?FfaQFHQS4hlJ+6E+magjogo/ssmFpym2Atuo5fHvW5T0pfhaCQIg7KUYnpQm?= =?us-ascii?Q?B/gUBIzY3y/Zgeh5LTUgOecBp9+HLJo8LN7gpvdKU7CBW5xkXZPSyYYSpH5q?= =?us-ascii?Q?4WXY9ot/V6k1eWjb9SgIJEVy9Z2Qf2AzCJjzS+Redl3JWDEge/yKa9d2oOti?= =?us-ascii?Q?h2z1o6irnVo2YsWNuC/G2KPzw5h0I6jgfg/nWzBgjdfvaTvXPEU16wGBE5uX?= =?us-ascii?Q?CR42pShgglxzFu1vMODF3J4afmshvjEXXwIJumCW1Q46C5fHFyRD9e3aX/+2?= =?us-ascii?Q?CokCElLG+N1NUpeOW0DqK2DZCLnLg006KTQ0nUf1glynII3J4lu5/xmwjWI2?= =?us-ascii?Q?XlL8/G7dvuQOIvCGvaLlJrPebwMoUPcraXa/JREGyE9aB/RiUBMLuEdOYKnU?= =?us-ascii?Q?pwiCJkIpT/YdxpmfuvTDGSxGtv1UJyrMut4UvIR04HrOXZ/ssjA4F2fvK+fe?= =?us-ascii?Q?Lcbpv6m/W54kCjDLT+zVcmqdfWBPE+rHx9U0lkdZ7h6yNMoJhBjOekYi6ZD+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pSKSvwe3Is4R5Y21QxSgZWQeFDGXt2fRsJjtqPYHfgp/VbIWh12NYxywAuplP3HhGQwX/HiSjE3FbLs7AeY1J0v6Rs8NJOcQ4N7PdKay13KAYun8s7AFS8093b0e2gy5I0TX30ynnzUQBmH8/NgvzvbKo=; 5:BCNFM1u5OskqXpt2/nrI8X09QySNQYD5n8ppn4cKDGnF15Cut1U7aRGGerQYB4HBtSn70DfKv94fsKyFsfIL9iogZhMLWSukkIjOn72DFeJ77K8jh0wQlC21n7jjY+gv6L9MM/RlVaTQ2GSeo2xkWg==; 24:GbcULiJZoV4C7CgxHqTpdRriYKsNW5+kTU8aXuO9twtiAF8MvWwO1GLH0BYz7zeIg2sBJaLykL33KWDeae6qdgPEG7cSNgEbzbVRY0Vrulw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 7:46/7pJ4V5xYTvfLQixBL4G3Ac46a5fmnVrIFD2v/54avxI0OAMBBDTDTysOyOVM8YGyX93HGEGaf/RLnHpw/CBcqIqE5vn9IkNVOWnT/3pIyHYwzVQibOKrDgEvmAOwwEI2h8HTkCZypPrDX3t/nE3G0RL2gscycAy8e9H2Vfnj0tLgaY90HqrRQs6G1S3YgvfMSJ8Ulc0IZJM8+5SO0k+LyFdzeUUmOIR1QxzSQ1YRVcQbEEGIKy8xOFpNZumqUqXtIsWcVK571a75q9Z6X3fjxGJQQ3En7PHR/I6k3kWRhVcu9yvTvTQRXCHYOc+HAErq5uzK1nRNFcVZWR02tToObfE46Evv3OAX6jtGVKXQO8j5+bPa65ItGU6T45D+Vh8wqmnqFhuShumNl6tncRIlbpzardhkcRjML0cS5Qv2w58M/w4q9bi94Ybh3E4lQCB5OGWOlFylSE7c9VKBfNQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2017 08:17:24.2871 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1726 Subject: Re: [dpdk-dev] [PATCH v3 15/29] crypto/qat: 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: Fri, 13 Jan 2017 08:17:32 -0000 On Thu, Jan 12, 2017 at 07:09:22PM +0000, Ferruh Yigit wrote: > Hi Jerin, > > On 1/12/2017 9:17 AM, Jerin Jacob wrote: > <...> > > > +#include > > + > > /* CSR write macro */ > > -#define ADF_CSR_WR(csrAddr, csrOffset, val) \ > > - (void)((*((volatile uint32_t *)(((uint8_t *)csrAddr) + csrOffset)) \ > > - = (val))) > > +#define ADF_CSR_WR(csrAddr, csrOffset, val) \ > > + rte_write32(val, (((uint8_t *)csrAddr) + csrOffset)) > > For IA, this update introduces an extra compiler barrier (rte_io_wmb()), > which is indeed not a must, is this correct? AFAIK, Compiler barrier is required for IA. I am not an IA expert, if someone thinks it needs to changed then I can fix it in following commit in this patch series by making rte_io_wmb() and rte_io_rmb() as empty. Let me know. AFAIK, Linux kernel code has a barrier in readl/writel for IA. Typically we don't use any non relaxed versions in fast path.In fast typically all the drivers has explicit write barrier for doorbell write and followed by a relaxed version of write. IMO, In any event, it won't generate performance regression. [dpdk-master] $ git show 70c343bdc8c33a51a9db23cd58122bdfc120a58f commit 70c343bdc8c33a51a9db23cd58122bdfc120a58f Author: Jerin Jacob Date: Mon Dec 5 06:36:49 2016 +0530 eal/x86: define I/O device memory barriers for IA The patch does not provide any functional change for IA. I/O barriers are mapped to existing smp barriers. CC: Bruce Richardson CC: Konstantin Ananyev Signed-off-by: Jerin Jacob diff --git a/lib/librte_eal/common/include/arch/x86/rte_atomic.h b/lib/librte_eal/common/include/arch/x86/rte_atomic.h index 00b1cdf..4eac666 100644 --- a/lib/librte_eal/common/include/arch/x86/rte_atomic.h +++ b/lib/librte_eal/common/include/arch/x86/rte_atomic.h @@ -61,6 +61,12 @@ extern "C" { #define rte_smp_rmb() rte_compiler_barrier() +#define rte_io_mb() rte_mb() + +#define rte_io_wmb() rte_compiler_barrier() + +#define rte_io_rmb() rte_compiler_barrier() + /*------------------------- 16 bit atomic operations * -------------------------*/ #ifndef RTE_FORCE_INTRINSICS > > If so, does it make sense to override these functions for x86, and make > rte_writeX = rte_writeX_relaxed > rte_readX = rte_readX_relaxed > > > > > /* CSR read macro */ > > -#define ADF_CSR_RD(csrAddr, csrOffset) \ > > - (*((volatile uint32_t *)(((uint8_t *)csrAddr) + csrOffset))) > > +#define ADF_CSR_RD(csrAddr, csrOffset) \ > > + rte_read32((((uint8_t *)csrAddr) + csrOffset)) > > This patchset both introduces new rte_readX/rte_writeX functions, also > applies them into drivers. > > While applying them, it changes the behavior. > Like above code was doing a read, but after update it does read and > read_memory_barrier. > > What do you think this patchset updates usage in a manner that keeps > behavior exact same. Like using rte_read32_relaxed for this case. > And doing architecture related updates in a different patchset? Need to use rte_read32 at this commit otherwise it will break for ARM. That's was all point for this patchset. For performance regression, we can always verify by taking delta between this changeset and the previous changeset. If you think, I need to make rte_io_wmb()/rte_io_rmb() as empty for IA then I could do that as well. > > This both makes easy to see architecture specific updates, and makes > easy to trace any possible performance issues by this patchset. > > > > > #define ADF_BANK_INT_SRC_SEL_MASK_0 0x4444444CUL > > #define ADF_BANK_INT_SRC_SEL_MASK_X 0x44444444UL > > >