]> 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)
commitbebb8dd655fb6a625bda6d22499460ee42385335
treec2f7c8e0c59010d681535888b637acb96116b937
parent955c71dacd39f031ad2ddac19a7540e4919ea8b6
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: 4e16cb068c5a ("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