]> git.baikalelectronics.ru Git - kernel.git/commit
ptp: Support late timestamp determination
authorGerhard Engleder <gerhard@engleder-embedded.com>
Fri, 6 May 2022 20:01:40 +0000 (22:01 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 May 2022 07:48:08 +0000 (09:48 +0200)
commitce91496d889b33a2d0e3bf3014532ee4038df2a2
treeda2483e5a1173a95fcedf4f5805f37a8b90deac9
parent32cd8582fc8862cbd20f118961b6923371fac98a
ptp: Support late timestamp determination

If a physical clock supports a free running cycle counter, then
timestamps shall be based on this time too. For TX it is known in
advance before the transmission if a timestamp based on the free running
cycle counter is needed. For RX it is impossible to know which timestamp
is needed before the packet is received and assigned to a socket.

Support late timestamp determination by a network device. Therefore, an
address/cookie is stored within the new netdev_data field of struct
skb_shared_hwtstamps. This address/cookie is provided to a new network
device function called ndo_get_tstamp(), which returns a timestamp based
on the normal/adjustable time or based on the free running cycle
counter. If function is not supported, then timestamp handling is not
changed.

This mechanism is intended for RX, but TX use is also possible.

Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/linux/netdevice.h
include/linux/skbuff.h
net/socket.c