Skip to content

Commit 289354f

Browse files
committed
net: partial revert of the "Make timestamping selectable: series
Revert following commits: commit acec05f ("net_tstamp: Add TIMESTAMPING SOFTWARE and HARDWARE mask") commit 11d55be ("net: ethtool: Add a command to expose current time stamping layer") commit bb8645b ("netlink: specs: Introduce new netlink command to get current timestamp") commit d905f9c ("net: ethtool: Add a command to list available time stamping layers") commit aed5004 ("netlink: specs: Introduce new netlink command to list available time stamping layers") commit 51bdf31 ("net: Replace hwtstamp_source by timestamping layer") commit 0f7f463 ("net: Change the API of PHY default timestamp to MAC") commit 091fab1 ("net: ethtool: ts: Update GET_TS to reply the current selected timestamp") commit 152c75e ("net: ethtool: ts: Let the active time stamping layer be selectable") commit ee60ea6 ("netlink: specs: Introduce time stamping set command") They need more time for reviews. Link: https://lore.kernel.org/all/20231118183529.6e67100c@kernel.org/ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 055dd75 commit 289354f

File tree

23 files changed

+28
-566
lines changed

23 files changed

+28
-566
lines changed

Documentation/netlink/specs/ethtool.yaml

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -939,26 +939,6 @@ attribute-sets:
939939
-
940940
name: burst-tmr
941941
type: u32
942-
-
943-
name: ts
944-
attributes:
945-
-
946-
name: header
947-
type: nest
948-
nested-attributes: header
949-
-
950-
name: ts-layer
951-
type: u32
952-
-
953-
name: ts-list
954-
attributes:
955-
-
956-
name: header
957-
type: nest
958-
nested-attributes: header
959-
-
960-
name: ts-list-layer
961-
type: binary
962942

963943
operations:
964944
enum-model: directional
@@ -1709,40 +1689,3 @@ operations:
17091689
name: mm-ntf
17101690
doc: Notification for change in MAC Merge configuration.
17111691
notify: mm-get
1712-
-
1713-
name: ts-get
1714-
doc: Get current timestamp
1715-
1716-
attribute-set: ts
1717-
1718-
do:
1719-
request:
1720-
attributes:
1721-
- header
1722-
reply:
1723-
attributes: &ts
1724-
- header
1725-
- ts-layer
1726-
-
1727-
name: ts-list-get
1728-
doc: Get list of timestamp devices available on an interface
1729-
1730-
attribute-set: ts-list
1731-
1732-
do:
1733-
request:
1734-
attributes:
1735-
- header
1736-
reply:
1737-
attributes:
1738-
- header
1739-
- ts-list-layer
1740-
-
1741-
name: ts-set
1742-
doc: Set the timestamp device
1743-
1744-
attribute-set: ts
1745-
1746-
do:
1747-
request:
1748-
attributes: *ts

Documentation/networking/ethtool-netlink.rst

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,6 @@ Userspace to kernel:
225225
``ETHTOOL_MSG_RSS_GET`` get RSS settings
226226
``ETHTOOL_MSG_MM_GET`` get MAC merge layer state
227227
``ETHTOOL_MSG_MM_SET`` set MAC merge layer parameters
228-
``ETHTOOL_MSG_TS_GET`` get current timestamping
229-
``ETHTOOL_MSG_TS_LIST_GET`` list available timestampings
230-
``ETHTOOL_MSG_TS_SET`` set current timestamping
231228
===================================== =================================
232229

233230
Kernel to userspace:
@@ -271,8 +268,6 @@ Kernel to userspace:
271268
``ETHTOOL_MSG_PSE_GET_REPLY`` PSE parameters
272269
``ETHTOOL_MSG_RSS_GET_REPLY`` RSS settings
273270
``ETHTOOL_MSG_MM_GET_REPLY`` MAC merge layer status
274-
``ETHTOOL_MSG_TS_GET_REPLY`` current timestamping
275-
``ETHTOOL_MSG_TS_LIST_GET_REPLY`` available timestampings
276271
======================================== =================================
277272

278273
``GET`` requests are sent by userspace applications to retrieve device
@@ -1999,61 +1994,6 @@ The attributes are propagated to the driver through the following structure:
19991994
.. kernel-doc:: include/linux/ethtool.h
20001995
:identifiers: ethtool_mm_cfg
20011996

