Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2570400rwb; Fri, 9 Dec 2022 03:58:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf4FtnmSbo8PIUdGjcbaZkmIlxs+ZjVlYhoV/FF83h2lYZXALaqzQNUUxF5pSSLaZGq4mA6q X-Received: by 2002:a17:906:ae82:b0:7ae:4de9:68ff with SMTP id md2-20020a170906ae8200b007ae4de968ffmr4126908ejb.64.1670587105962; Fri, 09 Dec 2022 03:58:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670587105; cv=none; d=google.com; s=arc-20160816; b=UnDX24VDqi1d7UB5ERStWZRuK2BIOl8zGsT+9r6fTzyHfAvRi2JaMAdTlVfA6XtZCv mfyLSgE3EejLxD/5iKXBt9ux63MAnerBG8uCNErGDjcmH93eMp15KYzoB1QyPa+GbXK8 5bcZSGHWpTWCLwZV+g3rVhYHAnkyDKGdEmUnVdy8H6JGS27e5hzkn/OaIPk55MxxzYoB MNnYbZavKJRVzI7Y7idRHkHrf7OpKT7mAzbuuTD/c9Q7Qw1MMLM3LxdbyVFDmv1GFasZ +inXrzwXIp0icjKmez4u3nY1vigyupgqVAJby487KNvB5bw3+r2mfKzH4rYFmN5oSv8j 2fBw== 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=9AXTqSpnFooFB52J7tpaoo3FAyJlLQ3WSA/kZTD4RcA=; b=H8l8J5MC1wY1bp8/nOa4ytVmzdzL9vZYV8JZXZof3mNyEgWpecnDzHKgGBX2lSzNzX hGMEKtiFTz1o5FV4er0bL+nCXECVuifEFneGCrolCajkb9qk6NFq8oTQ4uFcSoIdH32W RnOj6uV7zPUwTK4B7T5Uz5B2uWimSGAj0yPxaEnOO0/9woCQlmBmITXD7gA4MdKmr9Ik A9iGCBLwvEZNQm27L2Fmi17YrtoiSObmE4ZcNpUIJjs+RFSOriE47DZ0+9lQSsOShoI9 gf/cMz3u6QwHWnk5JEr+/w5Rm+lmIhOnMo6Z7p2J+g4QrsBYHDAqJ7EhbDrToyYFphqn 754w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fecNKEil; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xi7-20020a170906dac700b007c0fa80794fsi1162210ejb.733.2022.12.09.03.58.07; Fri, 09 Dec 2022 03:58:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fecNKEil; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229854AbiLILik (ORCPT + 75 others); Fri, 9 Dec 2022 06:38:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbiLILii (ORCPT ); Fri, 9 Dec 2022 06:38:38 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69B7B1571B; Fri, 9 Dec 2022 03:38:37 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id s5so2694272edc.12; Fri, 09 Dec 2022 03:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9AXTqSpnFooFB52J7tpaoo3FAyJlLQ3WSA/kZTD4RcA=; b=fecNKEilWUQlPQB2dahLnFmGXR5HpWOvEpibbuQ3Zl+WAH/JYMqhGL0IKctv1iA7mF ofPOVQkkCwC2Ar41v+BulectEWgqFFkMp/7QNMDrf9Ndw4qkZ9VVPyq8SUW9PTkQ0oXQ U8qO8NqIDQVnxdhjGhQkrPKOXQr7a3PEJ7njmQKlkMj4+LDZB40WIW605BNUN3FiIYC1 D/3DHrvtlkj/6/r+ekW2xoqiRE2chTXwm7CFCI8RIrl3n2m/uJWLZX6WZ67pl1YLVdrA eLFdDyDtmQIOOyE37z6NHAt3CMKzyWgCqw2BmgfgAkJsqUB6Z2nH6iO9AknoB+sPvW9S PdOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9AXTqSpnFooFB52J7tpaoo3FAyJlLQ3WSA/kZTD4RcA=; b=UpY9gdj3DVyqB1gCDB6bY33RGiSPFQ/mzaraKqqPcP0uIWoWlG7qiG2LI/rsZbXrBm 1PIhekrf607jwY/Imf2YWmjtiuChCySZo7PumNKHKqri7DMAmhJKEimEwv4hEtNGZjUn w9bn0lDlXIbLSTbKAypxNi7De+ltbu36JDA7cn+mB8ov6SFwfhzw9LNSULg8tnFNLTAv umvRn6fAchG8Lh3/4ltPLGUk28UBmTDW+jMyaXal88Qoo0UNNZiZsLSAAZXJFS26p6oj 7J78mRhlR8gtRGc6Z7/8CesvChbpjpnIv56uWO0E3g2qJVOyJIPdUkFUtueMtvVWpPdn gOOA== X-Gm-Message-State: ANoB5pnBouzlfvJF1OzCL5Y4iVrcvBc5BPUAXOb+IGNftv6J3N8VlEAO 14QY8t/3+Jp3mVxptlUgSk0= X-Received: by 2002:a05:6402:378c:b0:461:cdda:4004 with SMTP id et12-20020a056402378c00b00461cdda4004mr4605515edb.10.1670585915787; Fri, 09 Dec 2022 03:38:35 -0800 (PST) Received: from skbuf ([188.27.185.190]) by smtp.gmail.com with ESMTPSA id eg52-20020a05640228b400b00463c475684csm538329edb.73.2022.12.09.03.38.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 03:38:35 -0800 (PST) Date: Fri, 9 Dec 2022 13:38:33 +0200 From: Vladimir Oltean To: Arun Ramadoss Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, woojung.huh@microchip.com, UNGLinuxDriver@microchip.com, andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, Tristram.Ha@microchip.com, richardcochran@gmail.com, ceggers@arri.de Subject: Re: [Patch net-next v3 03/13] net: dsa: microchip: ptp: add 4 bytes in tail tag when ptp enabled Message-ID: <20221209113833.4kbgof3kfw4zjpaq@skbuf> References: <20221209072437.18373-1-arun.ramadoss@microchip.com> <20221209072437.18373-4-arun.ramadoss@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221209072437.18373-4-arun.ramadoss@microchip.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 09, 2022 at 12:54:27PM +0530, Arun Ramadoss wrote: > When the PTP is enabled in hardware bit 6 of PTP_MSG_CONF1 register, the > transmit frame needs additional 4 bytes before the tail tag. It is > needed for all the transmission packets irrespective of PTP packets or > not. > The 4-byte timestamp field is 0 for frames other than Pdelay_Resp. For > the one-step Pdelay_Resp, the switch needs the receive timestamp of the > Pdelay_Req message so that it can put the turnaround time in the > correction field. > Since PTP has to be enabled for both Transmission and reception > timestamping, driver needs to track of the tx and rx setting of the all > the user ports in the switch. > Two flags hw_tx_en and hw_rx_en are added in ksz_port to track the > timestampping setting of each port. When any one of ports has tx or rx > timestampping enabled, bit 6 of PTP_MSG_CONF1 is set and it is indicated > to tag_ksz.c through tagger bytes. This flag adds 4 additional bytes to > the tail tag. When tx and rx timestamping of all the ports are disabled, > then 4 bytes are not added. > > Testing using hwstamp -i > > Signed-off-by: Arun Ramadoss > --- Reviewed-by: Vladimir Oltean # mostly api