linux/drivers/net/ethernet/sfc
Ben Hutchings 950c54df1e sfc: Reduce RX scatter buffer size, and reduce alignment if appropriate
efx_start_datapath() asserts that we can fit 2 RX scatter buffers plus
a software structure, each appropriately aligned, into a single page.
Where L1_CACHE_BYTES == 256 and PAGE_SIZE == 4096, which is the case
on s390, this assertion fails.

The current scatter buffer size is also not a multiple of 64 or 128,
which are more common cache line sizes.  If we can make both the start
and end of a scatter buffer cache-aligned, this will reduce the need
for read-modify-write operations on inter- processor links.

Fix the alignment by reducing EFX_RX_USR_BUF_SIZE to 2048 - 256 ==
1792.  (We could use 2048 - L1_CACHE_BYTES, but EFX_RX_USR_BUF_SIZE
also affects user-level networking where a larger amount of
housekeeping data may be needed.  Although this version of the driver
does not support user-level networking, I prefer to keep scattering
behaviour consistent with the out-of-tree version.)

This still doesn't fix the s390 build because like most architectures
it has NET_IP_ALIGN == 2.  When NET_IP_ALIGN != 0 we cannot achieve
cache line alignment at either the start or end of a scatter buffer,
so there is actually no point in padding the buffers to a multiple of
the cache line size.  All we need is 4-byte alignment of the network
header, so do that.

Adjust the assertions accordingly.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-05-14 11:32:04 -07:00
..
Kconfig
Makefile
bitfield.h
efx.c sfc: Reduce RX scatter buffer size, and reduce alignment if appropriate 2013-05-14 11:32:04 -07:00
efx.h
enum.h
ethtool.c
falcon.c Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2013-05-02 14:38:53 -07:00
falcon_boards.c
falcon_xmac.c
filter.c
filter.h
io.h
mcdi.c
mcdi.h
mcdi_mac.c
mcdi_mon.c
mcdi_pcol.h
mcdi_phy.c
mdio_10g.c
mdio_10g.h
mtd.c
net_driver.h sfc: Reduce RX scatter buffer size, and reduce alignment if appropriate 2013-05-14 11:32:04 -07:00
nic.c
nic.h
phy.h
ptp.c sfc: fix return value check in efx_ptp_probe_channel() 2013-05-08 13:13:30 -07:00
qt202x_phy.c
regs.h
rx.c sfc: Reduce RX scatter buffer size, and reduce alignment if appropriate 2013-05-14 11:32:04 -07:00
selftest.c
selftest.h
siena.c
siena_sriov.c
spi.h
tenxpress.c
tx.c
txc43128_phy.c
vfdi.h
workarounds.h