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  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]
Date:	Sat, 1 Dec 2007 09:34:57 +1100
From:	Herbert Xu <>
To:	Andrew Gallatin <>
Cc:	Roland Dreier <>,,,
Subject: Re: [PATCH]: fix lro_gen_skb() alignment

On Fri, Nov 30, 2007 at 02:35:43PM -0500, Andrew Gallatin wrote:
> >Isn't the value of 2 ethernet-specific (to round the 14-byte header up
> >to 16)?  Given that the rest of the lro code is fairly careful to
> >calculate mac_hdr_len etc it seems as if it would be cleaner to make
> >this independent of the specific L2 being used.
> >
> >(And I plan on using the LRO module for IP-over-InfiniBand so this is
> >not completely theoretical)

Good point!

We really should rename NET_IP_ALIGN so that both Ethernet and DMA
occur in it somehow :)

> Good point.  I tend to think all the world is ethernet.
> Perhaps the better way would be to simply add an alignment pad
> field to lro_mgr?  When the driver initializes it, it specifies
> any padding needed.  Ethernet drivers would specify 2.

Just pass in the mac_hdr_len, and calculate the padding as

	ALIGN(mac_hdr_len, 4) - mac_hdr_len

or even simpler

	~(mac_hdr_len - 1) & 3

Bonus points for putting this in a macro alongside NET_IP_ALIGN :)

Visit Openswan at
Email: Herbert Xu ~{PmV>HI~} <>
Home Page:
PGP Key:
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists