RE: [Intel-wired-lan] [RFC PATCH] net: add net-device TX clock source selection framework
From: Loktionov, Aleksandr
Date: Tue Jul 29 2025 - 07:16:47 EST
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf
> Of Arkadiusz Kubalewski
> Sent: Tuesday, July 29, 2025 12:45 PM
> To: Nguyen, Anthony L <anthony.l.nguyen@xxxxxxxxx>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@xxxxxxxxx>; andrew+netdev@xxxxxxx;
> davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx; kuba@xxxxxxxxxx;
> pabeni@xxxxxxxxxx; horms@xxxxxxxxxx; sdf@xxxxxxxxxxx;
> almasrymina@xxxxxxxxxx; asml.silence@xxxxxxxxx; leitao@xxxxxxxxxx;
> kuniyu@xxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx; intel-wired-lan@xxxxxxxxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; Kubalewski, Arkadiusz
> <arkadiusz.kubalewski@xxxxxxxxx>
> Subject: [Intel-wired-lan] [RFC PATCH] net: add net-device TX clock
> source selection framework
>
> Add support for user-space control over network device transmit clock
> sources through a new sysfs interface.
> A network device may support multiple TX clock sources (OCXO, SyncE
> reference, external reference clocks) which are critical for time-
> sensitive networking applications and synchronization protocols.
>
> This patch introduces:
>
> 1. Core TX clock framework (net/core/tx_clk.c):
> - per net-device clock source registration and management
> - sysfs interface under /sys/class/net/<device>/tx_clk/
> - thread-safe clock switching by using mutex locking
>
> 2. Generic netdev integration:
> - new netdev_tx_clk_ops structure for driver callbacks
> - TX clock list and kobject directory in struct net_device
> - registration/cleanup functions for driver use
>
> 3. Intel ICE driver implementation:
> - support for E825 series network cards
> - three clock sources: OCXO (default), SyncE_ref, ext_ref
> - per-PF clock state management
>
> 4. Kconfig option NET_TX_CLK:
> - optional feature + user documentation
>
> User interface:
> - Read /sys/class/net/<device>/tx_clk/<clock_name> to get status (0/1)
> - Write "1" to switch to that clock source
> - Writing "0" is not supported (one clock must always be active)
>
> Example usage:
> # Check current clock status
> $ cat /sys/class/net/eth0/tx_clk/*
>
> # Switch to external reference clock
> $ echo 1 > /sys/class/net/eth0/tx_clk/ext_ref
>
> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@xxxxxxxxx>
> ---
...
> a/drivers/net/ethernet/intel/ice/ice_tx_clk.c
> b/drivers/net/ethernet/intel/ice/ice_tx_clk.c
> new file mode 100644
> index 000000000000..121e9fa0c146
> --- /dev/null
> +++ b/drivers/net/ethernet/intel/ice/ice_tx_clk.c
> @@ -0,0 +1,113 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/* Copyright (C) 2025, Intel Corporation. */
> +
...
> +++ b/net/core/tx_clk.c
> @@ -0,0 +1,150 @@
> +// SPDX-License-Identifier: GPL-2.0
I prefer old style /* SPDX-License-Identifier: GPL-2.0 */
Everything else is fine for me.
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@xxxxxxxxx>
...
> +EXPORT_SYMBOL_GPL(netdev_tx_clk_cleanup);
> |
> base-commit: fa582ca7e187a15e772e6a72fe035f649b387a60
> --
> 2.38.1