2002-
TS_GET
2003-
======
2004-
2005-
Gets current timestamping.
2006-
2007-
Request contents:
2008-
2009-
================================= ====== ====================
2010-
``ETHTOOL_A_TS_HEADER`` nested request header
2011-
================================= ====== ====================
2012-
2013-
Kernel response contents:
2014-
2015-
======================= ====== ==============================
2016-
``ETHTOOL_A_TS_HEADER`` nested reply header
2017-
``ETHTOOL_A_TS_LAYER`` u32 current timestamping
2018-
======================= ====== ==============================
2019-
2020-
This command get the current timestamp layer.
2021-
2022-
TS_LIST_GET
2023-
===========
2024-
2025-
Get the list of available timestampings.
2026-
2027-
Request contents:
2028-
2029-
================================= ====== ====================
2030-
``ETHTOOL_A_TS_HEADER`` nested request header
2031-
================================= ====== ====================
2032-
2033-
Kernel response contents:
2034-
2035-
=========================== ====== ==============================
2036-
``ETHTOOL_A_TS_HEADER`` nested reply header
2037-
``ETHTOOL_A_TS_LIST_LAYER`` binary available timestampings
2038-
=========================== ====== ==============================
2039-
2040-
This command lists all the possible timestamp layer available.
2041-
2042-
TS_SET
2043-
======
2044-
2045-
Modify the selected timestamping.
2046-
2047-
Request contents:
2048-
2049-
======================= ====== ===================
2050-
``ETHTOOL_A_TS_HEADER`` nested reply header
2051-
``ETHTOOL_A_TS_LAYER`` u32 timestamping
2052-
======================= ====== ===================
2053-
2054-
This command set the timestamping with one that should be listed by the
2055-
TSLIST_GET command.
2056-
20571997
Request translation
20581998
===================
20591999

@@ -2160,7 +2100,4 @@ are netlink only.
21602100
n/a ``ETHTOOL_MSG_PLCA_GET_STATUS``
21612101
n/a ``ETHTOOL_MSG_MM_GET``
21622102
n/a ``ETHTOOL_MSG_MM_SET``
2163-
n/a ``ETHTOOL_MSG_TS_GET``
2164-
n/a ``ETHTOOL_MSG_TS_LIST_GET``
2165-
n/a ``ETHTOOL_MSG_TS_SET``
21662103
=================================== =====================================

drivers/net/ethernet/microchip/lan966x/lan966x_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,15 +470,15 @@ static int lan966x_port_hwtstamp_set(struct net_device *dev,
470470
struct lan966x_port *port = netdev_priv(dev);
471471
int err;
472472

473-
if (cfg->source != MAC_TIMESTAMPING &&
474-
cfg->source != PHY_TIMESTAMPING)
473+
if (cfg->source != HWTSTAMP_SOURCE_NETDEV &&
474+
cfg->source != HWTSTAMP_SOURCE_PHYLIB)
475475
return -EOPNOTSUPP;
476476

477477
err = lan966x_ptp_setup_traps(port, cfg);
478478
if (err)
479479
return err;
480480

481-
if (cfg->source == MAC_TIMESTAMPING) {
481+
if (cfg->source == HWTSTAMP_SOURCE_NETDEV) {
482482
if (!port->lan966x->ptp)
483483
return -EOPNOTSUPP;
484484

drivers/net/phy/bcm-phy-ptp.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -931,9 +931,6 @@ struct bcm_ptp_private *bcm_ptp_probe(struct phy_device *phydev)
931931
return ERR_CAST(clock);
932932
priv->ptp_clock = clock;
933933

934-
/* Timestamp selected by default to keep legacy API */
935-
phydev->default_timestamp = true;
936-
937934
priv->phydev = phydev;
938935
bcm_ptp_init(priv);
939936

drivers/net/phy/dp83640.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,9 +1450,6 @@ static int dp83640_probe(struct phy_device *phydev)
14501450
phydev->mii_ts = &dp83640->mii_ts;
14511451
phydev->priv = dp83640;
14521452

1453-
/* Timestamp selected by default to keep legacy API */
1454-
phydev->default_timestamp = true;
1455-
14561453
spin_lock_init(&dp83640->rx_lock);
14571454
skb_queue_head_init(&dp83640->rx_queue);
14581455
skb_queue_head_init(&dp83640->tx_queue);

drivers/net/phy/micrel.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3158,9 +3158,6 @@ static void lan8814_ptp_init(struct phy_device *phydev)
31583158
ptp_priv->mii_ts.ts_info = lan8814_ts_info;
31593159

31603160
phydev->mii_ts = &ptp_priv->mii_ts;
3161-
3162-
/* Timestamp selected by default to keep legacy API */
3163-
phydev->default_timestamp = true;
31643161
}
31653162

31663163
static int lan8814_ptp_probe_once(struct phy_device *phydev)
@@ -4589,9 +4586,6 @@ static int lan8841_probe(struct phy_device *phydev)
45894586

45904587
phydev->mii_ts = &ptp_priv->mii_ts;
45914588

4592-
/* Timestamp selected by default to keep legacy API */
4593-
phydev->default_timestamp = true;
4594-
45954589
return 0;
45964590
}
45974591

drivers/net/phy/mscc/mscc_ptp.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,8 +1570,6 @@ int vsc8584_ptp_probe(struct phy_device *phydev)
15701570
return PTR_ERR(vsc8531->load_save);
15711571
}
15721572

