[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D0F6CA6D1@AcuExch.aculab.com>
Date: Tue, 25 Feb 2014 09:51:45 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Eric Dumazet' <eric.dumazet@...il.com>,
Stephen Hemminger <stephen@...workplumber.org>
CC: Julian Anastasov <ja@....bg>, David Miller <davem@...emloft.net>,
"Yuchung Cheng" <ycheng@...gle.com>,
netdev <netdev@...r.kernel.org>,
Neal Cardwell <ncardwell@...gle.com>,
Larry Brakmo <brakmo@...gle.com>
Subject: RE: [PATCH v6 net-next 1/2] net: add skb_mstamp infrastructure
From: Eric Dumazet
> 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.
...
> +struct skb_mstamp {
> + union {
> + u64 v64;
> + struct {
> + u32 stamp_us;
> + u32 stamp_jiffies;
> + };
> + };
> +};
Do you need the union here?
If you don't attempt to convert the value to a u64 then code
is less likely to process it incorrectly.
Most modern ABI pass/return short structures in registers,
so the actual code should be similar if you return the struct
by value.
David
Powered by blists - more mailing lists