x86/csum: Remove unnecessary odd handling
authorNoah Goldstein <goldstein.w.n@gmail.com>
Sun, 24 Sep 2023 14:35:49 +0000 (09:35 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Jan 2024 10:51:47 +0000 (11:51 +0100)
commit1078f257eb3ac68b149031747dd8f896b418d881
tree93fe17de179703b889bbeab2cb752593c8884c16
parentf99b7b22c0af0e3f093d1ff88afa23271bf0b08a
x86/csum: Remove unnecessary odd handling

[ Upstream commit 5d4acb62853abac1da2deebcb1c1c5b79219bf3b ]

The special case for odd aligned buffers is unnecessary and mostly
just adds overhead. Aligned buffers is the expectations, and even for
unaligned buffer, the only case that was helped is if the buffer was
1-byte from word aligned which is ~1/7 of the cases. Overall it seems
highly unlikely to be worth to extra branch.

It was left in the previous perf improvement patch because I was
erroneously comparing the exact output of `csum_partial(...)`, but
really we only need `csum_fold(csum_partial(...))` to match so its
safe to remove.

All csum kunit tests pass.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Laight <david.laight@aculab.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/lib/csum-partial_64.c