• Michael Chan's avatar
    bnxt_en: Drop oversize TX packets to prevent errors. · be11d272
    Michael Chan authored
    [ Upstream commit 2b3c6885 ]
    
    There have been reports of oversize UDP packets being sent to the
    driver to be transmitted, causing error conditions.  The issue is
    likely caused by the dst of the SKB switching between 'lo' with
    64K MTU and the hardware device with a smaller MTU.  Patches are
    being proposed by Mahesh Bandewar <maheshb@google.com> to fix the
    issue.
    
    In the meantime, add a quick length check in the driver to prevent
    the error.  The driver uses the TX packet size as index to look up an
    array to setup the TX BD.  The array is large enough to support all MTU
    sizes supported by the driver.  The oversize TX packet causes the
    driver to index beyond the array and put garbage values into the
    TX BD.  Add a simple check to prevent this.
    Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    be11d272
bnxt.c 215 KB