]> git.baikalelectronics.ru Git - kernel.git/commit
net: lan966x: Fix FDMA when MTU is changed
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Sun, 30 Oct 2022 21:36:36 +0000 (22:36 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 2 Nov 2022 04:18:16 +0000 (21:18 -0700)
commitfba794fe3ec923a2611d12c3209e8e223486ac18
treef9dde818b4a88d7b13cebd45a2e9d005669ca294
parent5023a94212f7724d3fa89124b94bc0c7a176efe2
net: lan966x: Fix FDMA when MTU is changed

When MTU is changed, FDMA is required to calculate what is the maximum
size of the frame that it can received. So it can calculate what is the
page order needed to allocate for the received frames.
The first problem was that, when the max MTU was calculated it was
reading the value from dev and not from HW, so in this way it was
missing L2 header + the FCS.
The other problem was that once the skb is created using
__build_skb_around, it would reserve some space for skb_shared_info.
So if we received a frame which size is at the limit of the page order
then the creating will failed because it would not have space to put all
the data.

Fixes: 65404903eaa5 ("net: lan966x: Update FDMA to change MTU.")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
drivers/net/ethernet/microchip/lan966x/lan966x_main.c