# RE: \[PATCH v6 net-next 0/9\] net: dsa: netc: add PTP support for NETC switch

- From: Wei Fang \<wei.fang@nxp.com\>
- Date: 2026-11-10 08:46:23 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2026/11/17904220
- Thread: https://ratatoskr.run/imx/2026/11/17848922/t.md

```text
> This patch set adds PTP timestamping support to the NETC switch, so that
> the switch ports can be used for IEEE 1588 PTP synchronization.
>
> The NETC switch has no time registers of its own and instead shares the
> PTP time of the NETC Timer, which is a separate PCIe function driven by
> its own driver. The first 3 patches prepare the Timer driver for this
> role: tidy up its 64-bit register access, drop an ineffective reset, and
> export netc_timer_get_current_time() so the switch driver can read the
> current PTP time across the driver boundary in a race-free way.
>
> The switch redirects PTP frames to the CPU through the ingress port
> filter table (IPFT). A few patches harden and simplify the existing IPFT
> and host flood handling first, then enable the ingress port filtering
> lookup by default so PTP filter rules take effect without extra software
> tracking.
>
> On top of that groundwork, the switch driver gains RX timestamping and
> both flavours of TX timestamping. Timestamps are carried between the
> hardware and the driver through dedicated switch tags: the ingress and
> transmit timestamps ride in To_Host tags, and per-frame requests ride in
> To_Port tags. Two-step TX matches a queued skb clone against the
> timestamp response echoed back by the hardware. One-step TX defers the
> Sync frame to a per-port work, where the driver reads a fresh PTP time
> and writes it into the Sync frame's timestamp field, then programs the
> single-step register and transmits the frame so the hardware can add the
> residence time to the correction field on the wire.
>
> Together these changes let standard user-space PTP stacks drive hardware
> timestamping on the NETC switch ports.

I saw netdev's Sashiko reported some issues [1], and I think some of them
should be fixed or improved.

[1] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261103021024.3121936-1-wei.fang%40oss.nxp.com

--
pw-bot: cr


NXP Confidential

```
