Thread (11 messages) flat view 11 messages, 3 authors, 14d ago

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

From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Date: 2026-07-30 13:02:26
Also in: imx, linux-arm-kernel, lkml, netdev

On 30/07/2026 02:31, Wei Fang wrote:
quoted
quoted
+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.
quoted
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.
well, you have the hardware, you can actually check if enetc driver 
provides it for you
quoted
quoted
+
+	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;
+}
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help