]> git.baikalelectronics.ru Git - kernel.git/commit
net: lantiq_xrx200: increase buffer reservation
authorAleksander Jan Bajkowski <olek2@wp.pl>
Fri, 17 Dec 2021 00:07:40 +0000 (01:07 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 18 Dec 2021 03:18:29 +0000 (19:18 -0800)
commit837f8d39c00616b7d28926c70b41c0727d7aac3f
treec2f7c8e0c59010d681535888b637acb96116b937
parentd006ed6336e645099baa242823ec964c7c428bd9
net: lantiq_xrx200: increase buffer reservation

If the user sets a lower mtu on the CPU port than on the switch,
then DMA inserts a few more bytes into the buffer than expected.
In the worst case, it may exceed the size of the buffer. The
experiments showed that the buffer should be a multiple of the
burst length value. This patch rounds the length of the rx buffer
upwards and fixes this bug. The reservation of FCS space in the
buffer has been removed as PMAC strips the FCS.

Fixes: 766f91d3bffc ("net: lantiq: add support for jumbo frames")
Reported-by: Thomas Nixon <tom@tomn.co.uk>
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/lantiq_xrx200.c