net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX
authorHangbin Liu <liuhangbin@gmail.com>
Fri, 10 Dec 2021 08:59:58 +0000 (16:59 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Dec 2021 12:28:24 +0000 (12:28 +0000)
commit9c9211a3fc7aa41b2952765b62000443b3bb6f23
tree1067f854727ae10bdf051d92072d9cb512906242
parenta3c62a042237d1adeb0290dcb768e17edd6dcd25
net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX

Since commit 94dd016ae538 ("bond: pass get_ts_info and SIOC[SG]HWTSTAMP
ioctl to active device") the user could get bond active interface's
PHC index directly. But when there is a failover, the bond active
interface will change, thus the PHC index is also changed. This may
break the user's program if they did not update the PHC timely.

This patch adds a new hwtstamp_config flag HWTSTAMP_FLAG_BONDED_PHC_INDEX.
When the user wants to get the bond active interface's PHC, they need to
add this flag and be aware the PHC index may be changed.

With the new flag. All flag checks in current drivers are removed. Only
the checking in net_hwtstamp_validate() is kept.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
40 files changed:
drivers/net/dsa/hirschmann/hellcreek_hwtstamp.c
drivers/net/dsa/mv88e6xxx/hwtstamp.c
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/aquantia/atlantic/aq_main.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
drivers/net/ethernet/broadcom/tg3.c
drivers/net/ethernet/cadence/macb_ptp.c
drivers/net/ethernet/cavium/liquidio/lio_main.c
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
drivers/net/ethernet/cavium/thunder/nicvf_main.c
drivers/net/ethernet/engleder/tsnep_ptp.c
drivers/net/ethernet/freescale/fec_ptp.c
drivers/net/ethernet/freescale/gianfar.c
drivers/net/ethernet/intel/e1000e/netdev.c
drivers/net/ethernet/intel/i40e/i40e_ptp.c
drivers/net/ethernet/intel/ice/ice_ptp.c
drivers/net/ethernet/intel/igb/igb_ptp.c
drivers/net/ethernet/intel/igc/igc_ptp.c
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/microchip/lan743x_ptp.c
drivers/net/ethernet/mscc/ocelot.c
drivers/net/ethernet/neterion/vxge/vxge-main.c
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
drivers/net/ethernet/qlogic/qede/qede_ptp.c
drivers/net/ethernet/renesas/ravb_main.c
drivers/net/ethernet/sfc/ptp.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/ti/cpsw_priv.c
drivers/net/ethernet/ti/netcp_ethss.c
drivers/net/ethernet/xscale/ixp4xx_eth.c
drivers/net/phy/dp83640.c
drivers/net/phy/mscc/mscc_ptp.c
drivers/ptp/ptp_ines.c
include/uapi/linux/net_tstamp.h
net/core/dev_ioctl.c