staging: fsl-dpaa2/eth: Extra headroom in RX buffers
authorBogdan Purcareata <bogdan.purcareata@nxp.com>
Sun, 29 Oct 2017 08:20:43 +0000 (08:20 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Nov 2017 15:19:27 +0000 (16:19 +0100)
commit4b2d9fe8795074626a29579e9afeedd52f1eeb83
tree20bd08d5745db35cfb495915e18957075ea6c582
parent8a4fd8778b929ac9459ad740f5e9812b2aa87bca
staging: fsl-dpaa2/eth: Extra headroom in RX buffers

The needed headroom that we ask the stack to reserve for us in TX
skbs is larger than the headroom available in RX frames, which
leads to skb reallocations in forwarding scenarios involving two
DPNI interfaces.

Configure the hardware to reserve some extra space in the RX
frame headroom to avoid this situation. The value is chosen based
on the Tx frame data offset, the Rx buffer alignment value and the
netdevice required headroom.

The network stack will take care to reserve space for HH_DATA_MOD when
building the skb, so there's no need to account for it in the netdevice
needed headroom.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h