lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1394387943.15968.1.camel@deadeye.wl.decadent.org.uk>
Date:	Sun, 09 Mar 2014 17:59:03 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	David Miller <davem@...emloft.net>
Cc:	phoebe.buckheister@...m.fraunhofer.de, netdev@...r.kernel.org,
	linux-zigbee-devel@...ts.sourceforge.net
Subject: Re: [PATCH net-next v4 1/4] ieee802154: add generic header handling
 routines

On Tue, 2014-03-04 at 17:20 -0500, David Miller wrote:
> From: "Phoebe Buckheister" <phoebe.buckheister@...m.fraunhofer.de>
> Date: Tue, 4 Mar 2014 23:16:31 +0100
> 
> > I see some value in being able to memcpy() to/from those fields directly
> > when building/reading headers, but I also think that not having to do
> > endianness conversion everywhere for a struct that cannot ever be a valid
> > header as is outweighs this.
> 
> Why have an intermediate copy when that's not necessary at all?  It
> seems like pure overhead to be.
> 
> Furthermore, cpu's have byte-shifting load and store instructions
> which will be used if you make use of the 'p' versions of the endian
> swap functions, such as cpu_to_le16p().
> 
> So it's going to cost basically nothing.

The real frame headers don't have naturally aligned fields, so if the
structures are to mirror them they would need to be __packed.  I'm sure
you realise what that does for performance.

Ben.

-- 
Ben Hutchings
I say we take off; nuke the site from orbit.  It's the only way to be sure.

Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