quoted
quoted
The one thing I worry about are those 64-bit statistics. I fear that they
not be 64-bit aligned in the final netlink message. This matters on cpus
that trap on unaligned loads/stores, such as sparc and MIPS.
Can you validate this?
I can have a try on a tile platform. I don't have access to sparc or mips.
Hmm, I've read arm instead of mips! So I've tried on mips. Data are aligned on
32-bit, like for all netlink messages. nla_put_u64() will do the same, as it
calls nla_put().
And the kernel will only use memcpy() to treat this attribute. Reader will be in
userland.
Probably worth commenting that the 64bit items might only be 32bit aligned.
Just to stop anyone trying to read/write them with pointer casts.
I think they are currently done with memcpy() - which should be ok.
It might be possibly to optimise by using a structure containing
a 64bit value marked __attribute__((aligned(4))).
David