diff options
author | Ioana Ciornei <ioana.ciornei@nxp.com> | 2021-04-02 12:55:31 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-02 14:25:47 -0700 |
commit | 50f826999a80a100218b0cbf4f14057bc0edb3a3 (patch) | |
tree | cd421dca6c165b58dfba35aa8867402ea79e617d /drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h | |
parent | 28d137cc8c0bd2c9501b8eb0855b631289c7b4a3 (diff) | |
download | lwn-50f826999a80a100218b0cbf4f14057bc0edb3a3.tar.gz lwn-50f826999a80a100218b0cbf4f14057bc0edb3a3.zip |
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>
Diffstat (limited to 'drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h')
-rw-r--r-- | drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h index 9ba31c2706bb..f8d2b4769983 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h @@ -489,6 +489,8 @@ struct dpaa2_eth_trap_data { struct dpaa2_eth_priv *priv; }; +#define DPAA2_ETH_DEFAULT_COPYBREAK 512 + /* Driver private data */ struct dpaa2_eth_priv { struct net_device *net_dev; |