diff options
author | Vincent Mailhol <[email protected]> | 2021-01-12 18:54:37 +0900 |
---|---|---|
committer | Marc Kleine-Budde <[email protected]> | 2021-01-14 08:43:44 +0100 |
commit | 741b91f1b0ea34f00f6a7d4539b767c409291fcf (patch) | |
tree | f73dcd9c8325b554f81ec3fe369489a85a409f68 /tools/perf/scripts/python/syscall-counts.py | |
parent | 99842c9685ab00fa8689e8bd12bde62b706b6198 (diff) |
can: dev: can_put_echo_skb(): add software tx timestamps
Call skb_tx_timestamp() within can_put_echo_skb() so that a software tx
timestamp gets attached to the skb.
There two main reasons to include this call in can_put_echo_skb():
* It easily allow to enable the tx timestamp on all devices with
just one small change.
* According to Documentation/networking/timestamping.rst, the tx
timestamps should be generated in the device driver as close as possible,
but always prior to passing the packet to the network interface. During the
call to can_put_echo_skb(), the skb gets cloned meaning that the driver
should not dereference the skb variable anymore after can_put_echo_skb()
returns. This makes can_put_echo_skb() the very last place we can use the
skb without having to access the echo_skb[] array.
Remark: by default, skb_tx_timestamp() does nothing. It needs to be activated
by passing the SOF_TIMESTAMPING_TX_SOFTWARE flag either through socket options
or control messages.
References:
* Support for the error queue in CAN RAW sockets (which is needed for
tx timestamps) was introduced in:
https://git.kernel.org//torvalds/c/eb88531bdbfaafb827192d1fc6c5a3fcc4fadd96
* Put the call to skb_tx_timestamp() just before adding it to the
array:
https://lore.kernel.org/r/[email protected]
* About Tx hardware timestamps
https://lore.kernel.org/r/[email protected]
Signed-off-by: Vincent Mailhol <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Marc Kleine-Budde <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
0 files changed, 0 insertions, 0 deletions