bond: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to active device
authorHangbin Liu <liuhangbin@gmail.com>
Tue, 30 Nov 2021 07:09:32 +0000 (15:09 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Nov 2021 12:19:31 +0000 (12:19 +0000)
commit94dd016ae538b12ea665015e5fd0c9844b184005
tree153136a5dbec2f6b90c86a5cdccfd6a2e9ac86ee
parent6167597d442f6676c6b79a05d5cba18967dca366
bond: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to active device

We have VLAN PTP support(via get_ts_info) on kernel, and bond support(by
getting active interface via netlink message) on userspace tool linuxptp.
But there are always some users who want to use PTP with VLAN over bond,
which is not able to do with the current implementation.

This patch passed get_ts_info and SIOC[SG]HWTSTAMP ioctl to active device
with bond mode active-backup/tlb/alb. With this users could get kernel native
bond or VLAN over bond PTP support.

Test with ptp4l and it works with VLAN over bond after this patch:
]# ptp4l -m -i bond0.23
ptp4l[53377.141]: selected /dev/ptp4 as PTP clock
ptp4l[53377.142]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[53377.143]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[53377.143]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[53384.127]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES
ptp4l[53384.127]: selected local clock e41d2d.fffe.123db0 as best master
ptp4l[53384.127]: port 1: assuming the grand master role

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c