[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B70DA@saturn3.aculab.com>
Date: Wed, 5 Dec 2012 11:41:33 -0000
From: "David Laight" <David.Laight@...LAB.COM>
To: <nicolas.dichtel@...nd.com>, "David Miller" <davem@...emloft.net>
Cc: <netdev@...r.kernel.org>
Subject: RE: [PATCH net-next 0/7] Allow to monitor multicast cache event via rtnetlink
> >> 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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists