Thread (40 messages) 40 messages, 9 authors, 2014-02-28

Re: [PATCH v7 net-next 1/2] net: add skb_mstamp infrastructure

From: David Miller <davem@davemloft.net>
Date: 2014-02-26 22:04:28

From: Eric Dumazet <redacted>
Date: Wed, 26 Feb 2014 14:02:11 -0800
From: Eric Dumazet <edumazet@google.com>

ktime_get() is too expensive on some cases, and we'd like to get
usec resolution timestamps in TCP stack.

This patch adds a light weight facility using a combination of
local_clock() and jiffies samples.

Instead of :

        u64 t0, t1;

        t0 = ktime_get();
        // stuff
        t1 = ktime_get();
        delta_us = ktime_us_delta(t1, t0);

use :
        struct skb_mstamp t0, t1;

        skb_mstamp_get(&t0);
        // stuff
        skb_mstamp_get(&t1);
        delta_us = skb_mstamp_us_delta(&t1, &t0);

Note : local_clock() might have a (bounded) drift between cpus.

Do not use this infra in place of ktime_get() without understanding the
issues.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help