]> Pileus Git - ~andy/linux/commit
sfc: Simplify TSO header buffer allocation
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 17 May 2012 17:40:54 +0000 (18:40 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Fri, 24 Aug 2012 19:10:11 +0000 (20:10 +0100)
commitf7251a9ce936f1006fbfdef63dbe42ae5e0fee7c
treee0187036af8587b61f4f492a31f3429b33dc0ffb
parent14bf718fb97efe9ff649c317e7d87a3617b13e7c
sfc: Simplify TSO header buffer allocation

TSO header buffers contain a control structure immediately followed by
the packet headers, and are kept on a free list when not in use.  This
complicates buffer management and tends to result in cache read misses
when we recycle such buffers (particularly if DMA-coherent memory
requires caches to be disabled).

Replace the free list with a simple mapping by descriptor index.  We
know that there is always a payload descriptor between any two
descriptors with TSO header buffers, so we can allocate only one
such buffer for each two descriptors.

While we're at it, use a standard error code for allocation failure,
not -1.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/net_driver.h
drivers/net/ethernet/sfc/nic.c
drivers/net/ethernet/sfc/tx.c