[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <69d878d4-78cc-82da-e4eb-b494ebdcd2b1@pengutronix.de>
Date: Mon, 11 Jan 2021 09:10:43 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Vincent Mailhol <mailhol.vincent@...adoo.fr>,
linux-can@...r.kernel.org,
Jeroen Hofstee <jhofstee@...tronenergy.com>
Cc: Wolfgang Grandegger <wg@...ndegger.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
"open list:NETWORKING DRIVERS" <netdev@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 1/1] can: dev: add software tx timestamps
On 1/10/21 1:49 PM, Vincent Mailhol wrote:
> Call skb_tx_timestamp() within can_put_echo_skb() so that a software
> tx timestamp gets attached on 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.
>
> Remarks:
>
> * 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.
>
> * The hardware rx timestamp of a local loopback message is the
> hardware tx timestamp. This means that there are no needs to
> implement SOF_TIMESTAMPING_TX_HARDWARE for CAN sockets.
>
> References:
>
> Support for the error queue in CAN RAW sockets (which is needed for tx
> timestamps) was introduced in:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eb88531bdbfaafb827192d1fc6c5a3fcc4fadd96
>
> Put the call to skb_tx_timestamp() just before adding it to the array:
> https://lkml.org/lkml/2021/1/10/54
>
> Signed-off-by: Vincent Mailhol <mailhol.vincent@...adoo.fr>
Applied to linux-can-next/testing (ontop of my dev infrastructure cleanup).
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists