Date: Mon, 29 Jul 2013 12:34:00 -0600 From: Warner Losh <imp@bsdimp.com> To: Hans Petter Selasky <hans.petter.selasky@bitfrost.no> Cc: freebsd-wireless@freebsd.org, freebsd-arm <freebsd-arm@freebsd.org> Subject: Re: My WLI-UC-GNM up crash Message-ID: <3571E4A7-D153-448E-A234-302C9C5603E9@bsdimp.com> In-Reply-To: <zarafa.51f6ad45.7961.536131947b8b1205@mail.lockless.no> References: <cakrd9exvuqeqz=3ntmh7k3e4_6fjw9jph_tpfchujhqhwwbzsg@mail.gmail.com> <zarafa.51f6ad45.7961.536131947b8b1205@mail.lockless.no>
next in thread | previous in thread | raw e-mail | index | archive | help
On Jul 29, 2013, at 11:58 AM, Hans Petter Selasky wrote: > The aligned will make sure that the structure gets padded properly to = the size specified. Only on ARM/MIPS etc, structures get automatically = aligned according to the element in the structure requiring the greatest = alignment. I'd turn this around and say only on x86 do structures not get aligned = this way. On any riscy architecture, unaligned accesses are expensive, = which is why the ABI there mandates this. > I've test-compiled the USB WLAN drivers, and the aligned makes a = difference. The problem is that the radiotap header skews some following = elements, so that they are no longer aligned. The radiotap header itself = is packed, and this is not a problem. This suggests a bigger problem. How is the radiotap header being = popualted? Is it by DMA or programmatically? If by DMA then we have = cache line sharing, which is bad. If by program, why is it packed to = start with? Warner > --HPS >=20 > =20 > -----Original message----- > > From:Warner Losh <imp@bsdimp.com> > > Sent: Monday 29th July 2013 17:04 > > To: Adrian Chadd <adrian@freebsd.org> > > Cc: Hans Petter Selasky <hans.petter.selasky@bitfrost.no>; = freebsd-arm <freebsd-arm@freebsd.org>; freebsd-wireless@freebsd.org > > Subject: Re: My WLI-UC-GNM up crash > >=20 > > Aren't structures already aligned to 4 bytes when placed inside = other structures (unless marked __packed)? > >=20 > > Warner > >=20 > > On Jul 28, 2013, at 11:50 AM, Adrian Chadd wrote: > >=20 > > > As long as that results in the radiotap structures being 4 or 8 = byte > > > padded when it's embedded in the softc - then yes, indeed. > > >=20 > > > Xiao, can you try? > > >=20 > > >=20 > > > -adrian > > >=20 > > > On 28 July 2013 03:35, Hans Petter Selasky <hps@bitfrost.no> = wrote: > > >> Hi, > > >>=20 > > >> Can you try the attached patch? > > >>=20 > > >> --HPS > > > _______________________________________________ > > > freebsd-arm@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > > > To unsubscribe, send any mail to = "freebsd-arm-unsubscribe@freebsd.org" > >=20 > >=20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3571E4A7-D153-448E-A234-302C9C5603E9>