net: mvneta: implement rx_copybreak
authorwilly tarreau <w@1wt.eu>
Thu, 16 Jan 2014 07:20:17 +0000 (08:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Jan 2014 23:15:43 +0000 (15:15 -0800)
commitf19fadfce8717d1da5e38c12d0dbe473bc3a7626
tree66855a00be2e09b2d81b8b52a20aafa0c5761fe3
parent8ec2cd48fe0d08f4c5370e925f083a68e4593ec8
net: mvneta: implement rx_copybreak

calling dma_map_single()/dma_unmap_single() is quite expensive compared
to copying a small packet. So let's copy short frames and keep the buffers
mapped. We set the limit to 256 bytes which seems to give good results both
on the XP-GP board and on the AX3/4.

The Rx small packet rate increased by 16.4% doing this, from 486kpps to
573kpps. It is worth noting that even the call to the function
dma_sync_single_range_for_cpu() is expensive (300 ns) although less
than dma_unmap_single(). Without it, the packet rate raises to 711kpps
(+24% more). Thus on systems where coherency from device to CPU is
guaranteed by a snoop control unit, this patch should provide even more
gains, and probably rx_copybreak could be increased.

Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
Tested-by: Arnaud Ebalard <arno@natisbad.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvneta.c