net: mvneta: implement rx_copybreak
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 <a5d87d2bd7c424ee5cbdb4e978635bf653d5a005@free-electrons.com>
Cc: Gregory CLEMENT <cd8db494d8ed74d7c3f56ec5c769dff3d51dd397@free-electrons.com>
Tested-by: Arnaud Ebalard <4a388ce446e5b5f71442f7933e5783ac3caa59a1@natisbad.org>
Signed-off-by: Willy Tarreau <aff024fe4ab0fece4091de044c58c9ae4233383a@1wt.eu>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs