• Horatiu Vultur's avatar
    net: lan966x: Fix FDMA when MTU is changed · 872ad758
    Horatiu Vultur authored
    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: 2ea1cbac ("net: lan966x: Update FDMA to change MTU.")
    Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    872ad758
lan966x_fdma.c 19.6 KB