Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp163958pxh; Tue, 9 Nov 2021 23:21:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9nuZgZrI1eYYNuXALD+kYT4Ia6Wix5s4rNvaIKf126ITM+voiHpxEIBU7hCdN5kYMskhm X-Received: by 2002:a05:6602:2cce:: with SMTP id j14mr5190056iow.111.1636528881425; Tue, 09 Nov 2021 23:21:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636528881; cv=none; d=google.com; s=arc-20160816; b=PsMxjd/Ur/edJW0tim02RygqX4MSUEKRy4T5LxicUC0Zs2Dd1zSVDd81sI6YSmHYdm EiPnB9ahHDYY1bsWDFE0aIpsLprt9kRm4VEPERAjXxvkPhzZqKhNP1KoP9r5N0jo/gva jMzFReod14maVwv7DYq0jPYiR6sMQ/PkAps6u1E4GrZPhbwCsX0kGLZlS6WCCuq97s1F 8057vU51ep3oOCrOy5J69x5wHoFJbKin4AuMsrRe0fufDT8GsXb9ZSKbQBxLUghExHRB B7cEB4Ocfto6RXUxBi+Ovp2pTIJTZPCPNa9W/P4bzlXJ81Q1qbn5/Qxgd4HaYQEqsIbx txbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=QYI7QecjnuG6GfxdL7j/OK7s1zjdjd+JXdxf/Anwd28=; b=T6p8A0Z56HD1IImFEtBhTYZD9dURGEIiG4skWzSYbZjksBmDmEudf4P23nOnfX3A/h tXAbLRuRgdD1Z2sxP4dOk6BSP8nUlx98OUo85Gau3n0pi/KoZ8bS61uc/tkZ6NPpz4p0 DIN/yqH/5m0/jUwU+9rgG2TEGd8ObrF5YlDc8cJvyg/1F4hCo0fibDbhJdC3Px3j95// NyGDPoWpthREJqqKMGuUIZLGjLZZsarKbLxo8rIl0I2O24y6C5OFBDg7JPdWfOtVMErB rUtHl7OmNqhfgZwFdBSVrKoOzGwiCdmefgbHhhMIJSVyC8cds/PlPsOtljTRmwDO24DF DQzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JA+pnNN5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w7si40821763ill.182.2021.11.09.23.20.27; Tue, 09 Nov 2021 23:21:21 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=JA+pnNN5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229695AbhKJHRX (ORCPT + 99 others); Wed, 10 Nov 2021 02:17:23 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:41084 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhKJHRW (ORCPT ); Wed, 10 Nov 2021 02:17:22 -0500 From: Kurt Kanzenbach DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1636528474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QYI7QecjnuG6GfxdL7j/OK7s1zjdjd+JXdxf/Anwd28=; b=JA+pnNN5pl09aLxL29MEYniyA8Xu1rTX+7i2DAzB5jI+Hsgp3Rnzr2wGEmD+N0ZKl07yND +POpOSGP226y+NiBgA+9fqZ6VhilXkGwW5mBBPMn55GP6XCNcxIcGAq56Ws3PkR4P/E+TN 996vQo2zx/m+nh1IQbhTWXFg8T+QSXM7tncXFV6S6gl6T1Z3nyYhjYQpIhlQkPAAx03Bng qJrpsR8WcqCBs4WakzxS5srdMVL+XscV2lKrPm4cv5WAEY7TIo/JUDSd9po7XYhUWcZvsU ayaMhB6B0ZH1+OyH3JdB23E0aXJ499z6BeE8QYb1OX5rDQsYlVameOSkV011JA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1636528474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QYI7QecjnuG6GfxdL7j/OK7s1zjdjd+JXdxf/Anwd28=; b=PlZUDTvGnYFz8eGYw1Kd/4NWTm6ysons3+Fay8IdiFO2RtvhiQGY6UmazJQTfSy9q59Y00 d0j9Z13e027C8ZDQ== To: Vladimir Oltean , Martin Kaistra Cc: Florian Fainelli , Andrew Lunn , Vivien Didelot , Richard Cochran , "David S. Miller" , Jakub Kicinski , John Stultz , Thomas Gleixner , Stephen Boyd , Russell King , Marc Kleine-Budde , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v2 6/7] net: dsa: b53: Add logic for TX timestamping In-Reply-To: <20211109111213.6vo5swdhxjvgmyjt@skbuf> References: <20211109095013.27829-1-martin.kaistra@linutronix.de> <20211109095013.27829-7-martin.kaistra@linutronix.de> <20211109111213.6vo5swdhxjvgmyjt@skbuf> Date: Wed, 10 Nov 2021 08:14:32 +0100 Message-ID: <87ee7o8otj.fsf@kurt> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Hi Vladimir, On Tue Nov 09 2021, Vladimir Oltean wrote: >> +void b53_port_txtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb) >> +{ >> + struct b53_device *dev = ds->priv; >> + struct b53_port_hwtstamp *ps = &dev->ports[port].port_hwtstamp; >> + struct sk_buff *clone; >> + unsigned int type; >> + >> + type = ptp_classify_raw(skb); >> + >> + if (type != PTP_CLASS_V2_L2) >> + return; >> + >> + if (!test_bit(B53_HWTSTAMP_ENABLED, &ps->state)) >> + return; >> + >> + clone = skb_clone_sk(skb); >> + if (!clone) >> + return; >> + >> + if (test_and_set_bit_lock(B53_HWTSTAMP_TX_IN_PROGRESS, &ps->state)) { > > Is it ok if you simply don't timestamp a second skb which may be sent > while the first one is in flight, I wonder? What PTP profiles have you > tested with? At just one PTP packet at a time, the switch isn't giving > you a lot. PTP only generates a couple of messages per second which need to be timestamped. Therefore, this behavior shouldn't be a problem. hellcreek (and mv88e6xxx) do the same thing, simply because the device can only hold only one Tx timestamp. If we'd allow more than one PTP packet in flight, there will be correlation problems. I've tested with default and gPTP profile without any problems. What PTP profiles do have in mind? > Is it a hardware limitation? Not for the b53. It will generate status frames for each to be timestamped packet. However, I don't see the need to allow more than one Tx packet per port to be timestamped at the moment. Thanks, Kurt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCgAxFiEEooWgvezyxHPhdEojeSpbgcuY8KYFAmGLcVgTHGt1cnRAbGlu dXRyb25peC5kZQAKCRB5KluBy5jwpohmD/9Fi3OzBODMKAMtxu4MdAKbvJaeHAqD a/6agx8SRMlt0nJ7bw52jAoD6ky1WPaAgpmr4iYvwLqp5yTwAa7V1jMxC82PaxUp DEo9E3HuTZiQD9s+w0UYE6JDcvG88QvZbRPvBc8k1r4vUTG13giPe6dYh8bAXmqB A+fpvH1o24dNG2IstdSdkbQvj4oK5nkTxXx6q72dx2eZ8Ong+tI2Jor5htu+qBHZ PdYU466Z2ov3KGd5Ne0zTZE4zDUEPJan5TeJoCy37zAjQSWj3VLeF2/MwoOZBGjk e92jimwtWWi2knpaBR60NA6PL1qx9oztbzB0n9/jLKkYu7W0y201Hw/KDdz5r80D RoIQ6c5z5e1GZztr4280dsFfGeL/rRph0sGiUMtKH7SXJOaU78bKa5P4BTGs6DQb lNewiEMoTnP6to7pb0iVDlky1rafX/yu4kDrjHXaN0lLtxDqDzYvB74d1ExUoxog opvhJr6UVCyt9wo+IYlheET5zjbMFRuS7L/NGismf7LwzBKogfzTrEIxjHieF0+m Xi29P1SWNCOlH9TGMd3Sd48txcJVXX4mv7JLGtQ0gUF4h09M2wHHVa7WUsyB3zRT G/K+1yicIt9T1VvkBRzRU4ggHPUbkBsuUacpRLcaxEggUwdD1vxBmBUOv17uHC1Q bbEeE4JSnePfAg== =JRT5 -----END PGP SIGNATURE----- --=-=-=--