lkml.org 
[lkml]   [2021]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] can: dev: add software tx timestamps
From
Date
Hello Vincent,

On 1/10/21 11:35 AM, Vincent Mailhol wrote:
> Call skb_tx_timestamp() within can_put_echo_skb() so that a software
> tx timestamp gets attached on the skb.
>
[..]
>
> diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
> index 3486704c8a95..3904e0874543 100644
> --- a/drivers/net/can/dev.c
> +++ b/drivers/net/can/dev.c
> @@ -484,6 +484,8 @@ int can_put_echo_skb(struct sk_buff *skb, struct net_device *dev,
>
> /* save this skb for tx interrupt echo handling */
> priv->echo_skb[idx] = skb;
> +
> + skb_tx_timestamp(skb);
> } else {
> /* locking problem with netif_stop_queue() ?? */
> netdev_err(dev, "%s: BUG! echo_skb %d is occupied!\n", __func__, idx);

Personally, I would put the skb_tx_timestamp, before adding it to the array:

        /* make settings for echo to reduce code in irq context */
        skb->pkt_type = PACKET_BROADCAST;
        skb->ip_summed = CHECKSUM_UNNECESSARY;
        skb->dev = dev;
+       skb_tx_timestamp(skb);

        /* save this skb for tx interrupt echo handling */
        priv->echo_skb[idx] = skb;


I don't think it actually matters though.

Regards,

Jeroen

\
 
 \ /
  Last update: 2021-01-10 12:33    [W:0.043 / U:1.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site