Skip to contentSkip to conversation

RX software timestamp for all

PATCH Superseded Gal Pressman 17 participants 23 messages Aug 29, 2024 – Sep 2, 2024

Subsystems (40)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover RX software timestamp for all

All devices support SOF_TIMESTAMPING_RX_SOFTWARE by virtue of net_timestamp_check() being called in the device independent code. Following Willem's suggestion [1], make it so drivers do not have to handle SOF_TIMESTAMPING_RX_SOFTWARE and SOF_TIMESTAMPING_SOFTWARE, nor setting of the PHC index to -1.

All drivers will now report RX software timestamp as supported.

[1] https://lore.kernel.org/netdev/[email protected]/

Thanks,
Gal

Gal Pressman (2):
ethtool: RX software timestamp for all
net: Remove setting of RX software timestamp from drivers

 drivers/net/bonding/bond_main.c               |  3 ---
 drivers/net/can/dev/dev.c                     |  3 ---
 drivers/net/can/peak_canfd/peak_canfd.c       |  3 ---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c  |  3 ---
 drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c  |  4 ----
 .../ethernet/broadcom/bnx2x/bnx2x_ethtool.c   |  4 ----
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  5 +----
 drivers/net/ethernet/broadcom/tg3.c           |  6 +-----
 drivers/net/ethernet/cadence/macb_main.c      |  5 ++---
 .../ethernet/cavium/liquidio/lio_ethtool.c    | 16 +++++++--------
 .../ethernet/cavium/thunder/nicvf_ethtool.c   |  2 --
 .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c    | 11 +++-------
 .../net/ethernet/cisco/enic/enic_ethtool.c    |  4 +---
 drivers/net/ethernet/engleder/tsnep_ethtool.c |  4 ----
 .../ethernet/freescale/enetc/enetc_ethtool.c  | 10 ++--------
 drivers/net/ethernet/freescale/fec_main.c     |  4 ----
 .../net/ethernet/freescale/gianfar_ethtool.c  | 10 ++--------
 .../ethernet/fungible/funeth/funeth_ethtool.c |  5 +----
 .../hisilicon/hns3/hns3pf/hclge_ptp.c         |  4 ----
 .../net/ethernet/intel/i40e/i40e_ethtool.c    |  4 ----
 drivers/net/ethernet/intel/ice/ice_ethtool.c  |  2 --
 drivers/net/ethernet/intel/igb/igb_ethtool.c  |  8 +-------
 drivers/net/ethernet/intel/igc/igc_ethtool.c  |  4 ----
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  |  4 ----
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  2 --
 .../marvell/octeontx2/nic/otx2_ethtool.c      |  2 --
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |  6 ++++++
 .../ethernet/mellanox/mlxsw/spectrum_ptp.h    | 20 -------------------
 .../net/ethernet/microchip/lan743x_ethtool.c  |  4 ----
 .../microchip/lan966x/lan966x_ethtool.c       | 11 ++++------
 .../microchip/sparx5/sparx5_ethtool.c         | 11 ++++------
 drivers/net/ethernet/mscc/ocelot_ptp.c        | 12 ++++-------
 .../ethernet/pensando/ionic/ionic_ethtool.c   |  2 --
 drivers/net/ethernet/qlogic/qede/qede_ptp.c   |  9 +--------
 drivers/net/ethernet/renesas/ravb_main.c      |  4 ++--
 drivers/net/ethernet/renesas/rswitch.c        |  2 --
 drivers/net/ethernet/renesas/rtsn.c           |  2 --
 drivers/net/ethernet/sfc/ethtool.c            |  5 -----
 drivers/net/ethernet/sfc/siena/ethtool.c      |  5 -----
 .../ethernet/stmicro/stmmac/stmmac_ethtool.c  |  4 ++--
 drivers/net/ethernet/ti/am65-cpsw-ethtool.c   |  2 --
 drivers/net/ethernet/ti/cpsw_ethtool.c        |  7 +------
 drivers/net/ethernet/ti/icssg/icssg_ethtool.c |  2 --
 drivers/net/ethernet/ti/netcp_ethss.c         |  7 +------
 drivers/net/ethernet/xscale/ixp4xx_eth.c      |  4 +---
 drivers/ptp/ptp_ines.c                        |  4 ----
 net/ethtool/common.c                          | 19 +++++++++---------
 47 files changed, 57 insertions(+), 217 deletions(-)
Signature · 1 line
2.40.1
#1 lore raw

PATCH 1/2 ethtool: RX software timestamp for all

All devices support SOF_TIMESTAMPING_RX_SOFTWARE by virtue of net_timestamp_check() being called in the device independent code.

Move the responsibility of reporting SOF_TIMESTAMPING_RX_SOFTWARE and SOF_TIMESTAMPING_SOFTWARE, and setting PHC index to -1 to the core. Device drivers no longer need to use them.

---
 net/ethtool/common.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
net/ethtool/common.c +10 -9
index 7257ae272296..aa7010f97152 100644
@@ -695,20 +695,21 @@ int __ethtool_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info
 {
 	const struct ethtool_ops *ops = dev->ethtool_ops;
 	struct phy_device *phydev = dev->phydev;
+	int err = 0;
 
 	memset(info, 0, sizeof(*info));
 	info->cmd = ETHTOOL_GET_TS_INFO;
-
-	if (phy_is_default_hwtstamp(phydev) && phy_has_tsinfo(phydev))
-		return phy_ts_info(phydev, info);
-	if (ops->get_ts_info)
-		return ops->get_ts_info(dev, info);
-
-	info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE;
 	info->phc_index = -1;
 
-	return 0;
+	if (phy_is_default_hwtstamp(phydev) && phy_has_tsinfo(phydev))
+		err = phy_ts_info(phydev, info);
+	else if (ops->get_ts_info)
+		err = ops->get_ts_info(dev, info);
+
+	info->so_timestamping |= SOF_TIMESTAMPING_RX_SOFTWARE |
+				 SOF_TIMESTAMPING_SOFTWARE;
+
+	return err;
 }
 
 int ethtool_get_phc_vclocks(struct net_device *dev, int **vclock_index)
Signature · 1 line
2.40.1
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH net-next 1/2] ethtool: RX software timestamp for all

Quoted 7 lines · Gal Pressman

All devices support SOF_TIMESTAMPING_RX_SOFTWARE by virtue of net_timestamp_check() being called in the device independent code.

Move the responsibility of reporting SOF_TIMESTAMPING_RX_SOFTWARE and SOF_TIMESTAMPING_SOFTWARE, and setting PHC index to -1 to the core. Device drivers no longer need to use them.

Quoted 5 lines

regards,
Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |
Reviewed-by on v1 1/2
#3 lore raw

Re: [PATCH net-next 1/2] ethtool: RX software timestamp for all

In reply to Gal Pressman
Quoted 7 lines · Gal Pressman

All devices support SOF_TIMESTAMPING_RX_SOFTWARE by virtue of net_timestamp_check() being called in the device independent code.

Move the responsibility of reporting SOF_TIMESTAMPING_RX_SOFTWARE and SOF_TIMESTAMPING_SOFTWARE, and setting PHC index to -1 to the core. Device drivers no longer need to use them.

Quoted 5 lines
#4 lore raw

PATCH 2/2 net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

---
 drivers/net/bonding/bond_main.c               |  3 ---
 drivers/net/can/dev/dev.c                     |  3 ---
 drivers/net/can/peak_canfd/peak_canfd.c       |  3 ---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c  |  3 ---
 drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c  |  4 ----
 .../ethernet/broadcom/bnx2x/bnx2x_ethtool.c   |  4 ----
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  5 +----
 drivers/net/ethernet/broadcom/tg3.c           |  6 +-----
 drivers/net/ethernet/cadence/macb_main.c      |  5 ++---
 .../ethernet/cavium/liquidio/lio_ethtool.c    | 16 +++++++--------
 .../ethernet/cavium/thunder/nicvf_ethtool.c   |  2 --
 .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c    | 11 +++-------
 .../net/ethernet/cisco/enic/enic_ethtool.c    |  4 +---
 drivers/net/ethernet/engleder/tsnep_ethtool.c |  4 ----
 .../ethernet/freescale/enetc/enetc_ethtool.c  | 10 ++--------
 drivers/net/ethernet/freescale/fec_main.c     |  4 ----
 .../net/ethernet/freescale/gianfar_ethtool.c  | 10 ++--------
 .../ethernet/fungible/funeth/funeth_ethtool.c |  5 +----
 .../hisilicon/hns3/hns3pf/hclge_ptp.c         |  4 ----
 .../net/ethernet/intel/i40e/i40e_ethtool.c    |  4 ----
 drivers/net/ethernet/intel/ice/ice_ethtool.c  |  2 --
 drivers/net/ethernet/intel/igb/igb_ethtool.c  |  8 +-------
 drivers/net/ethernet/intel/igc/igc_ethtool.c  |  4 ----
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  |  4 ----
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  2 --
 .../marvell/octeontx2/nic/otx2_ethtool.c      |  2 --
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |  6 ++++++
 .../ethernet/mellanox/mlxsw/spectrum_ptp.h    | 20 -------------------
 .../net/ethernet/microchip/lan743x_ethtool.c  |  4 ----
 .../microchip/lan966x/lan966x_ethtool.c       | 11 ++++------
 .../microchip/sparx5/sparx5_ethtool.c         | 11 ++++------
 drivers/net/ethernet/mscc/ocelot_ptp.c        | 12 ++++-------
 .../ethernet/pensando/ionic/ionic_ethtool.c   |  2 --
 drivers/net/ethernet/qlogic/qede/qede_ptp.c   |  9 +--------
 drivers/net/ethernet/renesas/ravb_main.c      |  4 ++--
 drivers/net/ethernet/renesas/rswitch.c        |  2 --
 drivers/net/ethernet/renesas/rtsn.c           |  2 --
 drivers/net/ethernet/sfc/ethtool.c            |  5 -----
 drivers/net/ethernet/sfc/siena/ethtool.c      |  5 -----
 .../ethernet/stmicro/stmmac/stmmac_ethtool.c  |  4 ++--
 drivers/net/ethernet/ti/am65-cpsw-ethtool.c   |  2 --
 drivers/net/ethernet/ti/cpsw_ethtool.c        |  7 +------
 drivers/net/ethernet/ti/icssg/icssg_ethtool.c |  2 --
 drivers/net/ethernet/ti/netcp_ethss.c         |  7 +------
 drivers/net/ethernet/xscale/ixp4xx_eth.c      |  4 +---
 drivers/ptp/ptp_ines.c                        |  4 ----
 46 files changed, 47 insertions(+), 208 deletions(-)
