RE: [PATCH net-next 6/7] net: dsa: netc: add PTP two-step timestamping support

From: Wei Fang

Date: Wed Jul 29 2026 - 21:35:39 EST


> > +int netc_get_ts_info(struct dsa_switch *ds, int port,
> > + struct kernel_ethtool_ts_info *info)
> > +{
> > + struct netc_switch *priv = ds->priv;
> > +
> > + info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
> > + SOF_TIMESTAMPING_RX_SOFTWARE |
> > + SOF_TIMESTAMPING_SOFTWARE;
>
> SOF_TIMESTAMPING_RX_SOFTWARE and SOF_TIMESTAMPING_SOFTWARE
> are available
> by default, no need to add them.

Yes, you are right, I will remove them.

>
> the code doesn't have skb_tx_timestamp() calls, I wonder how is
> SOF_TIMESTAMPING_TX_SOFTWARE implemented?

The switch and the conduit port (ENETC) are integrated into the NETC IP,
so the switch can only connect to the ENETC MAC. And the ENETC driver
calls skb_tx_timestamp() unconditionally, so I thought
SOF_TIMESTAMPING_TX_SOFTWARE can be added. I checked the existing
DSA drivers and found no drivers set this flag, maybe I should remove this
flag as well. Thanks.

>
> > +
> > + info->phc_index = netc_get_phc_index(priv);
> > + if (info->phc_index < 0)
> > + return 0;
> > +
> > + info->so_timestamping |= SOF_TIMESTAMPING_TX_HARDWARE |
> > + SOF_TIMESTAMPING_RX_HARDWARE |
> > + SOF_TIMESTAMPING_RAW_HARDWARE;
> > +
> > + info->tx_types = BIT(HWTSTAMP_TX_OFF) | BIT(HWTSTAMP_TX_ON);
> > +
> > + info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) |
> > + BIT(HWTSTAMP_FILTER_PTP_V2_EVENT) |
> > + BIT(HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
> > + BIT(HWTSTAMP_FILTER_PTP_V2_L4_EVENT);
> > +
> > + return 0;
> > +}
>