Commit a95b031c authored by Hangbin Liu's avatar Hangbin Liu Committed by David S. Miller

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: b8768dc4 ("net: ethtool: Refactor identical get_ts_info implementations.")
Reported-by: default avatarLiang Li <liali@redhat.com>
Closes: https://issues.redhat.com/browse/RHEL-42409Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Acked-by: default avatarKory Maincent <kory.maincent@bootlin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 00418d55
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment