]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_en: optimizes get_fixed_ipv6_csum()
authorEric Dumazet <edumazet@google.com>
Thu, 19 Apr 2018 15:49:29 +0000 (08:49 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 May 2018 15:59:19 +0000 (11:59 -0400)
commit89b9054119ef6c5a72a9aa128ef1f7fc94f2b4a4
treec41bf16890c1891a6f5b4db0b1fb5a8945f0c0d7
parent8a2eeb35d1462b3967456416e2161a8e92cd6ea1
net/mlx4_en: optimizes get_fixed_ipv6_csum()

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: Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
Acked-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_rx.c