bonding: fix incorrect software timestamping report
Subsystems (3)
PATCH 1/1 bonding: fix incorrect software timestamping report
The __ethtool_get_ts_info function returns directly if the device has a get_ts_info() method. For bonding with an active slave, this works correctly as we simply return the real device's timestamping information. However, when there is no active slave, we only check the slave's TX software timestamp information. We still need to set the phc index and RX timestamp information manually. Otherwise, the result will be look like:
Time stamping parameters for bond0:
Capabilities:
software-transmit
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes: none
Hardware Receive Filter Modes: none
This issue does not affect VLAN or MACVLAN devices, as they only have one downlink and can directly use the downlink's timestamping information.
--- drivers/net/bonding/bond_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/bonding/bond_main.c +3 -0
@@ -5773,6 +5773,9 @@ 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) {
Signature · 1 line
2.45.0
Quoted 14 lines · On Thu, 20 Jun 2024 16:56:26 +0800 Hangbin Liu <[email protected]> wrote:
The
__ethtool_get_ts_infofunction returns directly if the device has aget_ts_info()method. For bonding with an active slave, this works correctly as we simply return the real device's timestamping information. However, when there is no active slave, we only check the slave's TX software timestamp information. We still need to set the phc index and RX timestamp information manually. Otherwise, the result will be look like:Time stamping parameters for bond0:
Capabilities:
software-transmit
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes: none
Hardware Receive Filter Modes: none
Quoted 2 lines
This issue does not affect VLAN or MACVLAN devices, as they only have one downlink and can directly use the downlink's timestamping information.
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:
Quoted 8 lines · On Thu, 20 Jun 2024 16:56:26 +0800 you wrote:
The
__ethtool_get_ts_infofunction returns directly if the device has aget_ts_info()method. For bonding with an active slave, this works correctly as we simply return the real device's timestamping information. However, when there is no active slave, we only check the slave's TX software timestamp information. We still need to set the phc index and RX timestamp information manually. Otherwise, the result will be look like:[...]
Here is the summary with links:
- [net] bonding: fix incorrect software timestamping report
https://git.kernel.org/netdev/net/c/a95b031c6796
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html