1573-
/* Timestamp selected by default to keep legacy API */
1574-
phydev->default_timestamp = true;
15751573
vsc8531->ptp->phydev = phydev;
15761574

15771575
return 0;

drivers/net/phy/nxp-c45-tja11xx.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,9 +1658,6 @@ static int nxp_c45_probe(struct phy_device *phydev)
16581658
priv->mii_ts.ts_info = nxp_c45_ts_info;
16591659
phydev->mii_ts = &priv->mii_ts;
16601660
ret = nxp_c45_init_ptp_clock(priv);
1661-
1662-
/* Timestamp selected by default to keep legacy API */
1663-
phydev->default_timestamp = true;
16641661
} else {
16651662
phydev_dbg(phydev, "PTP support not enabled even if the phy supports it");
16661663
}

drivers/net/phy/phy_device.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,26 +1411,6 @@ int phy_sfp_probe(struct phy_device *phydev,
14111411
}
14121412
EXPORT_SYMBOL(phy_sfp_probe);
14131413

1414-
/**
1415-
* phy_set_timestamp - set the default selected timestamping device
1416-
* @dev: Pointer to net_device
1417-
* @phydev: Pointer to phy_device
1418-
*
1419-
* This is used to set default timestamping device taking into account
1420-
* the new API choice, which is selecting the timestamping from MAC by
1421-
* default if the phydev does not have default_timestamp flag enabled.
1422-
*/
1423-
static void phy_set_timestamp(struct net_device *dev, struct phy_device *phydev)
1424-
{
1425-
const struct ethtool_ops *ops = dev->ethtool_ops;
1426-
1427-
if (!phy_has_tsinfo(phydev))
1428-
return;
1429-
1430-
if (!ops->get_ts_info || phydev->default_timestamp)
1431-
dev->ts_layer = PHY_TIMESTAMPING;
1432-
}
1433-
14341414
/**
14351415
* phy_attach_direct - attach a network device to a given PHY device pointer
14361416
* @dev: network device to attach
@@ -1504,7 +1484,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
15041484

15051485
phydev->phy_link_change = phy_link_change;
15061486
if (dev) {
1507-
phy_set_timestamp(dev, phydev);
15081487
phydev->attached_dev = dev;
15091488
dev->phydev = phydev;
15101489

@@ -1833,22 +1812,6 @@ void phy_detach(struct phy_device *phydev)
18331812

18341813
phy_suspend(phydev);
18351814
if (dev) {
1836-
const struct ethtool_ops *ops = dev->ethtool_ops;
1837-
struct ethtool_ts_info ts_info = {0};
1838-
1839-
if (ops->get_ts_info) {
1840-
ops->get_ts_info(dev, &ts_info);
1841-
if ((ts_info.so_timestamping &
1842-
SOF_TIMESTAMPING_HARDWARE_MASK) ==
1843-
SOF_TIMESTAMPING_HARDWARE_MASK)
1844-
dev->ts_layer = MAC_TIMESTAMPING;
1845-
else if ((ts_info.so_timestamping &
1846-
SOF_TIMESTAMPING_SOFTWARE_MASK) ==
1847-
SOF_TIMESTAMPING_SOFTWARE_MASK)
1848-
dev->ts_layer = SOFTWARE_TIMESTAMPING;
1849-
} else {
1850-
dev->ts_layer = NO_TIMESTAMPING;
1851-
}
18521815
phydev->attached_dev->phydev = NULL;
18531816
phydev->attached_dev = NULL;
18541817
}

include/linux/net_tstamp.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55

66
#include <uapi/linux/net_tstamp.h>
77

8+
enum hwtstamp_source {
9+
HWTSTAMP_SOURCE_NETDEV,
10+
HWTSTAMP_SOURCE_PHYLIB,
11+
};
12+
813
/**
914
* struct kernel_hwtstamp_config - Kernel copy of struct hwtstamp_config
1015
*
@@ -15,8 +20,8 @@
1520
* a legacy implementation of a lower driver
1621
* @copied_to_user: request was passed to a legacy implementation which already
1722
* copied the ioctl request back to user space
18-
* @source: indication whether timestamps should come from software, the netdev
19-
* or from an attached phylib PHY
23+
* @source: indication whether timestamps should come from the netdev or from
24+
* an attached phylib PHY
2025
*
2126
* Prefer using this structure for in-kernel processing of hardware
2227
* timestamping configuration, over the inextensible struct hwtstamp_config
@@ -28,7 +33,7 @@ struct kernel_hwtstamp_config {
2833
int rx_filter;
2934
struct ifreq *ifr;
3035
bool copied_to_user;
31-
enum timestamping_layer source;
36+
enum hwtstamp_source source;
3237
};
3338

3439
static inline void hwtstamp_config_to_kernel(struct kernel_hwtstamp_config *kernel_cfg,

0 commit comments

Comments
 (0)