Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5730289pxu; Thu, 22 Oct 2020 09:36:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzq8Rn7vMkh6xuyoFRlmovPX2wslA4/rxg28yGinfWoX5lBOqaW2QIJC2YcUqjsITXp1OM8 X-Received: by 2002:a17:906:486:: with SMTP id f6mr2949162eja.473.1603384590819; Thu, 22 Oct 2020 09:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603384590; cv=none; d=google.com; s=arc-20160816; b=boNDZ8pIN25OCcwVJxU/CakqipM3rNaz+CwC8qrltKOUCnaIiywmp86KdBALciYQj9 QOFHXfxPo1PLK5Oh8UlzFln2Ztumh2kJNZrxIprTqnzmQMQ2ruZ2Pm1sqw3pNfalZBXZ qydvGsgy7iearB9ut6/hq/kITVZSXd4Te/ED2y6RhVS9A4gban8uImW5S2oDkrjn3+ZS DvgSBgeGcv+QA3LGmwq6mXToaJGljwSojwUxfTCZh0EdPbY9ZMRNnOVz1ZDPdbsXQzTV ghW4GvCSNexJBsV5z90s285lCJk0dyxCz9SxUWh4ZMvX+iMfc1iAfSfi8o8CE4neLmft uQhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jIaIAx6jS/4uqnHJUBuWWcGf2+UjzZ+gZdm819hN/VU=; b=tlyN3kCrGlZd44uEQUTitZcVlHSaphp/SPPgiJM3KBQww3LDxgrWuRtdSwROnX5BEE nEkCq0EU0K48zvpJxdQRVzXo3qEyPbxH71CMou7lL9hqMKDuC4fWp+9qMXdXDXyH5fpc B2GgBEjDc2awmuTfJzk/yZ0wZ+C4PV9QDIahTzEbpwkyCpBcsbX+s7xRaOQBxLVs39fK Cz4AhSozM3kIp8n9n0dBasN2yd0/RFbJk74VWiIJQwnYDSZDsdM8T1eC9hwWcvC5cONk 0xo4lJmZEc5eRp3xQeFJUMjEeC9kRgu72FT09DhFw1HIRI3edcIujD35Nfz9i/RlW2fA GPnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ThtOsYEM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si1401823ejb.125.2020.10.22.09.36.08; Thu, 22 Oct 2020 09:36:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ThtOsYEM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2897308AbgJVLcs (ORCPT + 99 others); Thu, 22 Oct 2020 07:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2897299AbgJVLcr (ORCPT ); Thu, 22 Oct 2020 07:32:47 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F24EC0613CE; Thu, 22 Oct 2020 04:32:47 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id t20so1391986edr.11; Thu, 22 Oct 2020 04:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jIaIAx6jS/4uqnHJUBuWWcGf2+UjzZ+gZdm819hN/VU=; b=ThtOsYEM5zerzLpBETqFjB3YKpeIJRvrmxJZEf3w4Kz9TeYMus9fkxqZomDOjrPcYl IRCDlFO5p8JDQHy/VyN3aDs8OMHv2Wwg/jkcPE+UDEx8jSV6kGPWZlCihR+1me/mVfwe 1beaL4nlFZ48dotOLhiSl03EchBgg+kfFcMdyzY82YyEI4FHOfvKBvhFaU1viBQG8JaS hn/STTq4JcywsW2SUbtbfIAnz1gMWTAboVM8+1ahVW0S3ElzI2rsSFxKD6EAsbSa4NGf KCvvjO+9p8XX9w8Je31XyrVwsxQ7bwV1GbDHSqQX8D2+oisv55xDvdT8H161tNFSshC+ SvWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jIaIAx6jS/4uqnHJUBuWWcGf2+UjzZ+gZdm819hN/VU=; b=fKZHZygcI8qImIoOsHY/hwHDCTQCHdlL2r2+irDBLZN2TuUfgOGEibqOrvTNCm+e24 X38WK2FGusaIyt+6qvcuMJQLlW5ARSr9UscXZODJ4jvFNZxf/Qfz5KZYCmWPBTex7+dS KGXll4WTUFiJFGu3+kKTvmu/JEgNNU9XuUqjJqTlKigJAM6sHUP/Tbd4hPNX7cNI+nen 11ET+j/5AyWV0qHyIE6BqPTiJbwSqMu+kduuz+TGSzh8Zecy+8y928ObswASWxaEaKT8 /HXc2twogAUucSBSrWgiBkpULylEYD24XT+DPA6luN6XVcdmmmoGi5Me3gyUp2ewqhv8 +mUA== X-Gm-Message-State: AOAM531lIOw9N5d2TDLgjRadlcv3fUe0CMr0HZ5TlTrmDnWhTLtUlgtA bDYUGOOGMvW5Wc4obSF7N4M= X-Received: by 2002:a50:f389:: with SMTP id g9mr1834189edm.367.1603366365840; Thu, 22 Oct 2020 04:32:45 -0700 (PDT) Received: from skbuf ([188.26.174.215]) by smtp.gmail.com with ESMTPSA id d6sm601729edr.26.2020.10.22.04.32.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 04:32:45 -0700 (PDT) Date: Thu, 22 Oct 2020 14:32:43 +0300 From: Vladimir Oltean To: Christian Eggers Cc: Richard Cochran , Florian Fainelli , Andrew Lunn , Vivien Didelot , Jakub Kicinski , Rob Herring , Helmut Grohne , Paul Barker , Codrin Ciubotariu , George McCollister , Marek Vasut , Tristram Ha , "David S . Miller" , Woojung Huh , Microchip Linux Driver Support , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH net-next 7/9] net: dsa: microchip: ksz9477: add hardware time stamping support Message-ID: <20201022113243.4shddtywgvpcqq6c@skbuf> References: <20201019172435.4416-1-ceggers@arri.de> <20201022090126.h64hfnlajqelveku@skbuf> <20201022105014.gflswfpie4qvbw3h@skbuf> <2541271.Km786uMvHt@n95hx1g2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2541271.Km786uMvHt@n95hx1g2> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 22, 2020 at 01:11:40PM +0200, Christian Eggers wrote: > Hi Vladimir, > > On Thursday, 22 October 2020, 12:50:14 CEST, Vladimir Oltean wrote: > after applying the RX timestamp correctly to the correction field (shifting > the nanoseconds by 16), That modification should have been done anyway, since the unit of measurement for correctionField is scaled ppb (48 bits nanoseconds, 16 bits scaled nanoseconds), and not nanoseconds. > it seems that "moving" the timestamp back to the tail tag on TX is not > required anymore. Keeping the RX timestamp simply in the correction > field (negative value), works fine now. So this halves the effort in > the tag_ksz driver. Ok, this makes sense. Depending on what Richard responds, it now looks like the cleanest approach would be to move your implementation that is currently in ksz9477_update_ptp_correction_field() into a generic function called static inline void ptp_onestep_p2p_move_t2_to_correction(struct sk_buff *skb, unsigned int ptp_type, struct ptp_header *ptp_header, ktime_t t2) You should then clearly document that this function is needed for hardware capable of one-step P2P that does not already modify the correctionField of Pdelay_Req event messages on ingress.