• Ard Biesheuvel's avatar
    net: cpsw: avoid alignment faults by taking NET_IP_ALIGN into account · 1771afd4
    Ard Biesheuvel authored
    Both versions of the CPSW driver declare a CPSW_HEADROOM_NA macro that
    takes NET_IP_ALIGN into account, but fail to use it appropriately when
    storing incoming packets in memory. This results in the IPv4 source and
    destination addresses to appear misaligned in memory, which causes
    aligment faults that need to be fixed up in software.
    
    So let's switch from CPSW_HEADROOM to CPSW_HEADROOM_NA where needed.
    This gets rid of any alignment faults on the RX path on a Beaglebone
    White.
    
    Fixes: 9ed4050c ("net: ethernet: ti: cpsw: add XDP support")
    Cc: Grygorii Strashko <grygorii.strashko@ti.com>
    Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1771afd4
cpsw.c 45.9 KB