Article View: linux.kernel.netdev
Article #20723Re: [PATCH v8 net-next 8/9] net: dsa: netc: add PTP two-step timestamping support
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 05:05
Date: Mon, 23 Nov 2026 05:05
114 lines
11946 bytes
11946 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] netc_port_del_ptp_filter() (drivers/net/dsa/netc/netc_ptp.c)
handles every error from ntmp_ipft_delete_entry() as "the entry isβ¦
--
net: dsa: netc: add PTP two-step timestamping support
This adds two-step TX timestamping and RX timestamping for the NETC
switch. For RX, IPFT rules trap PTP frames to the CPU port with an
ingress timestamp. For TX, the driver queues the skb clones and matches
them by request ID against hardware response frames delivered through a
new tagger callback.
> diff --git a/drivers/net/dsa/netc/netc_ptp.c b/drivers/net/dsa/netc/netc_ptp.c
> new file mode 100644
> index 0000000000000..bd4d0b70e7ee5
> --- /dev/null
> +++ b/drivers/net/dsa/netc/netc_ptp.c
> @@ -0,0 +1,502 @@
[ ... ]
> +static int netc_port_del_ptp_filter(struct netc_port *np)
> +{
> + struct netc_switch *priv = np->switch_priv;
> + int ret = 0;
> + int err;
> +
> + for (int i = 0; i < NETC_PTP_MAX; i++) {
> + if (np->ptp_ipft_eid[i] == NTMP_NULL_ENTRY_ID)
> + continue;
> +
> + /* No -ETIMEDOUT here: with the command BD ring enabled, the
> + * hardware execution time for a command is much less than
> + * 1ms, so no timeout error will occur. Any remaining error
> + * means the entry is still present in the table.
> + */
> + err = ntmp_ipft_delete_entry(&priv->ntmp,
> + np->ptp_ipft_eid[i]);
> + if (likely(!err)) {
> + np->ptp_ipft_eid[i] = NTMP_NULL_ENTRY_ID;
> + continue;
> + }
> +
> + ret = err;
> + dev_err(priv->dev,
> + "Delete PTP entry 0x%x (type %d) on port %d failed\n",
> + np->ptp_ipft_eid[i], i, np->dp->index);
> + }
[Severity: Low]
Is the claim in this comment guaranteed by the NTMP layer? The delete
goes through this path:
netc_port_hwtstamp_set()
netc_port_set_ptp_filter()
netc_port_del_ptp_filter()
ntmp_ipft_delete_entry()
ntmp_delete_entry_by_id()
netc_xmit_ntmp_cmd()
netc_xmit_ntmp_cmd() hands the BD to hardware and only then waits:
drivers/net/ethernet/freescale/enetc/ntmp.c:netc_xmit_ntmp_cmd() {
...
i = (i + 1) % cbdr->bd_num;
cbdr->next_to_use = i;
netc_write(cbdr->regs.pir, i);
err = read_poll_timeout(netc_read, val,
(val & NETC_CBDRCIR_INDEX) == i,
NETC_CBDR_DELAY_US, NETC_CBDR_TIMEOUT,
true, cbdr->regs.cir);
if (unlikely(err))
return err;
...
}
If the consumer index does not advance within NETC_CBDR_TIMEOUT, this
returns -ETIMEDOUT. The hardware may still run the DELETE after that.
In that case np->ptp_ipft_eid[i] is kept. netc_port_current_rx_filter()
would then report an rx_filter that is no longer installed. The commit
message says this design avoids exactly that:
"so a delete or rollback that fails partway does not leave software
reporting a filter that no longer matches the hardware."
Every later netc_port_set_ptp_filter() also starts by deleting the stale
entry ID. If the hardware rejects deleting a missing entry (the response
error status maps to -EIO), could every later hwtstamp_set on that port
fail until the switch is set up again?
This needs the hardware itself to stall, because read_poll_timeout()
reads once more after the deadline. The host-flood path added earlier in
the series by "net: dsa: netc: check return value of
ntmp_ipft_delete_entry()" makes the same assumption. This patch adds a
second user whose reported state depends on it.
Should -ETIMEDOUT be handled separately here, for example by treating
the entry state as unknown? Or should the comment say this is an
assumption about the hardware rather than a guarantee?
[ ... ]
--
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119030534.1892935-1-wei.fang%40oss.nxp.com
Technical Details
Message-ID:
<179541033885.3135.10657211800089692875@kernel.org>Path:
mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369042-linux-kernel-netdev=dewy.ruReferences:
<20261119030534.1892935-9-wei.fang@oss.nxp.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369042-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH v8 net-next 8/9] net: dsa: netc: add PTP two-step timestamping support Date: Mon, 23 Nov 2026 05:05:38 +0000 Organization: Usenet Network Message-ID: <179541033885.3135.10657211800089692875@kernel.org> References: <20261119030534.1892935-9-wei.fang@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3794881"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:mnpWoaLwfrQID313byhuaNs+V7E= sha256:Fp4wwqnnNNzvaORMLei+ExRJktjYNLQUhQs9U91wgB8= sha1:53BNFmN+4yMpDntD1RkM4lcwVHI= sha256:cZG6nrxc41fheO8HCkkthuMh45cHvwda7z2jC3YODYU= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 76F83125D8D; Mon, 23 Nov 2026 08:06:06 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0AE38EcQNCf4; Mon, 23 Nov 2026 08:06:02 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369042-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 7AE48125D8E; Mon, 23 Nov 2026 08:05:54 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 11BDB2D648; Mon, 23 Nov 2026 05:05:45 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795410341; b=LR/SYMQl4iqKaULWPdqdjPiultXI3t96MmOispbPE8fD12S6QrPtfZ5khI+JNklyZc3i z8yIwbGaIGJoC2MsXTULfUEXThVVqem2FOAf82Pet0s4102fZGJyzaaHepgo4I/HJL4cJ PKGIi+GCKxhpJlhazUugcCI3YOXXioweox/ZD2eCulcXppdrXIgtUclfq54wBNkKiFXHv GUQ7cxPPcveFHmBMw5i0FbmZu1gKAsNMYN51UrH3PIsWXr2VuGW7Eje7w1tO3ezZEpLe8 ogfTSr5AcBHotefhgeVszV6SEEIDLvlqzbTeqqfM7m7UIAOwmSIImaDshVD81R0o0/A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795410341; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=w8e+3WRbDOUCO3CM0bxDt3Ty+eAqQazN2XhtHI1VjrY=; b=bhINWhMb6gMDWCShB0lBByb48bcbfj5oZtfE1zjAoyd3CvihRBUFE26PHAv9HlJvuXjE XpaWU2gJzRqkPOEqjmRsW0bMYeDFSLprY37snPp5JLF/RaFP/iXTGdKEWEkaFFtQ0i3Kc GNeSS5gny0z8sC/v90GNSPhtcnw2FKQlrXXXaIOd5W1PkMEoLGnOZiSvw2nYsaXLVjbzp 06iCOehK+0cNntKjtTUJQWFaf6UKo+LfsV09tRKblay5rP+URVimHaHuVzYDzBadok7Ol HX1K5z3a+XK2Kocmd7XPRyE4O81wu4BQNRMZH2FtFdS7Pe0v/dTiqIbu2gZQIXi9TbA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lIfq0H3m; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 606AA606A695; Mon, 23 Nov 2026 05:05:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lIfq0H3m X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795410340; b=XI7u94ev2xAjYPLkxrkJDh/c3mxvk/6oGuby/nG6FR8JD5H1SDVB3YyBQcFzAhFk7ljA 7OcueL3onIyrguEB8FA/bl9EbDLNo+WQkEaYUBw+JRx8fh/dvMKGZKcTNh5SMrMZ3QUQY K2o5fga2s3cKKRegWmjOY3QzYW4DRPii2S5NO+R8pGhxPN8HO3DNmoE6PcduXVWTceJYo nkEt7I9zPcDMSmIzph+y+sAfxyUIXww2cGQPsW9NnszmwlMT5uqdddJBwFwf2kF3hqP9Y TO1PE4Aq5FGzP9DAvaimimdW8p1SarokuW8FPLN+nFVvOW4si3kFZqxVTfN6Jg/kZTA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795410340; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=w8e+3WRbDOUCO3CM0bxDt3Ty+eAqQazN2XhtHI1VjrY=; b=MlY1r0y4wn//09VwTEIqEbAJPdYLdRwJSoH2G+im0i3N1CAZrPHu0G981RhJYR30fhEp h2P0xTgCZrECakkNTYmZua7JZ4YaXVOfOshh51jV+2HiXVTpD8j74Rm8ZXXCNZ2VFaZx+ dfwYIwHyTK+biLqfunzcJawCkprKfu2XhtC+u6eojsEaoGK2PH4ZvHAE1HZm/Oaqbt8/b tG6D55NCzOO+mz4CtFnbBpdJNbD1W/iTlmziBh3HiDaj3f780xdxzIUJVaHDxCdchue9b 170hL1zvEWTd1OpFbsitX5j35sgW7ChLQPfzeVHURqxuKMQ9MN9cI9qb72bnTeYel7A== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lIfq0H3m; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81DC2606A335; Mon, 23 Nov 2026 05:05:40 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4456F1F000E0; Mon, 23 Nov 2026 05:05:39 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795410340; bh=w8e+3WRbDOUCO3CM0bxDt3Ty+eAqQazN2XhtHI1VjrY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=lIfq0H3mK5sdaXj7zpLKBnPA2do9QNohK1yaRLNQiyO7eS0fXUg9pBdBoDW7P291k 4x/EjDSsoVzpOWWBM6VzOLiK5blWykSpjzCrGJ8DXb1Qh1B/nEPUT/0eGCcEtSKspA UipdOChW9Y4o97ga1GdoH9hDa1He8EWgsXBG/2hzCBk2UInmFBAlW/F6cwJDPyLNuE MspTK+f3Iye+CIjptOZlpfGK7fXh/a4uVfF4H94Jz1v9TVdBDZs9QV/1iYOYRD9Xj1 pUt5oLDTGCsBA/a2sSy1zBvzzYDiDxDy55h7sx3KPJKuNeYHyhf9Z/D0hMXfN5TMq1 4WwX+kdsxFHAw== X-Cc: xiaoning.wang@nxp.com, andrew@lunn.ch, olteanv@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, richardcochran@gmail.com, linusw@kernel.org, linux@armlinux.org.uk, wei.fang@nxp.com, imx@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org X-In-Reply-To: <20261119030534.1892935-9-wei.fang@oss.nxp.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list