Received: by 10.223.164.202 with SMTP id h10csp962483wrb; Tue, 7 Nov 2017 18:34:08 -0800 (PST) X-Google-Smtp-Source: ABhQp+SC8+UlqVVxCJ4wp3gTEbh3zOw99XUgpDTdvFBQAUmefJdGsmcf7x9dZjvtjlmPMmhL0SwF X-Received: by 10.159.207.145 with SMTP id z17mr763921plo.162.1510108448584; Tue, 07 Nov 2017 18:34:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510108448; cv=none; d=google.com; s=arc-20160816; b=fAE+Nlotj7oxwheSVhp++7vRftCKmWEYC9fDjmnG0TmgipYBaVcXx0NM1tRBNxMUdp FtTAEnHtwL073EqxfJ9yFZeH5chhLBXf5uEsbr5KCnj8HwcPGuUUv651QI5+MJWuFUGc am+0NvxVtp75JbuamqOEEkyU1T4oQw9fBOKF0+9bCGoE295Z2CA88eN4B99lft0KY12N B+Y3r2zTg1/TyuWMh57vPme2Qe2ust0VSQBXXGfTrvxgcd0qNK0nAa8xI1t1m3DopOE+ doJ7G9Pc73zjAcye4UAy0//3X4OyHlb7neFVeymFGJNUjjHZYNPN+D+biD5EYA4WzdwX ZV6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=RKkjV6z3iAy4hiaTNAq2o7Rmi8eZzdDnzIP0gfFz+0s=; b=C2HyUnJSfsQUJmrQTHkW2G7vUBn8FyZAopoTtKW1j8FBOzc9/zzAlmm3gt7CP95jda hyy1QeRxiHnne8kemtM9dO1F9dGKTVgjzv/jWm3NvsYDQNU/GevFGuzLPqxD+z9T7koX PgBs324EpvwxUKuIumA+5J/ySl6/0bMO3EKL58++L5LULp8OkkjMO5onfi3bPY+DDL21 IJpzVYyrvV1hDA5o3L6B/+/Hnq8f61rKI4dvMHaet5aX287/N0Ys60A8pBgINm/dMFBf 7sIdIhyJXu9AueYSi0eojr5Hc6ilY/h6wOwps5yvg5AGJ5ecfot9540c5IDR+jKhA2Lb +ysQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=G84m6ft+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay6si2497928plb.336.2017.11.07.18.33.56; Tue, 07 Nov 2017 18:34:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=G84m6ft+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754182AbdKGTta (ORCPT + 90 others); Tue, 7 Nov 2017 14:49:30 -0500 Received: from mail-by2nam03on0079.outbound.protection.outlook.com ([104.47.42.79]:45696 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753824AbdKGTt2 (ORCPT ); Tue, 7 Nov 2017 14:49:28 -0500 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=RKkjV6z3iAy4hiaTNAq2o7Rmi8eZzdDnzIP0gfFz+0s=; b=G84m6ft+XiNBM3v3tKly4HFo3EeFEG0TfdYDZSy6uorrlSY42LMHeyvVoKf9uO0+kEcyCn2y0DArOw8KVGjCwzWC8kMqkyWwydfAtX1/X0RKRObSMDV1Ze6PJGlqwb9qMpHcnMvx0vL0rGsixVOzk1hzaN8EOZr7zgoEfR+b4ag= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@cavium.com; Received: from ddl.caveonetworks.com (50.233.148.156) by CY4PR07MB3496.namprd07.prod.outlook.com (10.171.252.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Tue, 7 Nov 2017 19:49:25 +0000 Subject: Re: [PATCH net-next 1/2] net: add support for Cavium PTP coprocessor To: Aleksey Makarov , netdev@vger.kernel.org Cc: Robert Richter , "Goutham, Sunil" , Radoslaw Biernacki , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20171107190704.15458-1-aleksey.makarov@cavium.com> <20171107190704.15458-2-aleksey.makarov@cavium.com> From: David Daney Message-ID: <1d765627-edb1-cc0f-65bc-cf061687a8c6@caviumnetworks.com> Date: Tue, 7 Nov 2017 11:49:23 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171107190704.15458-2-aleksey.makarov@cavium.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: BY2PR07CA0085.namprd07.prod.outlook.com (10.166.107.38) To CY4PR07MB3496.namprd07.prod.outlook.com (10.171.252.153) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3be765d1-6659-4e96-dc3c-08d52618a6b5 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:CY4PR07MB3496; X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3496;3:8J1qw9fz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OMMJSXLTwT/eXqq2QSZ4wvYTeoeVUTmziaxg7uPwEm5IKKDOrAIYig4HrV0aUB1KxBoiaSByAvJPF+mwL5jNbiL//5784rl80sSSuNZq0umKxnehDEQwzCVQpsHhthrqEBOlKPEcRa8xVvtL/ZYR7lcBokOcrxArZn1DmmXD+ZH4IGHqbU5e7Gr+a6v02fAE04cDkJoexEPv50xQLWtGxkT7h82yrplXgs2G4uKhmcfjUgYuj9tKP3wgTNTBT3G0K7Y+ekSsLwNR0G7cIMBjtZLaYj+7jtIvqo7hV1kfcyhdrrN/VXz5S4/fO10h/M0dfp3/8bJrze1uvkltAlWz20/vrk3b/VWFsFRkPzm8OyuGbMJLa7QTW0CeiyOvYMDzWtTd7vTZl8eYVEIYyoVXrp365jH90eNMLNYTowiYtrAae0Ia3lGuGa3YRI9wmnEx5REYEgCKxvU=;4:92aqlWLj4paFBpNN0Pab/xGLcdiwkA/mioFh72Rney6umBul78ide0WAB1TrBxQAsk8psFBHttjJPl/1BoEkcBoyOdSrGX71ZanHe3BPy0RCv1xPhMB9dacXkQQMGpFQGZwLL/W8kLmNQe7t4v+23vi3Q9JJTzVd/WQQQqpTrCy/6z491bwvV5Dt1EaI52yhXa4za1sWcuDc0x0vTW45s12/023rhl+PZj3y9jqSG0ulNxypHzOT1UgLfTmsQnPTOKVG+r6fhdOwrJR9zTbECg== X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(3231021)(6041248)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR07MB3496;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR07MB3496; X-Forefront-PRVS: 0484063412 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(376002)(346002)(189002)(199003)(24454002)(64126003)(47776003)(6512007)(6246003)(25786009)(66066001)(50466002)(478600001)(65826007)(50986999)(76176999)(54356999)(31686004)(58126008)(72206003)(7736002)(53936002)(305945005)(53546010)(189998001)(65806001)(65956001)(101416001)(5660300001)(36756003)(6116002)(229853002)(316002)(3846002)(2906002)(23676003)(68736007)(54906003)(67846002)(81166006)(81156014)(230700001)(69596002)(6486002)(6506006)(106356001)(8936002)(2950100002)(4326008)(105586002)(42882006)(97736004)(31696002)(33646002)(16526018)(83506002)(53416004)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB3496;H:ddl.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: =?utf-8?B?MTtDWTRQUjA3TUIzNDk2OzIzOldVVU9IM0UxNzU1UEtXOURyUjYvdkRpVk8w?= =?utf-8?B?azhPaXdaQkRZR2hVVnA0TEErL0duYTVnZVUvTmFPclREYVFvMThSOHRaUnVs?= =?utf-8?B?SXdmOExId1F2RkNvenRxUll4aVFXVmpNSDV2VzdKN3hBb1hWK3hGM1pwODRm?= =?utf-8?B?T0dYckJ4YUYwdW91bVcvVUJ1Qy9zbVZzSlF6a29zdmhFUEFsTUgrZHlKYlZG?= =?utf-8?B?REsyRWpocHRnVm1HUmk5YzNIdG9DT0tpOG9vZGw3US8xbmx2dXR4UFFESFYy?= =?utf-8?B?NEt6SkUvc1pUWEFOZnhVMmxLVWdNZmhwUDRvU3Z1OWRBK2p1L1FZZXNqUTNK?= =?utf-8?B?QTRXQ3lqeDhYazJFRVdGNXdXWjRNam5EODg1a2FvY2VLZ3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YeMV9kudE0=;5:POxzGSlZcv1lL1QJiQgZCHnrBBCgDuNLl4CJi/h0wELNrlOkGqycFfmhasPlBW0MWMGA15eMOu62VOd2Lipynridzhh04Yh3hq6pOacNeI8ocSYdmr8IEX6FivqfYdpkL/wJ44dMhcDxIb06yxXw7LXXwgu/c9SYyMXuOGEZM84=;24:yDUMHJC35tGBhTBjhOfA64kUYO9UgWIjblvL2KD1KrAYz96q3WKJX/AZ/lVKVxor1s0RaynxXpz66F8IaRKND9CIQyP37A7m9KhwkMClsug=;7:9upL9HknpueFzH4Z8WNyunAnlkfVSxQcfrkTCIBULn9EvHBmxkGqFwmuT75ydrOfqMIoIS1Y9+HO6GZzI359YnabOb752JMdQWKPmz3ZW9AJUWM0efLjwTnL2wem5DvbBRZa4MyZChVawcQqM7v6BHunWEWbZsidVCDMaVYVgx5COl53cw8uqM/K4D7dVtsIwJYfRlZSus5j18D7cn4QE6iQOflT1kns6z1YpT6p2fZha5HLih2R/KUb6VX85/RT SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2017 19:49:25.7831 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3be765d1-6659-4e96-dc3c-08d52618a6b5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3496 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/07/2017 11:07 AM, Aleksey Makarov wrote: > From: Radoslaw Biernacki > > This patch adds support for the Precision Time Protocol > Clocks and Timestamping hardware found on Cavium ThunderX > processors. > > Signed-off-by: Radoslaw Biernacki > Signed-off-by: Aleksey Makarov > --- > drivers/net/ethernet/cavium/Kconfig | 13 + > drivers/net/ethernet/cavium/Makefile | 1 + > drivers/net/ethernet/cavium/common/Makefile | 1 + > drivers/net/ethernet/cavium/common/cavium_ptp.c | 353 ++++++++++++++++++++++++ > drivers/net/ethernet/cavium/common/cavium_ptp.h | 78 ++++++ > 5 files changed, 446 insertions(+) > create mode 100644 drivers/net/ethernet/cavium/common/Makefile > create mode 100644 drivers/net/ethernet/cavium/common/cavium_ptp.c > create mode 100644 drivers/net/ethernet/cavium/common/cavium_ptp.h > [...] > + > +/* The Cavium PTP can *only* be found in SoCs containing the ThunderX > + * ARM64 CPU implementation. All accesses to the device registers on this > + * platform are implicitly strongly ordered with respect to memory > + * accesses. I believe that is not correct. I/O register accesses are implicitly ordered with respect to other I/O register accesses. However, with respect to memory accesses, no ordering is imposed. Therefore, one must be very careful not to introduce subtile memory ordering bugs with these things when using the unordered versions. > + * So writeq_relaxed() and readq_relaxed() are safe to use with > + * no memory barriers in this driver. The readq()/writeq() functions add > + * explicit ordering operation which in this case are redundant, and only > + * add overhead. Also it should be noted that on production silicon, the performance difference between the "relaxed" variant and the normal variant of read*/write* is often negligible. > + */ > + > +static u64 cavium_ptp_reg_read(struct cavium_ptp *clock, u64 offset) > +{ > + return readq_relaxed(clock->reg_base + offset); > +} > + > +static void cavium_ptp_reg_write(struct cavium_ptp *clock, u64 offset, u64 val) > +{ > + writeq_relaxed(val, clock->reg_base + offset); > +} > + Are the PTP register access really so much in the hot path that using the relaxed variants can be measured here? If not, would it make the driver look cleaner to remove these and just use readq/writeq calls directly in the body of the driver? David. From 1583463173264924659@xxx Wed Nov 08 02:29:19 +0000 2017 X-GM-THRID: 1583463173264924659 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread