Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6194061pxb; Mon, 8 Nov 2021 04:49:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzR6ikfDcUZ1vRqgPASaQm9mk7iN8ZwJT+rK/uDFfDW4SLPXyPhxalOVCS5TFl3a1Bk4PxK X-Received: by 2002:aa7:c444:: with SMTP id n4mr39754338edr.6.1636375759777; Mon, 08 Nov 2021 04:49:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636375759; cv=none; d=google.com; s=arc-20160816; b=Avnkr8mxv6AvWdAxX6/XgVDZBS0nZK7/ikYtOJEXvbmOtBQO7ZaBsHE9lzCuc9DxDJ EA7Z3SOIrTBC1w/qMrxfk0vU9EZ0i1Q/NuqEqZgL2H2WGaWX3GGreqV2rDJAdpM2ppRt QNluuDgnP1qcenLedDOnDsq2C204oO0SCEX8WyONUaZAOxvytpvtRM48w5s0uGb15XKx 6I8mHOPPNA+fA6cxJ1d3Twjvf/73IMRonPjAKqCg00qY3lTNJAm4apvOnqqwbcOtdv6x MlqJm5RDC7up0qijDoEE3pk7MCN44Bvrv++XmfKUoWVeENFEWhMamyyX3mo7DUyFQtNS dqsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:dkim-signature:message-id; bh=YoadjRf4FiKN1veUX9KomPwUfwXQtLyR4qj+Cau8Djk=; b=H8ufQi0B3585Nxnw36PTdnlwDG3r3Ln5lIU2OsEksmX4kVMu+iezSe+fxJ+yCXPJ3s c+DDEws2v4eeDE/uYgCZPEZV39wfxnI4G0nj/pTesPex/32gfTyHiTjcIWvf0wTwkQ9B PqFT4N++c4QSfyYxWbbN9e2x7HimndGA3vIv/yjOdt1sKQKWsjhgOSxGay6jUlZJMzbZ VdW3WNyxL1js5jwm4NGkGVCqmdEnllT9fX2RKoUS197eJmXxXyFYY0kFScv/67vm9lEW +X24aX99rpEPBMXL/4gso9SeneKKbivWuVYKY+Hf305Y3l3KICVRrAU9taE+zOzvj7CY Yh9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nrb11SEi; 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 du13si19777799ejc.417.2021.11.08.04.48.56; Mon, 08 Nov 2021 04:49:19 -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=nrb11SEi; 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 S238517AbhKHKAg (ORCPT + 99 others); Mon, 8 Nov 2021 05:00:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238510AbhKHKAf (ORCPT ); Mon, 8 Nov 2021 05:00:35 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA0F9C061570; Mon, 8 Nov 2021 01:57:51 -0800 (PST) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1636365468; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YoadjRf4FiKN1veUX9KomPwUfwXQtLyR4qj+Cau8Djk=; b=nrb11SEi8Se/oItTd/rpSkxJ+62DZgegCyr6Ja/iI8ah8h4J4QNYXvoy0VAD40x+l4Mn9M tS/1V59qrnKWYyw22jPcKM4WDuk07h56qgUhbn3lgQzvSmO9kXDpJ2q78Fo3ZUSdYOOXny a6GwQgkYAmul5bDEH0BNLV+3Ivft6ic9jxfUDvzvkS0Z6dvdmFSo5KldVRO1hRLLm2EfzH 3XwphGFmZgKD/nDyN4kB5A5oQnu4nqo0B+18gI5pGTsThvkrDZoUtp2rQnv/jg4xcjfWj5 RGySgKO6uZVvzxeGexfgvo7TWCbLxw8L7FWfD+xfQqoGu//KxSDbxYetAHbjFw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1636365468; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YoadjRf4FiKN1veUX9KomPwUfwXQtLyR4qj+Cau8Djk=; b=wfmDv6HDkEMfNOl8q/qCVj3p0Pfrnm6KcIzpeY55EaA7VXo5I8a4fqyva211L+a4RLk3T+ Dv9Ves3coE+XwOAA== Date: Mon, 8 Nov 2021 10:57:48 +0100 MIME-Version: 1.0 Subject: Re: [PATCH 6/7] net: dsa: b53: Add logic for TX timestamping Content-Language: de-DE To: Florian Fainelli Cc: Richard Cochran , Vladimir Oltean , "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, Andrew Lunn , Vivien Didelot References: <20211104133204.19757-1-martin.kaistra@linutronix.de> <20211104133204.19757-7-martin.kaistra@linutronix.de> <4f4e28f9-8d1e-f2e9-aa0c-37b2c4cd8e8a@gmail.com> From: Martin Kaistra In-Reply-To: <4f4e28f9-8d1e-f2e9-aa0c-37b2c4cd8e8a@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 06.11.21 um 03:50 schrieb Florian Fainelli: > > > On 11/4/2021 6:32 AM, Martin Kaistra wrote: >> In order to get the switch to generate a timestamp for a transmitted >> packet, we need to set the TS bit in the BRCM tag. The switch will then >> create a status frame, which gets send back to the cpu. >> In b53_port_txtstamp() we put the skb into a waiting position. >> >> When a status frame is received, we extract the timestamp and put the >> time >> according to our timecounter into the waiting skb. When >> TX_TSTAMP_TIMEOUT is reached and we have no means to correctly get back >> a full timestamp, we cancel the process. >> >> As the status frame doesn't contain a reference to the original packet, >> only one packet with timestamp request can be sent at a time. >> >> Signed-off-by: Martin Kaistra >> --- > > [snip] > >> +static long b53_hwtstamp_work(struct ptp_clock_info *ptp) >> +{ >> +    struct b53_device *dev = >> +        container_of(ptp, struct b53_device, ptp_clock_info); >> +    struct dsa_switch *ds = dev->ds; >> +    int i; >> + >> +    for (i = 0; i < ds->num_ports; i++) { >> +        struct b53_port_hwtstamp *ps; >> + >> +        if (!dsa_is_user_port(ds, i)) >> +            continue; > > Can you also check on !dsa_port_is_unused()? After the currently implemented check, dp->type should be DSA_PORT_TYPE_USER, so it can't be DSA_PORT_TYPE_UNUSED, right? Thanks, Martin