• Eric Dumazet's avatar
    net/mlx4_en: optimizes get_fixed_ipv6_csum() · 2d943adf
    Eric Dumazet authored
    While trying to support CHECKSUM_COMPLETE for IPV6 fragments,
    I had to experiments various hacks in get_fixed_ipv6_csum().
    I must admit I could not find how to implement this :/
    
    However, get_fixed_ipv6_csum() does a lot of redundant operations,
    calling csum_partial() twice.
    
    First csum_partial() computes the checksum of saddr and daddr,
    put in @csum_pseudo_hdr. Undone later in the second csum_partial()
    computed on whole ipv6 header.
    
    Then nexthdr is added once, added a second time, then substracted.
    
    payload_len is added once, then substracted.
    
    Really all this can be reduced to two add_csum(), to add back 6 bytes
    that were removed by mlx4 when providing hw_checksum in RX descriptor.
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Cc: Saeed Mahameed <saeedm@mellanox.com>
    Cc: Tariq Toukan <tariqt@mellanox.com>
    Reviewed-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
    Acked-by: default avatarTariq Toukan <tariqt@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    2d943adf
en_rx.c 34.1 KB