net: add skb_mstamp infrastructure
net: add skb_mstamp infrastructure

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 <312c7d941f03386814be517ffdb3e0eb6624e275@google.com>
Cc: Stephen Hemminger <06fa905d7f2aaced6dc72e9511c71a2a51e8aead@networkplumber.org>
Cc: Yuchung Cheng <5b5a0a360fa35167ac197fe6359c229fde284cf2@google.com>
Cc: Neal Cardwell <58d301c70203188c35d379474c26c9cc0636a189@google.com>
Cc: Larry Brakmo <6754b253462396bc03063ad3fb04d6207f607ed8@google.com>
Cc: Julian Anastasov <84572ef2253ef81e2d8cd8c65849f4d9a3881f47@ssi.bg>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs