net: Add the possibility to support a selected hwtstamp in netdevice

Introduce the description of a hwtstamp provider, mainly defined with a
the hwtstamp source and the phydev pointer.

Add a hwtstamp provider description within the netdev structure to
allow saving the hwtstamp we want to use. This prepares for future
support of an ethtool netlink command to select the desired hwtstamp
provider. By default, the old API that does not support hwtstamp
selectability is used, meaning the hwtstamp provider pointer is unset.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Kory Maincent
2024-12-12 18:06:43 +01:00
committed by David S. Miller
parent b18fe47c0c
commit 35f7cad174
6 changed files with 140 additions and 7 deletions

View File

@@ -82,6 +82,7 @@ struct xdp_metadata_ops;
struct xdp_md;
struct ethtool_netdev_state;
struct phy_link_topology;
struct hwtstamp_provider;
typedef u32 xdp_features_t;
@@ -2045,6 +2046,7 @@ enum netdev_reg_state {
*
* @neighbours: List heads pointing to this device's neighbours'
* dev_list, one per address-family.
* @hwprov: Tracks which PTP performs hardware packet time stamping.
*
* FIXME: cleanup struct net_device such that network protocol info
* moves out.
@@ -2457,6 +2459,8 @@ struct net_device {
struct hlist_head neighbours[NEIGH_NR_TABLES];
struct hwtstamp_provider __rcu *hwprov;
u8 priv[] ____cacheline_aligned
__counted_by(priv_len);
} ____cacheline_aligned;