]> git.baikalelectronics.ru Git - kernel.git/commit
dpaa2-eth: add rx copybreak support
authorIoana Ciornei <ioana.ciornei@nxp.com>
Fri, 2 Apr 2021 09:55:31 +0000 (12:55 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Apr 2021 21:25:47 +0000 (14:25 -0700)
commit34c6a9ad0e4dd1796b7673a96da207e18a3b457f
treecd421dca6c165b58dfba35aa8867402ea79e617d
parent2f83dad38f8fc81e437257a697d8f78b89bc9477
dpaa2-eth: add rx copybreak support

DMA unmapping, allocating a new buffer and DMA mapping it back on the
refill path is really not that efficient. Proper buffer recycling (page
pool, flipping the page and using the other half) cannot be done for
DPAA2 since it's not a ring based controller but it rather deals with
multiple queues which all get their buffers from the same buffer pool on
Rx.

To circumvent these limitations, add support for Rx copybreak. For small
sized packets instead of creating a skb around the buffer in which the
frame was received, allocate a new sk buffer altogether, copy the
contents of the frame and release the initial page back into the buffer
pool.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h