> The following patch creates skb_align and allows an architecture to
> override it. Thoughts?
I like it. While we haven't seen specific networking performance issues
on Opteron yet it's certainly one architectures that doesn't care much
about misalignment. The Intel EM64T CPUs have a bit more penalty, but
also not much. It's certainly one optimization worth trying.
> + * skb_align - align a buffer
> + * @skb: buffer to alter
> + * @len: bytes required to align
> + *
> + * Shift a buffer by len bytes for the purposes of alignment. On
> + * some architectures that handle unaligned accesses in hardware
> + * the effects of unaligned DMA is more costly so we allow it to
> + * be overridden. This is only allowed for an empty buffer.
> + */
> +#ifndef ARCH_HAS_SKB_ALIGN
> +#define skb_align(SKB, LEN) skb_reserve((SKB), (LEN))
> +#endif
But where does this come from? There's no clear asm/ include in skbuff.h
matching it, and relying on indirect ones is probably not a good idea.
-Andi
|