drivers/net/bonding/bond_main.c +0 -3
index f9633a6f8571..83c406b8b12c 100644
@@ -5770,9 +5770,6 @@ static int bond_ethtool_get_ts_info(struct net_device *bond_dev,
 	if (real_dev) {
 		ret = ethtool_get_ts_info_by_layer(real_dev, info);
 	} else {
-		info->phc_index = -1;
-		info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
-					SOF_TIMESTAMPING_SOFTWARE;
 		/* Check if all slaves support software tx timestamping */
 		rcu_read_lock();
 		bond_for_each_slave_rcu(bond, slave, iter) {
drivers/net/can/dev/dev.c +0 -3
index 87828f953073..6792c14fd7eb 100644
@@ -380,12 +380,9 @@ int can_ethtool_op_get_ts_info_hwts(struct net_device *dev,
 {
 	info->so_timestamping =
 		SOF_TIMESTAMPING_TX_SOFTWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
-	info->phc_index = -1;
 	info->tx_types = BIT(HWTSTAMP_TX_ON);
 	info->rx_filters = BIT(HWTSTAMP_FILTER_ALL);
 
drivers/net/can/peak_canfd/peak_canfd.c +0 -3
index b50005397463..28f3fd805273 100644
@@ -781,11 +781,8 @@ static int peak_get_ts_info(struct net_device *dev,
 {
 	info->so_timestamping =
 		SOF_TIMESTAMPING_TX_SOFTWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
-	info->phc_index = -1;
 	info->tx_types = BIT(HWTSTAMP_TX_OFF);
 	info->rx_filters = BIT(HWTSTAMP_FILTER_ALL);
 
drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 -3
index 3d68fef46ded..59f7cd8ceb39 100644
@@ -901,11 +901,8 @@ int pcan_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info
 {
 	info->so_timestamping =
 		SOF_TIMESTAMPING_TX_SOFTWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
-	info->phc_index = -1;
 	info->tx_types = BIT(HWTSTAMP_TX_OFF);
 	info->rx_filters = BIT(HWTSTAMP_FILTER_ALL);
 
drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c +0 -4
index 21407a26f806..5fc94c2f638e 100644
@@ -582,16 +582,12 @@ static int xgbe_get_ts_info(struct net_device *netdev,
 	struct xgbe_prv_data *pdata = netdev_priv(netdev);
 
 	ts_info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				   SOF_TIMESTAMPING_RX_SOFTWARE |
-				   SOF_TIMESTAMPING_SOFTWARE |
 				   SOF_TIMESTAMPING_TX_HARDWARE |
 				   SOF_TIMESTAMPING_RX_HARDWARE |
 				   SOF_TIMESTAMPING_RAW_HARDWARE;
 
 	if (pdata->ptp_clock)
 		ts_info->phc_index = ptp_clock_index(pdata->ptp_clock);
-	else
-		ts_info->phc_index = -1;
 
 	ts_info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
 	ts_info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) |
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +0 -4
index c7b56a5e5425..adf7b6b94941 100644
@@ -3640,16 +3640,12 @@ static int bnx2x_get_ts_info(struct net_device *dev,
 
 	if (bp->flags & PTP_SUPPORTED) {
 		info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-					SOF_TIMESTAMPING_RX_SOFTWARE |
-					SOF_TIMESTAMPING_SOFTWARE |
 					SOF_TIMESTAMPING_TX_HARDWARE |
 					SOF_TIMESTAMPING_RX_HARDWARE |
 					SOF_TIMESTAMPING_RAW_HARDWARE;
 
 		if (bp->ptp_clock)
 			info->phc_index = ptp_clock_index(bp->ptp_clock);
-		else
-			info->phc_index = -1;
 
 		info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) |
 				   (1 << HWTSTAMP_FILTER_PTP_V1_L4_EVENT) |
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +1 -4
index 9dadc89378f0..8fe680e691a3 100644
@@ -5040,11 +5040,8 @@ static int bnxt_get_ts_info(struct net_device *dev,
 	struct bnxt_ptp_cfg *ptp;
 
 	ptp = bp->ptp_cfg;
-	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE;
+	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE;
 
-	info->phc_index = -1;
 	if (!ptp)
 		return 0;
 
drivers/net/ethernet/broadcom/tg3.c +1 -5
index 0ec5f01551f9..378815917741 100644
@@ -6145,9 +6145,7 @@ static int tg3_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info
 {
 	struct tg3 *tp = netdev_priv(dev);
 
-	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE;
+	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE;
 
 	if (tg3_flag(tp, PTP_CAPABLE)) {
 		info->so_timestamping |= SOF_TIMESTAMPING_TX_HARDWARE |
@@ -6157,8 +6155,6 @@ static int tg3_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info
 
 	if (tp->ptp_clock)
 		info->phc_index = ptp_clock_index(tp->ptp_clock);
-	else
-		info->phc_index = -1;
 
 	info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
 
drivers/net/ethernet/cadence/macb_main.c +2 -3
index 95e8742dce1d..e41929c61a04 100644
@@ -3410,8 +3410,6 @@ static int gem_get_ts_info(struct net_device *dev,
 
 	info->so_timestamping =
 		SOF_TIMESTAMPING_TX_SOFTWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
@@ -3423,7 +3421,8 @@ static int gem_get_ts_info(struct net_device *dev,
 		(1 << HWTSTAMP_FILTER_NONE) |
 		(1 << HWTSTAMP_FILTER_ALL);
 
-	info->phc_index = bp->ptp_clock ? ptp_clock_index(bp->ptp_clock) : -1;
+	if (bp->ptp_clock)
+		info->phc_index = ptp_clock_index(bp->ptp_clock);
 
 	return 0;
 }
drivers/net/ethernet/cavium/liquidio/lio_ethtool.c +7 -9
index 5835965dbc32..c849e2c871a9 100644
@@ -2496,37 +2496,31 @@ static int lio_set_intr_coalesce(struct net_device *netdev,
 	return ret;
 }
 
+#ifdef PTP_HARDWARE_TIMESTAMPING
 static int lio_get_ts_info(struct net_device *netdev,
 			   struct kernel_ethtool_ts_info *info)
 {
 	struct lio *lio = GET_LIO(netdev);
 
 	info->so_timestamping =
-#ifdef PTP_HARDWARE_TIMESTAMPING
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE |
-		SOF_TIMESTAMPING_TX_SOFTWARE |
-#endif
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE;
+		SOF_TIMESTAMPING_TX_SOFTWARE;
 
 	if (lio->ptp_clock)
 		info->phc_index = ptp_clock_index(lio->ptp_clock);
-	else
-		info->phc_index = -1;
 
-#ifdef PTP_HARDWARE_TIMESTAMPING
 	info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
 
 	info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) |
 			   (1 << HWTSTAMP_FILTER_PTP_V1_L4_EVENT) |
 			   (1 << HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
 			   (1 << HWTSTAMP_FILTER_PTP_V2_L4_EVENT);
-#endif
 
 	return 0;
 }
+#endif
 
 /* Return register dump len. */
 static int lio_get_regs_len(struct net_device *dev)
@@ -3146,7 +3140,9 @@ static const struct ethtool_ops lio_ethtool_ops = {
 	.set_coalesce		= lio_set_intr_coalesce,
 	.get_priv_flags		= lio_get_priv_flags,
 	.set_priv_flags		= lio_set_priv_flags,
+#ifdef PTP_HARDWARE_TIMESTAMPING
 	.get_ts_info		= lio_get_ts_info,
+#endif
 };
 
 static const struct ethtool_ops lio_vf_ethtool_ops = {
@@ -3169,7 +3165,9 @@ static const struct ethtool_ops lio_vf_ethtool_ops = {
 	.set_coalesce		= lio_set_intr_coalesce,
 	.get_priv_flags		= lio_get_priv_flags,
 	.set_priv_flags		= lio_set_priv_flags,
+#ifdef PTP_HARDWARE_TIMESTAMPING
 	.get_ts_info		= lio_get_ts_info,
+#endif
 };
 
 void liquidio_set_ethtool_ops(struct net_device *netdev)
drivers/net/ethernet/cavium/thunder/nicvf_ethtool.c +0 -2
index 6a04d2530176..d0ff0c170b1a 100644
@@ -844,8 +844,6 @@ static int nicvf_get_ts_info(struct net_device *netdev,
 		return ethtool_op_get_ts_info(netdev, info);
 
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE |
 				SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c +3 -8
index 3d091947ae00..7f3f5afa864f 100644
@@ -1556,12 +1556,9 @@ static int get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *ts
 	struct  adapter *adapter = pi->adapter;
 
 	ts_info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				   SOF_TIMESTAMPING_RX_SOFTWARE |
-				   SOF_TIMESTAMPING_SOFTWARE;
-
-	ts_info->so_timestamping |= SOF_TIMESTAMPING_RX_HARDWARE |
-				    SOF_TIMESTAMPING_TX_HARDWARE |
-				    SOF_TIMESTAMPING_RAW_HARDWARE;
+				   SOF_TIMESTAMPING_RX_HARDWARE |
+				   SOF_TIMESTAMPING_TX_HARDWARE |
+				   SOF_TIMESTAMPING_RAW_HARDWARE;
 
 	ts_info->tx_types = (1 << HWTSTAMP_TX_OFF) |
 			    (1 << HWTSTAMP_TX_ON);
@@ -1575,8 +1572,6 @@ static int get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *ts
 
 	if (adapter->ptp_clock)
 		ts_info->phc_index = ptp_clock_index(adapter->ptp_clock);
-	else
-		ts_info->phc_index = -1;
 
 	return 0;
 }
drivers/net/ethernet/cisco/enic/enic_ethtool.c +1 -3
index f2f1055880b2..31685ee304c6 100644
@@ -601,9 +601,7 @@ static int enic_set_rxfh(struct net_device *netdev,
 static int enic_get_ts_info(struct net_device *netdev,
 			    struct kernel_ethtool_ts_info *info)
 {
-	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE;
+	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE;
 
 	return 0;
 }
drivers/net/ethernet/engleder/tsnep_ethtool.c +0 -4
index 9aa286ba1f00..228a638eae16 100644
@@ -310,16 +310,12 @@ static int tsnep_ethtool_get_ts_info(struct net_device *netdev,
 	struct tsnep_adapter *adapter = netdev_priv(netdev);
 
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE |
 				SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE;
 
 	if (adapter->ptp_clock)
 		info->phc_index = ptp_clock_index(adapter->ptp_clock);
-	else
-		info->phc_index = -1;
 
 	info->tx_types = BIT(HWTSTAMP_TX_OFF) |
 			 BIT(HWTSTAMP_TX_ON);
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +2 -8
index 5e684b23c5f5..47c478e08d44 100644
@@ -849,17 +849,13 @@ static int enetc_get_ts_info(struct net_device *ndev,
 	if (phc_idx) {
 		info->phc_index = *phc_idx;
 		symbol_put(enetc_phc_index);
-	} else {
-		info->phc_index = -1;
 	}
 
 #ifdef CONFIG_FSL_ENETC_PTP_CLOCK
 	info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE |
-				SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE;
+				SOF_TIMESTAMPING_TX_SOFTWARE;
 
 	info->tx_types = (1 << HWTSTAMP_TX_OFF) |
 			 (1 << HWTSTAMP_TX_ON) |
@@ -867,9 +863,7 @@ static int enetc_get_ts_info(struct net_device *ndev,
 	info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) |
 			   (1 << HWTSTAMP_FILTER_ALL);
 #else
-	info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE;
+	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE;
 #endif
 	return 0;
 }
drivers/net/ethernet/freescale/fec_main.c +0 -4
index 8c3bf0faba63..acbb627d51bf 100644
@@ -2775,15 +2775,11 @@ static int fec_enet_get_ts_info(struct net_device *ndev,
 	if (fep->bufdesc_ex) {
 
 		info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-					SOF_TIMESTAMPING_RX_SOFTWARE |
-					SOF_TIMESTAMPING_SOFTWARE |
 					SOF_TIMESTAMPING_TX_HARDWARE |
 					SOF_TIMESTAMPING_RX_HARDWARE |
 					SOF_TIMESTAMPING_RAW_HARDWARE;
 		if (fep->ptp_clock)
 			info->phc_index = ptp_clock_index(fep->ptp_clock);
-		else
-			info->phc_index = -1;
 
 		info->tx_types = (1 << HWTSTAMP_TX_OFF) |
 				 (1 << HWTSTAMP_TX_ON);
drivers/net/ethernet/freescale/gianfar_ethtool.c +2 -8
index f581402ad740..a99b95c4bcfb 100644
@@ -1455,12 +1455,8 @@ static int gfar_get_ts_info(struct net_device *dev,
 	struct device_node *ptp_node;
 	struct ptp_qoriq *ptp = NULL;
 
-	info->phc_index = -1;
-
 	if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER)) {
-		info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
-					SOF_TIMESTAMPING_TX_SOFTWARE |
-					SOF_TIMESTAMPING_SOFTWARE;
+		info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE;
 		return 0;
 	}
 
@@ -1478,9 +1474,7 @@ static int gfar_get_ts_info(struct net_device *dev,
 	info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE;
+				SOF_TIMESTAMPING_TX_SOFTWARE;
 	info->tx_types = (1 << HWTSTAMP_TX_OFF) |
 			 (1 << HWTSTAMP_TX_ON);
 	info->rx_filters = (1 << HWTSTAMP_FILTER_NONE) |
drivers/net/ethernet/fungible/funeth/funeth_ethtool.c +1 -4
index 7f081e6e8c87..ba83dbf4ed22 100644
@@ -1042,12 +1042,9 @@ static int fun_set_rxfh(struct net_device *netdev,
 static int fun_get_ts_info(struct net_device *netdev,
 			   struct kernel_ethtool_ts_info *info)
 {
-	info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_HARDWARE |
+	info->so_timestamping = SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE;
-	info->phc_index = -1;
 	info->tx_types = BIT(HWTSTAMP_TX_OFF);
 	info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) | BIT(HWTSTAMP_FILTER_ALL);
 	return 0;
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c +0 -4
index 5fff8ed388f8..5505caea88e9 100644
@@ -389,16 +389,12 @@ int hclge_ptp_get_ts_info(struct hnae3_handle *handle,
 	}
 
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE |
 				SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE;
 
 	if (hdev->ptp->clock)
 		info->phc_index = ptp_clock_index(hdev->ptp->clock);
-	else
-		info->phc_index = -1;
 
 	info->tx_types = BIT(HWTSTAMP_TX_OFF) | BIT(HWTSTAMP_TX_ON);
 
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +0 -4
index 1d0d2e526adb..2e57de16368b 100644
@@ -2555,16 +2555,12 @@ static int i40e_get_ts_info(struct net_device *dev,
 		return ethtool_op_get_ts_info(dev, info);
 
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE |
 				SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE;
 
 	if (pf->ptp_clock)
 		info->phc_index = ptp_clock_index(pf->ptp_clock);
-	else
-		info->phc_index = -1;
 
 	info->tx_types = BIT(HWTSTAMP_TX_OFF) | BIT(HWTSTAMP_TX_ON);
 
drivers/net/ethernet/intel/ice/ice_ethtool.c +0 -2
index bc79ba974e49..8a32c225e22c 100644
@@ -3792,8 +3792,6 @@ ice_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info)
 		return ethtool_op_get_ts_info(dev, info);
 
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE |
 				SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/intel/igb/igb_ethtool.c +1 -7
index 06b9970dffad..ca6ccbc13954 100644
@@ -2387,15 +2387,11 @@ static int igb_get_ts_info(struct net_device *dev,
 
 	if (adapter->ptp_clock)
 		info->phc_index = ptp_clock_index(adapter->ptp_clock);
-	else
-		info->phc_index = -1;
 
 	switch (adapter->hw.mac.type) {
 	case e1000_82575:
 		info->so_timestamping =
-			SOF_TIMESTAMPING_TX_SOFTWARE |
-			SOF_TIMESTAMPING_RX_SOFTWARE |
-			SOF_TIMESTAMPING_SOFTWARE;
+			SOF_TIMESTAMPING_TX_SOFTWARE;
 		return 0;
 	case e1000_82576:
 	case e1000_82580:
@@ -2405,8 +2401,6 @@ static int igb_get_ts_info(struct net_device *dev,
 	case e1000_i211:
 		info->so_timestamping =
 			SOF_TIMESTAMPING_TX_SOFTWARE |
-			SOF_TIMESTAMPING_RX_SOFTWARE |
-			SOF_TIMESTAMPING_SOFTWARE |
 			SOF_TIMESTAMPING_TX_HARDWARE |
 			SOF_TIMESTAMPING_RX_HARDWARE |
 			SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/intel/igc/igc_ethtool.c +0 -4
index 3d3ef4e1547c..fde6f2b3466d 100644
@@ -1565,15 +1565,11 @@ static int igc_ethtool_get_ts_info(struct net_device *dev,
 
 	if (adapter->ptp_clock)
 		info->phc_index = ptp_clock_index(adapter->ptp_clock);
-	else
-		info->phc_index = -1;
 
 	switch (adapter->hw.mac.type) {
 	case igc_i225:
 		info->so_timestamping =
 			SOF_TIMESTAMPING_TX_SOFTWARE |
-			SOF_TIMESTAMPING_RX_SOFTWARE |
-			SOF_TIMESTAMPING_SOFTWARE |
 			SOF_TIMESTAMPING_TX_HARDWARE |
 			SOF_TIMESTAMPING_RX_HARDWARE |
 			SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +0 -4
index 4cac76254966..9482e0cca8b7 100644
@@ -3196,16 +3196,12 @@ static int ixgbe_get_ts_info(struct net_device *dev,
 
 	info->so_timestamping =
 		SOF_TIMESTAMPING_TX_SOFTWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
 
 	if (adapter->ptp_clock)
 		info->phc_index = ptp_clock_index(adapter->ptp_clock);
-	else
-		info->phc_index = -1;
 
 	info->tx_types =
 		BIT(HWTSTAMP_TX_OFF) |
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +0 -2
index 0d62a33afa80..1f01c6febc6b 100644
@@ -5268,8 +5268,6 @@ static int mvpp2_ethtool_get_ts_info(struct net_device *dev,
 
 	info->phc_index = mvpp22_tai_ptp_clock_index(port->priv->tai);
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE |
 				SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +0 -2
index 0db62eb0dab3..32468c663605 100644
@@ -962,8 +962,6 @@ static int otx2_get_ts_info(struct net_device *netdev,
 		return ethtool_op_get_ts_info(netdev, info);
 
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE |
 				SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +6 -0
index f064789f3240..b749879b3daa 100644
@@ -2784,7 +2784,9 @@ static const struct mlxsw_sp_ptp_ops mlxsw_sp1_ptp_ops = {
 	.hwtstamp_get	= mlxsw_sp1_ptp_hwtstamp_get,
 	.hwtstamp_set	= mlxsw_sp1_ptp_hwtstamp_set,
 	.shaper_work	= mlxsw_sp1_ptp_shaper_work,
+#if IS_REACHABLE(CONFIG_PTP_1588_CLOCK)
 	.get_ts_info	= mlxsw_sp1_ptp_get_ts_info,
+#endif
 	.get_stats_count = mlxsw_sp1_get_stats_count,
 	.get_stats_strings = mlxsw_sp1_get_stats_strings,
 	.get_stats	= mlxsw_sp1_get_stats,
@@ -2801,7 +2803,9 @@ static const struct mlxsw_sp_ptp_ops mlxsw_sp2_ptp_ops = {
 	.hwtstamp_get	= mlxsw_sp2_ptp_hwtstamp_get,
 	.hwtstamp_set	= mlxsw_sp2_ptp_hwtstamp_set,
 	.shaper_work	= mlxsw_sp2_ptp_shaper_work,
+#if IS_REACHABLE(CONFIG_PTP_1588_CLOCK)
 	.get_ts_info	= mlxsw_sp2_ptp_get_ts_info,
+#endif
 	.get_stats_count = mlxsw_sp2_get_stats_count,
 	.get_stats_strings = mlxsw_sp2_get_stats_strings,
 	.get_stats	= mlxsw_sp2_get_stats,
@@ -2818,7 +2822,9 @@ static const struct mlxsw_sp_ptp_ops mlxsw_sp4_ptp_ops = {
 	.hwtstamp_get	= mlxsw_sp2_ptp_hwtstamp_get,
 	.hwtstamp_set	= mlxsw_sp2_ptp_hwtstamp_set,
 	.shaper_work	= mlxsw_sp2_ptp_shaper_work,
+#if IS_REACHABLE(CONFIG_PTP_1588_CLOCK)
 	.get_ts_info	= mlxsw_sp2_ptp_get_ts_info,
+#endif
 	.get_stats_count = mlxsw_sp2_get_stats_count,
 	.get_stats_strings = mlxsw_sp2_get_stats_strings,
 	.get_stats	= mlxsw_sp2_get_stats,
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h +0 -20
index 769095d4932d..c8aa1452fbb9 100644
@@ -11,14 +11,6 @@ struct mlxsw_sp;
 struct mlxsw_sp_port;
 struct mlxsw_sp_ptp_clock;
 
-static inline int mlxsw_sp_ptp_get_ts_info_noptp(struct kernel_ethtool_ts_info *info)
-{
-	info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE;
-	info->phc_index = -1;
-	return 0;
-}
-
 #if IS_REACHABLE(CONFIG_PTP_1588_CLOCK)
 
 struct mlxsw_sp_ptp_clock *
@@ -151,12 +143,6 @@ static inline void mlxsw_sp1_ptp_shaper_work(struct work_struct *work)
 {
 }
 
-static inline int mlxsw_sp1_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp,
-					    struct kernel_ethtool_ts_info *info)
-{
-	return mlxsw_sp_ptp_get_ts_info_noptp(info);
-}
-
 static inline int mlxsw_sp1_get_stats_count(void)
 {
 	return 0;
@@ -226,12 +212,6 @@ mlxsw_sp2_ptp_hwtstamp_set(struct mlxsw_sp_port *mlxsw_sp_port,
 	return -EOPNOTSUPP;
 }
 
-static inline int mlxsw_sp2_ptp_get_ts_info(struct mlxsw_sp *mlxsw_sp,
-					    struct kernel_ethtool_ts_info *info)
-{
-	return mlxsw_sp_ptp_get_ts_info_noptp(info);
-}
-
 static inline int
 mlxsw_sp2_ptp_txhdr_construct(struct mlxsw_core *mlxsw_core,
 			      struct mlxsw_sp_port *mlxsw_sp_port,
drivers/net/ethernet/microchip/lan743x_ethtool.c +0 -4
index 3a63ec091413..0f1c0edec460 100644
@@ -1034,16 +1034,12 @@ static int lan743x_ethtool_get_ts_info(struct net_device *netdev,
 	struct lan743x_adapter *adapter = netdev_priv(netdev);
 
 	ts_info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				   SOF_TIMESTAMPING_RX_SOFTWARE |
-				   SOF_TIMESTAMPING_SOFTWARE |
 				   SOF_TIMESTAMPING_TX_HARDWARE |
 				   SOF_TIMESTAMPING_RX_HARDWARE |
 				   SOF_TIMESTAMPING_RAW_HARDWARE;
 
 	if (adapter->ptp.ptp_clock)
 		ts_info->phc_index = ptp_clock_index(adapter->ptp.ptp_clock);
-	else
-		ts_info->phc_index = -1;
 
 	ts_info->tx_types = BIT(HWTSTAMP_TX_OFF) |
 			    BIT(HWTSTAMP_TX_ON) |
drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c +4 -7
index aec7066d83b3..2474dfd330f4 100644
@@ -549,16 +549,13 @@ static int lan966x_get_ts_info(struct net_device *dev,
 
 	phc = &lan966x->phc[LAN966X_PHC_PORT];
 
-	info->phc_index = phc->clock ? ptp_clock_index(phc->clock) : -1;
-	if (info->phc_index == -1) {
-		info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE |
-					 SOF_TIMESTAMPING_RX_SOFTWARE |
-					 SOF_TIMESTAMPING_SOFTWARE;
+	if (phc->clock) {
+		info->phc_index = ptp_clock_index(phc->clock);
+	} else {
+		info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE;
 		return 0;
 	}
 	info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE |
-				 SOF_TIMESTAMPING_RX_SOFTWARE |
-				 SOF_TIMESTAMPING_SOFTWARE |
 				 SOF_TIMESTAMPING_TX_HARDWARE |
 				 SOF_TIMESTAMPING_RX_HARDWARE |
 				 SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.c +4 -7
index 4f800c1a435d..d898a7238b48 100644
@@ -1194,16 +1194,13 @@ static int sparx5_get_ts_info(struct net_device *dev,
 
 	phc = &sparx5->phc[SPARX5_PHC_PORT];
 
-	info->phc_index = phc->clock ? ptp_clock_index(phc->clock) : -1;
-	if (info->phc_index == -1) {
-		info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE |
-					 SOF_TIMESTAMPING_RX_SOFTWARE |
-					 SOF_TIMESTAMPING_SOFTWARE;
+	if (phc->clock) {
+		info->phc_index = ptp_clock_index(phc->clock);
+	} else {
+		info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE;
 		return 0;
 	}
 	info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE |
-				 SOF_TIMESTAMPING_RX_SOFTWARE |
-				 SOF_TIMESTAMPING_SOFTWARE |
 				 SOF_TIMESTAMPING_TX_HARDWARE |
 				 SOF_TIMESTAMPING_RX_HARDWARE |
 				 SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/mscc/ocelot_ptp.c +4 -8
index b3c28260adf8..e172638b0601 100644
@@ -582,17 +582,13 @@ EXPORT_SYMBOL(ocelot_hwstamp_set);
 int ocelot_get_ts_info(struct ocelot *ocelot, int port,
 		       struct kernel_ethtool_ts_info *info)
 {
-	info->phc_index = ocelot->ptp_clock ?
-			  ptp_clock_index(ocelot->ptp_clock) : -1;
-	if (info->phc_index == -1) {
-		info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE |
-					 SOF_TIMESTAMPING_RX_SOFTWARE |
-					 SOF_TIMESTAMPING_SOFTWARE;
+	if (ocelot->ptp_clock) {
+		info->phc_index = ptp_clock_index(ocelot->ptp_clock);
+	} else {
+		info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE;
 		return 0;
 	}
 	info->so_timestamping |= SOF_TIMESTAMPING_TX_SOFTWARE |
-				 SOF_TIMESTAMPING_RX_SOFTWARE |
-				 SOF_TIMESTAMPING_SOFTWARE |
 				 SOF_TIMESTAMPING_TX_HARDWARE |
 				 SOF_TIMESTAMPING_RX_HARDWARE |
 				 SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +0 -2
index 4619fd74f3e3..dda22fa4448c 100644
@@ -989,8 +989,6 @@ static int ionic_get_ts_info(struct net_device *netdev,
 	info->phc_index = ptp_clock_index(lif->phc->ptp);
 
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE |
 				SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/qlogic/qede/qede_ptp.c +1 -8
index 63e3dac4d5f7..9d6399a5c780 100644
@@ -326,25 +326,18 @@ int qede_ptp_get_ts_info(struct qede_dev *edev, struct kernel_ethtool_ts_info *i
 	struct qede_ptp *ptp = edev->ptp;
 
 	if (!ptp) {
-		info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-					SOF_TIMESTAMPING_RX_SOFTWARE |
-					SOF_TIMESTAMPING_SOFTWARE;
-		info->phc_index = -1;
+		info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE;
 
 		return 0;
 	}
 
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE |
 				SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE;
 
 	if (ptp->clock)
 		info->phc_index = ptp_clock_index(ptp->clock);
-	else
-		info->phc_index = -1;
 
 	info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) |
 			   BIT(HWTSTAMP_FILTER_PTP_V1_L4_EVENT) |
drivers/net/ethernet/renesas/ravb_main.c +2 -2
index c02fb296bf7d..c7ec23688d56 100644
@@ -1744,8 +1744,6 @@ static int ravb_get_ts_info(struct net_device *ndev,
 
 	info->so_timestamping =
 		SOF_TIMESTAMPING_TX_SOFTWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
@@ -1756,6 +1754,8 @@ static int ravb_get_ts_info(struct net_device *ndev,
 		(1 << HWTSTAMP_FILTER_ALL);
 	if (hw_info->gptp || hw_info->ccc_gac)
 		info->phc_index = ptp_clock_index(priv->ptp.clock);
+	else
+		info->phc_index = 0;
 
 	return 0;
 }
drivers/net/ethernet/renesas/rswitch.c +0 -2
index ff50e20856ec..b80aa27a7214 100644
@@ -1815,8 +1815,6 @@ static int rswitch_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts
 
 	info->phc_index = ptp_clock_index(rdev->priv->ptp_priv->clock);
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-				SOF_TIMESTAMPING_RX_SOFTWARE |
-				SOF_TIMESTAMPING_SOFTWARE |
 				SOF_TIMESTAMPING_TX_HARDWARE |
 				SOF_TIMESTAMPING_RX_HARDWARE |
 				SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/renesas/rtsn.c +0 -2
index 0e6cea42f007..f9f63c61d792 100644
@@ -1219,8 +1219,6 @@ static int rtsn_get_ts_info(struct net_device *ndev,
 
 	info->phc_index = ptp_clock_index(priv->ptp_priv->clock);
 	info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
drivers/net/ethernet/sfc/ethtool.c +0 -5
index 7c887160e2ef..314b41d738f2 100644
@@ -230,11 +230,6 @@ static int efx_ethtool_get_ts_info(struct net_device *net_dev,
 {
 	struct efx_nic *efx = efx_netdev_priv(net_dev);
 
-	/* Software capabilities */
-	ts_info->so_timestamping = (SOF_TIMESTAMPING_RX_SOFTWARE |
-				    SOF_TIMESTAMPING_SOFTWARE);
-	ts_info->phc_index = -1;
-
 	efx_ptp_get_ts_info(efx, ts_info);
 	return 0;
 }
drivers/net/ethernet/sfc/siena/ethtool.c +0 -5
index 4c182d4edfc2..f4f4df687708 100644
@@ -230,11 +230,6 @@ static int efx_ethtool_get_ts_info(struct net_device *net_dev,
 {
 	struct efx_nic *efx = netdev_priv(net_dev);
 
-	/* Software capabilities */
-	ts_info->so_timestamping = (SOF_TIMESTAMPING_RX_SOFTWARE |
-				    SOF_TIMESTAMPING_SOFTWARE);
-	ts_info->phc_index = -1;
-
 	efx_siena_ptp_get_ts_info(efx, ts_info);
 	return 0;
 }
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +2 -2
index 7008219fd88d..a7b8407e898c 100644
@@ -1207,13 +1207,13 @@ static int stmmac_get_ts_info(struct net_device *dev,
 
 		info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
 					SOF_TIMESTAMPING_TX_HARDWARE |
-					SOF_TIMESTAMPING_RX_SOFTWARE |
 					SOF_TIMESTAMPING_RX_HARDWARE |
-					SOF_TIMESTAMPING_SOFTWARE |
 					SOF_TIMESTAMPING_RAW_HARDWARE;
 
 		if (priv->ptp_clock)
 			info->phc_index = ptp_clock_index(priv->ptp_clock);
+		else
+			info->phc_index = 0;
 
 		info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
 
drivers/net/ethernet/ti/am65-cpsw-ethtool.c +0 -2
index b60976947da5..539d5ca82f52 100644
@@ -714,8 +714,6 @@ static int am65_cpsw_get_ethtool_ts_info(struct net_device *ndev,
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_TX_SOFTWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
 	info->phc_index = am65_cpts_phc_index(common->cpts);
 	info->tx_types = BIT(HWTSTAMP_TX_OFF) | BIT(HWTSTAMP_TX_ON);
drivers/net/ethernet/ti/cpsw_ethtool.c +1 -6
index 53ed23d68722..21d55a180ef6 100644
@@ -725,8 +725,6 @@ int cpsw_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *inf
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_TX_SOFTWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
 	info->phc_index = cpsw->cpts->phc_index;
 	info->tx_types =
@@ -741,10 +739,7 @@ int cpsw_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *inf
 int cpsw_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *info)
 {
 	info->so_timestamping =
-		SOF_TIMESTAMPING_TX_SOFTWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE;
-	info->phc_index = -1;
+		SOF_TIMESTAMPING_TX_SOFTWARE;
 	info->tx_types = 0;
 	info->rx_filters = 0;
 	return 0;
drivers/net/ethernet/ti/icssg/icssg_ethtool.c +0 -2
index 5688f054cec5..a2df9e527928 100644
@@ -118,8 +118,6 @@ static int emac_get_ts_info(struct net_device *ndev,
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_TX_SOFTWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
 
 	info->phc_index = icss_iep_get_ptp_clock_idx(emac->iep);
drivers/net/ethernet/ti/netcp_ethss.c +1 -6
index d286709ca3b9..63e686f0b119 100644
@@ -2012,8 +2012,6 @@ static int keystone_get_ts_info(struct net_device *ndev,
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_TX_SOFTWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
 	info->phc_index = gbe_intf->gbe_dev->cpts->phc_index;
 	info->tx_types =
@@ -2030,10 +2028,7 @@ static int keystone_get_ts_info(struct net_device *ndev,
 				struct kernel_ethtool_ts_info *info)
 {
 	info->so_timestamping =
-		SOF_TIMESTAMPING_TX_SOFTWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE;
-	info->phc_index = -1;
+		SOF_TIMESTAMPING_TX_SOFTWARE;
 	info->tx_types = 0;
 	info->rx_filters = 0;
 	return 0;
drivers/net/ethernet/xscale/ixp4xx_eth.c +1 -3
index 56df37f8d50a..aef316278eb4 100644
@@ -1026,9 +1026,7 @@ static int ixp4xx_get_ts_info(struct net_device *dev,
 
 	if (info->phc_index < 0) {
 		info->so_timestamping =
-			SOF_TIMESTAMPING_TX_SOFTWARE |
-			SOF_TIMESTAMPING_RX_SOFTWARE |
-			SOF_TIMESTAMPING_SOFTWARE;
+			SOF_TIMESTAMPING_TX_SOFTWARE;
 		return 0;
 	}
 	info->so_timestamping =
drivers/ptp/ptp_ines.c +0 -4
index e6f7d2bf8dde..14a23d3a27f2 100644
@@ -562,12 +562,8 @@ static int ines_ts_info(struct mii_timestamper *mii_ts,
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_TX_SOFTWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
 
-	info->phc_index = -1;
-
 	info->tx_types =
 		(1 << HWTSTAMP_TX_OFF) |
 		(1 << HWTSTAMP_TX_ON) |
Signature · 1 line
2.40.1
maintainer Reviewed-by on v1 2/2
#5 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

Quoted 47 lines · Gal Pressman

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

---
 drivers/net/bonding/bond_main.c               |  3 ---
 drivers/net/can/dev/dev.c                     |  3 ---
 drivers/net/can/peak_canfd/peak_canfd.c       |  3 ---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c  |  3 ---
 drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c  |  4 ----
 .../ethernet/broadcom/bnx2x/bnx2x_ethtool.c   |  4 ----
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  5 +----
 drivers/net/ethernet/broadcom/tg3.c           |  6 +-----
 drivers/net/ethernet/cadence/macb_main.c      |  5 ++---
 .../ethernet/cavium/liquidio/lio_ethtool.c    | 16 +++++++--------
 .../ethernet/cavium/thunder/nicvf_ethtool.c   |  2 --
 .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c    | 11 +++-------
 .../net/ethernet/cisco/enic/enic_ethtool.c    |  4 +---
 drivers/net/ethernet/engleder/tsnep_ethtool.c |  4 ----
 .../ethernet/freescale/enetc/enetc_ethtool.c  | 10 ++--------
 drivers/net/ethernet/freescale/fec_main.c     |  4 ----
 .../net/ethernet/freescale/gianfar_ethtool.c  | 10 ++--------
 .../ethernet/fungible/funeth/funeth_ethtool.c |  5 +----
 .../hisilicon/hns3/hns3pf/hclge_ptp.c         |  4 ----
 .../net/ethernet/intel/i40e/i40e_ethtool.c    |  4 ----
 drivers/net/ethernet/intel/ice/ice_ethtool.c  |  2 --
 drivers/net/ethernet/intel/igb/igb_ethtool.c  |  8 +-------
 drivers/net/ethernet/intel/igc/igc_ethtool.c  |  4 ----
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  |  4 ----
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  2 --
 .../marvell/octeontx2/nic/otx2_ethtool.c      |  2 --
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |  6 ++++++
 .../ethernet/mellanox/mlxsw/spectrum_ptp.h    | 20 -------------------
 .../net/ethernet/microchip/lan743x_ethtool.c  |  4 ----
 .../microchip/lan966x/lan966x_ethtool.c       | 11 ++++------
 .../microchip/sparx5/sparx5_ethtool.c         | 11 ++++------
 drivers/net/ethernet/mscc/ocelot_ptp.c        | 12 ++++-------
 .../ethernet/pensando/ionic/ionic_ethtool.c   |  2 --
 drivers/net/ethernet/qlogic/qede/qede_ptp.c   |  9 +--------
 drivers/net/ethernet/renesas/ravb_main.c      |  4 ++--
 drivers/net/ethernet/renesas/rswitch.c        |  2 --
 drivers/net/ethernet/renesas/rtsn.c           |  2 --
 drivers/net/ethernet/sfc/ethtool.c            |  5 -----
 drivers/net/ethernet/sfc/siena/ethtool.c      |  5 -----
Quoted 8 lines
 .../ethernet/stmicro/stmmac/stmmac_ethtool.c  |  4 ++--
 drivers/net/ethernet/ti/am65-cpsw-ethtool.c   |  2 --
 drivers/net/ethernet/ti/cpsw_ethtool.c        |  7 +------
 drivers/net/ethernet/ti/icssg/icssg_ethtool.c |  2 --
 drivers/net/ethernet/ti/netcp_ethss.c         |  7 +------
 drivers/net/ethernet/xscale/ixp4xx_eth.c      |  4 +---
 drivers/ptp/ptp_ines.c                        |  4 ----
 46 files changed, 47 insertions(+), 208 deletions(-)

regards,
Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |
Reviewed-by on v1 2/2
#6 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 47 lines · Gal Pressman

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

---
  drivers/net/bonding/bond_main.c               |  3 ---
  drivers/net/can/dev/dev.c                     |  3 ---
  drivers/net/can/peak_canfd/peak_canfd.c       |  3 ---
  drivers/net/can/usb/peak_usb/pcan_usb_core.c  |  3 ---
  drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c  |  4 ----
  .../ethernet/broadcom/bnx2x/bnx2x_ethtool.c   |  4 ----
  .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  5 +----
  drivers/net/ethernet/broadcom/tg3.c           |  6 +-----
  drivers/net/ethernet/cadence/macb_main.c      |  5 ++---
  .../ethernet/cavium/liquidio/lio_ethtool.c    | 16 +++++++--------
  .../ethernet/cavium/thunder/nicvf_ethtool.c   |  2 --
  .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c    | 11 +++-------
  .../net/ethernet/cisco/enic/enic_ethtool.c    |  4 +---
  drivers/net/ethernet/engleder/tsnep_ethtool.c |  4 ----
  .../ethernet/freescale/enetc/enetc_ethtool.c  | 10 ++--------
  drivers/net/ethernet/freescale/fec_main.c     |  4 ----
  .../net/ethernet/freescale/gianfar_ethtool.c  | 10 ++--------
  .../ethernet/fungible/funeth/funeth_ethtool.c |  5 +----
  .../hisilicon/hns3/hns3pf/hclge_ptp.c         |  4 ----
  .../net/ethernet/intel/i40e/i40e_ethtool.c    |  4 ----
  drivers/net/ethernet/intel/ice/ice_ethtool.c  |  2 --
  drivers/net/ethernet/intel/igb/igb_ethtool.c  |  8 +-------
  drivers/net/ethernet/intel/igc/igc_ethtool.c  |  4 ----
  .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  |  4 ----
  .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  2 --
  .../marvell/octeontx2/nic/otx2_ethtool.c      |  2 --
  .../net/ethernet/mellanox/mlxsw/spectrum.c    |  6 ++++++
  .../ethernet/mellanox/mlxsw/spectrum_ptp.h    | 20 -------------------
  .../net/ethernet/microchip/lan743x_ethtool.c  |  4 ----
  .../microchip/lan966x/lan966x_ethtool.c       | 11 ++++------
  .../microchip/sparx5/sparx5_ethtool.c         | 11 ++++------
  drivers/net/ethernet/mscc/ocelot_ptp.c        | 12 ++++-------
  .../ethernet/pensando/ionic/ionic_ethtool.c   |  2 --
  drivers/net/ethernet/qlogic/qede/qede_ptp.c   |  9 +--------
  drivers/net/ethernet/renesas/ravb_main.c      |  4 ++--
  drivers/net/ethernet/renesas/rswitch.c        |  2 --
  drivers/net/ethernet/renesas/rtsn.c           |  2 --
  drivers/net/ethernet/sfc/ethtool.c            |  5 -----
  drivers/net/ethernet/sfc/siena/ethtool.c      |  5 -----
Quoted 8 lines
  .../ethernet/stmicro/stmmac/stmmac_ethtool.c  |  4 ++--
  drivers/net/ethernet/ti/am65-cpsw-ethtool.c   |  2 --
  drivers/net/ethernet/ti/cpsw_ethtool.c        |  7 +------
  drivers/net/ethernet/ti/icssg/icssg_ethtool.c |  2 --
  drivers/net/ethernet/ti/netcp_ethss.c         |  7 +------
  drivers/net/ethernet/xscale/ixp4xx_eth.c      |  4 +---
  drivers/ptp/ptp_ines.c                        |  4 ----
  46 files changed, 47 insertions(+), 208 deletions(-)

Thanks,
Gerhard

Reviewed-by on v1 2/2
#7 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 9 lines · Gal Pressman

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

---

for drivers/net/ethernet/pensando/ionic

maintainer Reviewed-by on v1 2/2
#8 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman

Hi Gal,

Thanks for your work.

Quoted 15 lines · Gal Pressman
drivers/net/ethernet/renesas/ravb_main.c +0 -2
index c02fb296bf7d..c7ec23688d56 100644
@@ -1744,8 +1744,6 @@ static int ravb_get_ts_info(struct net_device *ndev,
 
 	info->so_timestamping =
 		SOF_TIMESTAMPING_TX_SOFTWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;

drivers/net/ethernet/renesas/ravb_main.c static int ravb_get_ts_info(struct net_device *ndev, · line 1758

Quoted 5 lines
drivers/net/ethernet/renesas/ravb_main.c +2 -0
@@ -1756,6 +1754,8 @@ static int ravb_get_ts_info(struct net_device *ndev,
 		(1 << HWTSTAMP_FILTER_ALL);
 	if (hw_info->gptp || hw_info->ccc_gac)
 		info->phc_index = ptp_clock_index(priv->ptp.clock);
+	else
+		info->phc_index = 0;

I understand this work keeps things the same as they where before and that this change do not alter the existing behavior. But should not phc_index be left untouched here (kept at -1) as there are no ptp clock?

I think this might have been introduced in commit 7e09a052dc4e ("ravb:
Exclude gPTP feature support for RZ/G2L") when the driver excluded ptp support for some devices. I suspect the so_timestamping mask should also depend on this check and only advertise hardware clocks if it indeed exists?

If my assumption is correct I can fix this on top. For this change the existing behavior is kept, so for drivers/net/ethernet/renesas,

Quoted 3 lines
drivers/net/ethernet/renesas/ravb_main.c +0 -0
 	return 0;
 }
Signature · 2 lines
Kind Regards,
Niklas Söderlund
#9 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

Quoted 22 lines · Niklas Söderlund

Hi Gal,

Thanks for your work.

Quoted 16 lines · Gal Pressman
drivers/net/ethernet/renesas/ravb_main.c +0 -2
index c02fb296bf7d..c7ec23688d56 100644
@@ -1744,8 +1744,6 @@ static int ravb_get_ts_info(struct net_device *ndev,
 
 	info->so_timestamping =
 		SOF_TIMESTAMPING_TX_SOFTWARE |
-		SOF_TIMESTAMPING_RX_SOFTWARE |
-		SOF_TIMESTAMPING_SOFTWARE |
 		SOF_TIMESTAMPING_TX_HARDWARE |
 		SOF_TIMESTAMPING_RX_HARDWARE |
 		SOF_TIMESTAMPING_RAW_HARDWARE;
@@ -1756,6 +1754,8 @@ static int ravb_get_ts_info(struct net_device *ndev,
 		(1 << HWTSTAMP_FILTER_ALL);
Quoted 8 lines

drivers/net/ethernet/renesas/ravb_main.c static int ravb_get_ts_info(struct net_device *ndev, · line 1758

Quoted 4 lines
drivers/net/ethernet/renesas/ravb_main.c +2 -0
 	if (hw_info->gptp || hw_info->ccc_gac)
 		info->phc_index = ptp_clock_index(priv->ptp.clock);
+	else
+		info->phc_index = 0;

I understand this work keeps things the same as they where before and that this change do not alter the existing behavior. But should not phc_index be left untouched here (kept at -1) as there are no ptp clock?

Yes, setting the phc_index to zero felt bad and is likely a bug, but this patch is probably not the place to fix it.

Quoted 9 lines

I think this might have been introduced in commit 7e09a052dc4e ("ravb:
Exclude gPTP feature support for RZ/G2L") when the driver excluded ptp support for some devices. I suspect the so_timestamping mask should also depend on this check and only advertise hardware clocks if it indeed exists?

If my assumption is correct I can fix this on top. For this change the existing behavior is kept, so for drivers/net/ethernet/renesas,

Sounds good to me.

Quoted 2 lines

Thank you Niklas!

maintainer Reviewed-by on v1 2/2
#10 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 19 lines · Gal Pressman

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

---
  drivers/net/bonding/bond_main.c               |  3 ---
  drivers/net/can/dev/dev.c                     |  3 ---
  drivers/net/can/peak_canfd/peak_canfd.c       |  3 ---
  drivers/net/can/usb/peak_usb/pcan_usb_core.c  |  3 ---
  drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c  |  4 ----
  .../ethernet/broadcom/bnx2x/bnx2x_ethtool.c   |  4 ----
  .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  5 +----
  drivers/net/ethernet/broadcom/tg3.c           |  6 +-----
  drivers/net/ethernet/cadence/macb_main.c      |  5 ++---
  .../ethernet/cavium/liquidio/lio_ethtool.c    | 16 +++++++--------
  .../ethernet/cavium/thunder/nicvf_ethtool.c   |  2 --
Quoted 8 lines
  .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c    | 11 +++-------
  .../net/ethernet/cisco/enic/enic_ethtool.c    |  4 +---
  drivers/net/ethernet/engleder/tsnep_ethtool.c |  4 ----
  .../ethernet/freescale/enetc/enetc_ethtool.c  | 10 ++--------
  drivers/net/ethernet/freescale/fec_main.c     |  4 ----
  .../net/ethernet/freescale/gianfar_ethtool.c  | 10 ++--------
  .../ethernet/fungible/funeth/funeth_ethtool.c |  5 +----
  .../hisilicon/hns3/hns3pf/hclge_ptp.c         |  4 ----

for drivers/net/ethernet/hisilicon/hns3/

maintainer Reviewed-by on v1 2/2
#11 lore raw

RE: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 2 lines
 .../ethernet/freescale/enetc/enetc_ethtool.c  | 10 ++--------
 drivers/net/ethernet/freescale/fec_main.c     |  4 ----

Many thanks.
For drivers/net/ethernet/freescale/fec and enetc.

maintainer Reviewed-by on v1 2/2
#12 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 8 lines · Gal Pressman

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

---

for drivers/net/ethernet/marvell/octeontx2/

Reviewed-by on v1 2/2
#13 lore raw

RE: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 38 lines

[Some people who received this message don't often get email from [email protected]. Learn why this is important at
https://aka.ms/LearnAboutSenderIdentification ]

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

---

drivers/net/ethernet/microchip/lan743x_ethtool.c +0 -4
index 3a63ec091413..0f1c0edec460 100644
@@ -1034,16 +1034,12 @@ static int lan743x_ethtool_get_ts_info(struct
 net_device *netdev,
        struct lan743x_adapter *adapter = netdev_priv(netdev);
 
        ts_info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-                                  SOF_TIMESTAMPING_RX_SOFTWARE |
-                                  SOF_TIMESTAMPING_SOFTWARE |
                                   SOF_TIMESTAMPING_TX_HARDWARE |
                                   SOF_TIMESTAMPING_RX_HARDWARE |
                                   SOF_TIMESTAMPING_RAW_HARDWARE;
 
        if (adapter->ptp.ptp_clock)
                ts_info->phc_index = ptp_clock_index(adapter->ptp.ptp_clock);
-       else
-               ts_info->phc_index = -1;
 
        ts_info->tx_types = BIT(HWTSTAMP_TX_OFF) |
Quoted 1 line

BIT(HWTSTAMP_TX_ON) |

for drivers/net/ethernet/microchip/lan743x_ethtool.c

maintainer Reviewed-by on v1 2/2
#14 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman

drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h

Quoted 9 lines · Gal Pressman
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +0 -0
index f064789f3240..b749879b3daa 100644
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.h +0 -0
index 769095d4932d..c8aa1452fbb9 100644
reviewer Reviewed-by on v1 2/2
#15 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 7 lines · Gal Pressman

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

for:

drivers/net/ethernet/ti/am65-cpsw-ethtool.c
drivers/net/ethernet/ti/cpsw_ethtool.c
drivers/net/ethernet/ti/icssg/icssg_ethtool.c

maintainer Reviewed-by on v1 2/2
#16 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 24 lines · Gal Pressman

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

---
  drivers/net/bonding/bond_main.c               |  3 ---
  drivers/net/can/dev/dev.c                     |  3 ---
  drivers/net/can/peak_canfd/peak_canfd.c       |  3 ---
  drivers/net/can/usb/peak_usb/pcan_usb_core.c  |  3 ---
  drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c  |  4 ----
  .../ethernet/broadcom/bnx2x/bnx2x_ethtool.c   |  4 ----
  .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  5 +----
  drivers/net/ethernet/broadcom/tg3.c           |  6 +-----
  drivers/net/ethernet/cadence/macb_main.c      |  5 ++---
  .../ethernet/cavium/liquidio/lio_ethtool.c    | 16 +++++++--------
  .../ethernet/cavium/thunder/nicvf_ethtool.c   |  2 --
  .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c    | 11 +++-------
  .../net/ethernet/cisco/enic/enic_ethtool.c    |  4 +---
  drivers/net/ethernet/engleder/tsnep_ethtool.c |  4 ----
  .../ethernet/freescale/enetc/enetc_ethtool.c  | 10 ++--------
  drivers/net/ethernet/freescale/fec_main.c     |  4 ----
Quoted 8 lines
  .../net/ethernet/freescale/gianfar_ethtool.c  | 10 ++--------
  .../ethernet/fungible/funeth/funeth_ethtool.c |  5 +----
  .../hisilicon/hns3/hns3pf/hclge_ptp.c         |  4 ----
  .../net/ethernet/intel/i40e/i40e_ethtool.c    |  4 ----
  drivers/net/ethernet/intel/ice/ice_ethtool.c  |  2 --
  drivers/net/ethernet/intel/igb/igb_ethtool.c  |  8 +-------
  drivers/net/ethernet/intel/igc/igc_ethtool.c  |  4 ----
  .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  |  4 ----
maintainer
#17 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 3 lines · Gal Pressman
 drivers/net/bonding/bond_main.c               |  3 ---
 drivers/net/can/dev/dev.c                     |  3 ---
 drivers/net/can/peak_canfd/peak_canfd.c       |  3 ---

...

Quoted 4 lines
 drivers/net/ethernet/ti/netcp_ethss.c         |  7 +------
 drivers/net/ethernet/xscale/ixp4xx_eth.c      |  4 +---
 drivers/ptp/ptp_ines.c                        |  4 ----
 46 files changed, 47 insertions(+), 208 deletions(-)

This needs to be broken out into one patch per driver. That way, one can easily track the Acks.

Thanks,
Richard

#18 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

Quoted 8 lines · Richard Cochran
Quoted 3 lines · Gal Pressman
 drivers/net/bonding/bond_main.c               |  3 ---
 drivers/net/can/dev/dev.c                     |  3 ---
 drivers/net/can/peak_canfd/peak_canfd.c       |  3 ---

...

Quoted 7 lines
Quoted 4 lines
 drivers/net/ethernet/ti/netcp_ethss.c         |  7 +------
 drivers/net/ethernet/xscale/ixp4xx_eth.c      |  4 +---
 drivers/ptp/ptp_ines.c                        |  4 ----
 46 files changed, 47 insertions(+), 208 deletions(-)

This needs to be broken out into one patch per driver. That way, one can easily track the Acks.

I would, but it's not allowed to post series with more than 15 patches.

maintainer
#19 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

Quoted 1 line · Gal Pressman

I would, but it's not allowed to post series with more than 15 patches.

If that worries you, then you can post in batches.

Thanks,
Richard

maintainer Reviewed-by on v1 2/2
#20 lore raw

RE: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 7 lines · Gal Pressman

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

Quoted 13 lines
---
 drivers/net/bonding/bond_main.c               |  3 ---
 drivers/net/can/dev/dev.c                     |  3 ---
 drivers/net/can/peak_canfd/peak_canfd.c       |  3 ---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c  |  3 ---
 drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c  |  4 ----
 .../ethernet/broadcom/bnx2x/bnx2x_ethtool.c   |  4 ----
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  5 +----
 drivers/net/ethernet/broadcom/tg3.c           |  6 +-----
 drivers/net/ethernet/cadence/macb_main.c      |  5 ++---
 .../ethernet/cavium/liquidio/lio_ethtool.c    | 16 +++++++--------
 .../ethernet/cavium/thunder/nicvf_ethtool.c   |  2 --
 .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c    | 11 +++-------

for cxgb4 changes

Reviewed-by on v1 2/2
#21 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 47 lines · Gal Pressman

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

---
 drivers/net/bonding/bond_main.c               |  3 ---
 drivers/net/can/dev/dev.c                     |  3 ---
 drivers/net/can/peak_canfd/peak_canfd.c       |  3 ---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c  |  3 ---
 drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c  |  4 ----
 .../ethernet/broadcom/bnx2x/bnx2x_ethtool.c   |  4 ----
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  5 +----
 drivers/net/ethernet/broadcom/tg3.c           |  6 +-----
 drivers/net/ethernet/cadence/macb_main.c      |  5 ++---
 .../ethernet/cavium/liquidio/lio_ethtool.c    | 16 +++++++--------
 .../ethernet/cavium/thunder/nicvf_ethtool.c   |  2 --
 .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c    | 11 +++-------
 .../net/ethernet/cisco/enic/enic_ethtool.c    |  4 +---
 drivers/net/ethernet/engleder/tsnep_ethtool.c |  4 ----
 .../ethernet/freescale/enetc/enetc_ethtool.c  | 10 ++--------
 drivers/net/ethernet/freescale/fec_main.c     |  4 ----
 .../net/ethernet/freescale/gianfar_ethtool.c  | 10 ++--------
 .../ethernet/fungible/funeth/funeth_ethtool.c |  5 +----
 .../hisilicon/hns3/hns3pf/hclge_ptp.c         |  4 ----
 .../net/ethernet/intel/i40e/i40e_ethtool.c    |  4 ----
 drivers/net/ethernet/intel/ice/ice_ethtool.c  |  2 --
 drivers/net/ethernet/intel/igb/igb_ethtool.c  |  8 +-------
 drivers/net/ethernet/intel/igc/igc_ethtool.c  |  4 ----
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  |  4 ----
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  2 --
 .../marvell/octeontx2/nic/otx2_ethtool.c      |  2 --
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |  6 ++++++
 .../ethernet/mellanox/mlxsw/spectrum_ptp.h    | 20 -------------------
 .../net/ethernet/microchip/lan743x_ethtool.c  |  4 ----
 .../microchip/lan966x/lan966x_ethtool.c       | 11 ++++------
 .../microchip/sparx5/sparx5_ethtool.c         | 11 ++++------
 drivers/net/ethernet/mscc/ocelot_ptp.c        | 12 ++++-------
 .../ethernet/pensando/ionic/ionic_ethtool.c   |  2 --
 drivers/net/ethernet/qlogic/qede/qede_ptp.c   |  9 +--------
 drivers/net/ethernet/renesas/ravb_main.c      |  4 ++--
 drivers/net/ethernet/renesas/rswitch.c        |  2 --
 drivers/net/ethernet/renesas/rtsn.c           |  2 --
 drivers/net/ethernet/sfc/ethtool.c            |  5 -----
 drivers/net/ethernet/sfc/siena/ethtool.c      |  5 -----
Quoted 8 lines
 .../ethernet/stmicro/stmmac/stmmac_ethtool.c  |  4 ++--
 drivers/net/ethernet/ti/am65-cpsw-ethtool.c   |  2 --
 drivers/net/ethernet/ti/cpsw_ethtool.c        |  7 +------
 drivers/net/ethernet/ti/icssg/icssg_ethtool.c |  2 --
 drivers/net/ethernet/ti/netcp_ethss.c         |  7 +------
 drivers/net/ethernet/xscale/ixp4xx_eth.c      |  4 +---
 drivers/ptp/ptp_ines.c                        |  4 ----
 46 files changed, 47 insertions(+), 208 deletions(-)

For drivers/net/ethernet/sfc and drivers/net/ethernet/sfc/siena:

Acked-by on v1 2/2
#22 lore raw

Re: [PATCH net-next 2/2] net: Remove setting of RX software timestamp from drivers

In reply to Gal Pressman
Quoted 47 lines · Gal Pressman

The responsibility for reporting of RX software timestamp has moved to the core layer (see __ethtool_get_ts_info()), remove usage from the device drivers.

---
 drivers/net/bonding/bond_main.c               |  3 ---
 drivers/net/can/dev/dev.c                     |  3 ---
 drivers/net/can/peak_canfd/peak_canfd.c       |  3 ---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c  |  3 ---
 drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c  |  4 ----
 .../ethernet/broadcom/bnx2x/bnx2x_ethtool.c   |  4 ----
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  5 +----
 drivers/net/ethernet/broadcom/tg3.c           |  6 +-----
 drivers/net/ethernet/cadence/macb_main.c      |  5 ++---
 .../ethernet/cavium/liquidio/lio_ethtool.c    | 16 +++++++--------
 .../ethernet/cavium/thunder/nicvf_ethtool.c   |  2 --
 .../ethernet/chelsio/cxgb4/cxgb4_ethtool.c    | 11 +++-------
 .../net/ethernet/cisco/enic/enic_ethtool.c    |  4 +---
 drivers/net/ethernet/engleder/tsnep_ethtool.c |  4 ----
 .../ethernet/freescale/enetc/enetc_ethtool.c  | 10 ++--------
 drivers/net/ethernet/freescale/fec_main.c     |  4 ----
 .../net/ethernet/freescale/gianfar_ethtool.c  | 10 ++--------
 .../ethernet/fungible/funeth/funeth_ethtool.c |  5 +----
 .../hisilicon/hns3/hns3pf/hclge_ptp.c         |  4 ----
 .../net/ethernet/intel/i40e/i40e_ethtool.c    |  4 ----
 drivers/net/ethernet/intel/ice/ice_ethtool.c  |  2 --
 drivers/net/ethernet/intel/igb/igb_ethtool.c  |  8 +-------
 drivers/net/ethernet/intel/igc/igc_ethtool.c  |  4 ----
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  |  4 ----
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  2 --
 .../marvell/octeontx2/nic/otx2_ethtool.c      |  2 --
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |  6 ++++++
 .../ethernet/mellanox/mlxsw/spectrum_ptp.h    | 20 -------------------
 .../net/ethernet/microchip/lan743x_ethtool.c  |  4 ----
 .../microchip/lan966x/lan966x_ethtool.c       | 11 ++++------
 .../microchip/sparx5/sparx5_ethtool.c         | 11 ++++------
 drivers/net/ethernet/mscc/ocelot_ptp.c        | 12 ++++-------
 .../ethernet/pensando/ionic/ionic_ethtool.c   |  2 --
 drivers/net/ethernet/qlogic/qede/qede_ptp.c   |  9 +--------
 drivers/net/ethernet/renesas/ravb_main.c      |  4 ++--
 drivers/net/ethernet/renesas/rswitch.c        |  2 --
 drivers/net/ethernet/renesas/rtsn.c           |  2 --
 drivers/net/ethernet/sfc/ethtool.c            |  5 -----
 drivers/net/ethernet/sfc/siena/ethtool.c      |  5 -----
Quoted 9 lines
 .../ethernet/stmicro/stmmac/stmmac_ethtool.c  |  4 ++--
 drivers/net/ethernet/ti/am65-cpsw-ethtool.c   |  2 --
 drivers/net/ethernet/ti/cpsw_ethtool.c        |  7 +------
 drivers/net/ethernet/ti/icssg/icssg_ethtool.c |  2 --
 drivers/net/ethernet/ti/netcp_ethss.c         |  7 +------
 drivers/net/ethernet/xscale/ixp4xx_eth.c      |  4 +---
 drivers/ptp/ptp_ines.c                        |  4 ----
 46 files changed, 47 insertions(+), 208 deletions(-)

drivers/net/ethernet/amd/xgbe/

Thanks,
Shyam