aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHangbin Liu <[email protected]>2024-06-20 16:56:26 +0800
committerDavid S. Miller <[email protected]>2024-06-21 11:27:46 +0100
commita95b031c6796bf9972da2d4b4b524a57734f3a0a (patch)
tree1238f98809ee5631d5f820f931ea166e9f23c0fb
parent00418d5530ca1f42d8721fe0a3e73d1ae477c223 (diff)
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. Fixes: b8768dc40777 ("net: ethtool: Refactor identical get_ts_info implementations.") Reported-by: Liang Li <[email protected]> Closes: https://issues.redhat.com/browse/RHEL-42409 Signed-off-by: Hangbin Liu <[email protected]> Acked-by: Kory Maincent <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--drivers/net/bonding/bond_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 3c3fcce4acd4..d19aabf5d4fb 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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) {