• Eric Dumazet's avatar
    bnx2x: fix checksum validation · caac5084
    Eric Dumazet authored
    commit d6cb3e41 upstream.
    
    bnx2x driver incorrectly sets ip_summed to CHECKSUM_UNNECESSARY on
    encapsulated segments. TCP stack happily accepts frames with bad
    checksums, if they are inside a GRE or IPIP encapsulation.
    
    Our understanding is that if no IP or L4 csum validation was done by the
    hardware, we should leave ip_summed as is (CHECKSUM_NONE), since
    hardware doesn't provide CHECKSUM_COMPLETE support in its cqe.
    
    Then, if IP/L4 checksumming was done by the hardware, set
    CHECKSUM_UNNECESSARY if no error was flagged.
    
    Patch based on findings and analysis from Robert Evans
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Cc: Eilon Greenstein <eilong@broadcom.com>
    Cc: Yaniv Rosner <yanivr@broadcom.com>
    Cc: Merav Sicron <meravs@broadcom.com>
    Cc: Tom Herbert <therbert@google.com>
    Cc: Robert Evans <evansr@google.com>
    Cc: Willem de Bruijn <willemb@google.com>
    Acked-by: default avatarEilon Greenstein <eilong@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    [bwh: Backported to 3.2: adjust context, indentation]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    caac5084
bnx2x_cmn.c 92.8 KB